Commit cadf12c60cc27c5b0b8273c1de4b190a0e88bd7d

Authored by Dmitriy Zaporozhets
1 parent 724ea16c

Merged activities & projects pages

app/assets/stylesheets/common.scss
... ... @@ -925,7 +925,7 @@ p.time {
925 925 }
926 926 a:last-child h4 { border:none; }
927 927  
928   - a.active {
  928 + a:hover {
929 929 h4 {
930 930 color:#111;
931 931 border-right:4px solid $styled_border_color;
... ...
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
... ... @@ -1,10 +0,0 @@
1   -- if @events.any?
2   - %div.dashboard_category
3   - %h3
4   - %span.ico.activities
5   - = link_to "Activities" , "#activities", :id => "activities"
6   -
7   - %hr
8   - = render @events
9   -- else
10   - %h3 Nothing here
app/views/dashboard/index.html.haml
... ... @@ -62,9 +62,6 @@
62 62 %h3
63 63 %span.ico.activities
64 64 = link_to "Activities" , "#activities", :id => "activities"
65   - %strong.right
66   - = link_to dashboard_activities_path do
67   - Visit activities page →
68 65  
69 66 %hr
70 67 .row
... ...
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
... ... @@ -1,7 +0,0 @@
1   -- if @project.repo_exists? && @project.has_commits?
2   - :plain
3   - $(".show_holder").html("#{escape_javascript(render(:partial => 'projects/show'))}");
4   -- else
5   - :plain
6   - $(".show_holder").html("#{escape_javascript(render(:template => 'projects/empty'))}");
7   -
spec/requests/dashboard_spec.rb
... ... @@ -23,18 +23,4 @@ describe &quot;Dashboard&quot; 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
... ...