##// END OF EJS Templates
added dashboard items config in visual settings
marcink -
r3904:fe053a42 beta
parent child Browse files
Show More
@@ -106,9 +106,6 b' use_htsts = false'
106 ## number of commits stats will parse on each iteration
106 ## number of commits stats will parse on each iteration
107 commit_parse_limit = 25
107 commit_parse_limit = 25
108
108
109 ## number of items displayed in lightweight dashboard before paginating is shown
110 dashboard_items = 100
111
112 ## use gravatar service to display avatars
109 ## use gravatar service to display avatars
113 use_gravatar = true
110 use_gravatar = true
114
111
@@ -106,9 +106,6 b' use_htsts = false'
106 ## number of commits stats will parse on each iteration
106 ## number of commits stats will parse on each iteration
107 commit_parse_limit = 25
107 commit_parse_limit = 25
108
108
109 ## number of items displayed in lightweight dashboard before paginating is shown
110 dashboard_items = 100
111
112 ## use gravatar service to display avatars
109 ## use gravatar service to display avatars
113 use_gravatar = true
110 use_gravatar = true
114
111
@@ -106,9 +106,6 b' use_htsts = false'
106 ## number of commits stats will parse on each iteration
106 ## number of commits stats will parse on each iteration
107 commit_parse_limit = 25
107 commit_parse_limit = 25
108
108
109 ## number of items displayed in lightweight dashboard before paginating is shown
110 dashboard_items = 100
111
112 ## use gravatar service to display avatars
109 ## use gravatar service to display avatars
113 use_gravatar = true
110 use_gravatar = true
114
111
@@ -183,6 +183,7 b' class SettingsController(BaseController)'
183 )
183 )
184
184
185 try:
185 try:
186 #TODO: rewrite this to something less ugly
186 sett1 = RhodeCodeSetting.get_by_name_or_create('show_public_icon')
187 sett1 = RhodeCodeSetting.get_by_name_or_create('show_public_icon')
187 sett1.app_settings_value = \
188 sett1.app_settings_value = \
188 form_result['rhodecode_show_public_icon']
189 form_result['rhodecode_show_public_icon']
@@ -203,6 +204,11 b' class SettingsController(BaseController)'
203 form_result['rhodecode_repository_fields']
204 form_result['rhodecode_repository_fields']
204 Session().add(sett4)
205 Session().add(sett4)
205
206
207 sett5 = RhodeCodeSetting.get_by_name_or_create('dashboard_items')
208 sett5.app_settings_value = \
209 form_result['rhodecode_dashboard_items']
210 Session().add(sett5)
211
206 Session().commit()
212 Session().commit()
207 set_rhodecode_config(config)
213 set_rhodecode_config(config)
208 h.flash(_('Updated visualisation settings'),
214 h.flash(_('Updated visualisation settings'),
@@ -267,18 +267,19 b' class BaseController(WSGIController):'
267 # Visual options
267 # Visual options
268 c.visual = AttributeDict({})
268 c.visual = AttributeDict({})
269 rc_config = RhodeCodeSetting.get_app_settings()
269 rc_config = RhodeCodeSetting.get_app_settings()
270
270 ## DB stored
271 c.visual.show_public_icon = str2bool(rc_config.get('rhodecode_show_public_icon'))
271 c.visual.show_public_icon = str2bool(rc_config.get('rhodecode_show_public_icon'))
272 c.visual.show_private_icon = str2bool(rc_config.get('rhodecode_show_private_icon'))
272 c.visual.show_private_icon = str2bool(rc_config.get('rhodecode_show_private_icon'))
273 c.visual.stylify_metatags = str2bool(rc_config.get('rhodecode_stylify_metatags'))
273 c.visual.stylify_metatags = str2bool(rc_config.get('rhodecode_stylify_metatags'))
274 c.visual.dashboard_items = safe_int(config.get('dashboard_items', 100))
274 c.visual.dashboard_items = safe_int(rc_config.get('rhodecode_dashboard_items', 100))
275 c.visual.repository_fields = str2bool(rc_config.get('rhodecode_repository_fields'))
275 c.visual.repository_fields = str2bool(rc_config.get('rhodecode_repository_fields'))
276 ## INI stored
277 self.cut_off_limit = int(config.get('cut_off_limit'))
278
276 c.repo_name = get_repo_slug(request) # can be empty
279 c.repo_name = get_repo_slug(request) # can be empty
277 c.backends = BACKENDS.keys()
280 c.backends = BACKENDS.keys()
278 c.unread_notifications = NotificationModel()\
281 c.unread_notifications = NotificationModel()\
279 .get_unread_cnt_for_user(c.rhodecode_user.user_id)
282 .get_unread_cnt_for_user(c.rhodecode_user.user_id)
280 self.cut_off_limit = int(config.get('cut_off_limit'))
281
282 self.sa = meta.Session
283 self.sa = meta.Session
283 self.scm_model = ScmModel(self.sa)
284 self.scm_model = ScmModel(self.sa)
284
285
@@ -285,6 +285,7 b' def ApplicationVisualisationForm():'
285
285
286 rhodecode_repository_fields = v.StringBoolean(if_missing=False)
286 rhodecode_repository_fields = v.StringBoolean(if_missing=False)
287 rhodecode_lightweight_journal = v.StringBoolean(if_missing=False)
287 rhodecode_lightweight_journal = v.StringBoolean(if_missing=False)
288 rhodecode_dashboard_items = v.UnicodeString()
288
289
289 return _ApplicationVisualisationForm
290 return _ApplicationVisualisationForm
290
291
@@ -133,9 +133,18 b''
133 ${h.checkbox('rhodecode_repository_fields','True')}
133 ${h.checkbox('rhodecode_repository_fields','True')}
134 <label for="rhodecode_repository_fields">${_('Use repository extra fields')}</label>
134 <label for="rhodecode_repository_fields">${_('Use repository extra fields')}</label>
135 </div>
135 </div>
136 <span class="help-block">${_('Allows storing additional customized fields per repository.')}</span>
136 </div>
137 </div>
137 </div>
138 </div>
138
139 <div class="field">
140 <div class="label">
141 <label for="rhodecode_realm">${_('Dashboard items')}:</label>
142 </div>
143 <div class="input">
144 ${h.text('rhodecode_dashboard_items',size=5)}
145 <span class="help-block">${_('Number of items displayed in lightweight dashboard before pagination is shown.')}</span>
146 </div>
147 </div>
139 <div class="field">
148 <div class="field">
140 <div class="label label-checkbox">
149 <div class="label label-checkbox">
141 <label>${_('Icons')}:</label>
150 <label>${_('Icons')}:</label>
@@ -149,6 +158,7 b''
149 ${h.checkbox('rhodecode_show_private_icon','True')}
158 ${h.checkbox('rhodecode_show_private_icon','True')}
150 <label for="rhodecode_show_private_icon">${_('Show private repo icon on repositories')}</label>
159 <label for="rhodecode_show_private_icon">${_('Show private repo icon on repositories')}</label>
151 </div>
160 </div>
161 <span class="help-block">${_('Show public/private icons next to repositories names')}</span>
152 </div>
162 </div>
153 </div>
163 </div>
154
164
General Comments 0
You need to be logged in to leave comments. Login now