diff options
24 files changed, 222 insertions, 108 deletions
diff --git a/app/assets/stylesheets/generic/buttons.scss b/app/assets/stylesheets/generic/buttons.scss index dd0a2938cfe..a9849aa487c 100644 --- a/app/assets/stylesheets/generic/buttons.scss +++ b/app/assets/stylesheets/generic/buttons.scss @@ -59,8 +59,8 @@ &.btn-primary { color: #ffffff; - background-color: #429bca; - border-color: #358ebd; + background-color: $bg_primary; + border-color: $border_primary; &.hover, &:hover, @@ -74,8 +74,8 @@ &.btn-success { color: #ffffff; - background-color: #5cb85c; - border-color: #4cae4c; + background-color: $bg_success; + border-color: $border_success; &.hover, @@ -90,8 +90,8 @@ &.btn-danger { color: #ffffff; - background-color: #d9534f; - border-color: #d43f3a; + background-color: $bg_danger; + border-color: $border_danger; &.hover, @@ -104,6 +104,22 @@ } } + &.btn-warning { + color: #ffffff; + background-color: $bg_warning; + border-color: $border_warning; + + + &.hover, + &:hover, + &.disabled, + &[disabled] { + color: #ffffff; + background-color: #e38c02; + border-color: #e38c02; + } + } + &.btn-new { @extend .btn-success; } diff --git a/app/assets/stylesheets/generic/common.scss b/app/assets/stylesheets/generic/common.scss index 6ab6458ea0d..0cb2090f53d 100644 --- a/app/assets/stylesheets/generic/common.scss +++ b/app/assets/stylesheets/generic/common.scss @@ -60,7 +60,7 @@ pre { .dropdown-menu > li > a:hover, .dropdown-menu > li > a:focus { - background: #29b; + background: $bg_style_color; color: #FFF } diff --git a/app/assets/stylesheets/generic/issue_box.scss b/app/assets/stylesheets/generic/issue_box.scss index bd692417989..3cb64d69a9f 100644 --- a/app/assets/stylesheets/generic/issue_box.scss +++ b/app/assets/stylesheets/generic/issue_box.scss @@ -17,52 +17,36 @@ &.issue-box-closed { border-color: $border_danger; .state { - background-color: $bg_light_danger; + background-color: $bg_danger; + color: #FFF; border-color: $border_danger; - color: $color_danger; - .state-label { - background-color: $bg_danger; - color: #FFF; - } } } &.issue-box-merged { border-color: $border_primary; .state { - background-color: $bg_light_primary; + background-color: $bg_primary; + color: #FFF; border-color: $border_primary; - color: $color_primary; - .state-label { - background-color: $bg_primary; - color: #FFF; - } } } &.issue-box-open { border-color: $border_success; .state { - background-color: $bg_light_success; border-color: $border_success; - color: $color_success; - .state-label { - background-color: $bg_success; - color: #FFF; - } + background-color: $bg_success; + color: #FFF; } } &.issue-box-expired { border-color: #cea61b; .state { - background-color: #fcf8e3; border-color: #faebcc; - color: #8a6d3b; - .state-label { - background: #cea61b; - color: #FFF; - } + background: #cea61b; + color: #FFF; } } @@ -72,12 +56,12 @@ .state { border-bottom: 1px solid #DDD; - line-height: 32px; + padding: 10px 25px; } .title { - font-size: 22px; - font-weight: 500; + font-size: 26px; + font-weight: normal; line-height: 1.5; margin: 0; color: #333; @@ -115,14 +99,15 @@ .state-label { font-size: 14px; - padding: 1px 25px; - text-align: center; - text-shadow: none; - display: inline-block; - line-height: 34px; + float: left; + font-weight: bold; } .creator { - padding: 2px 15px; + float: right; + a { + color: #FFF; + text-decoration: underline; + } } } diff --git a/app/assets/stylesheets/generic/typography.scss b/app/assets/stylesheets/generic/typography.scss index 8cc72d7f07a..4ab83786b50 100644 --- a/app/assets/stylesheets/generic/typography.scss +++ b/app/assets/stylesheets/generic/typography.scss @@ -40,7 +40,7 @@ a { color: $link_color; &:hover { text-decoration: none; - color: $primary_color; + color: $link_hover_color; } &:focus { diff --git a/app/assets/stylesheets/gl_bootstrap.scss b/app/assets/stylesheets/gl_bootstrap.scss index f46dfbf1127..3bff2156c33 100644 --- a/app/assets/stylesheets/gl_bootstrap.scss +++ b/app/assets/stylesheets/gl_bootstrap.scss @@ -7,8 +7,9 @@ */ $font-size-base: 13px !default; -$nav-pills-active-link-hover-bg: $bg_style_color; -$pagination-active-bg: $bg_style_color; +$nav-pills-active-link-hover-bg: $bg_primary; +$pagination-active-bg: $bg_primary; +$list-group-active-bg: $bg_style_color; // Core variables and mixins @import "bootstrap/variables"; @@ -227,7 +228,10 @@ ul.breadcrumb { * */ .panel { + @include border-radius(0px); + .panel-heading { + @include border-radius(0px); font-size: 14px; line-height: 18px; @@ -248,4 +252,68 @@ ul.breadcrumb { background: #FFF; } } + + &.panel-small { + .panel-heading { + padding: 6px 15px; + } + } +} + +.panel-default { + .panel-heading { + background-color: #EEE; + } +} + +.panel-danger { + border-color: $border_danger; + .panel-heading { + color: #ffffff; + background-color: $bg_danger; + border-color: $border_danger; + a { + color: #FFF; + text-decoration: underline; + } + } +} + +.panel-success { + border-color: $border_success; + .panel-heading { + color: #ffffff; + background-color: $bg_success; + border-color: $border_success; + a { + color: #FFF; + text-decoration: underline; + } + } +} + +.panel-primary { + border-color: $border_primary; + .panel-heading { + color: #ffffff; + background-color: $bg_primary; + border-color: $border_primary; + a { + color: #FFF; + text-decoration: underline; + } + } +} + +.panel-warning { + border-color: $border_warning; + .panel-heading { + color: #ffffff; + background-color: $bg_warning; + border-color: $border_warning; + a { + color: #FFF; + text-decoration: underline; + } + } } diff --git a/app/assets/stylesheets/main/variables.scss b/app/assets/stylesheets/main/variables.scss index f133777de56..8bcdad35792 100644 --- a/app/assets/stylesheets/main/variables.scss +++ b/app/assets/stylesheets/main/variables.scss @@ -1,37 +1,39 @@ -/** +/* * General Colors */ -$primary_color: #2FA0BB; -$link_color: #3A89A3; $style_color: #474D57; $bg_style_color: #2299BB; -$list-group-active-bg: $bg_style_color; $hover: #D9EDF7; /* + * Link colors + */ +$link_color: #446e9b; +$link_hover_color: #2FA0BB; + +/* * Success colors (green) */ -$border_success: #4cae4c; -$bg_success: #5cb85c; -$bg_light_success: #dff0d8; -$color_success: #3c763d; +$border_success: #469408; +$bg_success: #469408; /* * Danger colors (red) */ $border_danger: #d43f3a; $bg_danger: #d9534f; -$bg_light_danger: #f2dede; -$color_danger: #a94442; /* * Primary colors (blue) */ -$border_primary: #358ebd; -$bg_primary: #429bca; -$bg_light_primary: #d9edf7; -$color_primary: #31708f; +$border_primary: #446e9b; +$bg_primary: #446e9b; +/* + * Warning colors (yellow) + */ +$bg_warning: #d9831f; +$border_warning: #d9831f; /** * Commit Diff Colors diff --git a/app/assets/stylesheets/sections/merge_requests.scss b/app/assets/stylesheets/sections/merge_requests.scss index cac4cb66aa4..5d716ddec3b 100644 --- a/app/assets/stylesheets/sections/merge_requests.scss +++ b/app/assets/stylesheets/sections/merge_requests.scss @@ -106,12 +106,6 @@ } .mr-state-widget { - @include border-radius(0px); - - .panel-heading { - @include border-radius(0px); - } - .panel-body { h4 { margin-top: 0px; diff --git a/app/assets/stylesheets/sections/nav.scss b/app/assets/stylesheets/sections/nav.scss index 88f16a21596..59eaaec9498 100644 --- a/app/assets/stylesheets/sections/nav.scss +++ b/app/assets/stylesheets/sections/nav.scss @@ -64,7 +64,7 @@ left: 50%; width: 0; height: 0; - border-color: transparent transparent #29b transparent; + border-color: transparent transparent $link_color transparent; border-style: solid; border-width: 6px; margin-left: -6px; @@ -116,7 +116,7 @@ padding: 5px 0; &.active { - background-color: $primary_color; + background-color: $link_hover_color; a { color: #fff; diff --git a/app/assets/stylesheets/sections/notes.scss b/app/assets/stylesheets/sections/notes.scss index 2758f57bd54..e8d6ec3e29a 100644 --- a/app/assets/stylesheets/sections/notes.scss +++ b/app/assets/stylesheets/sections/notes.scss @@ -37,7 +37,7 @@ ul.notes { font-weight: bold; font-size: 14px; &:hover { - color: $primary_color; + color: $link_hover_color; } } } @@ -172,7 +172,7 @@ ul.notes { @extend .cgray; &:hover { - color: $primary_color; + color: $link_hover_color; &.danger { @extend .cred; } } } diff --git a/app/assets/stylesheets/sections/projects.scss b/app/assets/stylesheets/sections/projects.scss index 5757858a1ce..949d646afcd 100644 --- a/app/assets/stylesheets/sections/projects.scss +++ b/app/assets/stylesheets/sections/projects.scss @@ -85,7 +85,7 @@ .btn { background: none; - color: #29b; + color: $link_color; &.active { color: #333; diff --git a/app/assets/stylesheets/sections/tree.scss b/app/assets/stylesheets/sections/tree.scss index 86e2a51641a..db177a0083c 100644 --- a/app/assets/stylesheets/sections/tree.scss +++ b/app/assets/stylesheets/sections/tree.scss @@ -53,7 +53,7 @@ vertical-align: middle; a { &:hover { - color: $primary_color; + color: $link_hover_color; } } diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 5f07cdf448c..198ca76545c 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -231,4 +231,31 @@ module ApplicationHelper content_tag(:i, nil, class: 'icon-spinner icon-spin') + text end end + + def link_to(name = nil, options = nil, html_options = nil, &block) + begin + uri = URI(options) + host = uri.host + absolute_uri = uri.absolute? + rescue URI::InvalidURIError, ArgumentError + host = nil + absolute_uri = nil + end + + # Add "nofollow" only to external links + if host && host != Gitlab.config.gitlab.host && absolute_uri + if html_options + if html_options[:rel] + html_options[:rel] << " nofollow" + else + html_options.merge!(rel: "nofollow") + end + else + html_options = Hash.new + html_options[:rel] = "nofollow" + end + end + + super + end end diff --git a/app/views/projects/edit.html.haml b/app/views/projects/edit.html.haml index 43775026f71..59dcf3a6ff0 100644 --- a/app/views/projects/edit.html.haml +++ b/app/views/projects/edit.html.haml @@ -106,7 +106,7 @@ .js-toggle-content.hide - if can? current_user, :archive_project, @project - .panel.panel-default.panel.panel-danger + .panel.panel-default.panel.panel-warning .panel-heading - if @project.archived? Unarchive project @@ -132,10 +132,29 @@ %strong Archived projects cannot be committed to! = link_to 'Archive', archive_project_path(@project), data: { confirm: "Are you sure that you want to archive this project?\nAn archived project cannot be committed to." }, - method: :post, class: "btn btn-remove" + method: :post, class: "btn btn-warning" - else .nothing-here-block Only the project owner can archive a project + .panel.panel-default.panel.panel-warning + .panel-heading Rename repository + .errors-holder + .panel-body + = form_for(@project, html: { class: 'form-horizontal' }) do |f| + .form-group + = f.label :path, class: 'control-label' do + %span Path + .col-sm-9 + .form-group + .input-group + = f.text_field :path, class: 'form-control' + %span.input-group-addon .git + %ul + %li Be careful. Renaming a project's repository can have unintended side effects. + %li You will need to update your local repositories to point to the new location. + .form-actions + = f.submit 'Rename', class: "btn btn-warning" + - if can?(current_user, :change_namespace, @project) .panel.panel-default.panel.panel-danger .panel-heading Transfer project @@ -157,25 +176,6 @@ - else .nothing-here-block Only the project owner can transfer a project - .panel.panel-default.panel.panel-danger - .panel-heading Rename repository - .errors-holder - .panel-body - = form_for(@project, html: { class: 'form-horizontal' }) do |f| - .form-group - = f.label :path, class: 'control-label' do - %span Path - .col-sm-9 - .form-group - .input-group - = f.text_field :path, class: 'form-control' - %span.input-group-addon .git - %ul - %li Be careful. Renaming a project's repository can have unintended side effects. - %li You will need to update your local repositories to point to the new location. - .form-actions - = f.submit 'Rename', class: "btn btn-remove" - - if can?(current_user, :remove_project, @project) .panel.panel-default.panel.panel-danger .panel-heading Remove project diff --git a/app/views/projects/issues/show.html.haml b/app/views/projects/issues/show.html.haml index 2c816e788de..695eb225754 100644 --- a/app/views/projects/issues/show.html.haml +++ b/app/views/projects/issues/show.html.haml @@ -32,13 +32,13 @@ .issue-box{ class: issue_box_class(@issue) } .state.clearfix - .state-label.col-sm-2.col-xs-12 + .state-label - if @issue.closed? Closed - else Open - %span.creator.col-sm-9.col-xs-12 + .creator Created by #{link_to_member(@project, @issue.author)} #{time_ago_with_tooltip(@issue.created_at)} %h4.title @@ -73,4 +73,4 @@ = label.name -.voting_notes#notes= render "projects/notes/notes_with_form"
\ No newline at end of file +.voting_notes#notes= render "projects/notes/notes_with_form" diff --git a/app/views/projects/merge_requests/show/_mr_box.html.haml b/app/views/projects/merge_requests/show/_mr_box.html.haml index 435e916c6dc..f1aaba2010d 100644 --- a/app/views/projects/merge_requests/show/_mr_box.html.haml +++ b/app/views/projects/merge_requests/show/_mr_box.html.haml @@ -1,6 +1,6 @@ .issue-box{ class: issue_box_class(@merge_request) } .state.clearfix - %span.state-label.col-sm-2.col-xs-12 + .state-label - if @merge_request.merged? Merged - elsif @merge_request.closed? @@ -8,7 +8,7 @@ - else Open - %span.creator.col-sm-9.col-xs-12 + .creator Created by #{link_to_member(@project, @merge_request.author)} #{time_ago_with_tooltip(@merge_request.created_at)} %h4.title diff --git a/app/views/projects/milestones/show.html.haml b/app/views/projects/milestones/show.html.haml index e33f4e5273c..d355f258827 100644 --- a/app/views/projects/milestones/show.html.haml +++ b/app/views/projects/milestones/show.html.haml @@ -22,14 +22,14 @@ .issue-box{ class: issue_box_class(@milestone) } .state.clearfix - .state-label.col-sm-2.col-xs-12 + .state-label - if @milestone.closed? Closed - elsif @milestone.expired? Expired - else Open - %span.creator.col-sm-9.col-xs-12 + .creator = @milestone.expires_at %h4.title diff --git a/app/views/shared/_issues.html.haml b/app/views/shared/_issues.html.haml index d36e96dc49a..e976f897dc9 100644 --- a/app/views/shared/_issues.html.haml +++ b/app/views/shared/_issues.html.haml @@ -1,6 +1,6 @@ - if @issues.any? - @issues.group_by(&:project).each do |group| - .panel.panel-default.panel.panel-default-small + .panel.panel-default.panel-small - project = group[0] .panel-heading = link_to_project project diff --git a/app/views/shared/_merge_requests.html.haml b/app/views/shared/_merge_requests.html.haml index 954b16cfdb5..39a1ee38f8e 100644 --- a/app/views/shared/_merge_requests.html.haml +++ b/app/views/shared/_merge_requests.html.haml @@ -1,6 +1,6 @@ - if @merge_requests.any? - @merge_requests.group_by(&:target_project).each do |group| - .panel.panel-default.panel.panel-default-small + .panel.panel-default.panel-small - project = group[0] .panel-heading = link_to_project project diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example index 04e85ed9a9d..6f33256a2b1 100644 --- a/config/gitlab.yml.example +++ b/config/gitlab.yml.example @@ -35,9 +35,6 @@ production: &base # Email address used in the "From" field in mails sent by GitLab email_from: example@example.com - # Email address of your support contact (default: same as email_from) - support_email: support@example.com - # Email server smtp settings are in [a separate file](initializers/smtp_settings.rb.sample). ## User settings diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index 97f29546404..18c628223a4 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -79,7 +79,6 @@ Settings.gitlab['port'] ||= Settings.gitlab.https ? 443 : 80 Settings.gitlab['relative_url_root'] ||= ENV['RAILS_RELATIVE_URL_ROOT'] || '' Settings.gitlab['protocol'] ||= Settings.gitlab.https ? "https" : "http" Settings.gitlab['email_from'] ||= "gitlab@#{Settings.gitlab.host}" -Settings.gitlab['support_email'] ||= Settings.gitlab.email_from Settings.gitlab['url'] ||= Settings.send(:build_gitlab_url) Settings.gitlab['user'] ||= 'git' Settings.gitlab['user_home'] ||= begin diff --git a/doc/install/installation.md b/doc/install/installation.md index 99731130624..0dc28d8da82 100644 --- a/doc/install/installation.md +++ b/doc/install/installation.md @@ -254,7 +254,7 @@ GitLab Shell is an ssh access and repository management software developed speci cd /home/git/gitlab # Run the installation task for gitlab-shell (replace `REDIS_URL` if needed): - sudo -u git -H bundle exec rake gitlab:shell:install[v1.9.4] REDIS_URL=redis://localhost:6379 RAILS_ENV=production + sudo -u git -H bundle exec rake gitlab:shell:install[v1.9.5] REDIS_URL=redis://localhost:6379 RAILS_ENV=production # By default, the gitlab-shell config is generated from your main gitlab config. You can review (and modify) it as follows: sudo -u git -H editor /home/git/gitlab-shell/config.yml diff --git a/doc/update/upgrader.md b/doc/update/upgrader.md index b3947fa2deb..19faca4ec4e 100644 --- a/doc/update/upgrader.md +++ b/doc/update/upgrader.md @@ -18,11 +18,12 @@ __GitLab Upgrader is available only for GitLab version 6.4.2 or higher__ ### 2. Run gitlab upgrade tool + # Starting with GitLab version 7.0 upgrader script has been moved to bin directory cd /home/git/gitlab - sudo -u git -H ruby bin/upgrade.rb + if [ -f bin/upgrade.rb ]; then sudo -u git -H ruby bin/upgrade.rb; else sudo -u git -H ruby script/upgrade.rb; fi # to perform a non-interactive install (no user input required) you can add -y - # sudo -u git -H ruby bin/upgrade.rb -y + # if [ -f bin/upgrade.rb ]; then sudo -u git -H ruby bin/upgrade.rb -y; else sudo -u git -H ruby script/upgrade.rb -y; fi ### 3. Start application @@ -55,6 +56,8 @@ Here is a one line command with step 1 to 4 for the next time you upgrade: ```bash cd /home/git/gitlab; sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production; \ - sudo service gitlab stop; sudo -u git -H ruby bin/upgrade.rb -y; sudo service gitlab start; \ + sudo service gitlab stop; \ + if [ -f bin/upgrade.rb ]; then sudo -u git -H ruby bin/upgrade.rb -y; else sudo -u git -H ruby script/upgrade.rb -y; fi; \ + sudo service gitlab start; \ sudo service nginx restart; sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production ``` diff --git a/lib/tasks/gitlab/check.rake b/lib/tasks/gitlab/check.rake index 8a7f39599ab..362693b0603 100644 --- a/lib/tasks/gitlab/check.rake +++ b/lib/tasks/gitlab/check.rake @@ -779,7 +779,7 @@ namespace :gitlab do end def check_gitlab_shell - required_version = Gitlab::VersionInfo.new(1, 9, 4) + required_version = Gitlab::VersionInfo.new(1, 9, 5) current_version = Gitlab::VersionInfo.parse(gitlab_shell_version) print "GitLab Shell version >= #{required_version} ? ... " diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index 0376e0aadf0..10c5617d245 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -195,4 +195,27 @@ describe ApplicationHelper do simple_sanitize(input).should == a_tag end end + + describe "link_to" do + + it "should not include rel=nofollow for internal links" do + expect(link_to("Home", root_path)).to eq("<a href=\"/\">Home</a>") + end + + it "should include rel=nofollow for external links" do + expect(link_to("Example", "http://www.example.com")).to eq("<a href=\"http://www.example.com\" rel=\"nofollow\">Example</a>") + end + + it "should include re=nofollow for external links and honor existing html_options" do + expect( + link_to("Example", "http://www.example.com", class: "toggle", data: {toggle: "dropdown"}) + ).to eq("<a class=\"toggle\" data-toggle=\"dropdown\" href=\"http://www.example.com\" rel=\"nofollow\">Example</a>") + end + + it "should include rel=nofollow for external links and preserver other rel values" do + expect( + link_to("Example", "http://www.example.com", rel: "noreferrer") + ).to eq("<a href=\"http://www.example.com\" rel=\"noreferrer nofollow\">Example</a>") + end + end end |