add subscribe UI
This commit is contained in:
parent
ee4447b6a0
commit
b5ccb15c5a
4 changed files with 35 additions and 14 deletions
|
@ -54,7 +54,7 @@ class AddPostForm(forms.ModelForm):
|
|||
name = forms.CharField(label=_('Subject'), max_length=155,
|
||||
widget=forms.TextInput(attrs={'size':'115'}))
|
||||
attachment = forms.FileField(label=_('Attachment'), required=False)
|
||||
subscribe = forms.BooleanField(label=_('Subscribe'), help_text=_("Subscribe this topic."), required=False)
|
||||
subscribe = forms.BooleanField(label=_('Subscribe'), help_text=_("Subscribe to this topic."), required=False)
|
||||
|
||||
class Meta:
|
||||
model = Post
|
||||
|
|
|
@ -346,6 +346,10 @@ td .tclcon {
|
|||
width: 100%;
|
||||
}
|
||||
|
||||
.djangobb #subscribe {
|
||||
margin: -10px 0;
|
||||
}
|
||||
|
||||
.djangobb .markItUpEditor {
|
||||
width: 100%;
|
||||
vertical-align: top;
|
||||
|
|
|
@ -41,18 +41,35 @@
|
|||
{{ form.body.errors }}
|
||||
{{ form.body }}
|
||||
</label>
|
||||
{% if forum_settings.ATTACHMENT_SUPPORT %}
|
||||
<div class="inform">
|
||||
<fieldset>
|
||||
<legend>{% trans "Attachment" %}</legend>
|
||||
<div class="infldset">
|
||||
{{ form.attachment.errors }}
|
||||
<div class="rbox">
|
||||
{{ form.attachment }}
|
||||
</div>
|
||||
|
||||
<label id="subscribe">
|
||||
{% if subscribed %}
|
||||
{% trans "You are receiving notifications for updates to this topic." %}
|
||||
<a href="{% url djangobb:forum_delete_subscription topic.id %}">{% trans 'Unsubscribe?' %}</a>
|
||||
<div class="success" style="display: none">
|
||||
{% trans "Unsubscribed! You will no longer receive notifications for updates to this topic." %}
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="error" style="dispaly: none">
|
||||
{% trans "Hmm, something went wrong. Please try again." %}
|
||||
</div>
|
||||
{% else %}
|
||||
<div {% if subscribed %}style="display: none"{% endif %}>
|
||||
{{ form.subscribe }} {% trans "Notify me of updates to this topic" %}{{ form.subscribe.errors }}<br />
|
||||
</div>
|
||||
{% endif %}
|
||||
</label>
|
||||
{% if forum_settings.ATTACHMENT_SUPPORT %}
|
||||
<div class="inform">
|
||||
<fieldset>
|
||||
<legend>{% trans "Attachment" %}</legend>
|
||||
<div class="infldset">
|
||||
{{ form.attachment.errors }}
|
||||
<div class="rbox">
|
||||
{{ form.attachment }}
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="form-submit">
|
||||
<button type="submit" class="grey button" name="{{ form.FORM_NAME }}"><span>{% trans "Submit" %}</span></button>
|
||||
|
|
|
@ -433,7 +433,7 @@ def show_topic(request, topic_id, full=True):
|
|||
reply_form = AddPostForm(
|
||||
initial={
|
||||
'markup': request.user.forum_profile.markup,
|
||||
'subscribe': request.user.forum_profile.auto_subscribe,
|
||||
'subscribe': True,
|
||||
},
|
||||
**post_form_kwargs
|
||||
)
|
||||
|
@ -587,7 +587,7 @@ def add_topic(request, forum_id, full=True):
|
|||
form = AddPostForm(
|
||||
initial={
|
||||
'markup': request.user.forum_profile.markup,
|
||||
'subscribe': request.user.forum_profile.auto_subscribe,
|
||||
'subscribe': True,
|
||||
},
|
||||
**post_form_kwargs
|
||||
)
|
||||
|
|
Reference in a new issue