Commit cadf12c60cc27c5b0b8273c1de4b190a0e88bd7d
1 parent
724ea16c
Exists in
master
and in
4 other branches
Merged activities & projects pages
Showing
9 changed files
with
11 additions
and
65 deletions
Show diff stats
app/assets/stylesheets/common.scss
app/controllers/dashboard_controller.rb
| ... | ... | @@ -34,9 +34,4 @@ class DashboardController < ApplicationController |
| 34 | 34 | format.atom { render :layout => false } |
| 35 | 35 | end |
| 36 | 36 | end |
| 37 | - | |
| 38 | - def activities | |
| 39 | - @projects = current_user.projects.all | |
| 40 | - @events = Event.where(:project_id => @projects.map(&:id)).recent.limit(40) | |
| 41 | - end | |
| 42 | 37 | end | ... | ... |
app/controllers/projects_controller.rb
| ... | ... | @@ -13,6 +13,7 @@ class ProjectsController < ApplicationController |
| 13 | 13 | def index |
| 14 | 14 | @projects = current_user.projects |
| 15 | 15 | @projects = @projects.select(&:last_activity_date).sort_by(&:last_activity_date).reverse |
| 16 | + @events = Event.where(:project_id => @projects.map(&:id)).recent.limit(40) | |
| 16 | 17 | end |
| 17 | 18 | |
| 18 | 19 | def new |
| ... | ... | @@ -78,7 +79,6 @@ class ProjectsController < ApplicationController |
| 78 | 79 | render "projects/empty" |
| 79 | 80 | end |
| 80 | 81 | end |
| 81 | - format.js | |
| 82 | 82 | end |
| 83 | 83 | end |
| 84 | 84 | ... | ... |
app/views/dashboard/activities.html.haml
app/views/dashboard/index.html.haml
app/views/layouts/_app_menu.html.haml
| 1 | 1 | %nav.main_menu |
| 2 | 2 | = render "layouts/const_menu_links" |
| 3 | 3 | = link_to "Projects", projects_path, :class => "#{"current" if current_page?(projects_path)}" |
| 4 | - = link_to "Activities", dashboard_activities_path, :class => "#{"current" if current_page?(dashboard_activities_path)}" | |
| 5 | 4 | = link_to dashboard_issues_path, :class => "#{"current" if current_page?(dashboard_issues_path)}", :id => "issues_slide" do |
| 6 | 5 | Issues |
| 7 | 6 | %span.count= current_user.assigned_issues.opened.count | ... | ... |
app/views/projects/index.html.haml
| 1 | 1 | - if @projects.any? |
| 2 | 2 | .row |
| 3 | - .span4 | |
| 3 | + .span11 | |
| 4 | + = render @events | |
| 5 | + .span5.right | |
| 4 | 6 | %div.leftbar.ui-box |
| 5 | 7 | %h5 |
| 6 | 8 | Projects |
| 9 | + %small | |
| 10 | + (#{@projects.count}) | |
| 7 | 11 | - if current_user.can_create_project? |
| 8 | 12 | %span.right |
| 9 | 13 | = link_to new_project_path, :class => "btn very_small info" do |
| 10 | 14 | New Project |
| 11 | 15 | .content_list |
| 12 | 16 | - @projects.each do |project| |
| 13 | - = link_to project_path(project), :remote => true, :class => dom_class(project) do | |
| 17 | + = link_to project_path(project), :class => dom_class(project) do | |
| 14 | 18 | %h4 |
| 15 | 19 | %span.ico.project |
| 16 | - = truncate(project.name, :length => 22) | |
| 17 | - .span12.right | |
| 18 | - .show_holder.ui-box.padded | |
| 19 | - .loading | |
| 20 | + = truncate(project.name, :length => 25) | |
| 21 | + %span.right | |
| 22 | + → | |
| 20 | 23 | |
| 21 | 24 | - else |
| 22 | 25 | %h3 Nothing here |
| ... | ... | @@ -31,20 +34,3 @@ |
| 31 | 34 | New Project » |
| 32 | 35 | - else |
| 33 | 36 | If you will be added to project - it will be displayed here |
| 34 | - | |
| 35 | - | |
| 36 | -:javascript | |
| 37 | - $(function(){ | |
| 38 | - $("a.project").live("ajax:before", function() { | |
| 39 | - $(".show_holder").html("<div class='loading'>"); | |
| 40 | - $('a.project').removeClass("active"); | |
| 41 | - $(this).addClass("active"); | |
| 42 | - }); | |
| 43 | - $('a.project:first-child').trigger("click"); | |
| 44 | - }); | |
| 45 | - | |
| 46 | -- if @projects.count == @limit | |
| 47 | - :javascript | |
| 48 | - $(function(){ | |
| 49 | - Pager.init(#{@limit}); | |
| 50 | - }); | ... | ... |
app/views/projects/show.js.haml
spec/requests/dashboard_spec.rb
| ... | ... | @@ -23,18 +23,4 @@ describe "Dashboard" do |
| 23 | 23 | page.should have_content(@project.name) |
| 24 | 24 | end |
| 25 | 25 | end |
| 26 | - | |
| 27 | - describe "GET /dashboard/activities" do | |
| 28 | - before do | |
| 29 | - visit dashboard_activities_path | |
| 30 | - end | |
| 31 | - | |
| 32 | - it "should be on dashboard page" do | |
| 33 | - current_path.should == dashboard_activities_path | |
| 34 | - end | |
| 35 | - | |
| 36 | - it "should have projects panel" do | |
| 37 | - page.should have_content(@project.name) | |
| 38 | - end | |
| 39 | - end | |
| 40 | 26 | end | ... | ... |