Commit e46033bd5016beca5f189527091e1a35a66ef565
Exists in
master
and in
9 other branches
Merge branch 'work-assignment-order' into noosfero
Showing
1 changed file
with
5 additions
and
5 deletions
Show diff stats
plugins/work_assignment/lib/work_assignment_plugin/helper.rb
| 1 | module WorkAssignmentPlugin::Helper | 1 | module WorkAssignmentPlugin::Helper |
| 2 | include CmsHelper | 2 | include CmsHelper |
| 3 | - | 3 | + |
| 4 | def display_submissions(work_assignment, user) | 4 | def display_submissions(work_assignment, user) |
| 5 | return if work_assignment.submissions.empty? | 5 | return if work_assignment.submissions.empty? |
| 6 | content_tag('table', | 6 | content_tag('table', |
| @@ -11,7 +11,7 @@ module WorkAssignmentPlugin::Helper | @@ -11,7 +11,7 @@ module WorkAssignmentPlugin::Helper | ||
| 11 | content_tag('th', '') + | 11 | content_tag('th', '') + |
| 12 | content_tag('th', '') | 12 | content_tag('th', '') |
| 13 | ).html_safe + | 13 | ).html_safe + |
| 14 | - work_assignment.children.map {|author_folder| display_author_folder(author_folder, user)}.join("\n").html_safe | 14 | + work_assignment.children.order('name ASC').map {|author_folder| display_author_folder(author_folder, user)}.join("\n").html_safe |
| 15 | ) | 15 | ) |
| 16 | end | 16 | end |
| 17 | 17 | ||
| @@ -24,7 +24,7 @@ module WorkAssignmentPlugin::Helper | @@ -24,7 +24,7 @@ module WorkAssignmentPlugin::Helper | ||
| 24 | content_tag('td', content_tag('button', _('View all versions'), :class => 'view-author-versions', 'data-folder-id' => author_folder.id)) + | 24 | content_tag('td', content_tag('button', _('View all versions'), :class => 'view-author-versions', 'data-folder-id' => author_folder.id)) + |
| 25 | content_tag('td', display_privacy_button(author_folder, user)) | 25 | content_tag('td', display_privacy_button(author_folder, user)) |
| 26 | ).html_safe + | 26 | ).html_safe + |
| 27 | - author_folder.children.map {|submission| display_submission(submission, user)}.join("\n").html_safe | 27 | + author_folder.children.order('created_at DESC').map {|submission| display_submission(submission, user)}.join("\n").html_safe |
| 28 | end | 28 | end |
| 29 | 29 | ||
| 30 | def display_submission(submission, user) | 30 | def display_submission(submission, user) |
| @@ -32,7 +32,7 @@ module WorkAssignmentPlugin::Helper | @@ -32,7 +32,7 @@ module WorkAssignmentPlugin::Helper | ||
| 32 | content_tag('td', link_to_submission(submission, user)) + | 32 | content_tag('td', link_to_submission(submission, user)) + |
| 33 | content_tag('td', time_format(submission.created_at))+ | 33 | content_tag('td', time_format(submission.created_at))+ |
| 34 | content_tag('td', '') + | 34 | content_tag('td', '') + |
| 35 | - content_tag('td', | 35 | + content_tag('td', |
| 36 | if submission.parent.parent.allow_post_content?(user) | 36 | if submission.parent.parent.allow_post_content?(user) |
| 37 | display_delete_button(submission) | 37 | display_delete_button(submission) |
| 38 | end | 38 | end |
| @@ -67,7 +67,7 @@ module WorkAssignmentPlugin::Helper | @@ -67,7 +67,7 @@ module WorkAssignmentPlugin::Helper | ||
| 67 | end | 67 | end |
| 68 | 68 | ||
| 69 | def display_delete_button(article) | 69 | def display_delete_button(article) |
| 70 | - expirable_button article, :delete, _('Delete'), | 70 | + expirable_button article, :delete, _('Delete'), |
| 71 | {:controller =>'cms', :action => 'destroy', :id => article.id }, | 71 | {:controller =>'cms', :action => 'destroy', :id => article.id }, |
| 72 | :method => :post, :confirm => delete_article_message(article) | 72 | :method => :post, :confirm => delete_article_message(article) |
| 73 | end | 73 | end |