From 0a4222fb9802aa979171920c489a7db11e3f1ff8 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Sat, 28 Jan 2012 16:47:55 +0200 Subject: [PATCH] Bootstrap: Activities --- app/assets/stylesheets/common.scss | 19 ++- app/assets/stylesheets/reset_bootstrap.scss | 10 +- app/assets/stylesheets/top_panel.scss | 116 +++++++++--------- app/controllers/merge_requests_controller.rb | 2 + app/controllers/projects_controller.rb | 3 +- app/helpers/dashboard_helper.rb | 2 + app/models/commit.rb | 6 + app/views/commits/_commits.html.haml | 9 +- app/views/dashboard/_issues_feed.html.haml | 36 ++---- .../dashboard/_merge_requests_feed.html.haml | 34 ++--- app/views/dashboard/_projects_feed.html.haml | 34 +++-- app/views/dashboard/issues.html.haml | 4 +- app/views/dashboard/merge_requests.html.haml | 7 +- app/views/layouts/_app_side.html.haml | 2 +- app/views/merge_requests/show.html.haml | 35 +++--- app/views/projects/_feed.html.haml | 106 +++++----------- app/views/projects/_form.html.haml | 14 +-- app/views/projects/edit.html.haml | 82 ++++--------- app/views/projects/empty.html.haml | 17 +-- app/views/projects/index.html.haml | 4 +- app/views/projects/info.html.haml | 49 ++++++-- app/views/projects/show.html.haml | 32 +++-- app/views/repositories/_feed.html.haml | 28 ++--- app/views/repositories/branches.html.haml | 27 ++-- app/views/repositories/show.html.haml | 9 +- config/routes.rb | 2 +- 26 files changed, 324 insertions(+), 365 deletions(-) diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index 998930ea..936bc529 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -133,9 +133,12 @@ aside.project-side } img.avatar { - width:32px; float:left; - padding-right:5px; + margin-right:15px; + width:40px; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; } .media-grid { @@ -147,6 +150,18 @@ img.avatar { } } +.wll { + background-color: #FFF; + margin-bottom: 10px; + padding: 5px; + min-height: 20px; + border-bottom: 1px solid #eee; + border-bottom: 1px solid rgba(0, 0, 0, 0.05); + .author { color: #999; } + &:last-child { border:none } + p { padding-top:5px;} +} + @import "reset_bootstrap.scss"; @import "top_panel.scss"; @import "projects.css.scss"; diff --git a/app/assets/stylesheets/reset_bootstrap.scss b/app/assets/stylesheets/reset_bootstrap.scss index 73237c9f..4eb47443 100644 --- a/app/assets/stylesheets/reset_bootstrap.scss +++ b/app/assets/stylesheets/reset_bootstrap.scss @@ -1,4 +1,12 @@ a { color: $link_color; - &:hover { text-decoration:none; } + &:hover { + text-decoration:none; + color: $active_link_color; + } +} + +.alert-message.entry { + background:#F1F1F1; + border-color:#ccc; } diff --git a/app/assets/stylesheets/top_panel.scss b/app/assets/stylesheets/top_panel.scss index aa9c3313..28657876 100644 --- a/app/assets/stylesheets/top_panel.scss +++ b/app/assets/stylesheets/top_panel.scss @@ -1,3 +1,60 @@ +body header { + position:absolute; + width:100%; + padding:0; + margin:0; + top:0; + left:0; + background: #F1F1F1; /* for non-css3 browsers */ + border-bottom: 1px solid #ccc; + box-shadow: 0 -1px 0 white inset; + -moz-box-shadow: 0 -1px 0 white inset; + -webkit-box-shadow: 0 -1px 0 white inset; + + height:50px; + + .wrapper { + margin:auto; + min-width:$min_app_width; + max-width:$max_app_width; + position:relative; + padding:10px $app_padding; + } + + .project_name { + float:left; + width:235px; + margin-right:30px; + font-size:16px; + font-weight:bold; + padding:8px; + color:#333; + } + + .git_url_wrapper { + padding:0px; + margin:0px; + float:left; + + .git-url { + padding:0px; + margin:0px; + font-size: 12px; + + margin-right:10px; + border-radius: 4px; + -moz-border-radius: 4px; + + + color: #666; + border: 1px solid #AAA; + padding: 0 10px 0 30px; + background: transparent url('images.png') no-repeat 8px -42px; + width: 160px; + height:26px; + } + } +} .main_links { width:155px; float:left; @@ -47,64 +104,6 @@ } } -body header { - position:absolute; - width:100%; - padding:0; - margin:0; - top:0; - left:0; - background: #999; /* for non-css3 browsers */ - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFF', endColorstr='#EAEAEA'); /* for IE */ - background: -webkit-gradient(linear, left top, left bottom, from(#FFFFFF), to(#EAEAEA)); /* for webkit browsers */ - background: -moz-linear-gradient(top, #FFFFFF, #EAEAEA); /* for firefox 3.6+ */ - background: -o-linear-gradient(top, #FFFFFF, #EAEAEA); /* for firefox 3.6+ */ - border-bottom: 1px solid #ccc; - - height:50px; - - .wrapper { - margin:auto; - min-width:$min_app_width; - max-width:$max_app_width; - position:relative; - padding:10px $app_padding; - } - - .project_name { - float:left; - width:235px; - margin-right:30px; - font-size:16px; - font-weight:bold; - padding:8px; - color:#333; - } - - .git_url_wrapper { - padding:0px; - margin:0px; - float:left; - - .git-url { - padding:0px; - margin:0px; - font-size: 12px; - - margin-right:10px; - border-radius: 4px; - -moz-border-radius: 4px; - - - color: #666; - border: 1px solid #AAA; - padding: 0 10px 0 30px; - background: transparent url('images.png') no-repeat 8px -42px; - width: 160px; - height:26px; - } - } -} .top_panel_holder .chzn-container { position:relative; @@ -138,7 +137,6 @@ body header { .rss-icon { margin:0 15px; padding:3px; - border:1px solid #AAA; border-radius:3px; float:left; } diff --git a/app/controllers/merge_requests_controller.rb b/app/controllers/merge_requests_controller.rb index 3456a0a7..9ab62f5e 100644 --- a/app/controllers/merge_requests_controller.rb +++ b/app/controllers/merge_requests_controller.rb @@ -39,6 +39,8 @@ class MergeRequestsController < ApplicationController @notes = @merge_request.notes.inc_author.order("created_at DESC").limit(20) @note = @project.notes.new(:noteable => @merge_request) + render_full_content + respond_to do |format| format.html format.js { respond_with_notes } diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 6bd72a86..7f9e6866 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -68,7 +68,8 @@ class ProjectsController < ApplicationController def show return render "projects/empty" unless @project.repo_exists? && @project.has_commits? - limit = (params[:limit] || 20).to_i + limit = (params[:limit] || 10).to_i + @activities = @project.activities(limit)#updates_wo_repo(limit) end diff --git a/app/helpers/dashboard_helper.rb b/app/helpers/dashboard_helper.rb index 5cf10278..55ed901c 100644 --- a/app/helpers/dashboard_helper.rb +++ b/app/helpers/dashboard_helper.rb @@ -3,6 +3,7 @@ module DashboardHelper case object.class.name.to_s when "Issue" then project_issue_path(project, project.issues.find(object.id)) when "Commit" then project_commit_path(project, project.repo.commits(object.id).first) + when "MergeRequest" then project_merge_request_path(project, object.id) when "Note" then note = object @@ -26,6 +27,7 @@ module DashboardHelper when "Note" then markdown(object.note) when "Issue" then object.title when "Commit" then object.safe_message + when "MergeRequest" then object.title else return "Project Wall" end diff --git a/app/models/commit.rb b/app/models/commit.rb index 695dfa52..01fac4a8 100644 --- a/app/models/commit.rb +++ b/app/models/commit.rb @@ -1,4 +1,6 @@ class Commit + include ActiveModel::Conversion + extend ActiveModel::Naming attr_accessor :commit attr_accessor :head @@ -16,6 +18,10 @@ class Commit :id, :to => :commit + def persisted? + false + end + def initialize(raw_commit, head = nil) @commit = raw_commit @head = head diff --git a/app/views/commits/_commits.html.haml b/app/views/commits/_commits.html.haml index 6d7828a6..71737d5a 100644 --- a/app/views/commits/_commits.html.haml +++ b/app/views/commits/_commits.html.haml @@ -4,16 +4,17 @@ %h5.underlined= day.stamp("28 Aug, 2010") %ul.unstyled - commits.each do |commit| - %li + %li.wll %a{ :class => "update-item", :href => project_commit_path(@project, :id => commit.id) } .right.btn = truncate(commit.id.to_s, :length => 10) ยป = image_tag gravatar_icon(commit.author_email), :class => "avatar", :width => 32 - %div - %strong - = truncate(commit.safe_message, :length => 50) %span.update-author %strong= commit.author_name + – = time_ago_in_words(commit.committed_date) ago + %p + %strong + = truncate(commit.safe_message, :length => 50) diff --git a/app/views/dashboard/_issues_feed.html.haml b/app/views/dashboard/_issues_feed.html.haml index dbd1efff..782cb5e0 100644 --- a/app/views/dashboard/_issues_feed.html.haml +++ b/app/views/dashboard/_issues_feed.html.haml @@ -1,26 +1,10 @@ -#feeds_content_holder - - unless @issues.empty? - .project-box.project-updates.ui-box.ui-box-small.ui-box-big - .data - - @issues.each do |update| - %a.project-update{:href => dashboard_feed_path(update.project, update)} - .avatar= image_tag gravatar_icon(update.assignee_email), :class => "avatar", :width => 32 - %div - = truncate update.title, :length => 35 - .right= truncate update.project.name - %span.update-author - %strong= update.author_name - authored - = time_ago_in_words(update.created_at) - ago - .right - - if update.critical - %span.label.important critical - - if update.today? - %span.label.new today - - - else - %h2 - No assigned - %span.tag.open open - issues +- @issues.each do |issue| + .alert-message.entry + = link_to [issue.project, issue] do + %p + %strong + = issue.project.name + – + Issue # + = issue.id + = truncate issue.title, :length => 50 diff --git a/app/views/dashboard/_merge_requests_feed.html.haml b/app/views/dashboard/_merge_requests_feed.html.haml index 1f8553e4..b1044d54 100644 --- a/app/views/dashboard/_merge_requests_feed.html.haml +++ b/app/views/dashboard/_merge_requests_feed.html.haml @@ -1,24 +1,10 @@ -#feeds_content_holder - - unless @merge_requests.empty? - .project-box.project-updates.ui-box.ui-box-small.ui-box-big - .data - - @merge_requests.each do |update| - %a.project-update{:href => project_merge_request_path(update.project, update)} - = image_tag gravatar_icon(update.author_email), :class => "left", :width => 40 - %span.update-title - = truncate update.title, :length => 35 - .right= truncate update.project.name - %span.update-author - %strong= update.author_name - authored - = time_ago_in_words(update.created_at) - ago - .right - %span.tag.commit= update.source_branch - → - %span.tag.commit= update.target_branch - - else - %h2 - No authored or assigned - %span.tag.open open - merge requests +- @merge_requests.each do |merge_request| + .alert-message.entry + = link_to [merge_request.project, merge_request] do + %p + %strong + = merge_request.project.name + – + Issue # + = merge_request.id + = truncate merge_request.title, :length => 50 diff --git a/app/views/dashboard/_projects_feed.html.haml b/app/views/dashboard/_projects_feed.html.haml index 5beb7485..8171f59a 100644 --- a/app/views/dashboard/_projects_feed.html.haml +++ b/app/views/dashboard/_projects_feed.html.haml @@ -1,19 +1,17 @@ -#feeds_content_holder - - @active_projects.first(3).each do |project| - .project-box.project-updates.ui-box.ui-box-small.ui-box-big - = link_to project do - %h4= project.name - - project.updates(3).each do |update| - %a.project-update{:href => dashboard_feed_path(project, update)} - = image_tag gravatar_icon(update.author_email), :class => "avatar", :width => 32 - %div - = 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 +- @active_projects.first(3).each do |project| + = link_to project do + %h4= project.name + - project.updates(3).each do |update| + %a.project-update{:href => dashboard_feed_path(project, update)} + = image_tag gravatar_icon(update.author_email), :class => "avatar", :width => 32 + %div + = 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 diff --git a/app/views/dashboard/issues.html.haml b/app/views/dashboard/issues.html.haml index d93d555b..6db447fb 100644 --- a/app/views/dashboard/issues.html.haml +++ b/app/views/dashboard/issues.html.haml @@ -1,6 +1,6 @@ %h3 Issues - %small ( authored or assigned to you ) + %small ( assigned to you ) %hr -.news-feed= render "dashboard/issues_feed" += render "dashboard/issues_feed" diff --git a/app/views/dashboard/merge_requests.html.haml b/app/views/dashboard/merge_requests.html.haml index 1a586db7..91dd6909 100644 --- a/app/views/dashboard/merge_requests.html.haml +++ b/app/views/dashboard/merge_requests.html.haml @@ -1,3 +1,6 @@ -%h3 Merge Requests +%h3 + Merge Requests + %small ( authored or assigned to you ) + %hr -.news-feed= render "dashboard/merge_requests_feed" += render "dashboard/merge_requests_feed" diff --git a/app/views/layouts/_app_side.html.haml b/app/views/layouts/_app_side.html.haml index 0111afb8..b4a97c5a 100644 --- a/app/views/layouts/_app_side.html.haml +++ b/app/views/layouts/_app_side.html.haml @@ -1,6 +1,6 @@ .fixed %aside - = link_to "Activities", dashboard_path, :class => "#{"active" if current_page?(dashboard_path) || current_page?(root_path) }" + -#= link_to "Activities", dashboard_path, :class => "#{"active" if current_page?(dashboard_path) || current_page?(root_path) }" = link_to "Projects", projects_path, :class => "#{"active" if current_page?(projects_path)}" = link_to "Issues", dashboard_issues_path, :class => "#{"active" if current_page?(dashboard_issues_path)}", :id => "issues_slide" = link_to "Requests", dashboard_merge_requests_path, :class => "#{"active" if current_page?(dashboard_merge_requests_path)}", :id => "merge_requests_slide" diff --git a/app/views/merge_requests/show.html.haml b/app/views/merge_requests/show.html.haml index 7cbee121..5de44518 100644 --- a/app/views/merge_requests/show.html.haml +++ b/app/views/merge_requests/show.html.haml @@ -1,32 +1,33 @@ +%h3 + = "Merge Request ##{@merge_request.id}:" +   + %span.label= @merge_request.source_branch + → + %span.label= @merge_request.target_branch + + %span.right + - if can?(current_user, :admin_project, @project) || @merge_request.author == current_user + = link_to edit_project_merge_request_path(@project, @merge_request), :class => "btn small" do + Edit Merge Request +%hr + %div %span.entity-info - - if can?(current_user, :admin_project, @project) || @merge_request.author == current_user - = link_to edit_project_merge_request_path(@project, @merge_request) do - .entity-button - Edit Merge Request - %i = image_tag gravatar_icon(@merge_request.author_email), :class => "left", :width => 40, :style => "padding-right:5px;" %span.commit-title %strong - = "Merge Request ##{@merge_request.id}:" -   - .tag.commit.inline= @merge_request.source_branch - → - .tag.commit.inline= @merge_request.target_branch - %span.commit-author + %span.commit-author %strong = link_to project_team_member_path(@project, @project.team_member_by_id(@merge_request.author.id)) do %span.author= @merge_request.author_name → = link_to project_team_member_path(@project, @project.team_member_by_id(@merge_request.assignee.id)) do %span.author= @merge_request.assignee_name - -   -   + %br = @merge_request.created_at.stamp("Aug 21, 2011 9:23pm") - - %hr - %div.well= simple_format @merge_request.title +%hr +.clearfix +%div.well= simple_format @merge_request.title .tabs diff --git a/app/views/projects/_feed.html.haml b/app/views/projects/_feed.html.haml index 7667f787..e399f5ca 100644 --- a/app/views/projects/_feed.html.haml +++ b/app/views/projects/_feed.html.haml @@ -1,79 +1,29 @@ -- if update.kind_of?(Note) - %a.project-update.titled{:href => dashboard_feed_path(project, update)} - = image_tag gravatar_icon(update.author_email), :class => "avatar", :width => 32 - %div - = dashboard_feed_title(update) - %span.update-author - %strong= update.author_name - = time_ago_in_words(update.created_at) - ago - - noteable = update.target - - if noteable.kind_of?(MergeRequest) - .title-block - %div - %span.commit.tag - Merge Request # - = noteable.id - %span.update-author - %span= noteable.source_branch +%li.wll + .row + .span9 + = image_tag gravatar_icon(update.author_email), :class => "avatar thumb" + %p + %strong.author= update.author_name + %span + – + authored + = time_ago_in_words(update.created_at) + ago + - if update.kind_of? MergeRequest + = link_to project_merge_request_path(@project, update) do + = "Opened merge request ##{update.id}." + %span.label= update.source_branch → - %span= noteable.target_branch - - - elsif noteable.kind_of?(Issue) - .title-block - %div - %span.commit.tag - Issue # - = noteable.id - %span.update-author - .left= truncate noteable.title - - - elsif noteable.kind_of?(Commit) - .title-block - %div - %span.commit.tag - commit - %span.update-author - .left= truncate noteable.id - - else - .title-block - %div - %span.commit.tag - Project Wall - - -- elsif update.kind_of?(MergeRequest) - %a.project-update.titled{:href => project_merge_request_path(project, update)} - = image_tag gravatar_icon(update.author_email), :class => "avatar", :width => 32 - %div - Opened merge request - %span.update-author - %strong= update.author_name - = time_ago_in_words(update.created_at) - ago - .title-block - %div - %span.commit.tag - Merge Request # - = update.id - %span.update-author - %span= update.source_branch - → - %span= update.target_branch - -- elsif update.kind_of?(Issue) - %a.project-update.titled{:href => dashboard_feed_path(project, update)} - = image_tag gravatar_icon(update.author_email), :class => "avatar", :width => 32 - %div - Created new Issue - %span.update-author - %strong= update.author_name - = time_ago_in_words(update.created_at) - ago - .title-block - %div - %span.commit.tag - Issue # - = update.id - %span.update-author - .left= truncate update.title + %span.label= update.target_branch + - elsif update.kind_of? Issue + = link_to project_issue_path(@project, update) do + Opened new + %span.label.important= "issue ##{update.id}" + = truncate update.title + - else + = link_to [@project, update.target] do + %p + = update.target.class.name.titleize + = truncate(update.target.id.to_s, :length => 10) +   + = dashboard_feed_title(update) diff --git a/app/views/projects/_form.html.haml b/app/views/projects/_form.html.haml index b7299b54..44b72336 100644 --- a/app/views/projects/_form.html.haml +++ b/app/views/projects/_form.html.haml @@ -18,10 +18,10 @@ %cite= "http://#{GIT_HOST["host"]}/" .input= f.text_field :code, :placeholder => "example" - - unless @project.new_record? || @project.heads.empty? - .clearfix - = f.label :default_branch, "Default Branch" - .input= f.select(:default_branch, @project.heads.map(&:name), {}, :style => "width:300px;") + - unless @project.new_record? || @project.heads.empty? + .clearfix + = f.label :default_branch, "Default Branch" + .input= f.select(:default_branch, @project.heads.map(&:name), {}, :style => "width:210px;") .clearfix @@ -30,9 +30,9 @@ %br - .merge-tabs + .actions = f.submit 'Save', :class => "btn primary" -   + = link_to 'Cancel', @project, :class => "btn" - unless @project.new_record? .right - = link_to 'Remove', @project, :confirm => 'Are you sure?', :method => :delete, :class => "btn" + = link_to 'Remove', @project, :confirm => 'Are you sure?', :method => :delete, :class => "btn danger" diff --git a/app/views/projects/edit.html.haml b/app/views/projects/edit.html.haml index 69e0f218..be8aae7d 100644 --- a/app/views/projects/edit.html.haml +++ b/app/views/projects/edit.html.haml @@ -1,69 +1,29 @@ = render "project_head" - -= form_for(@project, :remote => true) do |f| - %div - %span.entity-info - = link_to info_project_path(@project) do - .entity-button - Info - %i - %h2= @project.name - %hr - %table.no-borders - -if @project.errors.any? - %tr - %td{:colspan => 2} - #error_explanation - - @project.errors.full_messages.each do |msg| - %span= msg - %br - - %tr - %td= f.label :name - %td= f.text_field :name, :placeholder => "Example Project" - %tr - %td - .left= f.label :path - %cite.right= "git@#{GIT_HOST["host"]}:" - %td - = f.text_field :path, :placeholder => "example_project", :disabled => !@project.new_record? - %tr - %td - .left= f.label :code - %cite.right= "http://#{GIT_HOST["host"]}/" - %td= f.text_field :code, :placeholder => "example" - - - unless @project.new_record? || @project.heads.empty? - %tr - %td= f.label :default_branch, "Default Branch" - %td= f.select(:default_branch, @project.heads.map(&:name), {}, :style => "width:300px;") - - %tr - %td= f.label :description - %td= f.text_area :description, :placeholder => "project description", :style => "height:50px" - - %br - - .merge-tabs - = f.submit 'Save', :class => "grey-button" -   - - unless @project.new_record? - .right - = link_to 'Remove', @project, :confirm => 'Are you sure?', :method => :delete, :class => "red-button" - +%h3 Edit Project +%hr += render "projects/form" %div{ :class => "ajax_loader", :style => "display:none;height:200px;"} %center = image_tag "ajax-loader.gif", :class => "append-bottom" - %h3.prepend-top Updating project & repository. Please wait for few minutes - -:javascript - $('.edit_project').bind('ajax:before', function() { - $(".edit_project").hide(); - $('.ajax_loader').show(); - }); + %h3.prepend-top Saving project & repository. Please wait... :javascript $(function(){ - $('#project_default_branch').chosen(); - }) + $("#project_name").live("change", function(){ + var slug = slugify($(this).val()); + $("#project_code").val(slug); + $("#project_path").val(slug); + }); + }); + function slugify(text) { + return text.replace(/[^-a-zA-Z0-9]+/g, '_').toLowerCase(); + } + + $(function(){ + $('.edit_project').live('ajax:before', function() { + $(this).hide(); + $('.ajax_loader').show(); + }); + $('form #project_default_branch').chosen(); + }) diff --git a/app/views/projects/empty.html.haml b/app/views/projects/empty.html.haml index f089c6ec..0811f82e 100644 --- a/app/views/projects/empty.html.haml +++ b/app/views/projects/empty.html.haml @@ -1,13 +1,14 @@ - if current_user.require_ssh_key? - %ul.errors_holder - %li You have no ssh keys added yo tour profile. - %li You wont be able to pull/push repository. - %li Visit profile → keys and add public key of every machine you want to use for work with gitlabhq. + .alert-message.block-message.error + %ul + %li You have no ssh keys added yo tour profile. + %li You wont be able to pull/push repository. + %li Visit profile → keys and add public key of every machine you want to use for work with gitlabhq. - -%ul.alert_holder - %li You should push repository to proceed. - %li After push you will be able to browse code, commits etc. +.alert-message.block-message.error + %ul.alert_holder + %li You should push repository to proceed. + %li After push you will be able to browse code, commits etc. - bash_lexer = Pygments::Lexer[:bash] %div.git-empty diff --git a/app/views/projects/index.html.haml b/app/views/projects/index.html.haml index 725f2e51..c52a7f85 100644 --- a/app/views/projects/index.html.haml +++ b/app/views/projects/index.html.haml @@ -1,4 +1,6 @@ -%h3 Projects +%h3 + Projects + %small= "( #{current_user.projects.count} )" %hr - unless @projects.empty? %div.tile= render "tile" diff --git a/app/views/projects/info.html.haml b/app/views/projects/info.html.haml index 787ad06d..513b2ab2 100644 --- a/app/views/projects/info.html.haml +++ b/app/views/projects/info.html.haml @@ -1,15 +1,14 @@ = render "project_head" +%h3= @project.name +%br -%div - %span.entity-info - = link_to edit_project_path(@project) do - .entity-button - Edit - %i - %h2= @project.name - %hr + -%table.no-borders +%pre + = "git clone #{@project.url_to_repo}" + + +%table %tr %td Name %td= @project.name @@ -17,6 +16,36 @@ %tr %td Slug %td= @project.code + + %tr + %td Path + %td= @project.path + + %tr + %td Owner + %td= link_to @project.owner.name, project_team_member_path(@project, @project.team_member_by_id(@project.owner)) + + %tr + %td Last commit + %td + = time_ago_in_words(@project.commit.committed_date) + ago + + %tr + %td Team + %td + = @project.users_projects.count + users + + %tr + %td Open Issues + %td + = @project.issues.opened.count + + %tr + %td Merge Requests + %td + = @project.merge_requests.opened.count %tr %td Created @@ -25,4 +54,6 @@ %tr %td{:colspan => 2}= simple_format @project.description +.actions + = link_to "Edit", edit_project_path(@project), :class => "btn" diff --git a/app/views/projects/show.html.haml b/app/views/projects/show.html.haml index 2eb220b5..d388f5bd 100644 --- a/app/views/projects/show.html.haml +++ b/app/views/projects/show.html.haml @@ -1,13 +1,21 @@ -- content_for(:body_class, "project-page dashboard") - = render "project_head" -#news-feed.news-feed - .project-box.project-updates - - @activities.each do |update| - = render "projects/feed", :update => update, :project => @project - -:javascript - function updateDashboard(){ - $('.project-content').load("#{escape_javascript(project_path(@project))} .project-content>*"); - } - setInterval("updateDashboard()", 300000); +- @activities.each do |update| + .alert-message.entry + = link_to dashboard_feed_path(@project, update) do + - if update.kind_of? Note + %p + %strong + = update.target.class.name.titleize + = truncate update.target.id.to_s, :length => 10 + commented + – + = image_tag gravatar_icon(update.author_email), :class => "", :width => 16 + = truncate dashboard_feed_title(update), :length => 50 + - else + %p + %strong + = update.class.name.titleize + = truncate update.id.to_s + – + = image_tag gravatar_icon(update.author_email), :class => "", :width => 16 + = truncate dashboard_feed_title(update), :length => 50 diff --git a/app/views/repositories/_feed.html.haml b/app/views/repositories/_feed.html.haml index f163b477..3d99b8ea 100644 --- a/app/views/repositories/_feed.html.haml +++ b/app/views/repositories/_feed.html.haml @@ -1,15 +1,13 @@ -%a.project-update.titled{:href => project_commits_path(project, :ref => update.head.name)} - = 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 - .title-block - %span.update-title - %span.commit.tag= update.head.name - %span.update-author - .left= truncate update.commit.id - +- commit = update +.alert-message.entry + = link_to project_commits_path(@project, :ref => commit.head.name) do + %p + %strong + = commit.head.name + – + = truncate(commit.id.to_s, :length => 10) + = image_tag gravatar_icon(commit.author_email), :class => "", :width => 16 + = truncate(commit.safe_message, :length => 40) + %span.right + = time_ago_in_words(commit.committed_date) + ago diff --git a/app/views/repositories/branches.html.haml b/app/views/repositories/branches.html.haml index befa88cc..d817ab51 100644 --- a/app/views/repositories/branches.html.haml +++ b/app/views/repositories/branches.html.haml @@ -1,13 +1,20 @@ = render "head" - unless @branches.empty? - %div.update-data.ui-box.ui-box-small - .data + %table + %thead + %tr + %th Name + %th Last commit + %tbody - @branches.each do |branch| - %a.update-item{:href => project_commits_path(@project, :ref => branch.name)} - %span.update-title{:style => "margin-bottom:0px;"} - = branch.name - %span.update-author.right - = time_ago_in_words(branch.commit.committed_date) - ago -- else - %h3 No brances + %tr + %td + = link_to project_commits_path(@project, :ref => branch.name) do + %strong= branch.name + - if branch.name == @project.root_ref + %span.label default + %td + = link_to project_commits_path(@project, branch.commit.id) do + = truncate branch.commit.id.to_s, :length => 10 + = time_ago_in_words(branch.commit.committed_date) + ago diff --git a/app/views/repositories/show.html.haml b/app/views/repositories/show.html.haml index 3c9208cb..91dd8ee6 100644 --- a/app/views/repositories/show.html.haml +++ b/app/views/repositories/show.html.haml @@ -1,8 +1,5 @@ -- content_for(:body_class, "project-page dashboard") = render "head" - -#news-feed.news-feed - .project-box.project-updates - - @activities.each do |update| - = render "repositories/feed", :update => update, :project => @project +%ul.unstyled + - @activities.each do |update| + = render "repositories/feed", :update => update, :project => @project diff --git a/config/routes.rb b/config/routes.rb index bb575356..eedb9ac5 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -106,5 +106,5 @@ Gitlab::Application.routes.draw do end resources :notes, :only => [:create, :destroy] end - root :to => "dashboard#index" + root :to => "projects#index" end