Commit 8170da06 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'dev' into gh_master

parents 121f6d04 e29a2566
...@@ -667,6 +667,15 @@ table.highlighttable pre{ ...@@ -667,6 +667,15 @@ table.highlighttable pre{
.cred { color:#D12F19; } .cred { color:#D12F19; }
.cgreen { color:#44aa22; } .cgreen { color:#44aa22; }
body.project-page table .commit {
a.tree-commit-link {
color:gray;
&:hover {
text-decoration:underline;
}
}
}
body.project-page #notes-list .note {padding: 10px; border-bottom: 1px solid #eee; overflow: hidden; display: block;} body.project-page #notes-list .note {padding: 10px; border-bottom: 1px solid #eee; overflow: hidden; display: block;}
body.project-page #notes-list .note {padding: 10px; border-bottom: 1px solid #eee; overflow: hidden; display: block;} body.project-page #notes-list .note {padding: 10px; border-bottom: 1px solid #eee; overflow: hidden; display: block;}
body.project-page #notes-list .note img{float: left; margin-right: 10px;} body.project-page #notes-list .note img{float: left; margin-right: 10px;}
......
...@@ -4,6 +4,10 @@ module ApplicationHelper ...@@ -4,6 +4,10 @@ module ApplicationHelper
"http://www.gravatar.com/avatar/#{Digest::MD5.hexdigest(user_email)}?s=40&d=identicon" "http://www.gravatar.com/avatar/#{Digest::MD5.hexdigest(user_email)}?s=40&d=identicon"
end end
def fixed_mode?
@view_mode == :fixed
end
def body_class(default_class = nil) def body_class(default_class = nil)
main = content_for(:body_class).blank? ? main = content_for(:body_class).blank? ?
default_class : default_class :
......
...@@ -50,6 +50,11 @@ class Project < ActiveRecord::Base ...@@ -50,6 +50,11 @@ class Project < ActiveRecord::Base
code code
end end
def team_member_by_name_or_email(email = nil, name = nil)
user = users.where("email like ? or name like ?", email, name).first
users_projects.find_by_user_id(user.id) if user
end
def common_notes def common_notes
notes.where(:noteable_type => ["", nil]) notes.where(:noteable_type => ["", nil])
end end
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
= image_tag "no_avatar.png", :class => "left", :width => 40, :style => "padding-right:5px;" = image_tag "no_avatar.png", :class => "left", :width => 40, :style => "padding-right:5px;"
%span.commit-title %span.commit-title
%strong %strong
= truncate(commit.safe_message, :length => 60) = truncate(commit.safe_message, :length => fixed_mode? ? 60 : 120)
%span.commit-author %span.commit-author
%strong= commit.author_name %strong= commit.author_name
= time_ago_in_words(commit.committed_date) = time_ago_in_words(commit.committed_date)
......
...@@ -16,29 +16,29 @@ ...@@ -16,29 +16,29 @@
.project-container .project-container
.project-sidebar .project-sidebar
.fixed .fixed
%input.git-url.text{:id => "", :name => "", :readonly => "", :type => "text", :value => @project.url_to_repo} %input.git-url.text{:id => "", :name => "", :readonly => "", :type => "text", :value => @project.url_to_repo, :class => "one_click_select"}
%aside %aside
= link_to "History", project_path(@project), :class => current_page?(:controller => "projects", :action => "show", :id => @project) ? "current" : nil = link_to "History", project_path(@project), :class => current_page?(:controller => "projects", :action => "show", :id => @project) ? "current" : nil
= link_to "Tree", tree_project_path(@project), :class => current_page?(:controller => "projects", :action => "tree", :id => @project) ? "current" : nil = link_to "Tree", tree_project_path(@project), :class => current_page?(:controller => "projects", :action => "tree", :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 "Commits", project_commits_path(@project), :class => current_page?(:controller => "commits", :action => "index", :project_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 = link_to team_project_path(@project), :class => (current_page?(:controller => "projects", :action => "team", :id => @project) || controller.controller_name == "team_members") ? "current" : nil do
Team Team
- if @project.users_projects.count > 0 - if @project.users_projects.count > 0
%span{ :class => "number" }= @project.users_projects.count %span{ :class => "number" }= @project.users_projects.count
= link_to project_issues_path(@project), :class => (controller.controller_name == "issues") ? "current" : nil do = link_to project_issues_path(@project), :class => (controller.controller_name == "issues") ? "current" : nil do
Issues Issues
- if @project.issues.opened.count > 0 - if @project.issues.opened.count > 0
%span{ :class => "number" }= @project.issues.opened.count %span{ :class => "number" }= @project.issues.opened.count
= link_to wall_project_path(@project), :class => current_page?(:controller => "projects", :action => "wall", :id => @project) ? "current" : nil do = link_to wall_project_path(@project), :class => current_page?(:controller => "projects", :action => "wall", :id => @project) ? "current" : nil do
Wall Wall
- if @project.common_notes.count > 0 - if @project.common_notes.count > 0
%span{ :class => "number" }= @project.common_notes.count %span{ :class => "number" }= @project.common_notes.count
= link_to project_snippets_path(@project), :class => (controller.controller_name == "snippets") ? "current" : nil do = link_to project_snippets_path(@project), :class => (controller.controller_name == "snippets") ? "current" : nil do
Snippets Snippets
- if @project.snippets.count > 0 - if @project.snippets.count > 0
%span{ :class => "number" }= @project.snippets.non_expired.count %span{ :class => "number" }= @project.snippets.non_expired.count
- if @commit - if @commit
= link_to truncate(commit_name(@project,@commit), :length => 15), project_commit_path(@project, :id => @commit.id), :class => current_page?(:controller => "commits", :action => "show", :project_id => @project, :id => @commit.id) ? "current" : nil = link_to truncate(commit_name(@project,@commit), :length => 15), project_commit_path(@project, :id => @commit.id), :class => current_page?(:controller => "commits", :action => "show", :project_id => @project, :id => @commit.id) ? "current" : nil
.project-content .project-content
= yield = yield
...@@ -11,5 +11,8 @@ ...@@ -11,5 +11,8 @@
%td %td
= time_ago_in_words(content_commit.committed_date) = time_ago_in_words(content_commit.committed_date)
ago ago
%td %td.commit
= link_to truncate(content_commit.safe_message, :length => 40), project_commit_path(@project, content_commit) = link_to truncate(content_commit.safe_message, :length => fixed_mode? ? 40 : 80), project_commit_path(@project, content_commit), :class => "tree-commit-link"
- tm = @project.team_member_by_name_or_email(content_commit.author_email, content_commit.author_name)
- if tm
= link_to "[#{tm.user_name}]", project_team_member_path(@project, tm)
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