Commit 76294699 authored by Valery Sizov's avatar Valery Sizov

Merge remote-tracking branch 'origin/master' into network_graph

Conflicts:
	app/assets/stylesheets/projects.css.scss
	lib/commit_ext.rb
parents dc844f01 2f790001
...@@ -8,3 +8,34 @@ ...@@ -8,3 +8,34 @@
*= require_self *= require_self
*= require_tree . *= require_tree .
*/ */
/** COLORS **/
.cgray { color:gray; }
.cred { color:#D12F19; }
.cgreen { color:#44aa22; }
/** COMMON STYLES **/
.left {
float:left;
}
.right {
float:right;
}
.width-50p{
width:50%;
}
.width-49p{
width:49%;
}
.width-30p{
width:30%;
}
.width-65p{
width:65%;
}
.append-bottom-10 {
margin-bottom:10px;
}
.prepend-top-10 {
margin-top:10px;
}
...@@ -37,4 +37,6 @@ ...@@ -37,4 +37,6 @@
} }
} }
pre.commit_message {
white-space: pre-wrap;
}
...@@ -10,14 +10,13 @@ ...@@ -10,14 +10,13 @@
color: #444; color: #444;
} }
#issues-table-holder .issue:hover .action-links { display:block; }
.issues_filter { .issues_filter {
margin-top:10px; margin-top:10px;
.left { .left {
margin-right:15px; margin-right:15px;
} }
} }
.top_panel_issues{ .top_panel_issues{
#issue_search_form { #issue_search_form {
margin:5px 0; margin:5px 0;
...@@ -36,3 +35,14 @@ ...@@ -36,3 +35,14 @@
} }
} }
} }
/** ISSUES LIST **/
.issue .action-links {
display:none;
a {
margin-left:10px;
}
}
.issue:hover .action-links { display:block; }
// Place all the styles related to the Projects controller here. /** MIXINS **/
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
@mixin round-borders-bottom($radius) { @mixin round-borders-bottom($radius) {
border-top: 1px solid #eaeaea; border-top: 1px solid #eaeaea;
-moz-border-radius-bottomright: $radius; -moz-border-radius-bottomright: $radius;
...@@ -29,18 +26,6 @@ ...@@ -29,18 +26,6 @@
border-radius: $radius; border-radius: $radius;
} }
@mixin hover-color {
background-color:#FFFFCF;
}
@mixin panel-color {
background: #111 !important;
background: -webkit-gradient(linear,left top,left bottom,from(#333),to(#111)) !important;
background: -moz-linear-gradient(top,#333,#111) !important;
background: transparent 9 !important;
}
/** File stat **/ /** File stat **/
.file_stats { .file_stats {
margin-bottom:10px; margin-bottom:10px;
...@@ -66,24 +51,16 @@ ...@@ -66,24 +51,16 @@
@include round-borders-all(4px); @include round-borders-all(4px);
padding: 4px 0px; padding: 4px 0px;
} }
table.round-borders { table.round-borders {
float:left; float:left;
} }
#content-container{
min-height:250px;
background: #fff;
@include round-borders-bottom(8px);
borders:2px solid #eaeaea;
border-top: none;
padding:20px;
}
a { a {
color: #111; color: #111;
} }
/** FILE CONTENT VIEW **/
.view_file_content{ .view_file_content{
.old_line, .new_line { .old_line, .new_line {
background:#ECECEC; background:#ECECEC;
...@@ -122,10 +99,34 @@ a { ...@@ -122,10 +99,34 @@ a {
} }
} }
.back_small.button{ td.code {
width: 100%;
.highlight {
margin-left: 55px;
overflow:auto;
overflow-y:hidden;
}
}
.highlight pre {
white-space: pre;
word-wrap:normal;
}
.highlighttable tr:hover {
background:white;
}
table.highlighttable pre{
line-height:16px !important;
font-size:12px !important;
}
table.highlighttable .linenodiv pre {
text-align: right;
padding-right: 4px;
} }
/** PROJECTS **/
input.ssh_project_url { input.ssh_project_url {
padding:5px; padding:5px;
margin:0px; margin:0px;
...@@ -149,38 +150,7 @@ input.ssh_project_url { ...@@ -149,38 +150,7 @@ input.ssh_project_url {
clear: both; clear: both;
} }
.top_project_menu {
a {
border-right: 1px solid #FFFFFF;
box-shadow: -1px 0 #DDDDDD inset;
color: #666;
display: block;
font-size: 16px;
text-decoration: none;
line-height: 20px;
padding: 11px 26px 12px 24px;
text-shadow: 0 1px 0 #FFFFFF;
float:left;
&.current {
background-color: #FFFFFF;
color: #222222;
}
}
}
.top_bar {
margin-top:50px;
background-color: #F4F4F4;
@include round-borders-top(8px);
box-shadow: 0 1px #FFFFFF inset, 0 -1px #DDDDDD inset;
height: 43px;
overflow: hidden;
width:990px;
}
/** FORM INPUTS **/ /** FORM INPUTS **/
.user_new, .user_new,
.new_key, .new_key,
.new_issue, .new_issue,
...@@ -202,7 +172,6 @@ input.ssh_project_url { ...@@ -202,7 +172,6 @@ input.ssh_project_url {
} }
.input_button { .input_button {
//@include round-borders-all(4px);
padding:8px; padding:8px;
font-size:14px; font-size:14px;
cursor:pointer; cursor:pointer;
...@@ -214,7 +183,6 @@ input.ssh_project_url { ...@@ -214,7 +183,6 @@ input.ssh_project_url {
} }
/** FLASH **/ /** FLASH **/
#flash_container { #flash_container {
height:40px; height:40px;
position:fixed; position:fixed;
...@@ -236,7 +204,6 @@ input.ssh_project_url { ...@@ -236,7 +204,6 @@ input.ssh_project_url {
} }
/** Buttons **/ /** Buttons **/
.lbutton, .lbutton,
.lite_button { .lite_button {
display:block; display:block;
...@@ -273,126 +240,10 @@ input.ssh_project_url { ...@@ -273,126 +240,10 @@ input.ssh_project_url {
width: 60px; width: 60px;
} }
.project_thumb {
margin:20px 0;
width: 250px;
float:left;
padding:20px;
text-align:center;
p, h4 {
text-align:left;
}
.lbutton {
float:left;
}
}
.handle:hover{ .handle:hover{
cursor: move; cursor: move;
} }
.handle{
width: 12px;
height: 12px;
padding: 10px;
}
.tag {
@include round-borders-all(4px);
padding:2px 4px;
border:none;
text-shadow:none;
&.high {
background: #D12F19;
color:white;
}
&.today {
background: #44aa22;
color:white;
}
&.yours {
background: #4466cc;
color:white;
}
&.normal {
background: #2c5ca6;
color:white;
}
&.notes {
background: #2c5c66;
color:white;
}
}
.left {
float:left;
}
.right {
float:right;
}
.width-50p{
width:50%;
}
.width-49p{
width:49%;
}
.width-30p{
width:30%;
}
.width-65p{
width:65%;
}
pre.commit_message {
white-space: pre-wrap;
}
#container {
/* min-height:100%;*/
}
.ui-selectmenu{
@include round-borders-all(4px);
margin-right:10px;
font-size:1.5em;
height:auto;
font-weight:bold;
.ui-selectmenu-status {
padding:3px 10px;
}
}
td.code {
width: 100%;
.highlight {
margin-left: 55px;
overflow:auto;
overflow-y:hidden;
}
}
.highlight pre {
white-space: pre;
word-wrap:normal;
}
.highlighttable tr:hover {
background:white;
}
table.highlighttable pre{
line-height:16px !important;
font-size:12px !important;
}
table.highlighttable .linenodiv pre {
text-align: right;
padding-right: 4px;
}
.project-refs-form { .project-refs-form {
span { span {
background: none !important; background: none !important;
...@@ -408,11 +259,6 @@ table.highlighttable .linenodiv pre { ...@@ -408,11 +259,6 @@ table.highlighttable .linenodiv pre {
.filter .left { margin-right:15px; } .filter .left { margin-right:15px; }
.cgray { color:gray; }
.cred { color:#D12F19; }
.cgreen { color:#44aa22; }
body.project-page table .commit { body.project-page table .commit {
a.tree-commit-link { a.tree-commit-link {
color:gray; color:gray;
...@@ -422,56 +268,114 @@ body.project-page table .commit { ...@@ -422,56 +268,114 @@ body.project-page table .commit {
} }
} }
/** NEW PROJECT **/
.new-project-hodler {
.icon span { background-position: -31px -70px; }
td { border-bottom: 1px solid #DEE2E3; }
}
/** Feed entry **/
.commit,
.snippet,
.message {
.title {
color:#666;
a { color:#666 !important; }
p { margin-top:0px; }
}
.author { color: #999 }
}
.snippet .action-links, /** JQuery UI **/
#issues-table-holder .issue .action-links { .ui-autocomplete { @include round-borders-all(5px); }
.ui-menu-item { cursor: pointer }
.ui-selectmenu{
@include round-borders-all(4px);
margin-right:10px;
font-size:1.5em;
height:auto;
font-weight:bold;
.ui-selectmenu-status {
padding:3px 10px;
}
}
/** Snippets **/
.new_snippet textarea,
.edit_snippet textarea {
height:300px;
padding: 8px;
width: 95%;
}
.snippet .action-links {
display:none; display:none;
a { a {
margin-left:10px; margin-left:10px;
} }
} }
.snippet:hover .action-links { display:block; } .snippet:hover .action-links { display:block; }
/** ISSUES TAGS **/
.tag {
@include round-borders-all(4px);
padding:2px 4px;
border:none;
text-shadow:none;
&.high {
/** NEW PROJECT **/ background: #D12F19;
.new-project-hodler { color:white;
.icon span {
background-position: -31px -70px;
}
td {
border-bottom: 1px solid #DEE2E3;
} }
}
//.message .note-title p { margin-bottom:0px; }
.commit, &.today {
.snippet, background: #44aa22;
.message { color:white;
.title {
color:#666;
a {
color:#666 !important;
}
p {
margin-top:0px;
}
} }
.author { &.yours {
color: #999 background: #4466cc;
color:white;
}
&.normal {
background: #2c5ca6;
color:white;
}
&.notes {
background: #2c5c66;
color:white;
}
&.note {
background: #2c5c66;
color:white;
}
&.issue {
background: #D12F19;
color:white;
}
&.commit {
background: #44aacc;
color:white;
} }
} }
/** UI autocomplete **/
.ui-autocomplete { @include round-borders-all(5px); }
.ui-menu-item { cursor: pointer }
#holder { #holder {
border: solid 1px #999; border: solid 1px #999;
cursor: move; cursor: move;
height: 70%; height: 70%;
overflow: hidden; overflow: hidden;
} }
/* Project Dashboard Page */
html, body { height: 100%; }
body.dashboard.project-page .news-feed h2{float: left;}
body.dashboard.project-page .news-feed .project-updates {margin-bottom: 20px; display: block; width: 100%;}
body.dashboard.project-page .news-feed .project-updates .data{ padding: 0}
body.dashboard.project-page .news-feed .project-updates a.project-update {padding: 10px; border-bottom: 1px solid #eee; overflow: hidden; display: block;}
body.dashboard.project-page .news-feed .project-updates a.project-update:last-child{border-bottom: 0}
body.dashboard.project-page .news-feed .project-updates a.project-update img{float: left; margin-right: 10px;}
body.dashboard.project-page .news-feed .project-updates a.project-update span.update-title, .dashboard-page .news-feed .project-updates li a span.update-author{display: block;}
body.dashboard.project-page .news-feed .project-updates a.project-update span.update-title{margin-bottom: 10px}
body.dashboard.project-page .news-feed .project-updates a.project-update span.update-author{color: #999; font-weight: normal; font-style: italic;}
body.dashboard.project-page .news-feed .project-updates a.project-update span.update-author strong{font-weight: bold; font-style: normal;}
/* eo Dashboard Page */
...@@ -66,21 +66,8 @@ class ProjectsController < ApplicationController ...@@ -66,21 +66,8 @@ class ProjectsController < ApplicationController
def show def show
return render "projects/empty" unless @project.repo_exists? return render "projects/empty" unless @project.repo_exists?
@date = case params[:view] limit = (params[:limit] || 40).to_i
when "week" then Date.today - 7.days @activities = @project.updates(limit)
when "day" then Date.today
else nil
end
if @date
@date = @date.at_beginning_of_day
@commits = @project.commits_since(@date)
@messages = project.notes.since(@date).order("created_at DESC")
else
@commits = @project.fresh_commits
@messages = project.notes.fresh.limit(10)
end
end end
# #
......
...@@ -73,7 +73,7 @@ class Repository ...@@ -73,7 +73,7 @@ class Repository
def fresh_commits(n = 10) def fresh_commits(n = 10)
commits = heads.map do |h| commits = heads.map do |h|
repo.commits(h.name, n) repo.commits(h.name, n).each { |c| c.head = h }
end.flatten.uniq { |c| c.id } end.flatten.uniq { |c| c.id }
commits.sort! do |x, y| commits.sort! do |x, y|
...@@ -85,7 +85,7 @@ class Repository ...@@ -85,7 +85,7 @@ class Repository
def commits_since(date) def commits_since(date)
commits = heads.map do |h| commits = heads.map do |h|
repo.log(h.name, nil, :since => date) repo.log(h.name, nil, :since => date).each { |c| c.head = h }
end.flatten.uniq { |c| c.id } end.flatten.uniq { |c| c.id }
commits.sort! do |x, y| commits.sort! do |x, y|
......
...@@ -27,6 +27,8 @@ ...@@ -27,6 +27,8 @@
%a.project-update{:href => dashboard_feed_path(project, update)} %a.project-update{:href => dashboard_feed_path(project, update)}
= image_tag gravatar_icon(update.author_email), :class => "left", :width => 40 = image_tag gravatar_icon(update.author_email), :class => "left", :width => 40
%span.update-title %span.update-title
- if update.kind_of?(Grit::Commit)
%span.right.tag.commit= update.head.name
= dashboard_feed_title(update) = dashboard_feed_title(update)
%span.update-author %span.update-author
%strong= update.author_name %strong= update.author_name
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
.git_url_wrapper .git_url_wrapper
%input.git-url.text{:id => "", :name => "", :readonly => "", :type => "text", :value => @project.url_to_repo, :class => "one_click_select"} %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 "Activities", 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 "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
......
...@@ -28,4 +28,4 @@ ...@@ -28,4 +28,4 @@
.clear .clear
%br %br
= f.submit 'Add note', :class => "lbutton vm", :id => "submit_note" = f.submit 'Add note', :class => "button", :id => "submit_note"
%a.project-update{:href => dashboard_feed_path(project, update)}
= image_tag gravatar_icon(update.author_email), :class => "left", :width => 40
%span.update-title
= dashboard_feed_title(update)
%span.update-author
%strong= update.author_name
authored
= time_ago_in_words(update.created_at)
ago
.right
- klass = update.class.to_s.split("::").last.downcase
%span.tag{ :class => klass }= klass
- if update.kind_of?(Grit::Commit)
%span.tag.commit= update.head.name
%table
%thead
%th
Commits
.filter.right
= form_tag project_path(@project), :method => :get, :class => "right" do
.left
= radio_button_tag :view, "recent", (params[:view] || "recent") == "recent", :onclick => "this.form.submit()", :id => "recent_view"
= label_tag "recent_view","Recent"
.left
= radio_button_tag :view, "day", params[:view] == "day", :onclick => "this.form.submit()", :id => "day_view"
= label_tag "day_view","Today"
.left
= radio_button_tag :view, "week", params[:view] == "week", :onclick => "this.form.submit()", :id => "week_view"
= label_tag "week_view","Week"
- @commits.each do |commit|
%tr
%td
%div.commit
- if commit.author.email
= image_tag gravatar_icon(commit.author.email), :class => "left", :width => 40, :style => "padding-right:5px;"
- else
= image_tag "no_avatar.png", :class => "left", :width => 40, :style => "padding-right:5px;"
.title
%p= link_to truncate(commit.safe_message, :length => 40), project_commit_path(@project, :id => commit.id)
%span
%span.author
%strong= commit.author.name.force_encoding("UTF-8")
%cite.cgray
= time_ago_in_words(commit.committed_date)
ago
- @messages.group_by{ |x| [x.noteable_id, x.noteable_type]}.each do |item, notes|
- id, type = item[0], item[1]
- parent = load_note_parent(id, type, @project)
- next unless parent
%table
%thead
%th
%div{ :class => "recent_message_parent"}
= link_to(truncate(dashboard_feed_title(parent), :length => 40 ), dashboard_feed_path(@project, parent))
- notes.sort {|x,y| y.updated_at <=> x.updated_at }.each do |note|
%tr
%td
%div.message
= image_tag gravatar_icon(note.author_email), :class => "left", :width => 40, :style => "padding-right:5px;"
%div.title
= link_to markdown(truncate(note.note, :length => 40)), dashboard_feed_path(@project, parent) + "#note_#{note.id}"
- if note.attachment.url
%br
Attachment:
= link_to note.attachment_identifier, note.attachment.url
%div.author
%strong= note.author_name
%cite.cgray
= time_ago_in_words(note.updated_at)
ago
%br
.left.width-49p - content_for(:body_class, "project-page dashboard")
=render "projects/recent_commits"
.right.width-49p #news-feed.news-feed
=render "projects/recent_messages" %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 :javascript
function updateDashboard(){ function updateDashboard(){
......
...@@ -19,7 +19,8 @@ ...@@ -19,7 +19,8 @@
%td{:colspan => 2} %td{:colspan => 2}
= f.label :content, "Code" = f.label :content, "Code"
%br %br
= f.text_area :content, :style => "height:240px;width:932px;" %br
= f.text_area :content
.actions.prepend-top .actions.prepend-top
= f.submit 'Save', :class => "lbutton vm" = f.submit 'Save', :class => "button"
%div %div
- if can? current_user, :write_snippet, @project - if can? current_user, :write_snippet, @project
.left= link_to 'New Snippet', new_project_snippet_path(@project), :class => "lbutton vm" = link_to 'New Snippet', new_project_snippet_path(@project), :class => "button append-bottom-10"
%table.round-borders#snippets-table %table.round-borders#snippets-table
%thead %thead
......
module CommitExt module CommitExt
attr_accessor :head
attr_accessor :refs attr_accessor :refs
def safe_message def safe_message
......
...@@ -22,6 +22,7 @@ describe "Dashboard" do ...@@ -22,6 +22,7 @@ describe "Dashboard" do
it "should have news feed" do it "should have news feed" do
within "#news-feed" do within "#news-feed" do
page.should have_content("master")
page.should have_content(@project.commit.author.name) page.should have_content(@project.commit.author.name)
page.should have_content(@project.commit.safe_message) page.should have_content(@project.commit.safe_message)
end end
......
...@@ -72,10 +72,13 @@ describe "Projects" do ...@@ -72,10 +72,13 @@ describe "Projects" do
current_path.should == project_path(@project) current_path.should == project_path(@project)
end end
it "should beahave like dashboard" do it "should beahave like activities page" do
page.should have_content("History") within ".project-update" do
page.should have_content("master")
page.should have_content(@project.commit.author.name)
page.should have_content(@project.commit.safe_message)
end
end end
end end
describe "GET /projects/team" do describe "GET /projects/team" do
......
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