From c1c64d985ec66433b9e990c5595997850727d8aa Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Sat, 12 Nov 2011 14:45:32 +0200 Subject: [PATCH 1/4] css refactor --- app/assets/stylesheets/application.css | 31 +++ app/assets/stylesheets/commits.css.scss | 4 +- app/assets/stylesheets/issues.css.scss | 14 +- app/assets/stylesheets/projects.css.scss | 320 +++++++---------------- app/views/notes/_form.html.haml | 2 +- app/views/snippets/_form.html.haml | 5 +- app/views/snippets/index.html.haml | 2 +- 7 files changed, 149 insertions(+), 229 deletions(-) diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index e170dc07..8deb3642 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -8,3 +8,34 @@ *= require_self *= 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; +} diff --git a/app/assets/stylesheets/commits.css.scss b/app/assets/stylesheets/commits.css.scss index f1f09219..c56492cd 100644 --- a/app/assets/stylesheets/commits.css.scss +++ b/app/assets/stylesheets/commits.css.scss @@ -37,4 +37,6 @@ } } - +pre.commit_message { + white-space: pre-wrap; +} diff --git a/app/assets/stylesheets/issues.css.scss b/app/assets/stylesheets/issues.css.scss index 2aef285b..f520e37a 100644 --- a/app/assets/stylesheets/issues.css.scss +++ b/app/assets/stylesheets/issues.css.scss @@ -10,14 +10,13 @@ color: #444; } -#issues-table-holder .issue:hover .action-links { display:block; } - .issues_filter { margin-top:10px; .left { margin-right:15px; } } + .top_panel_issues{ #issue_search_form { margin:5px 0; @@ -36,3 +35,14 @@ } } } + +/** ISSUES LIST **/ +.issue .action-links { + display:none; + a { + margin-left:10px; + } +} +.issue:hover .action-links { display:block; } + + diff --git a/app/assets/stylesheets/projects.css.scss b/app/assets/stylesheets/projects.css.scss index b03ad105..1a9ab673 100644 --- a/app/assets/stylesheets/projects.css.scss +++ b/app/assets/stylesheets/projects.css.scss @@ -1,7 +1,4 @@ -// Place all the styles related to the Projects controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ - +/** MIXINS **/ @mixin round-borders-bottom($radius) { border-top: 1px solid #eaeaea; -moz-border-radius-bottomright: $radius; @@ -29,18 +26,6 @@ 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_stats { margin-bottom:10px; @@ -66,24 +51,16 @@ @include round-borders-all(4px); padding: 4px 0px; } + table.round-borders { float:left; } - -#content-container{ - min-height:250px; - background: #fff; - @include round-borders-bottom(8px); - borders:2px solid #eaeaea; - border-top: none; - padding:20px; -} - a { color: #111; } +/** FILE CONTENT VIEW **/ .view_file_content{ .old_line, .new_line { background:#ECECEC; @@ -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 { padding:5px; margin:0px; @@ -149,38 +150,7 @@ input.ssh_project_url { 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 **/ - .user_new, .new_key, .new_issue, @@ -202,7 +172,6 @@ input.ssh_project_url { } .input_button { - //@include round-borders-all(4px); padding:8px; font-size:14px; cursor:pointer; @@ -214,7 +183,6 @@ input.ssh_project_url { } /** FLASH **/ - #flash_container { height:40px; position:fixed; @@ -236,7 +204,6 @@ input.ssh_project_url { } /** Buttons **/ - .lbutton, .lite_button { display:block; @@ -273,31 +240,82 @@ input.ssh_project_url { 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{ cursor: move; } -.handle{ - width: 12px; - height: 12px; - padding: 10px; +.project-refs-form { + span { + background: none !important; + position:static !important; + width:auto !important; + height: auto !important; + } } +.project-refs-select { + width:200px; +} +.filter .left { margin-right:15px; } + +body.project-page table .commit { + a.tree-commit-link { + color:gray; + &:hover { + text-decoration:underline; + } + } +} + +/** 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 } +} + +/** JQuery UI **/ +.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; + a { + margin-left:10px; + } +} +.snippet:hover .action-links { display:block; } + +/** ISSUES TAGS **/ .tag { @include round-borders-all(4px); padding:2px 4px; @@ -327,145 +345,3 @@ input.ssh_project_url { 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 { - span { - background: none !important; - position:static !important; - width:auto !important; - height: auto !important; - } -} - -.project-refs-select { - width:200px; -} - -.filter .left { margin-right:15px; } - - -.cgray { color:gray; } -.cred { color:#D12F19; } -.cgreen { color:#44aa22; } - -body.project-page table .commit { - a.tree-commit-link { - color:gray; - &:hover { - text-decoration:underline; - } - } -} - - -.snippet .action-links, -#issues-table-holder .issue .action-links { - display:none; - a { - margin-left:10px; - } -} - -.snippet:hover .action-links { display:block; } - - - -/** NEW PROJECT **/ -.new-project-hodler { - .icon span { - background-position: -31px -70px; - } - td { - border-bottom: 1px solid #DEE2E3; - } -} - -//.message .note-title p { margin-bottom:0px; } - -.commit, -.snippet, -.message { - .title { - color:#666; - a { - color:#666 !important; - } - p { - margin-top:0px; - } - } - - .author { - color: #999 - } -} - -/** UI autocomplete **/ -.ui-autocomplete { @include round-borders-all(5px); } -.ui-menu-item { cursor: pointer } - diff --git a/app/views/notes/_form.html.haml b/app/views/notes/_form.html.haml index a0def20b..98e66bd4 100644 --- a/app/views/notes/_form.html.haml +++ b/app/views/notes/_form.html.haml @@ -28,4 +28,4 @@ .clear %br - = f.submit 'Add note', :class => "lbutton vm", :id => "submit_note" + = f.submit 'Add note', :class => "button", :id => "submit_note" diff --git a/app/views/snippets/_form.html.haml b/app/views/snippets/_form.html.haml index 5cd0f74a..b3cae65c 100644 --- a/app/views/snippets/_form.html.haml +++ b/app/views/snippets/_form.html.haml @@ -19,7 +19,8 @@ %td{:colspan => 2} = f.label :content, "Code" %br - = f.text_area :content, :style => "height:240px;width:932px;" + %br + = f.text_area :content .actions.prepend-top - = f.submit 'Save', :class => "lbutton vm" + = f.submit 'Save', :class => "button" diff --git a/app/views/snippets/index.html.haml b/app/views/snippets/index.html.haml index 58e6085f..0ae37cff 100644 --- a/app/views/snippets/index.html.haml +++ b/app/views/snippets/index.html.haml @@ -1,6 +1,6 @@ %div - 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 %thead From 4dd5d9c8cce5c596a159277c464026cf0f50f1c4 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Sat, 12 Nov 2011 15:18:56 +0200 Subject: [PATCH 2/4] =?UTF-8?q?Issue=20#185=20=E2=80=93=20Show=20branch=20?= =?UTF-8?q?name=20for=20commits=20on=20activities=20&=20dashboard=20pages?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/assets/stylesheets/projects.css.scss | 8 ++++++++ app/models/repository.rb | 4 ++-- app/views/dashboard/index.html.haml | 2 ++ app/views/layouts/project.html.haml | 2 +- app/views/projects/_recent_commits.html.haml | 4 +++- lib/commit_ext.rb | 2 ++ spec/requests/dashboard_spec.rb | 1 + spec/requests/projects_spec.rb | 9 ++++++--- 8 files changed, 25 insertions(+), 7 deletions(-) diff --git a/app/assets/stylesheets/projects.css.scss b/app/assets/stylesheets/projects.css.scss index 1a9ab673..c94e7934 100644 --- a/app/assets/stylesheets/projects.css.scss +++ b/app/assets/stylesheets/projects.css.scss @@ -344,4 +344,12 @@ body.project-page table .commit { background: #2c5c66; color:white; } + &.issue { + background: #D12F19; + color:white; + } + &.commit { + background: #2c5c66; + color:white; + } } diff --git a/app/models/repository.rb b/app/models/repository.rb index 3b094715..5a2b71a4 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -73,7 +73,7 @@ class Repository def fresh_commits(n = 10) 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 } commits.sort! do |x, y| @@ -85,7 +85,7 @@ class Repository def commits_since(date) 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 } commits.sort! do |x, y| diff --git a/app/views/dashboard/index.html.haml b/app/views/dashboard/index.html.haml index e7559dd5..a8b7f253 100644 --- a/app/views/dashboard/index.html.haml +++ b/app/views/dashboard/index.html.haml @@ -27,6 +27,8 @@ %a.project-update{:href => dashboard_feed_path(project, update)} = image_tag gravatar_icon(update.author_email), :class => "left", :width => 40 %span.update-title + - if update.kind_of?(Grit::Commit) + %span.tag.commit= update.head.name = dashboard_feed_title(update) %span.update-author %strong= update.author_name diff --git a/app/views/layouts/project.html.haml b/app/views/layouts/project.html.haml index 078f710c..48b4360f 100644 --- a/app/views/layouts/project.html.haml +++ b/app/views/layouts/project.html.haml @@ -19,7 +19,7 @@ .git_url_wrapper %input.git-url.text{:id => "", :name => "", :readonly => "", :type => "text", :value => @project.url_to_repo, :class => "one_click_select"} %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 "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 diff --git a/app/views/projects/_recent_commits.html.haml b/app/views/projects/_recent_commits.html.haml index 7dfc1971..9680eb52 100644 --- a/app/views/projects/_recent_commits.html.haml +++ b/app/views/projects/_recent_commits.html.haml @@ -22,7 +22,9 @@ - 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) + %p + %span.tag.commit= commit.head.name + = link_to truncate(commit.safe_message, :length => 40), project_commit_path(@project, :id => commit.id) %span %span.author diff --git a/lib/commit_ext.rb b/lib/commit_ext.rb index db650355..2850a239 100644 --- a/lib/commit_ext.rb +++ b/lib/commit_ext.rb @@ -1,4 +1,6 @@ module CommitExt + attr_accessor :head + def safe_message message.encode("UTF-8", :invalid => :replace, diff --git a/spec/requests/dashboard_spec.rb b/spec/requests/dashboard_spec.rb index 6940366a..d54c6154 100644 --- a/spec/requests/dashboard_spec.rb +++ b/spec/requests/dashboard_spec.rb @@ -22,6 +22,7 @@ describe "Dashboard" do it "should have 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.safe_message) end diff --git a/spec/requests/projects_spec.rb b/spec/requests/projects_spec.rb index 3d897157..87f76fdb 100644 --- a/spec/requests/projects_spec.rb +++ b/spec/requests/projects_spec.rb @@ -72,10 +72,13 @@ describe "Projects" do current_path.should == project_path(@project) end - it "should beahave like dashboard" do - page.should have_content("History") + it "should beahave like activities page" do + within ".commit" 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 describe "GET /projects/team" do From 8786aff25a8e68e1dd6c50f3802eadb35908f151 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Sat, 12 Nov 2011 16:19:34 +0200 Subject: [PATCH 3/4] project avtivity page --- app/assets/stylesheets/projects.css.scss | 22 +++++++++++- app/views/projects/_feed.html.haml | 15 ++++++++ app/views/projects/_recent_commits.html.haml | 34 ------------------- app/views/projects/_recent_messages.html.haml | 27 --------------- app/views/projects/show.html.haml | 12 ++++--- spec/requests/projects_spec.rb | 2 +- 6 files changed, 45 insertions(+), 67 deletions(-) create mode 100644 app/views/projects/_feed.html.haml delete mode 100644 app/views/projects/_recent_commits.html.haml delete mode 100644 app/views/projects/_recent_messages.html.haml diff --git a/app/assets/stylesheets/projects.css.scss b/app/assets/stylesheets/projects.css.scss index c94e7934..8ea868bc 100644 --- a/app/assets/stylesheets/projects.css.scss +++ b/app/assets/stylesheets/projects.css.scss @@ -344,12 +344,32 @@ body.project-page table .commit { background: #2c5c66; color:white; } + &.note { + background: #2c5c66; + color:white; + } &.issue { background: #D12F19; color:white; } &.commit { - background: #2c5c66; + background: #44aacc; color:white; } } + + +/* 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 */ diff --git a/app/views/projects/_feed.html.haml b/app/views/projects/_feed.html.haml new file mode 100644 index 00000000..e1ed2944 --- /dev/null +++ b/app/views/projects/_feed.html.haml @@ -0,0 +1,15 @@ +%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 + diff --git a/app/views/projects/_recent_commits.html.haml b/app/views/projects/_recent_commits.html.haml deleted file mode 100644 index 9680eb52..00000000 --- a/app/views/projects/_recent_commits.html.haml +++ /dev/null @@ -1,34 +0,0 @@ -%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 - %span.tag.commit= commit.head.name - = 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 diff --git a/app/views/projects/_recent_messages.html.haml b/app/views/projects/_recent_messages.html.haml deleted file mode 100644 index 57583f5c..00000000 --- a/app/views/projects/_recent_messages.html.haml +++ /dev/null @@ -1,27 +0,0 @@ -- @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 diff --git a/app/views/projects/show.html.haml b/app/views/projects/show.html.haml index f693cb9d..97ac92d1 100644 --- a/app/views/projects/show.html.haml +++ b/app/views/projects/show.html.haml @@ -1,8 +1,12 @@ -.left.width-49p - =render "projects/recent_commits" +- content_for(:body_class, "project-page dashboard") -.right.width-49p - =render "projects/recent_messages" +#news-feed.news-feed + %h2.icon + %span> + Activities + .project-box.project-updates.ui-box.ui-box-small.ui-box-big + - @project.updates(20).each do |update| + = render "projects/feed", :update => update, :project => @project :javascript function updateDashboard(){ diff --git a/spec/requests/projects_spec.rb b/spec/requests/projects_spec.rb index 87f76fdb..85c2d275 100644 --- a/spec/requests/projects_spec.rb +++ b/spec/requests/projects_spec.rb @@ -73,7 +73,7 @@ describe "Projects" do end it "should beahave like activities page" do - within ".commit" do + 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) From 2f790001a029144f7a614d49a123cd1037f6398c Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Sat, 12 Nov 2011 16:28:14 +0200 Subject: [PATCH 4/4] project -> show refactor --- app/controllers/projects_controller.rb | 17 ++--------------- app/views/dashboard/index.html.haml | 2 +- app/views/projects/show.html.haml | 2 +- 3 files changed, 4 insertions(+), 17 deletions(-) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 0494e182..0639982c 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -64,21 +64,8 @@ class ProjectsController < ApplicationController def show return render "projects/empty" unless @project.repo_exists? - @date = case params[:view] - when "week" then Date.today - 7.days - 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 + limit = (params[:limit] || 40).to_i + @activities = @project.updates(limit) end # diff --git a/app/views/dashboard/index.html.haml b/app/views/dashboard/index.html.haml index a8b7f253..e25ec249 100644 --- a/app/views/dashboard/index.html.haml +++ b/app/views/dashboard/index.html.haml @@ -28,7 +28,7 @@ = image_tag gravatar_icon(update.author_email), :class => "left", :width => 40 %span.update-title - if update.kind_of?(Grit::Commit) - %span.tag.commit= update.head.name + %span.right.tag.commit= update.head.name = dashboard_feed_title(update) %span.update-author %strong= update.author_name diff --git a/app/views/projects/show.html.haml b/app/views/projects/show.html.haml index 97ac92d1..0530736f 100644 --- a/app/views/projects/show.html.haml +++ b/app/views/projects/show.html.haml @@ -5,7 +5,7 @@ %span> Activities .project-box.project-updates.ui-box.ui-box-small.ui-box-big - - @project.updates(20).each do |update| + - @activities.each do |update| = render "projects/feed", :update => update, :project => @project :javascript