From 98fcd3b38a06ed889c84f54ab7e829659a5c1ce0 Mon Sep 17 00:00:00 2001 From: Aleksei Kvitinskii Date: Sun, 6 Nov 2011 20:48:21 +0200 Subject: [PATCH 01/10] correct html on project page --- app/views/projects/index.html.haml | 32 ++++++++++++++++-------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/app/views/projects/index.html.haml b/app/views/projects/index.html.haml index a35ead82..ba860571 100644 --- a/app/views/projects/index.html.haml +++ b/app/views/projects/index.html.haml @@ -1,18 +1,20 @@ - content_for(:body_class, "projects-page") - content_for(:page_title) do - .grid_4 - - if current_user.can_create_project? - %a.grey-button.right{:href => new_project_path} Create new project - %h2.icon - %span - Projects + .container_4 + .grid_4 + - if current_user.can_create_project? + %a.grey-button.right{:href => new_project_path} Create new project + %h2.icon + %span + Projects -- unless @projects.empty? - %div{:class => "tile", :style => view_mode_style("tile")} - = render "tile" - %div{:class => "list", :style => view_mode_style("list")} - = render "list" -- else - %center.prepend-top - %h2 - %cite Nothing here + %div.clear + - unless @projects.empty? + %div{:class => "tile", :style => view_mode_style("tile")} + = render "tile" + %div{:class => "list", :style => view_mode_style("list")} + = render "list" + - else + %center.prepend-top + %h2 + %cite Nothing here From 060a2e225755aedc99a8cdbc5fae8296daa7a958 Mon Sep 17 00:00:00 2001 From: Aleksei Kvitinskii Date: Mon, 7 Nov 2011 13:40:22 +0200 Subject: [PATCH 02/10] move tag path to the appropriate helper --- app/helpers/tags_helper.rb | 5 +++++ app/views/projects/_list.html.haml | 2 +- app/views/tags/index.html.haml | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 app/helpers/tags_helper.rb diff --git a/app/helpers/tags_helper.rb b/app/helpers/tags_helper.rb new file mode 100644 index 00000000..1e82e34d --- /dev/null +++ b/app/helpers/tags_helper.rb @@ -0,0 +1,5 @@ +module TagsHelper + def tag_path tag + "/tags/#{tag}" + end +end diff --git a/app/views/projects/_list.html.haml b/app/views/projects/_list.html.haml index 7976b11f..89deb76d 100644 --- a/app/views/projects/_list.html.haml +++ b/app/views/projects/_list.html.haml @@ -14,7 +14,7 @@ = project.name .small-tags - project.tag_list.each do |tag| - = link_to tag, "/tags/#{tag}" + = link_to tag, tag_path(tag) %td= truncate project.url_to_repo %td= project.code diff --git a/app/views/tags/index.html.haml b/app/views/tags/index.html.haml index c83d62c7..ba16b92b 100644 --- a/app/views/tags/index.html.haml +++ b/app/views/tags/index.html.haml @@ -7,5 +7,5 @@ .tags-list - @tags.all.each do |tag| - = link_to "#{tag.name}(#{tag.count})", "/tags/#{tag.name}" + = link_to "#{tag.name}(#{tag.count})", tag_path(name) From 3fe9f3ebe6b89489fb5a022cb8afe6f63d33b529 Mon Sep 17 00:00:00 2001 From: Aleksei Kvitinskii Date: Mon, 7 Nov 2011 14:12:46 +0200 Subject: [PATCH 03/10] implemented cookie remember option for issue page filter --- app/helpers/issues_helper.rb | 4 ++++ app/views/issues/index.html.haml | 14 ++++++++++---- app/views/layouts/project.html.haml | 2 +- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index bfb9d25e..08bfa569 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -1,2 +1,6 @@ module IssuesHelper + def project_issues_filter_path project, params = {} + params[:f] ||= cookies['issue_filter'] + project_issues_path project, params + end end diff --git a/app/views/issues/index.html.haml b/app/views/issues/index.html.haml index 21e455b9..79f15c86 100644 --- a/app/views/issues/index.html.haml +++ b/app/views/issues/index.html.haml @@ -10,16 +10,16 @@ .right.issues_filter = form_tag project_issues_path(@project), :method => :get do .left - = radio_button_tag :f, 0, (params[:f] || "0") == "0", :onclick => "this.form.submit()", :id => "open_issues", :class => "status" + = radio_button_tag :f, 0, (params[:f] || "0") == "0", :onclick => "setIssueFilter(this.form, 0);", :id => "open_issues", :class => "status" = label_tag "open_issues","Open" .left - = radio_button_tag :f, 2, params[:f] == "2", :onclick => "this.form.submit()", :id => "closed_issues", :class => "status" + = radio_button_tag :f, 2, params[:f] == "2", :onclick => "setIssueFilter(this.form, 2);", :id => "closed_issues", :class => "status" = label_tag "closed_issues","Closed" .left - = radio_button_tag :f, 3, params[:f] == "3", :onclick => "this.form.submit()", :id => "my_issues", :class => "status" + = radio_button_tag :f, 3, params[:f] == "3", :onclick => "setIssueFilter(this.form, 3);", :id => "my_issues", :class => "status" = label_tag "my_issues","To Me" .left - = radio_button_tag :f, 1, params[:f] == "1", :onclick => "this.form.submit()", :id => "all_issues", :class => "status" + = radio_button_tag :f, 1, params[:f] == "1", :onclick => "setIssueFilter(this.form, 1);", :id => "all_issues", :class => "status" = label_tag "all_issues","All" #issues-table-holder= render "issues" @@ -28,6 +28,12 @@ var href = $('.issue_search').parent().attr('action'); var last_terms = ''; + + var setIssueFilter = function(form, value){ + $.cookie('issue_filter', value, { expires: 140 }); + form.submit(); + } + $('.issue_search').keyup(function() { var terms = $(this).val(); var project_id = $('#project_id').val(); diff --git a/app/views/layouts/project.html.haml b/app/views/layouts/project.html.haml index ee6581ec..4b4eaf7d 100644 --- a/app/views/layouts/project.html.haml +++ b/app/views/layouts/project.html.haml @@ -25,7 +25,7 @@ Team - if @project.users_projects.count > 0 %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_filter_path(@project), :class => (controller.controller_name == "issues") ? "current" : nil do Issues - if @project.issues.opened.count > 0 %span{ :class => "number" }= @project.issues.opened.count From af7bed2aa5476ca6f359f0b0c67f46151b5db9b9 Mon Sep 17 00:00:00 2001 From: Aleksei Kvitinskii Date: Mon, 7 Nov 2011 19:48:58 +0200 Subject: [PATCH 04/10] add tag links to project page --- app/assets/stylesheets/tags.css.css | 14 ++++++++++++++ app/helpers/tags_helper.rb | 10 ++++++++++ app/views/layouts/project.html.haml | 3 +++ app/views/projects/_list.html.haml | 5 ++--- app/views/projects/_tile.html.haml | 4 +--- 5 files changed, 30 insertions(+), 6 deletions(-) diff --git a/app/assets/stylesheets/tags.css.css b/app/assets/stylesheets/tags.css.css index afd458fd..e65918ea 100644 --- a/app/assets/stylesheets/tags.css.css +++ b/app/assets/stylesheets/tags.css.css @@ -27,4 +27,18 @@ color: #FFF; text-shadow: none; font-weight: bold; +} + + +.medium-tags a{ + font-size: 12px; + + display: inline-block; + padding: 3px 4px 2px 4px; + margin: 0px 7px 8px 0px; + border-radius: 3px; + background-color: #72bbdf; + color: #FFF; + text-shadow: none; + font-weight: bold; } \ No newline at end of file diff --git a/app/helpers/tags_helper.rb b/app/helpers/tags_helper.rb index 1e82e34d..5c1ecc86 100644 --- a/app/helpers/tags_helper.rb +++ b/app/helpers/tags_helper.rb @@ -2,4 +2,14 @@ module TagsHelper def tag_path tag "/tags/#{tag}" end + + def tag_list project + html = '' + project.tag_list.each do |tag| + html += link_to tag, tag_path(tag) + end + + html.html_safe + end + end diff --git a/app/views/layouts/project.html.haml b/app/views/layouts/project.html.haml index ee6581ec..70ebb890 100644 --- a/app/views/layouts/project.html.haml +++ b/app/views/layouts/project.html.haml @@ -39,6 +39,9 @@ %span{ :class => "number" }= @project.snippets.non_expired.count - 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 + + .medium-tags{:style => 'padding: 10px 0 0 10px; width: 210px;'}= tag_list @project + .project-content = yield diff --git a/app/views/projects/_list.html.haml b/app/views/projects/_list.html.haml index 89deb76d..f41fb3e4 100644 --- a/app/views/projects/_list.html.haml +++ b/app/views/projects/_list.html.haml @@ -12,9 +12,8 @@ %tr{ :class => "project", :url => project_path(project) } %td = project.name - .small-tags - - project.tag_list.each do |tag| - = link_to tag, tag_path(tag) + .small-tags= tag_list project + %td= truncate project.url_to_repo %td= project.code diff --git a/app/views/projects/_tile.html.haml b/app/views/projects/_tile.html.haml index cc891f63..1f2a4a97 100644 --- a/app/views/projects/_tile.html.haml +++ b/app/views/projects/_tile.html.haml @@ -13,9 +13,7 @@ - last_note = project.notes.last = last_note ? last_note.created_at.stamp("24 Aug, 2011") : "Never" - %p.small-tags - - project.tag_list.each do |tag| - = link_to tag, "/tags/#{tag}" + %p.small-tags= tag_list project .buttons %a.browse-code.button.yellow{:href => tree_project_path(project)} Browse code From 4a1b70f7b2d55bf26be35a2544e3b8e76bdc0585 Mon Sep 17 00:00:00 2001 From: Aleksei Kvitinskii Date: Mon, 7 Nov 2011 20:38:54 +0200 Subject: [PATCH 05/10] add tags to admin project form --- app/assets/javascripts/projects.js | 16 ++++++++ app/views/admin/projects/_form.html.haml | 49 ++++++++++++++---------- app/views/projects/_form.html.haml | 17 ++------ 3 files changed, 48 insertions(+), 34 deletions(-) diff --git a/app/assets/javascripts/projects.js b/app/assets/javascripts/projects.js index 87be2f07..b4521fab 100644 --- a/app/assets/javascripts/projects.js +++ b/app/assets/javascripts/projects.js @@ -40,3 +40,19 @@ $(document).ready(function(){ function focusSearch() { $("#search").focus(); } + +function taggifyForm(){ + var tag_field = $('#tag_field').tagify(); + + tag_field.tagify('inputField').autocomplete({ + source: '/tags.json' + }); + + + $('form').submit( function() { + var tag_field = $('#tag_field') + tag_field.val( tag_field.tagify('serialize') ); + return true; + }); +} + diff --git a/app/views/admin/projects/_form.html.haml b/app/views/admin/projects/_form.html.haml index 9823e594..f64e10fd 100644 --- a/app/views/admin/projects/_form.html.haml +++ b/app/views/admin/projects/_form.html.haml @@ -1,30 +1,39 @@ = form_for [:admin, @admin_project] do |f| -if @admin_project.errors.any? #error_explanation - %h2= "#{pluralize(@admin_project.errors.count, "error")} prohibited this admin_project from being saved:" + %h2= "#{pluralize(@admin_project.errors.count, "error")} prohibited this admin_project from being saved:" %ul - @admin_project.errors.full_messages.each do |msg| %li= msg - .span-24 - .span-12 - .field - = f.label :name - %br - = f.text_field :name - .field - = f.label :code - %br - = f.text_field :code - .field - = f.label :path - %br - = f.text_field :path - .span-10 - .field - = f.label :description - %br - = f.text_area :description + .form-row + = f.label :name + %br + = f.text_field :name + .form-row + = f.label :code + %br + = f.text_field :code + .form-row + = f.label :path + %br + = f.text_field :path + + + .form-row + = f.label :tag_list + %br + = f.text_area :tag_list, :placeholder => "project tags", :style => "height:50px", :id => :tag_field + + .form-row + = f.label :description + %br + = f.text_area :description .clear .actions = f.submit 'Save', :class => "lbutton" + +:javascript + $(function(){ + taggifyForm(); + }) diff --git a/app/views/projects/_form.html.haml b/app/views/projects/_form.html.haml index 2ddfda48..53b23f5f 100644 --- a/app/views/projects/_form.html.haml +++ b/app/views/projects/_form.html.haml @@ -29,8 +29,8 @@ %tr %td= f.label :tag_list %td= f.text_area :tag_list, :placeholder => "project tags", :style => "height:50px", :id => :tag_field - - .field + + .form-row = f.label :description %br/ = f.text_area :description, :style => "height:140px;width:932px;" @@ -55,16 +55,5 @@ :javascript $(function(){ - var tag_field = $('#tag_field').tagify(); - - tag_field.tagify('inputField').autocomplete({ - source: '/tags.json' - }); - - - $('form').submit( function() { - var tag_field = $('#tag_field') - tag_field.val( tag_field.tagify('serialize') ); - return true; - }); + taggifyForm(); }) From 9e3915b25948878d31de78c5ced43e288e0cadfe Mon Sep 17 00:00:00 2001 From: Aleksei Kvitinskii Date: Mon, 7 Nov 2011 21:39:24 +0200 Subject: [PATCH 06/10] fix typo in the template --- app/views/layouts/project.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/project.html.haml b/app/views/layouts/project.html.haml index 959cdbe9..becdf99c 100644 --- a/app/views/layouts/project.html.haml +++ b/app/views/layouts/project.html.haml @@ -31,7 +31,7 @@ %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 Wall - - if @project.common_nsotes.count > 0 + - if @project.common_notes.count > 0 %span{ :class => "number" }= @project.common_notes.count = link_to project_snippets_path(@project), :class => (controller.controller_name == "snippets") ? "current" : nil do Snippets From 1fa01cbcc9f8fb5a9dbf5974496d029f1d189cfc Mon Sep 17 00:00:00 2001 From: Aleksei Kvitinskii Date: Tue, 8 Nov 2011 00:02:50 +0200 Subject: [PATCH 07/10] fix typo --- app/views/layouts/project.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/project.html.haml b/app/views/layouts/project.html.haml index becdf99c..70ebb890 100644 --- a/app/views/layouts/project.html.haml +++ b/app/views/layouts/project.html.haml @@ -26,7 +26,7 @@ - if @project.users_projects.count > 0 %span{ :class => "number" }= @project.users_projects.count = link_to project_issues_path(@project), :class => (controller.controller_name == "issues") ? "current" : nil do - Issuess + Issues - if @project.issues.opened.count > 0 %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 From a44e329222516573ae3a9c255801bd057ec2fd36 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 9 Nov 2011 01:56:10 +0200 Subject: [PATCH 08/10] project dashboard updated --- app/assets/stylesheets/projects.css.scss | 55 ++------------- app/helpers/dashboard_helper.rb | 4 +- app/views/dashboard/index.html.haml | 4 +- app/views/projects/_recent_commits.html.haml | 49 ++++++++----- app/views/projects/_recent_messages.html.haml | 69 ++++++------------- app/views/projects/show.html.haml | 19 +---- spec/requests/issues_spec.rb | 1 - 7 files changed, 62 insertions(+), 139 deletions(-) diff --git a/app/assets/stylesheets/projects.css.scss b/app/assets/stylesheets/projects.css.scss index 1d6d43f3..8c5d8a68 100644 --- a/app/assets/stylesheets/projects.css.scss +++ b/app/assets/stylesheets/projects.css.scss @@ -443,57 +443,6 @@ input.ssh_project_url { padding: 10px; } -.recent_message_parent { - img { - padding-right:10px; - } - - float: left; - margin: 0 20px 20px 0px; - padding: 5px 0px;; - width: 420px; - - &.dash_wall{ - border-bottom: 2px solid orange; - span { - background: orange; - color:black; - } - } - - &.dash_issue{ - border-bottom: 2px solid #ffbbbb; - span { - background: #ffbbbb; - } - } - &.dash_commit{ - border-bottom: 2px solid #bbbbff; - - span{ - background: #bbbbff; - } - } - - &.dash_snippet{ - border-bottom: 2px solid #bbffbb; - - span{ - background: #bbffbb; - } - } - - span{ - border: 1px solid #aaa; - color:black; - padding:1px 4px; - } - - h4 { - margin-bottom:3px; - } - -} .commit, .message{ .author { @@ -665,6 +614,8 @@ table.highlighttable pre{ margin-right:15px; } } +.filter .left { margin-right:15px; } + .cgray { color:gray; } .cred { color:#D12F19; } @@ -721,3 +672,5 @@ body.project-page #notes-list .note span.note-author strong{font-weight: bold; f border-bottom: 1px solid #DEE2E3; } } + +.message .note-title p { margin-bottom:0px; } diff --git a/app/helpers/dashboard_helper.rb b/app/helpers/dashboard_helper.rb index 0560af5d..03f6a015 100644 --- a/app/helpers/dashboard_helper.rb +++ b/app/helpers/dashboard_helper.rb @@ -12,7 +12,7 @@ module DashboardHelper when "Commit" then project_commit_path(project, :id => note.noteable_id) else wall_project_path(project) end - else "#" + else wall_project_path(project) end rescue "#" @@ -23,7 +23,7 @@ module DashboardHelper when "Note" then markdown(object.note) when "Issue" then object.title when "Grit::Commit" then object.safe_message - else "" + else return "Project Wall" end "[#{object.class.name}] #{truncate(sanitize(title, :tags => []), :length => 60)} " end diff --git a/app/views/dashboard/index.html.haml b/app/views/dashboard/index.html.haml index eb2122df..8d48d1f7 100644 --- a/app/views/dashboard/index.html.haml +++ b/app/views/dashboard/index.html.haml @@ -23,7 +23,7 @@ .project-box.project-updates.ui-box.ui-box-small.ui-box-big %h3= project.name .data - - project.updates.each do |update| + - project.updates(4).each do |update| %a.project-update{:href => dashboard_feed_path(project, update)} = image_tag gravatar_icon(update.author_email), :class => "left", :width => 40 %span.update-title @@ -34,7 +34,5 @@ = time_ago_in_words(update.created_at) ago %br - / .project-update - / .project-updates / #news-feed / #dashboard-content diff --git a/app/views/projects/_recent_commits.html.haml b/app/views/projects/_recent_commits.html.haml index b34470d6..385fa4b6 100644 --- a/app/views/projects/_recent_commits.html.haml +++ b/app/views/projects/_recent_commits.html.haml @@ -1,18 +1,33 @@ -- @commits.each do |commit| - %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;" - %p{:style => "margin-bottom: 3px;"} - %strong - = link_to truncate(commit.safe_message, :length => 60), project_commit_path(@project, :id => commit.id) - - %span - %span.author - = commit.author.name.force_encoding("UTF-8") - %cite - = time_ago_in_words(commit.committed_date) - ago - %br +%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;" + %p{:style => "margin-bottom: 3px;"} + %strong + = link_to truncate(commit.safe_message, :length => fixed_mode? ? 40 : 100), project_commit_path(@project, :id => commit.id) + %span + %span.note-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 index e5fb28b9..00052963 100644 --- a/app/views/projects/_recent_messages.html.haml +++ b/app/views/projects/_recent_messages.html.haml @@ -3,50 +3,25 @@ - parent = load_note_parent(id, type, @project) - next unless parent - - case type - - when "Issue" - - css_class = "dash_issue" - - issue = parent - - item_code = issue.author.email - - link_item_name = truncate(issue.title, :length => 50) - - link_to_item = project_issue_path(@project, issue) - - when "Snippet" - - css_class = "dash_snippet" - - item_code = parent.author.email - - link_item_name = parent.title - - link_to_item = project_snippet_path(@project, parent) - - when "Commit" - - css_class = "dash_commit" - - commit = parent - - item_code = commit.author.email - - link_item_name = truncate(commit.safe_message, :length => 50) - - link_to_item = project_commit_path(@project, :id => commit.id) - - else - - css_class = "dash_wall" - - item_code = @project.name - - link_item_name = "Project Wall" - - link_to_item = wall_project_path(@project) - - %div{ :class => "recent_message_parent #{css_class}"} - = image_tag gravatar_icon(item_code), :class => "left", :width => 40 - %h4 - = link_to(link_item_name, link_to_item) - %span - = type - .clear - - notes.sort {|x,y| x.updated_at <=> y.updated_at }.each do |note| - %div.message - = image_tag gravatar_icon(note.author.email), :class => "left", :width => 24, :style => "padding-right:5px;" - %p{:style => "margin-bottom: 3px;"} - %span.author - = note.author.name - = link_to markdown(truncate(note.note, :length => 200)), link_to_item + "#note_#{note.id}" - - if note.attachment.url - %br - Attachment: - = link_to note.attachment_identifier, note.attachment.url - %br - %br - .append-bottom -   - .clear + %table + %thead + %th + %div{ :class => "recent_message_parent"} + = link_to(truncate(dashboard_feed_title(parent), :length => fixed_mode? ? 40 : 100 ), 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.note-author + %strong= note.author_name + %cite.cgray + = time_ago_in_words(note.updated_at) + ago + %div.note-title + = link_to markdown(truncate(note.note, :length => fixed_mode? ? 40 : 100)), dashboard_feed_path(@project, parent) + "#note_#{note.id}" + - if note.attachment.url + %br + Attachment: + = link_to note.attachment_identifier, note.attachment.url + %br diff --git a/app/views/projects/show.html.haml b/app/views/projects/show.html.haml index ff352437..f693cb9d 100644 --- a/app/views/projects/show.html.haml +++ b/app/views/projects/show.html.haml @@ -1,28 +1,11 @@ -%div - %h2.left History - .right - = form_tag project_path(@project), :method => :get do - .span-2 - = radio_button_tag :view, "recent", (params[:view] || "recent") == "recent", :onclick => "this.form.submit()", :id => "recent_view" - = label_tag "recent_view","Recent" - .span-2 - = radio_button_tag :view, "day", params[:view] == "day", :onclick => "this.form.submit()", :id => "day_view" - = label_tag "day_view","Today" - .span-2 - = radio_button_tag :view, "week", params[:view] == "week", :onclick => "this.form.submit()", :id => "week_view" - = label_tag "week_view","Week" - .clear - %hr .left.width-49p - %h3 Commits =render "projects/recent_commits" .right.width-49p - %h3 Talk =render "projects/recent_messages" :javascript function updateDashboard(){ - $('#content-container').load("#{escape_javascript(project_path(@project))} #content-container>*"); + $('.project-content').load("#{escape_javascript(project_path(@project))} .project-content>*"); } setInterval("updateDashboard()", 300000); diff --git a/spec/requests/issues_spec.rb b/spec/requests/issues_spec.rb index 0dda659b..235b0b22 100644 --- a/spec/requests/issues_spec.rb +++ b/spec/requests/issues_spec.rb @@ -158,7 +158,6 @@ describe "Issues" do it "should have valid show page for issue" do page.should have_content @issue.title page.should have_content @user.name - page.should have_content "today" end end From b78f6581434b30f18e694e57c7427ad764fc26f4 Mon Sep 17 00:00:00 2001 From: gitlabhq Date: Wed, 9 Nov 2011 06:37:01 -0500 Subject: [PATCH 09/10] dashboard beautify --- app/assets/stylesheets/projects.css.scss | 29 ++++++++++++------- app/views/projects/_recent_commits.html.haml | 7 ++--- app/views/projects/_recent_messages.html.haml | 12 ++++---- 3 files changed, 27 insertions(+), 21 deletions(-) diff --git a/app/assets/stylesheets/projects.css.scss b/app/assets/stylesheets/projects.css.scss index 8c5d8a68..10885d3b 100644 --- a/app/assets/stylesheets/projects.css.scss +++ b/app/assets/stylesheets/projects.css.scss @@ -443,16 +443,6 @@ input.ssh_project_url { padding: 10px; } -.commit, -.message{ - .author { - background: #eaeaea; - color: #333; - border: 1px solid #aaa; - padding:1px 2px; - margin-right:5px; - } -} /* Note textare */ #note_note { @@ -673,4 +663,21 @@ body.project-page #notes-list .note span.note-author strong{font-weight: bold; f } } -.message .note-title p { margin-bottom:0px; } +//.message .note-title p { margin-bottom:0px; } + +.commit, +.message { + .title { + color:#666; + a { + color:#666 !important; + } + p { + margin-top:0px; + } + } + + .author { + color: #999 + } +} diff --git a/app/views/projects/_recent_commits.html.haml b/app/views/projects/_recent_commits.html.haml index 385fa4b6..5e9eca8d 100644 --- a/app/views/projects/_recent_commits.html.haml +++ b/app/views/projects/_recent_commits.html.haml @@ -21,12 +21,11 @@ = 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;" - %p{:style => "margin-bottom: 3px;"} - %strong - = link_to truncate(commit.safe_message, :length => fixed_mode? ? 40 : 100), project_commit_path(@project, :id => commit.id) + .title + %p= link_to truncate(commit.safe_message, :length => fixed_mode? ? 40 : 100), project_commit_path(@project, :id => commit.id) %span - %span.note-author + %span.author %strong= commit.author.name.force_encoding("UTF-8") %cite.cgray = time_ago_in_words(commit.committed_date) diff --git a/app/views/projects/_recent_messages.html.haml b/app/views/projects/_recent_messages.html.haml index 00052963..1a8c8c97 100644 --- a/app/views/projects/_recent_messages.html.haml +++ b/app/views/projects/_recent_messages.html.haml @@ -13,15 +13,15 @@ %td %div.message = image_tag gravatar_icon(note.author_email), :class => "left", :width => 40, :style => "padding-right:5px;" - %div.note-author - %strong= note.author_name - %cite.cgray - = time_ago_in_words(note.updated_at) - ago - %div.note-title + %div.title = link_to markdown(truncate(note.note, :length => fixed_mode? ? 40 : 100)), 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 From 3f70316c5f264948d74eb9080079be4c78f5aaa9 Mon Sep 17 00:00:00 2001 From: Nihad Abbasov Date: Wed, 9 Nov 2011 17:53:15 +0400 Subject: [PATCH 10/10] fix elsif statement --- app/views/commits/_text_file.html.haml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/views/commits/_text_file.html.haml b/app/views/commits/_text_file.html.haml index 1ef4a3c8..ed9adffd 100644 --- a/app/views/commits/_text_file.html.haml +++ b/app/views/commits/_text_file.html.haml @@ -13,10 +13,8 @@ = diff_line(line, line_new, line_old) - if line[0] == "+" - line_new += 1 - - elsif - - line[0] == "-" + - elsif line[0] == "-" - line_old += 1 - else - line_new += 1 - line_old += 1 -