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