• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

allura


Commit MetaInfo

Revision69ab1b1b8c43651af310e07fe5d8be2d59c70fe7 (tree)
Time2012-07-06 22:07:29
AuthorIgor Bondarenko <jetmind2@gmai...>
CommiterIgor Bondarenko

Log Message

[#4481] ticket:102 Added option to enable/disable voting on tickets.

Change Summary

Incremental Difference

--- a/ForgeTracker/forgetracker/templates/tracker/ticket.html
+++ b/ForgeTracker/forgetracker/templates/tracker/ticket.html
@@ -108,7 +108,9 @@
108108 {% endblock %}
109109
110110 {% block content %}
111-{{ c.vote_form.display(artifact=ticket) }}
111+{% if voting_enabled %}
112+ {{ c.vote_form.display(artifact=ticket) }}
113+{% endif %}
112114 <div id="ticket_content">
113115 {{g.markdown.convert(ticket.description)|safe}}
114116 {% if ticket.attachments %}
--- a/ForgeTracker/forgetracker/tracker_main.py
+++ b/ForgeTracker/forgetracker/tracker_main.py
@@ -106,6 +106,7 @@ class ForgeTrackerApp(Application):
106106 permissions = ['configure', 'read', 'write', 'save_searches',
107107 'unmoderated_post', 'post', 'moderate', 'admin']
108108 config_options = Application.config_options + [
109+ ConfigOption('EnableVoting', bool, False),
109110 ConfigOption('TicketMonitoringEmail', str, ''),
110111 ConfigOption('TicketMonitoringType',
111112 schema.OneOf('NewTicketsOnly', 'AllTicketChanges'), None)
@@ -1021,10 +1022,11 @@ class TicketController(BaseController):
10211022 subscribed = M.Mailbox.subscribed(artifact=self.ticket)
10221023 post_count = self.ticket.discussion_thread.post_count
10231024 limit, page = h.paging_sanitizer(limit, page, post_count)
1025+ voting_enabled = self.ticket.app.config.options.get('EnableVoting')
10241026 return dict(ticket=self.ticket, globals=c.app.globals,
10251027 allow_edit=has_access(self.ticket, 'write')(),
10261028 tool_subscribed=tool_subscribed,
1027- subscribed=subscribed,
1029+ subscribed=subscribed, voting_enabled=voting_enabled,
10281030 page=page, limit=limit, count=post_count)
10291031 else:
10301032 raise exc.HTTPNotFound, 'Ticket #%s does not exist.' % self.ticket_num
@@ -1240,6 +1242,7 @@ class TrackerAdminController(DefaultAdminController):
12401242 def options(self, **kw):
12411243 c.options_admin = W.options_admin
12421244 return dict(app=self.app, form_value=dict(
1245+ EnableVoting=self.app.config.options.get('EnableVoting'),
12431246 TicketMonitoringType=self.app.config.options.get('TicketMonitoringType'),
12441247 TicketMonitoringEmail=self.app.config.options.get('TicketMonitoringEmail'),
12451248 TicketHelpNew=self.app.config.options.get('TicketHelpNew'),
--- a/ForgeTracker/forgetracker/widgets/admin.py
+++ b/ForgeTracker/forgetracker/widgets/admin.py
@@ -13,6 +13,9 @@ class OptionsAdmin(ff.AdminForm):
1313 @property
1414 def fields(self):
1515 fields = [
16+ ew.Checkbox(
17+ name='EnableVoting',
18+ label='Enable voting on tickets'),
1619 ew.TextField(
1720 name='TicketMonitoringEmail',
1821 label='Email ticket notifications to',