implement #89: ability to disabling graphic-smiles for forum-posts [возможность отключения графических смайлов в форумных-постах]
This commit is contained in:
parent
01e7925b58
commit
a5220a93a0
3 changed files with 14 additions and 3 deletions
|
@ -224,7 +224,7 @@ class PersonalityProfileForm(forms.ModelForm):
|
|||
class DisplayProfileForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = Profile
|
||||
fields = ['theme']
|
||||
fields = ['theme', 'show_smilies']
|
||||
|
||||
|
||||
class PrivacyProfileForm(forms.ModelForm):
|
||||
|
|
|
@ -200,7 +200,7 @@ class Post(models.Model):
|
|||
else:
|
||||
raise Exception('Invalid markup property: %s' % self.markup)
|
||||
self.body_html = urlize(self.body_html)
|
||||
if forum_settings.SMILES_SUPPORT:
|
||||
if forum_settings.SMILES_SUPPORT and self.user.forum_profile.show_smilies:
|
||||
self.body_html = smiles(self.body_html)
|
||||
super(Post, self).save(*args, **kwargs)
|
||||
|
||||
|
@ -281,6 +281,7 @@ class Profile(models.Model):
|
|||
theme = models.CharField(_('Theme'), choices=THEME_CHOICES, max_length=80, default='default')
|
||||
show_avatar = models.BooleanField(_('Show avatar'), blank=True, default=True)
|
||||
show_signatures = models.BooleanField(_('Show signatures'), blank=True, default=True)
|
||||
show_smilies = models.BooleanField(_('Show smilies'), blank=True, default=True)
|
||||
privacy_permission = models.IntegerField(_('Privacy permission'), choices=PRIVACY_CHOICES, default=1)
|
||||
markup = models.CharField(_('Default markup'), max_length=15, default=forum_settings.DEFAULT_MARKUP, choices=MARKUP_CHOICES)
|
||||
post_count = models.IntegerField(_('Post count'), blank=True, default=0)
|
||||
|
|
|
@ -15,11 +15,21 @@
|
|||
<div class="infldset">
|
||||
{{ form.theme.errors }}
|
||||
<label>{% trans "If you like you can use a different visual style for this forum." %}<br>
|
||||
|
||||
{{ form.theme }}
|
||||
<br></label>
|
||||
</div>
|
||||
</fieldset>
|
||||
<br/>
|
||||
<fieldset>
|
||||
<legend>{% trans "Post display legend" %}</legend>
|
||||
<div class="infldset">
|
||||
<p>{% trans "Post display info" %}</p>
|
||||
<div class="rbox">
|
||||
{{ form.show_smilies.errors }}
|
||||
<label>{{ form.show_smilies }}{% trans "Show smilies" %}<br></label>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
<p><input name="update" value="{% trans "Submit" %}" type="submit">{% trans "When you update your profile, you will be redirected back to this page." %}</p>
|
||||
</form>
|
||||
|
|
Reference in a new issue