Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 390
- Log:
Initial import of Canvass, a donations-based poll application.
- Author:
- rool
- Date:
- Mon Mar 21 14:58:04 +0000 2011
- Size:
- 2747 Bytes
1 | <% |
2 | # Render as follows: |
3 | # |
4 | # render( |
5 | # :partial => 'edit', |
6 | # :locals => { |
7 | # :poll => <poll>, |
8 | # :action => :create | :update |
9 | # } |
10 | # ) |
11 | # |
12 | # ...where <poll> is the poll to edit and :action is used for the |
13 | # internationalised text in the 'submit' action button. In addition, |
14 | # a "delete" button is shown for the :update case. |
15 | |
16 | form_for( poll ) do | f | %> |
17 | <%= f.error_messages %> |
18 | |
19 | <table border="1" cellspacing="1" cellpadding="0"> |
20 | <tr> |
21 | <th><%= f.label :title %></th> |
22 | <td> |
23 | <%= f.text_field :title, :size => 30, :maxlength => Poll::MAXLEN_TITLE %> |
24 | </td> |
25 | </tr> |
26 | <tr> |
27 | <th><%= f.label :currency %></th> |
28 | <td> |
29 | <% if ( poll.votes.blank? || poll.votes.zero? ) -%> |
30 | <%= currencyhelp_menu( Currency.all, { :form => f } ) %> |
31 | <% else -%> |
32 | <%=h poll.currency.name %> |
33 | <br /> |
34 | <span class="view_hint"> |
35 | <%= apphelp_view_hint( :cannot_change_currency_hint ) %> |
36 | </span> |
37 | <% end -%> |
38 | </td> |
39 | </tr> |
40 | <% if ( action == :update ) -%> |
41 | <tr> |
42 | <th><%= f.label :workflow_state %></th> |
43 | <td> |
44 | <%= apphelp_state( poll.workflow_state, PollsController ) %> |
45 | ⇒ |
46 | <%= pollshelp_state_change_menu( f, poll ) %> |
47 | <%= help_link( "poll_states" ) %> |
48 | <br /> |
49 | <span class="view_hint"> |
50 | <%= apphelp_view_hint( :state_change_care_hint ) %> |
51 | </span> |
52 | </td> |
53 | </tr> |
54 | <% end -%> |
55 | </table> |
56 | |
57 | <p /> |
58 | <%= f.label :description %> |
59 | (<a target="_blank" href="http://redcloth.org/textile/">modern Textile</a>) |
60 | <br /> |
61 | |
62 | <div class="redcloth_preview_outer"> |
63 | <span class="redcloth_preview_title"> |
64 | <%= apphelp_view_hint( :preview ) %> |
65 | </span> |
66 | <div class="redcloth_preview_inner" id="description_preview"> |
67 | <noscript> |
68 | <%= apphelp_view_hint( :preview_no_js ) %> |
69 | </noscript> |
70 | </div> |
71 | </div> |
72 | |
73 | <%= f.text_area :description, :rows => 20, :cols => 80, :class => 'redcloth_preview_source' %> |
74 | |
75 | <script type="text/javascript"> |
76 | document.observe |
77 | ( |
78 | "dom:loaded", |
79 | function() |
80 | { |
81 | new RedClothPreview |
82 | ( |
83 | 'poll_description', |
84 | 'description_preview', |
85 | '<%= redcloth_path() %>' |
86 | ); |
87 | } |
88 | ); |
89 | </script> |
90 | |
91 | <br style="clear: both;" /> |
92 | <p /> |
93 | <div class="buttons aligned"> |
94 | <%= apphelp_submit( f, action ) %> |
95 | |
96 | <% if ( action == :create ) -%> |
97 | <%= apphelp_protected_button_to( :index, { :method => :polls_path } ) %> |
98 | <% else -%> |
99 | <%= |
100 | apphelp_protected_buttons_to( |
101 | nil, |
102 | [ :show, { :method => :poll_path }, @poll ], |
103 | [ :index, { :method => :polls_path } ] |
104 | ) |
105 | %> |
106 | <% end -%> |
107 | </div> |
108 | <% end %> |