Commit c5cb748c11584042b3cf4838c828462f57c24c43
1 parent
67ab8c92
Exists in
master
and in
28 other branches
ActionItem158: adding a delete action for articles
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1796 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
2 changed files
with
8 additions
and
3 deletions
Show diff stats
app/views/cms/view.rhtml
| @@ -39,6 +39,7 @@ | @@ -39,6 +39,7 @@ | ||
| 39 | <td> | 39 | <td> |
| 40 | <%= link_to _('Properties'), :action => 'edit', :id => folder.id %> | 40 | <%= link_to _('Properties'), :action => 'edit', :id => folder.id %> |
| 41 | <%= link_to _('Public view'), folder.url %> | 41 | <%= link_to _('Public view'), folder.url %> |
| 42 | + <%= link_to _('Delete'), { :action => 'destroy', :id => folder.id }, :method => :post, :confirm => _('Are you sure that you want to remove this folder? Note that all the items inside it will also be removed!') %> | ||
| 42 | </td> | 43 | </td> |
| 43 | </tr> | 44 | </tr> |
| 44 | <% end %> | 45 | <% end %> |
| @@ -51,9 +52,6 @@ | @@ -51,9 +52,6 @@ | ||
| 51 | </td> | 52 | </td> |
| 52 | </tr> | 53 | </tr> |
| 53 | <% end %> | 54 | <% end %> |
| 54 | - <% if @subitems.empty? %> | ||
| 55 | - <tr><td colspan='2' align='center'><em><%= _('None') %></em></td></tr> | ||
| 56 | - <% end %> | ||
| 57 | <% for item in @subitems %> | 55 | <% for item in @subitems %> |
| 58 | <tr> | 56 | <tr> |
| 59 | <td> | 57 | <td> |
| @@ -66,9 +64,14 @@ | @@ -66,9 +64,14 @@ | ||
| 66 | <td> | 64 | <td> |
| 67 | <%= link_to _('Edit'), :action => 'edit', :id => item.id %> | 65 | <%= link_to _('Edit'), :action => 'edit', :id => item.id %> |
| 68 | <%= link_to _('Public view'), item.url %> | 66 | <%= link_to _('Public view'), item.url %> |
| 67 | + <%= link_to _('Delete'), { :action => 'destroy', :id => item.id }, :method => :post, :confirm => _('Are you sure that you want to remove this item?') %> | ||
| 69 | </td> | 68 | </td> |
| 70 | </tr> | 69 | </tr> |
| 71 | <% end %> | 70 | <% end %> |
| 72 | 71 | ||
| 72 | + <% if @subitems.empty? || @folders.empty? %> | ||
| 73 | + <tr><td colspan='3' align='center'><em><%= _('None') %></em></td></tr> | ||
| 74 | + <% end %> | ||
| 75 | + | ||
| 73 | 76 | ||
| 74 | </table> | 77 | </table> |
test/functional/cms_controller_test.rb
| @@ -150,6 +150,8 @@ class CmsControllerTest < Test::Unit::TestCase | @@ -150,6 +150,8 @@ class CmsControllerTest < Test::Unit::TestCase | ||
| 150 | end | 150 | end |
| 151 | end | 151 | end |
| 152 | 152 | ||
| 153 | + should 'display' | ||
| 154 | + | ||
| 153 | should 'be able to create a RSS feed' do | 155 | should 'be able to create a RSS feed' do |
| 154 | login_as(profile.identifier) | 156 | login_as(profile.identifier) |
| 155 | assert_difference RssFeed, :count do | 157 | assert_difference RssFeed, :count do |