diff --git a/app/views/tasks/_approve_article.rhtml b/app/views/tasks/_approve_article.rhtml index e9fca09..37f54d0 100644 --- a/app/views/tasks/_approve_article.rhtml +++ b/app/views/tasks/_approve_article.rhtml @@ -1,31 +1,36 @@

<%= _('New article') %>

-<%= _('%s wants to publish content: %s.') % - [content_tag('strong', link_to( task.requestor.name, task.requestor.public_profile_url ) ), - content_tag('strong', link_to( task.name, task.article.url ) )] %> - <% form_for('task', task, :url => { :action => 'close', :id => task.id } ) do |f| %> -
- <%= radio_button_tag(:decision, 'finish', true, + <% if task.article.nil? %> + <%= _('%s wanted to publish content but it was removed. It cannot be approved.') % content_tag('strong', link_to( task.requestor.name, task.requestor.public_profile_url ) ) %> + <%= hidden_field_tag(:decision, 'cancel') %> + <% else %> + <%= _('%s wants to publish content: %s.') % + [content_tag('strong', link_to( task.requestor.name, task.requestor.public_profile_url ) ), + content_tag('strong', link_to( task.name, task.article.url ) )] %> + +
+ <%= radio_button_tag(:decision, 'finish', true, :id => "decision-finish-#{task.id}", :onclick => "Element.show('group-for-friend-#{task.id}')") %> - + -     +     - <%= radio_button_tag(:decision, 'cancel', false, - :id => "decision-cancel-#{task.id}", - :onclick => "Element.hide('group-for-friend-#{task.id}')") %> - + <%= radio_button_tag(:decision, 'cancel', false, + :id => "decision-cancel-#{task.id}", + :onclick => "Element.hide('group-for-friend-#{task.id}')") %> + - <%= labelled_form_field _('Name for publishing'), f.text_field(:name, :style => 'width:80%;') %> + <%= labelled_form_field _('Name for publishing'), f.text_field(:name, :style => 'width:80%;') %> - <%= select_folder(_('Select the folder where the article must be published'), 'task', 'article_parent_id', task.target.folders) %> - <%= labelled_form_field( _('Highlight this article'), f.check_box(:highlighted)) %> - <%= labelled_form_field _('Comment for author'), f.text_area(:closing_statment, :style => 'height:200px; width:80%;') %> + <%= select_folder(_('Select the folder where the article must be published'), 'task', 'article_parent_id', task.target.folders) %> + <%= labelled_form_field( _('Highlight this article'), f.check_box(:highlighted)) %> + <%= labelled_form_field _('Comment for author'), f.text_area(:closing_statment, :style => 'height:200px; width:80%;') %> -
+
+ <% end %> <% button_bar do %> <%= submit_button(:ok, _('Ok!')) %> diff --git a/features/publish_article.feature b/features/publish_article.feature index 9f0b764..b98b7d0 100644 --- a/features/publish_article.feature +++ b/features/publish_article.feature @@ -113,3 +113,23 @@ Feature: publish article When I press "Ok!" Then I should see "Validation failed: Slug (the code generated from the article name) is already being used by another article." + Scenario: ask to publish an article and remove it before approval + Given I am logged in as "joaosilva" + And "Joao Silva" is admin of "Sample Community" + And I am on Sample Community's control panel + And I follow "Community Info and settings" + And I choose "profile_data_moderated_articles_true" + And I press "Save" + And I am on Joao Silva's control panel + And I follow "Manage Content" + And I follow "Spread" + And I check "Sample Community" + And I press "Publish" + And "joaosilva" has no articles + And I am on Sample Community's control panel + When I follow "Tasks" + Then I should see "Joao Silva wanted to publish an article but it was removed. It cannot be approved." + And I press "Ok!" + And I am on Sample Community's control panel + When I follow "Tasks" + Then I should not see "Joao Silva wanted to publish an article but it was removed. It cannot be approved." -- libgit2 0.21.2