Commit 0f627a65f43e1b6bfce059bf1750075fb589e583
1 parent
c1c903fb
Exists in
master
and in
4 other branches
Project tab r1 is finished
Showing
16 changed files
with
128 additions
and
53 deletions
Show diff stats
app/assets/stylesheets/projects.css.scss
... | ... | @@ -573,7 +573,6 @@ h4.middle-panel { |
573 | 573 | |
574 | 574 | .tab { |
575 | 575 | font-weight: bold; |
576 | - text-transform: uppercase; | |
577 | 576 | border-right: 1px solid #ddd; |
578 | 577 | background:none; |
579 | 578 | padding: 10px; |
... | ... | @@ -600,7 +599,9 @@ h4.middle-panel { |
600 | 599 | } |
601 | 600 | } |
602 | 601 | .activities-tab span { background: url("images.png") no-repeat -161px -1px; } |
603 | -.stat-tab, .team-tab, .snippets-tab span { background: url("images.png") no-repeat -38px -77px; } | |
602 | +.stat-tab span, | |
603 | +.team-tab span, | |
604 | +.snippets-tab span { background: url("images.png") no-repeat -38px -77px; } | |
604 | 605 | .files-tab span { background: url("images.png") no-repeat -112px -23px; } |
605 | 606 | |
606 | 607 | .merge-notes-tab span { background: url("images.png") no-repeat -161px -1px; } | ... | ... |
app/controllers/projects_controller.rb
... | ... | @@ -57,7 +57,7 @@ class ProjectsController < ApplicationController |
57 | 57 | def update |
58 | 58 | respond_to do |format| |
59 | 59 | if project.update_attributes(params[:project]) |
60 | - format.html { redirect_to project, :notice => 'Project was successfully updated.' } | |
60 | + format.html { redirect_to info_project_path(project), :notice => 'Project was successfully updated.' } | |
61 | 61 | format.js |
62 | 62 | else |
63 | 63 | format.html { render action: "edit" } |
... | ... | @@ -67,16 +67,16 @@ class ProjectsController < ApplicationController |
67 | 67 | end |
68 | 68 | |
69 | 69 | def show |
70 | + return render "projects/empty" unless @project.repo_exists? && @project.has_commits? | |
71 | + limit = (params[:limit] || 20).to_i | |
72 | + @activities = @project.cached_updates(limit) | |
70 | 73 | end |
71 | 74 | |
72 | 75 | def files |
73 | 76 | @notes = @project.notes.where("attachment != 'NULL'").order("created_at DESC") |
74 | 77 | end |
75 | 78 | |
76 | - def activities | |
77 | - return render "projects/empty" unless @project.repo_exists? && @project.has_commits? | |
78 | - limit = (params[:limit] || 20).to_i | |
79 | - @activities = @project.cached_updates(limit) | |
79 | + def info | |
80 | 80 | end |
81 | 81 | |
82 | 82 | # | ... | ... |
app/views/dashboard/_sidebar.html.haml
app/views/layouts/project.html.haml
... | ... | @@ -23,7 +23,7 @@ |
23 | 23 | .project-sidebar |
24 | 24 | .fixed |
25 | 25 | %aside |
26 | - = 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 | |
26 | + = link_to "Project", project_path(@project), :class => (current_page?(:controller => "projects", :action => "show", :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 | |
27 | 27 | = 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 |
28 | 28 | = link_to "Commits", project_commits_path(@project), :class => current_page?(:controller => "commits", :action => "index", :project_id => @project) ? "current" : nil |
29 | 29 | = link_to "Network graph", graph_project_path(@project), :class => current_page?(:controller => "projects", :action => "graph", :id => @project) ? "current" : nil | ... | ... |
app/views/projects/_project_head.html.haml
1 | -%div | |
2 | - -#- if can? current_user, :admin_project, @project | |
3 | - -#%span.entity-info | |
4 | - -#= link_to edit_project_path(@project) do | |
5 | - -#.entity-button | |
6 | - -#Edit Project | |
7 | - -#%i | |
8 | - | |
9 | - -#%h2= @project.name | |
10 | 1 | .merge-tabs |
11 | - = link_to activities_project_path(@project), :class => "activities-tab tab #{'active' if current_page?(activities_project_path(@project)) }" do | |
2 | + = link_to project_path(@project), :class => "activities-tab tab #{'active' if current_page?(project_path(@project)) }" do | |
12 | 3 | %span |
13 | 4 | Activities |
14 | - = link_to project_path(@project), :class => "stat-tab tab" do | |
5 | + = link_to info_project_path(@project), :class => "stat-tab tab #{'active' if current_page?(info_project_path(@project)) || current_page?(edit_project_path(@project)) }" do | |
15 | 6 | %span |
16 | 7 | Info |
17 | - = link_to team_project_path(@project), :class => "team-tab tab" do | |
8 | + = link_to team_project_path(@project), :class => "team-tab tab #{'active' if current_page?(team_project_path(@project)) }" do | |
18 | 9 | %span |
19 | 10 | Team |
20 | - = link_to files_project_path(@project), :class => "files-tab tab" do | |
11 | + = link_to files_project_path(@project), :class => "files-tab tab #{'active' if current_page?(files_project_path(@project)) }" do | |
21 | 12 | %span |
22 | 13 | Files |
23 | - = link_to project_snippets_path(@project), :class => "snippets-tab tab" do | |
14 | + = link_to project_snippets_path(@project), :class => "snippets-tab tab #{'active' if current_page?(project_snippets_path(@project)) }" do | |
24 | 15 | %span |
25 | 16 | Snippets |
26 | 17 | ... | ... |
app/views/projects/_team.html.haml
1 | -%h2.icon | |
2 | - %span> | |
3 | - Team | |
4 | 1 | - if can? current_user, :admin_team_member, @project |
5 | 2 | %div#new-member-holder |
6 | 3 | .right= link_to "Add new", new_project_team_member_path(@project), :remote => true, :class => "grey-button" |
4 | + .clear | |
7 | 5 | %br |
8 | 6 | %table.round-borders#team-table |
9 | 7 | %thead | ... | ... |
app/views/projects/_tile.html.haml
... | ... | @@ -2,7 +2,7 @@ |
2 | 2 | - projects.each_with_index do |project, i| |
3 | 3 | %div.grid_1.projects_selector |
4 | 4 | %div{ :class => "project-box ui-box ui-box-big" } |
5 | - = link_to activities_project_path(project) do | |
5 | + = link_to project_path(project) do | |
6 | 6 | %h3= truncate(project.name, :length => 20) |
7 | 7 | .data |
8 | 8 | %p.title.repository.git_url_wrapper | ... | ... |
app/views/projects/activities.html.haml
... | ... | @@ -1,13 +0,0 @@ |
1 | -- content_for(:body_class, "project-page dashboard") | |
2 | - | |
3 | -= render "project_head" | |
4 | -#news-feed.news-feed | |
5 | - .project-box.project-updates.ui-box.ui-box-small.ui-box-big | |
6 | - - @activities.each do |update| | |
7 | - = render "projects/feed", :update => update, :project => @project | |
8 | - | |
9 | -:javascript | |
10 | - function updateDashboard(){ | |
11 | - $('.project-content').load("#{escape_javascript(project_path(@project))} .project-content>*"); | |
12 | - } | |
13 | - setInterval("updateDashboard()", 300000); |
app/views/projects/edit.html.erb
... | ... | @@ -1 +0,0 @@ |
1 | -<%= render 'form' %> |
... | ... | @@ -0,0 +1,69 @@ |
1 | += render "project_head" | |
2 | + | |
3 | += form_for(@project, :remote => true) do |f| | |
4 | + %div | |
5 | + %span.entity-info | |
6 | + = link_to info_project_path(@project) do | |
7 | + .entity-button | |
8 | + Info | |
9 | + %i | |
10 | + %h2= @project.name | |
11 | + %hr | |
12 | + %table.no-borders | |
13 | + -if @project.errors.any? | |
14 | + %tr | |
15 | + %td{:colspan => 2} | |
16 | + #error_explanation | |
17 | + - @project.errors.full_messages.each do |msg| | |
18 | + %span= msg | |
19 | + %br | |
20 | + | |
21 | + %tr | |
22 | + %td= f.label :name | |
23 | + %td= f.text_field :name, :placeholder => "Example Project" | |
24 | + %tr | |
25 | + %td | |
26 | + .left= f.label :path | |
27 | + %cite.right= "git@#{GIT_HOST["host"]}:" | |
28 | + %td | |
29 | + = f.text_field :path, :placeholder => "example_project", :disabled => !@project.new_record? | |
30 | + %tr | |
31 | + %td | |
32 | + .left= f.label :code | |
33 | + %cite.right= "http://#{GIT_HOST["host"]}/" | |
34 | + %td= f.text_field :code, :placeholder => "example" | |
35 | + | |
36 | + - unless @project.new_record? || @project.heads.empty? | |
37 | + %tr | |
38 | + %td= f.label :default_branch, "Default Branch" | |
39 | + %td= f.select(:default_branch, @project.heads.map(&:name), {}, :style => "width:300px;") | |
40 | + | |
41 | + %tr | |
42 | + %td= f.label :description | |
43 | + %td= f.text_area :description, :placeholder => "project description", :style => "height:50px" | |
44 | + | |
45 | + %br | |
46 | + | |
47 | + .merge-tabs | |
48 | + = f.submit 'Save', :class => "grey-button" | |
49 | + | |
50 | + - unless @project.new_record? | |
51 | + .right | |
52 | + = link_to 'Remove', @project, :confirm => 'Are you sure?', :method => :delete, :class => "red-button" | |
53 | + | |
54 | +%div{ :class => "ajax_loader", :style => "display:none;height:200px;"} | |
55 | + %center | |
56 | + = image_tag "ajax-loader.gif", :class => "append-bottom" | |
57 | + %h3.prepend-top Updating project & repository. Please wait for few minutes | |
58 | + | |
59 | +:javascript | |
60 | + $('.edit_project').bind('ajax:before', function() { | |
61 | + $(".edit_project").hide(); | |
62 | + $('.ajax_loader').show(); | |
63 | + }); | |
64 | + | |
65 | +:javascript | |
66 | + $(function(){ | |
67 | + $('form #project_default_branch').chosen(); | |
68 | + }) | |
69 | + | ... | ... |
... | ... | @@ -0,0 +1,28 @@ |
1 | += render "project_head" | |
2 | + | |
3 | +%div | |
4 | + %span.entity-info | |
5 | + = link_to edit_project_path(@project) do | |
6 | + .entity-button | |
7 | + Edit | |
8 | + %i | |
9 | + %h2= @project.name | |
10 | + %hr | |
11 | + | |
12 | +%table.no-borders | |
13 | + %tr | |
14 | + %td Name | |
15 | + %td= @project.name | |
16 | + | |
17 | + %tr | |
18 | + %td Slug | |
19 | + %td= @project.code | |
20 | + | |
21 | + %tr | |
22 | + %td Created | |
23 | + %td= @project.created_at.stamp("Aug 21, 2011") | |
24 | + | |
25 | + %tr | |
26 | + %td{:colspan => 2}= simple_format @project.description | |
27 | + | |
28 | + | ... | ... |
app/views/projects/show.html.haml
1 | -= render "project_head" | |
2 | -.stats | |
3 | - - unless @project.description.empty? | |
4 | - %h3= simple_format @project.description | |
1 | +- content_for(:body_class, "project-page dashboard") | |
5 | 2 | |
3 | += render "project_head" | |
4 | +#news-feed.news-feed | |
5 | + .project-box.project-updates.ui-box.ui-box-small.ui-box-big | |
6 | + - @activities.each do |update| | |
7 | + = render "projects/feed", :update => update, :project => @project | |
6 | 8 | |
9 | +:javascript | |
10 | + function updateDashboard(){ | |
11 | + $('.project-content').load("#{escape_javascript(project_path(@project))} .project-content>*"); | |
12 | + } | |
13 | + setInterval("updateDashboard()", 300000); | ... | ... |
app/views/projects/update.js.haml
1 | 1 | - if @project.valid? |
2 | 2 | :plain |
3 | - location.href = "#{project_path(@project, :notice => 'Project was successfully updated.')}"; | |
3 | + location.href = "#{info_project_path(@project, :notice => 'Project was successfully updated.')}"; | |
4 | 4 | - else |
5 | 5 | :plain |
6 | 6 | $(".edit_project").replaceWith("#{escape_javascript(render('form'))}"); | ... | ... |
app/views/snippets/index.html.haml
config/routes.rb
spec/requests/projects_spec.rb