Commit 44854faa1178acc339e0896f13f887d7afa9a5ce
1 parent
94481abd
Exists in
master
and in
29 other branches
ActionItem234: added a better interface to accept articles
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@2454 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
2 changed files
with
43 additions
and
0 deletions
Show diff stats
app/models/approve_article.rb
1 | 1 | class ApproveArticle < Task |
2 | 2 | serialize :data, Hash |
3 | 3 | |
4 | + def description | |
5 | + _('%s wants to publish %s') % [requestor.name, article.name] | |
6 | + end | |
7 | + | |
4 | 8 | def data |
5 | 9 | self[:data] ||= {} |
6 | 10 | end |
... | ... | @@ -21,6 +25,14 @@ class ApproveArticle < Task |
21 | 25 | data[:name] = value |
22 | 26 | end |
23 | 27 | |
28 | + def closing_statment | |
29 | + data[:closing_statment] | |
30 | + end | |
31 | + | |
32 | + def closing_statment= value | |
33 | + data[:closing_statment] = value | |
34 | + end | |
35 | + | |
24 | 36 | def perform |
25 | 37 | PublishedArticle.create(:name => name, :profile => target, :reference_article => article) |
26 | 38 | end | ... | ... |
... | ... | @@ -0,0 +1,31 @@ |
1 | +<h2><%= _('New article') %></h2> | |
2 | + | |
3 | +<%= _('%s wants to publish content: %s.') % | |
4 | + [content_tag('strong', link_to( task.requestor.name, task.requestor.public_profile_url ) ), | |
5 | + content_tag('strong', link_to( task.name, task.article.url ) )] %> | |
6 | + | |
7 | +<% form_for('task', task, :url => { :action => 'close', :id => task.id } ) do |f| %> | |
8 | + | |
9 | + <div> | |
10 | + <%= radio_button_tag(:decision, 'finish', true, | |
11 | + :id => "decision-finish-#{task.id}", | |
12 | + :onclick => "Element.show('group-for-friend-#{task.id}')") %> | |
13 | + <label for="<%= "decision-finish-#{task.id}" %>"><b><%= _('Accept') %></b></label> | |
14 | + | |
15 | + | |
16 | + | |
17 | + <%= radio_button_tag(:decision, 'cancel', false, | |
18 | + :id => "decision-cancel-#{task.id}", | |
19 | + :onclick => "Element.hide('group-for-friend-#{task.id}')") %> | |
20 | + <label for="<%= "decision-cancel-#{task.id}" %>"><b><%= _('Ignore') %></b></label> | |
21 | + | |
22 | + <%= labelled_form_field _('Name for publishing'), f.text_field(:name) %> | |
23 | + | |
24 | + <%= labelled_form_field(_('Closing statment'), f.text_area(:closing_statment) ) %> | |
25 | + | |
26 | + </div> | |
27 | + | |
28 | + <% button_bar do %> | |
29 | + <%= submit_button(:ok, _('Ok!')) %> | |
30 | + <% end %> | |
31 | +<% end %> | ... | ... |