Project tab added. activities, team, snippets moved to project tab
This commit is contained in:
parent
6e5caa1985
commit
c1c903fb95
|
@ -561,6 +561,7 @@ h4.middle-panel {
|
||||||
display:none;
|
display:none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.merge-tabs {
|
.merge-tabs {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
border: 1px solid #ccc;
|
border: 1px solid #ccc;
|
||||||
|
@ -576,7 +577,7 @@ h4.middle-panel {
|
||||||
border-right: 1px solid #ddd;
|
border-right: 1px solid #ddd;
|
||||||
background:none;
|
background:none;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
width:60px;
|
min-width:60px;
|
||||||
float:left;
|
float:left;
|
||||||
position:relative;
|
position:relative;
|
||||||
top:-5px;
|
top:-5px;
|
||||||
|
@ -598,6 +599,9 @@ h4.middle-panel {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.activities-tab span { background: url("images.png") no-repeat -161px -1px; }
|
||||||
|
.stat-tab, .team-tab, .snippets-tab span { background: url("images.png") no-repeat -38px -77px; }
|
||||||
|
.files-tab span { background: url("images.png") no-repeat -112px -23px; }
|
||||||
|
|
||||||
.merge-notes-tab span { background: url("images.png") no-repeat -161px -1px; }
|
.merge-notes-tab span { background: url("images.png") no-repeat -161px -1px; }
|
||||||
.merge-commits-tab span { background: url("images.png") no-repeat -86px 1px; }
|
.merge-commits-tab span { background: url("images.png") no-repeat -86px 1px; }
|
||||||
|
|
|
@ -67,6 +67,13 @@ class ProjectsController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
|
end
|
||||||
|
|
||||||
|
def files
|
||||||
|
@notes = @project.notes.where("attachment != 'NULL'").order("created_at DESC")
|
||||||
|
end
|
||||||
|
|
||||||
|
def activities
|
||||||
return render "projects/empty" unless @project.repo_exists? && @project.has_commits?
|
return render "projects/empty" unless @project.repo_exists? && @project.has_commits?
|
||||||
limit = (params[:limit] || 20).to_i
|
limit = (params[:limit] || 20).to_i
|
||||||
@activities = @project.cached_updates(limit)
|
@activities = @project.cached_updates(limit)
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
%ol.project-list
|
%ol.project-list
|
||||||
- @projects.each do |project|
|
- @projects.each do |project|
|
||||||
%li
|
%li
|
||||||
%a{:href => project_path(project)}
|
%a{:href => activities_project_path(project)}
|
||||||
%span.arrow →
|
%span.arrow →
|
||||||
%span.project-name= project.name
|
%span.project-name= project.name
|
||||||
%span.time
|
%span.time
|
||||||
|
|
|
@ -23,14 +23,10 @@
|
||||||
.project-sidebar
|
.project-sidebar
|
||||||
.fixed
|
.fixed
|
||||||
%aside
|
%aside
|
||||||
= link_to "Activities", project_path(@project), :class => current_page?(:controller => "projects", :action => "show", :id => @project) ? "current" : nil
|
= link_to "Project", project_path(@project), :class => (current_page?(:controller => "projects", :action => "activities", :id => @project) || controller.controller_name == "snippets" || current_page?(:controller => "projects", :action => "team", :id => @project) || controller.controller_name == "team_members" || current_page?(project_path(@project))) ? "current" : nil
|
||||||
= link_to "Tree", tree_project_ref_path(@project, @project.root_ref), :class => current_page?(:controller => "refs", :action => "tree", :project_id => @project, :id => @ref || @project.root_ref ) ? "current" : nil
|
= link_to "Tree", tree_project_ref_path(@project, @project.root_ref), :class => current_page?(:controller => "refs", :action => "tree", :project_id => @project, :id => @ref || @project.root_ref ) ? "current" : nil
|
||||||
= link_to "Commits", project_commits_path(@project), :class => current_page?(:controller => "commits", :action => "index", :project_id => @project) ? "current" : nil
|
= link_to "Commits", project_commits_path(@project), :class => current_page?(:controller => "commits", :action => "index", :project_id => @project) ? "current" : nil
|
||||||
= link_to "Network graph", graph_project_path(@project), :class => current_page?(:controller => "projects", :action => "graph", :id => @project) ? "current" : nil
|
= link_to "Network graph", graph_project_path(@project), :class => current_page?(:controller => "projects", :action => "graph", :id => @project) ? "current" : nil
|
||||||
= link_to team_project_path(@project), :class => (current_page?(:controller => "projects", :action => "team", :id => @project) || controller.controller_name == "team_members") ? "current" : nil do
|
|
||||||
Team
|
|
||||||
- if @project.users_projects.count > 0
|
|
||||||
%span{ :class => "number" }= @project.users_projects.count
|
|
||||||
= link_to project_issues_filter_path(@project), :class => (controller.controller_name == "issues") ? "current" : nil do
|
= link_to project_issues_filter_path(@project), :class => (controller.controller_name == "issues") ? "current" : nil do
|
||||||
Issues
|
Issues
|
||||||
- if @project.issues.open_for(current_user).count > 0
|
- if @project.issues.open_for(current_user).count > 0
|
||||||
|
@ -43,13 +39,7 @@
|
||||||
Merge Requests
|
Merge Requests
|
||||||
- if @project.merge_requests.opened.count > 0
|
- if @project.merge_requests.opened.count > 0
|
||||||
%span{ :class => "number" }= @project.merge_requests.opened.count
|
%span{ :class => "number" }= @project.merge_requests.opened.count
|
||||||
= link_to project_snippets_path(@project), :class => (controller.controller_name == "snippets") ? "current" : nil do
|
|
||||||
Snippets
|
|
||||||
- if @project.snippets.non_expired.count > 0
|
|
||||||
%span{ :class => "number" }= @project.snippets.non_expired.count
|
|
||||||
|
|
||||||
- if can? current_user, :admin_project, @project
|
|
||||||
= link_to "Admin", edit_project_path(@project), :class => (current_page?(edit_project_path(@project))) ? "current" : nil
|
|
||||||
|
|
||||||
.medium-tags{:style => 'padding: 10px 0 0 10px; width: 210px;'}= tag_list @project
|
.medium-tags{:style => 'padding: 10px 0 0 10px; width: 210px;'}= tag_list @project
|
||||||
|
|
||||||
|
|
27
app/views/projects/_project_head.html.haml
Normal file
27
app/views/projects/_project_head.html.haml
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
%div
|
||||||
|
-#- if can? current_user, :admin_project, @project
|
||||||
|
-#%span.entity-info
|
||||||
|
-#= link_to edit_project_path(@project) do
|
||||||
|
-#.entity-button
|
||||||
|
-#Edit Project
|
||||||
|
-#%i
|
||||||
|
|
||||||
|
-#%h2= @project.name
|
||||||
|
.merge-tabs
|
||||||
|
= link_to activities_project_path(@project), :class => "activities-tab tab #{'active' if current_page?(activities_project_path(@project)) }" do
|
||||||
|
%span
|
||||||
|
Activities
|
||||||
|
= link_to project_path(@project), :class => "stat-tab tab" do
|
||||||
|
%span
|
||||||
|
Info
|
||||||
|
= link_to team_project_path(@project), :class => "team-tab tab" do
|
||||||
|
%span
|
||||||
|
Team
|
||||||
|
= link_to files_project_path(@project), :class => "files-tab tab" do
|
||||||
|
%span
|
||||||
|
Files
|
||||||
|
= link_to project_snippets_path(@project), :class => "snippets-tab tab" do
|
||||||
|
%span
|
||||||
|
Snippets
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
- projects.each_with_index do |project, i|
|
- projects.each_with_index do |project, i|
|
||||||
%div.grid_1.projects_selector
|
%div.grid_1.projects_selector
|
||||||
%div{ :class => "project-box ui-box ui-box-big" }
|
%div{ :class => "project-box ui-box ui-box-big" }
|
||||||
= link_to project_path(project) do
|
= link_to activities_project_path(project) do
|
||||||
%h3= truncate(project.name, :length => 20)
|
%h3= truncate(project.name, :length => 20)
|
||||||
.data
|
.data
|
||||||
%p.title.repository.git_url_wrapper
|
%p.title.repository.git_url_wrapper
|
||||||
|
|
13
app/views/projects/activities.html.haml
Normal file
13
app/views/projects/activities.html.haml
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
- content_for(:body_class, "project-page dashboard")
|
||||||
|
|
||||||
|
= render "project_head"
|
||||||
|
#news-feed.news-feed
|
||||||
|
.project-box.project-updates.ui-box.ui-box-small.ui-box-big
|
||||||
|
- @activities.each do |update|
|
||||||
|
= render "projects/feed", :update => update, :project => @project
|
||||||
|
|
||||||
|
:javascript
|
||||||
|
function updateDashboard(){
|
||||||
|
$('.project-content').load("#{escape_javascript(project_path(@project))} .project-content>*");
|
||||||
|
}
|
||||||
|
setInterval("updateDashboard()", 300000);
|
15
app/views/projects/files.html.haml
Normal file
15
app/views/projects/files.html.haml
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
= render "project_head"
|
||||||
|
%div{ :class => "update-data ui-box ui-box-small ui-box-big" }
|
||||||
|
.data
|
||||||
|
- @notes.each do |note|
|
||||||
|
%a.update-item{:href => note.attachment.url}
|
||||||
|
= image_tag gravatar_icon(note.author_email), :class => "left", :width => 16
|
||||||
|
%span.update-title{:style => "margin-bottom:0px;"}
|
||||||
|
= note.attachment_identifier
|
||||||
|
%span.update-author.right
|
||||||
|
Added
|
||||||
|
= time_ago_in_words(note.created_at)
|
||||||
|
ago
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,6 @@
|
||||||
- content_for(:body_class, "project-page dashboard")
|
= render "project_head"
|
||||||
|
.stats
|
||||||
|
- unless @project.description.empty?
|
||||||
|
%h3= simple_format @project.description
|
||||||
|
|
||||||
#news-feed.news-feed
|
|
||||||
%h2.icon
|
|
||||||
%span>
|
|
||||||
Activities
|
|
||||||
.project-box.project-updates.ui-box.ui-box-small.ui-box-big
|
|
||||||
- @activities.each do |update|
|
|
||||||
= render "projects/feed", :update => update, :project => @project
|
|
||||||
|
|
||||||
:javascript
|
|
||||||
function updateDashboard(){
|
|
||||||
$('.project-content').load("#{escape_javascript(project_path(@project))} .project-content>*");
|
|
||||||
}
|
|
||||||
setInterval("updateDashboard()", 300000);
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
= render "project_head"
|
||||||
%div
|
%div
|
||||||
= render :partial => "team", :locals => {:project => @project}
|
= render :partial => "team", :locals => {:project => @project}
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
= render "projects/project_head"
|
||||||
%h2.icon
|
%h2.icon
|
||||||
%span>
|
%span>
|
||||||
Snippets
|
Snippets
|
||||||
|
|
|
@ -42,6 +42,10 @@ Gitlab::Application.routes.draw do
|
||||||
get "team"
|
get "team"
|
||||||
get "wall"
|
get "wall"
|
||||||
get "graph"
|
get "graph"
|
||||||
|
get "activities"
|
||||||
|
get "branches"
|
||||||
|
get "tags"
|
||||||
|
get "files"
|
||||||
end
|
end
|
||||||
|
|
||||||
resources :refs, :only => [], :path => "/" do
|
resources :refs, :only => [], :path => "/" do
|
||||||
|
|
Loading…
Reference in a new issue