Commit d95cfc61 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

started cleaning UI

parent 1ee69714
......@@ -745,16 +745,7 @@ a.project-update.titled {
.add_new {
float:right;
padding: 5px 12px;
border: 1px solid #CCC;
&:hover {
background:#eee;
}
&:active {
background:#ddd;
}
padding: 6px 12px;
}
.tree_progress {
......@@ -845,3 +836,26 @@ tr.line_notes_row {
color:#2FA0BB;
}
}
.top-tabs {
margin: 0;
padding: 5px;
font-size: 14px;
padding-bottom:10px;
margin-bottom:20px;
height:26px;
border-bottom:1px solid #ccc;
.tab {
font-weight: bold;
background:none;
padding: 10px;
float:left;
padding-left:0px;
padding-right:40px;
&.active {
color: #2FA0BB;
}
}
}
......@@ -69,7 +69,7 @@ class ProjectsController < ApplicationController
def show
return render "projects/empty" unless @project.repo_exists? && @project.has_commits?
limit = (params[:limit] || 20).to_i
@activities = @project.updates_wo_repo(limit)
@activities = @project.activities(limit)#updates_wo_repo(limit)
end
def files
......
......@@ -18,7 +18,11 @@ class TeamMembersController < ApplicationController
def create
@team_member = UsersProject.new(params[:team_member])
@team_member.project = project
@team_member.save
if @team_member.save
redirect_to team_project_path(@project)
else
render "new"
end
end
def update
......
......@@ -300,11 +300,11 @@ class Project < ActiveRecord::Base
end[0...n]
end
def updates_wo_repo(n=3)
def activities(n=3)
[
fresh_issues(n),
fresh_merge_requests(n),
fresh_notes(n)
notes.inc_author_project.where("noteable_type is not null").order("created_at desc").first(n)
].compact.flatten.sort do |x, y|
y.created_at <=> x.created_at
end[0...n]
......
......@@ -40,8 +40,6 @@
%span.update-title
%span.commit.tag
Project Wall
%span.update-author
\...
- elsif update.kind_of?(MergeRequest)
......
.merge-tabs
.top-tabs
= link_to project_path(@project), :class => "activities-tab tab #{'active' if current_page?(project_path(@project)) }" do
%span
Activities
......@@ -23,5 +23,5 @@
- if current_page?(team_project_path(@project))
- if can? current_user, :admin_team_member, @project
= link_to new_project_team_member_path(@project), :class => "add_new", :title => "New Team Member", :remote => true do
= link_to new_project_team_member_path(@project), :class => "add_new", :title => "New Team Member" do
= image_tag "add_new.png", :width => 14
.merge-tabs.repository
.top-tabs.repository
= link_to project_repository_path(@project), :class => "activities-tab tab #{'active' if current_page?(project_repository_path(@project)) }" do
%span
Activities
......
= form_for @team_member, :as => :team_member, :url => project_team_members_path(@project, @team_member), :remote => "true" do |f|
= form_for @team_member, :as => :team_member, :url => project_team_members_path(@project, @team_member) do |f|
%div
%span.entity-info
- if request.xhr?
= link_to "#back", :onclick => "backToMembers();" do
= link_to project_team_members_path(@project) do
.entity-button
Team List
%i
......
= render "team_members/form"
:plain
$("#team-table").hide("slide", { direction: "left" }, 150, function(){
$(this).parent().append("#{escape_javascript(render('form'))}");
$('#team_member_new select#team_member_user_id').chosen();
$("#team_member_new").show("slide", { direction: "right" }, 150);
$(".add_new").hide();
});
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