##// 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 106 ## number of commits stats will parse on each iteration
107 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 109 ## use gravatar service to display avatars
113 110 use_gravatar = true
114 111
@@ -106,9 +106,6 b' use_htsts = false'
106 106 ## number of commits stats will parse on each iteration
107 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 109 ## use gravatar service to display avatars
113 110 use_gravatar = true
114 111
@@ -106,9 +106,6 b' use_htsts = false'
106 106 ## number of commits stats will parse on each iteration
107 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 109 ## use gravatar service to display avatars
113 110 use_gravatar = true
114 111
@@ -183,6 +183,7 b' class SettingsController(BaseController)'
183 183 )
184 184
185 185 try:
186 #TODO: rewrite this to something less ugly
186 187 sett1 = RhodeCodeSetting.get_by_name_or_create('show_public_icon')
187 188 sett1.app_settings_value = \
188 189 form_result['rhodecode_show_public_icon']
@@ -203,6 +204,11 b' class SettingsController(BaseController)'
203 204 form_result['rhodecode_repository_fields']
204 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 212 Session().commit()
207 213 set_rhodecode_config(config)
208 214 h.flash(_('Updated visualisation settings'),
@@ -267,18 +267,19 b' class BaseController(WSGIController):'
267 267 # Visual options
268 268 c.visual = AttributeDict({})
269 269 rc_config = RhodeCodeSetting.get_app_settings()
270
270 ## DB stored
271 271 c.visual.show_public_icon = str2bool(rc_config.get('rhodecode_show_public_icon'))
272 272 c.visual.show_private_icon = str2bool(rc_config.get('rhodecode_show_private_icon'))
273 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 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 279 c.repo_name = get_repo_slug(request) # can be empty
277 280 c.backends = BACKENDS.keys()
278 281 c.unread_notifications = NotificationModel()\
279 282 .get_unread_cnt_for_user(c.rhodecode_user.user_id)
280 self.cut_off_limit = int(config.get('cut_off_limit'))
281
282 283 self.sa = meta.Session
283 284 self.scm_model = ScmModel(self.sa)
284 285
@@ -285,6 +285,7 b' def ApplicationVisualisationForm():'
285 285
286 286 rhodecode_repository_fields = v.StringBoolean(if_missing=False)
287 287 rhodecode_lightweight_journal = v.StringBoolean(if_missing=False)
288 rhodecode_dashboard_items = v.UnicodeString()
288 289
289 290 return _ApplicationVisualisationForm
290 291
@@ -133,9 +133,18 b''
133 133 ${h.checkbox('rhodecode_repository_fields','True')}
134 134 <label for="rhodecode_repository_fields">${_('Use repository extra fields')}</label>
135 135 </div>
136 <span class="help-block">${_('Allows storing additional customized fields per repository.')}</span>
136 137 </div>
137 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 148 <div class="field">
140 149 <div class="label label-checkbox">
141 150 <label>${_('Icons')}:</label>
@@ -149,6 +158,7 b''
149 158 ${h.checkbox('rhodecode_show_private_icon','True')}
150 159 <label for="rhodecode_show_private_icon">${_('Show private repo icon on repositories')}</label>
151 160 </div>
161 <span class="help-block">${_('Show public/private icons next to repositories names')}</span>
152 162 </div>
153 163 </div>
154 164
General Comments 0
You need to be logged in to leave comments. Login now