WIP add inline-comments admin setting (
bug 1115707); r!smacleod
Add an admin setting to toggle inline comments on the diff view, defaults to
enabled.
MozReview-Commit-ID: FMOayqJqk69
--- a/reviewboard/reviewboard/admin/forms.py
+++ b/reviewboard/reviewboard/admin/forms.py
@@ -609,16 +609,22 @@ class DiffSettingsForm(SiteSettingsForm)
include_space_patterns = forms.CharField(
label=_("Show all whitespace for"),
required=False,
help_text=_("A comma-separated list of file patterns for which all "
"whitespace changes should be shown. "
"(e.g., \"*.py, *.txt\")"),
widget=forms.TextInput(attrs={'size': '60'}))
+ diffviewer_show_comments_inline = forms.BooleanField(
+ label=_("Show comments inline"),
+ help_text=_("Shows comments inline when viewing a diff instead of as "
+ "a bubble in the left hand column."),
+ required=False)
+
diffviewer_context_num_lines = forms.IntegerField(
label=_("Lines of Context"),
help_text=_("The number of unchanged lines shown above and below "
"changed lines."),
initial=5,
widget=forms.TextInput(attrs={'size': '5'}))
diffviewer_paginate_by = forms.IntegerField(
@@ -659,17 +665,18 @@ class DiffSettingsForm(SiteSettingsForm)
title = _("Diff Viewer Settings")
save_blacklist = ('include_space_patterns',)
fieldsets = (
{
'classes': ('wide',),
'fields': ('diffviewer_syntax_highlighting',
'diffviewer_syntax_highlighting_threshold',
'diffviewer_show_trailing_whitespace',
- 'include_space_patterns'),
+ 'include_space_patterns',
+ 'diffviewer_show_comments_inline'),
},
{
'title': _("Advanced"),
'description': _(
"These are advanced settings that control the behavior "
"and display of the diff viewer. In general, these "
"settings do not need to be changed."
),
--- a/reviewboard/reviewboard/admin/siteconfig.py
+++ b/reviewboard/reviewboard/admin/siteconfig.py
@@ -136,16 +136,17 @@ defaults.update({
'diffviewer_context_num_lines': 5,
'diffviewer_include_space_patterns': [],
'diffviewer_max_diff_size': 0,
'diffviewer_paginate_by': 20,
'diffviewer_paginate_orphans': 10,
'diffviewer_syntax_highlighting': True,
'diffviewer_syntax_highlighting_threshold': 0,
'diffviewer_show_trailing_whitespace': True,
+ 'diffviewer_show_comments_inline': True,
'integration_gravatars': True,
'mail_send_review_mail': False,
'mail_send_new_user_mail': False,
'mail_enable_autogenerated_header': True,
'search_enable': False,
'send_support_usage_stats': True,
'site_domain_method': 'http',