RISC OS Open
A fast and easily customised operating system for ARM devices
ROOL
Home | News | Downloads | Bugs | Bounties | Forum | Documents | Photos | Contact us
Account
You are currently browsing the Subversion repository.
Changesets can be listed by changeset number.
The CVS repository is here.
  • Changesets
  • » Changeset 457

Changeset 457

Add admin ability to revert an underway poll to an open state.
More sensible entries now presented in the state change menu.

  • Comitted by: rool
  • Date: Thursday October 24 05:58:50 2013 (over 5 years ago)

Affected files:

  • Updated rool/rails/canvass/trunk/app/helpers/application_helper.rb (diff)
  • Updated rool/rails/canvass/trunk/app/helpers/polls_helper.rb (diff)
  • Updated rool/rails/canvass/trunk/app/models/poll.rb (diff)
  • Updated rool/rails/canvass/trunk/config/environment.rb (diff)
  • Updated rool/rails/canvass/trunk/config/locales/en.yml (diff)

rool/rails/canvass/trunk/app/helpers/application_helper.rb:

prev.current 
apphelp_view_hint( "state_#{ state }", ctrl )
end
  208 # As "apphelp_state", but works with event names.
  209 #
  210 def apphelp_event( event, ctrl = controller )
  211 apphelp_view_hint( "event_#{ event }", ctrl )
  212 end
  213
# Constructs links to controllers and actions based on whether or not users
# can perform given actions.
#

rool/rails/canvass/trunk/app/helpers/polls_helper.rb:

prev.current 
''
]
  69 # 'Events' is a hash of event names yielding event data. Collect this to
  70 # an array of key/value pairs and sort using the value's "transitions_to"
  71 # field. State names have "a_", "b_" etc. prefixes so that they sort in a
  72 # rational order for the progression from one state to another.
  73
  74 events = item.current_state.events.dup.collect.sort do | a, b |
  75 a[ 1 ].transitions_to.to_s <=> b[ 1 ].transitions_to.to_s
  76 end
  77
  78 # Generate a menu from this array using the translated event name for the
  79 # visible text and the state name to which the item should be transitioned
  80 # as the associated form value. We use the sorted array from above rather
  81 # than the raw events data as the raw events hash is not sorted by logical
  82 # transition order (hashes are not inherently sorted and event names do
  83 # not have the sortable prefix convention used for state names).
  84
form.select(
:workflow_state,
71   item.allowed_new_states.collect { | state |
72   [ apphelp_state( state, PollsController ), state ]
  87 events.collect { | event |
  88 event_name = event[ 0 ]
  89 event_data = event[ 1 ]
  90 [ apphelp_event( event_name, PollsController ), event_data.transitions_to ]
}.unshift( blank_entry ),
:selected => ''
)
76   end
  94 end
end

rool/rails/canvass/trunk/app/models/poll.rb:

prev.current 
# the developer be taking "too long" to complete the work. That's up to
# individual administrators or organisations to assess.
#
  182 # Administrators may choose to revert a poll, if it turns out it was
  183 # not really being developed or a developer halts work. The poll is
  184 # still wanted, so not expired; it returns to an OPEN state. No money
  185 # is redistributed.
  186 #
# Organisations may choose to pay developers before or after they
# complete work. The general recommendation is to do so only when the
# poll reaches a STATE_COMPLETED state, but again, individual
... ...
state STATE_UNDERWAY do
event :completed, :transitions_to => STATE_COMPLETED
event :expired, :transitions_to => STATE_EXPIRED
  195 event :reverted, :transitions_to => STATE_OPEN
end
# STATE_COMPLETED: Work on the poll completed; the associated feature is

rool/rails/canvass/trunk/config/environment.rb:

prev.current 
# Be sure to restart your server when you modify this file
# Specifies gem version of Rails to use when vendor/rails is not present
4   RAILS_GEM_VERSION = '2.3.15' unless defined? RAILS_GEM_VERSION
  4 RAILS_GEM_VERSION = '2.3.18' unless defined? RAILS_GEM_VERSION
# Bootstrap the Rails environment, frameworks, and default configuration
require File.join(File.dirname(__FILE__), 'boot')

rool/rails/canvass/trunk/config/locales/en.yml:

prev.current 
org:
pond:
canvass:
99   site_name: "Canvass"
  99 site_name: "RISC OS Open"
site_tagline: "...your opinion"
action_names:
... ...
view_state_c_completed: "Completed"
view_state_d_expired: "Expired"
  330 view_event_underway: "Get underway"
  331 view_event_expired: "Expire"
  332 view_event_completed: "Complete"
  333 view_event_reverted: "Revert to open"
  334
view_menu_no_change: "No change"
view_state_change_care_hint: "Take care! State changes cannot be undone."
view_cannot_change_currency_hint: "Currency cannot change after the bounty has attracted donations."
... ...
view_no_index_items: "No matching bounties can be found."
view_list_of_donations: "Donations"
  344 view_matching_pot: "%{amount} left for matching"
view_preview: "Preview"
view_preview_no_js: "The preview will only work if your browser has robust support for JavaScript enabled."

Search tickets

Social

Follow us on and

ROOL Store

Buy RISC OS Open merchandise here, including SD cards for Raspberry Pi and more.

Donate! Why?

Help ROOL make things happen – please consider donating!

RISC OS IPR

RISC OS is an Open Source operating system owned by RISC OS Developments Ltd and licensed primarily under the Apache 2.0 license.

Options

  • Tickets
  • New ticket
  • Milestones
  • Subversion: Changesets
  • Subversion: Browse
  • CVS: Revisions
  • CVS: Browse
  • Search

RSS feeds Rss

  • Changesets
  • Everything!
  • More feeds...
Site design © RISC OS Open Limited 2018 except where indicated
The RISC OS Open Collaboa theme is distantly based on the Collaboa default layout

Valid XHTML 1.0  |  Valid CSS

Powered by Collaboa
This site runs on Rails

Hosted by Arachsys