BigW Consortium Gitlab

Commit cadf12c6 by Dmitriy Zaporozhets

Merged activities & projects pages

parent 724ea16c
......@@ -925,7 +925,7 @@ p.time {
}
a:last-child h4 { border:none; }
a.active {
a:hover {
h4 {
color:#111;
border-right:4px solid $styled_border_color;
......
......@@ -34,9 +34,4 @@ class DashboardController < ApplicationController
format.atom { render :layout => false }
end
end
def activities
@projects = current_user.projects.all
@events = Event.where(:project_id => @projects.map(&:id)).recent.limit(40)
end
end
......@@ -13,6 +13,7 @@ class ProjectsController < ApplicationController
def index
@projects = current_user.projects
@projects = @projects.select(&:last_activity_date).sort_by(&:last_activity_date).reverse
@events = Event.where(:project_id => @projects.map(&:id)).recent.limit(40)
end
def new
......@@ -78,7 +79,6 @@ class ProjectsController < ApplicationController
render "projects/empty"
end
end
format.js
end
end
......
- if @events.any?
%div.dashboard_category
%h3
%span.ico.activities
= link_to "Activities" , "#activities", :id => "activities"
%hr
= render @events
- else
%h3 Nothing here
......@@ -62,9 +62,6 @@
%h3
%span.ico.activities
= link_to "Activities" , "#activities", :id => "activities"
%strong.right
= link_to dashboard_activities_path do
Visit activities page &rarr;
%hr
.row
......
%nav.main_menu
= render "layouts/const_menu_links"
= link_to "Projects", projects_path, :class => "#{"current" if current_page?(projects_path)}"
= link_to "Activities", dashboard_activities_path, :class => "#{"current" if current_page?(dashboard_activities_path)}"
= link_to dashboard_issues_path, :class => "#{"current" if current_page?(dashboard_issues_path)}", :id => "issues_slide" do
Issues
%span.count= current_user.assigned_issues.opened.count
......
- if @projects.any?
.row
.span4
.span11
= render @events
.span5.right
%div.leftbar.ui-box
%h5
Projects
%small
(#{@projects.count})
- if current_user.can_create_project?
%span.right
= link_to new_project_path, :class => "btn very_small info" do
New Project
.content_list
- @projects.each do |project|
= link_to project_path(project), :remote => true, :class => dom_class(project) do
= link_to project_path(project), :class => dom_class(project) do
%h4
%span.ico.project
= truncate(project.name, :length => 22)
.span12.right
.show_holder.ui-box.padded
.loading
= truncate(project.name, :length => 25)
%span.right
&rarr;
- else
%h3 Nothing here
......@@ -31,20 +34,3 @@
New Project »
- else
If you will be added to project - it will be displayed here
:javascript
$(function(){
$("a.project").live("ajax:before", function() {
$(".show_holder").html("<div class='loading'>");
$('a.project').removeClass("active");
$(this).addClass("active");
});
$('a.project:first-child').trigger("click");
});
- if @projects.count == @limit
:javascript
$(function(){
Pager.init(#{@limit});
});
- if @project.repo_exists? && @project.has_commits?
:plain
$(".show_holder").html("#{escape_javascript(render(:partial => 'projects/show'))}");
- else
:plain
$(".show_holder").html("#{escape_javascript(render(:template => 'projects/empty'))}");
......@@ -23,18 +23,4 @@ describe "Dashboard" do
page.should have_content(@project.name)
end
end
describe "GET /dashboard/activities" do
before do
visit dashboard_activities_path
end
it "should be on dashboard page" do
current_path.should == dashboard_activities_path
end
it "should have projects panel" do
page.should have_content(@project.name)
end
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment