Commit d95cfc6144864065cfce1cf000b081b09389013e
1 parent
1ee69714
Exists in
master
and in
4 other branches
started cleaning UI
Showing
10 changed files
with
38 additions
and
29 deletions
Show diff stats
app/assets/stylesheets/projects.css.scss
... | ... | @@ -745,16 +745,7 @@ a.project-update.titled { |
745 | 745 | |
746 | 746 | .add_new { |
747 | 747 | float:right; |
748 | - padding: 5px 12px; | |
749 | - border: 1px solid #CCC; | |
750 | - | |
751 | - &:hover { | |
752 | - background:#eee; | |
753 | - } | |
754 | - | |
755 | - &:active { | |
756 | - background:#ddd; | |
757 | - } | |
748 | + padding: 6px 12px; | |
758 | 749 | } |
759 | 750 | |
760 | 751 | .tree_progress { |
... | ... | @@ -845,3 +836,26 @@ tr.line_notes_row { |
845 | 836 | color:#2FA0BB; |
846 | 837 | } |
847 | 838 | } |
839 | + | |
840 | +.top-tabs { | |
841 | + margin: 0; | |
842 | + padding: 5px; | |
843 | + font-size: 14px; | |
844 | + padding-bottom:10px; | |
845 | + margin-bottom:20px; | |
846 | + height:26px; | |
847 | + border-bottom:1px solid #ccc; | |
848 | + | |
849 | + .tab { | |
850 | + font-weight: bold; | |
851 | + background:none; | |
852 | + padding: 10px; | |
853 | + float:left; | |
854 | + padding-left:0px; | |
855 | + padding-right:40px; | |
856 | + | |
857 | + &.active { | |
858 | + color: #2FA0BB; | |
859 | + } | |
860 | + } | |
861 | +} | ... | ... |
app/controllers/projects_controller.rb
... | ... | @@ -69,7 +69,7 @@ class ProjectsController < ApplicationController |
69 | 69 | def show |
70 | 70 | return render "projects/empty" unless @project.repo_exists? && @project.has_commits? |
71 | 71 | limit = (params[:limit] || 20).to_i |
72 | - @activities = @project.updates_wo_repo(limit) | |
72 | + @activities = @project.activities(limit)#updates_wo_repo(limit) | |
73 | 73 | end |
74 | 74 | |
75 | 75 | def files | ... | ... |
app/controllers/team_members_controller.rb
... | ... | @@ -18,7 +18,11 @@ class TeamMembersController < ApplicationController |
18 | 18 | def create |
19 | 19 | @team_member = UsersProject.new(params[:team_member]) |
20 | 20 | @team_member.project = project |
21 | - @team_member.save | |
21 | + if @team_member.save | |
22 | + redirect_to team_project_path(@project) | |
23 | + else | |
24 | + render "new" | |
25 | + end | |
22 | 26 | end |
23 | 27 | |
24 | 28 | def update | ... | ... |
app/models/project.rb
... | ... | @@ -300,11 +300,11 @@ class Project < ActiveRecord::Base |
300 | 300 | end[0...n] |
301 | 301 | end |
302 | 302 | |
303 | - def updates_wo_repo(n=3) | |
303 | + def activities(n=3) | |
304 | 304 | [ |
305 | 305 | fresh_issues(n), |
306 | 306 | fresh_merge_requests(n), |
307 | - fresh_notes(n) | |
307 | + notes.inc_author_project.where("noteable_type is not null").order("created_at desc").first(n) | |
308 | 308 | ].compact.flatten.sort do |x, y| |
309 | 309 | y.created_at <=> x.created_at |
310 | 310 | end[0...n] | ... | ... |
app/views/projects/_feed.html.haml
app/views/projects/_project_head.html.haml
1 | -.merge-tabs | |
1 | +.top-tabs | |
2 | 2 | = link_to project_path(@project), :class => "activities-tab tab #{'active' if current_page?(project_path(@project)) }" do |
3 | 3 | %span |
4 | 4 | Activities |
... | ... | @@ -23,5 +23,5 @@ |
23 | 23 | |
24 | 24 | - if current_page?(team_project_path(@project)) |
25 | 25 | - if can? current_user, :admin_team_member, @project |
26 | - = link_to new_project_team_member_path(@project), :class => "add_new", :title => "New Team Member", :remote => true do | |
26 | + = link_to new_project_team_member_path(@project), :class => "add_new", :title => "New Team Member" do | |
27 | 27 | = image_tag "add_new.png", :width => 14 | ... | ... |
app/views/repositories/_head.html.haml
app/views/team_members/_form.html.haml
1 | -= form_for @team_member, :as => :team_member, :url => project_team_members_path(@project, @team_member), :remote => "true" do |f| | |
1 | += form_for @team_member, :as => :team_member, :url => project_team_members_path(@project, @team_member) do |f| | |
2 | 2 | %div |
3 | 3 | %span.entity-info |
4 | 4 | - if request.xhr? |
5 | - = link_to "#back", :onclick => "backToMembers();" do | |
5 | + = link_to project_team_members_path(@project) do | |
6 | 6 | .entity-button |
7 | 7 | Team List |
8 | 8 | %i | ... | ... |
... | ... | @@ -0,0 +1 @@ |
1 | += render "team_members/form" | ... | ... |
app/views/team_members/new.js.haml
... | ... | @@ -1,8 +0,0 @@ |
1 | -:plain | |
2 | - $("#team-table").hide("slide", { direction: "left" }, 150, function(){ | |
3 | - $(this).parent().append("#{escape_javascript(render('form'))}"); | |
4 | - $('#team_member_new select#team_member_user_id').chosen(); | |
5 | - $("#team_member_new").show("slide", { direction: "right" }, 150); | |
6 | - $(".add_new").hide(); | |
7 | - }); | |
8 | - |