Commit 008118fb28e1eaf2f50a3f3dba3f5efc41d4da79
1 parent
55952f37
Exists in
master
and in
28 other branches
ActionItem36: displaying list of pending requests so the user can act on them
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1514 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
8 changed files
with
40 additions
and
0 deletions
Show diff stats
app/controllers/my_profile/profile_editor_controller.rb
| ... | ... | @@ -0,0 +1,9 @@ |
| 1 | +<% unless @pending_tasks.empty? %> | |
| 2 | + <div class='pending-tasks'> | |
| 3 | + <h2><%= _('You have pending requests') %></h2> | |
| 4 | + <ul> | |
| 5 | + <%= @pending_tasks.map {|item| content_tag('li', item.description)} %> | |
| 6 | + </ul> | |
| 7 | + <%= button(:todo, _('Process requests'), :controller => 'tasks', :action => 'index') %> | |
| 8 | + </div> | |
| 9 | +<% end %> | ... | ... |
app/views/profile_editor/index.rhtml
public/designs/icons/default/README
821 Bytes
public/designs/icons/default/style.css
public/stylesheets/common.css
| ... | ... | @@ -444,3 +444,13 @@ div.auto-complete li.selected { |
| 444 | 444 | background: #B8CFE7; |
| 445 | 445 | color: #204A87; |
| 446 | 446 | } |
| 447 | + | |
| 448 | +/* pending tasks list */ | |
| 449 | + | |
| 450 | +div.pending-tasks { | |
| 451 | + background: #B8CFE7; | |
| 452 | + color: #204A87; | |
| 453 | + border: 2px solid #204A87; | |
| 454 | + padding: 2px; | |
| 455 | + margin: 1em; | |
| 456 | +} | ... | ... |
test/functional/profile_editor_controller_test.rb
| ... | ... | @@ -31,6 +31,19 @@ class ProfileEditorControllerTest < Test::Unit::TestCase |
| 31 | 31 | assert_tag :tag => 'td', :content => 'my contact information' |
| 32 | 32 | end |
| 33 | 33 | |
| 34 | + def test_should_present_pending_tasks_in_index | |
| 35 | + ze = Profile['ze'] # a fixture >:-( | |
| 36 | + @controller.expects(:profile).returns(ze).at_least_once | |
| 37 | + tasks = mock | |
| 38 | + pending = [] | |
| 39 | + pending.expects(:empty?).returns(false) # force the display of the pending tasks list | |
| 40 | + tasks.expects(:pending).returns(pending) | |
| 41 | + ze.expects(:tasks).returns(tasks) | |
| 42 | + get :index, :profile => ze.identifier | |
| 43 | + assert_same pending, assigns(:pending_tasks) | |
| 44 | + assert_tag :tag => 'div', :attributes => { :class => 'pending-tasks' }, :descendant => { :tag => 'a', :attributes => { :href => '/myprofile/ze/tasks' } } | |
| 45 | + end | |
| 46 | + | |
| 34 | 47 | def test_edit_person_info |
| 35 | 48 | person = User.create(:login => 'test_profile', :email => 'test@noosfero.org', :password => 'test', :password_confirmation => 'test').person |
| 36 | 49 | ... | ... |