From 42be5ee1cd8eb752c52ddb82bdf7c452190d4193 Mon Sep 17 00:00:00 2001 From: Ricardo Band Date: Sat, 12 Sep 2015 20:53:18 +0000 Subject: hooks: Add full project namespace to payload Payload of "project_member, :create" and "project_member, :destroy" now also have a field project_path_with_namespace. --- app/services/system_hooks_service.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'app') diff --git a/app/services/system_hooks_service.rb b/app/services/system_hooks_service.rb index 60235b6be2a..9a5fe4af9dd 100644 --- a/app/services/system_hooks_service.rb +++ b/app/services/system_hooks_service.rb @@ -54,6 +54,7 @@ class SystemHooksService data.merge!({ project_name: model.project.name, project_path: model.project.path, + project_path_with_namespace: model.project.path_with_namespace, project_id: model.project.id, user_name: model.user.name, user_email: model.user.email, -- cgit v1.2.1 From e5e6c846ead9ea4cacc53c2308c5ca86ce1ab766 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Mon, 5 Oct 2015 20:20:27 +0200 Subject: Fix builds view --- app/views/ci/builds/show.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/views/ci/builds/show.html.haml b/app/views/ci/builds/show.html.haml index c42d11bf05d..be33c5e8aa4 100644 --- a/app/views/ci/builds/show.html.haml +++ b/app/views/ci/builds/show.html.haml @@ -1,7 +1,7 @@ #up-build-trace - if @commit.matrix_for_ref?(@build.ref) %ul.center-top-menu - - @commit.builds_without_retry_for_ref(build.ref).each do |build| + - @commit.builds_without_retry_for_ref(@build.ref).each do |build| %li{class: ('active' if build == @build) } = link_to ci_project_build_url(@project, build) do = ci_icon_for_status(build.status) -- cgit v1.2.1 From fc795d6ee2bdc1229f82c535222752364b5c9e44 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Mon, 5 Oct 2015 21:20:54 +0200 Subject: Fix graphical glitches --- app/controllers/ci/projects_controller.rb | 8 +++++--- app/views/ci/commits/_commit.html.haml | 3 ++- app/views/ci/commits/show.html.haml | 26 +++++++++++++++++--------- 3 files changed, 24 insertions(+), 13 deletions(-) (limited to 'app') diff --git a/app/controllers/ci/projects_controller.rb b/app/controllers/ci/projects_controller.rb index 33b8ae64659..64d544acfd9 100644 --- a/app/controllers/ci/projects_controller.rb +++ b/app/controllers/ci/projects_controller.rb @@ -14,9 +14,11 @@ module Ci def show @ref = params[:ref] - @commits = @project.commits.reverse_order - # TODO: this is broken - # @commits = @commits.where(ref: @ref) if @ref + @commits = @project.commits.group(:sha).reverse_order + if @ref + builds = @project.builds.where(ref: @ref).select(:commit_id).distinct + @commits = @commits.where(id: builds) + end @commits = @commits.page(params[:page]).per(20) end diff --git a/app/views/ci/commits/_commit.html.haml b/app/views/ci/commits/_commit.html.haml index f8a1fa50851..6e6cc9b2c37 100644 --- a/app/views/ci/commits/_commit.html.haml +++ b/app/views/ci/commits/_commit.html.haml @@ -16,7 +16,8 @@ %td.build-branch - unless @ref %span - = link_to truncate(commit.last_ref, length: 25), ci_project_path(@project, ref: commit.last_ref) + - commit.refs.each do |ref| + = link_to truncate(ref, length: 25), ci_project_path(@project, ref: ref) %td.duration - if commit.duration > 0 diff --git a/app/views/ci/commits/show.html.haml b/app/views/ci/commits/show.html.haml index 7217671fe95..7ebef8c5e06 100644 --- a/app/views/ci/commits/show.html.haml +++ b/app/views/ci/commits/show.html.haml @@ -4,14 +4,22 @@ .gray-content-block.middle-block %pre.commit-message - #{@commit.git_commit_message} + - if @commit.git_commit_message + #{@commit.git_commit_message} + - else + No commit message .gray-content-block.second-block .row .col-sm-6 - %p - %span.attr-name Commit: - #{gitlab_commit_link(@project, @commit.sha)} + %p + %span.attr-name Commit: + #{gitlab_commit_link(@project, @commit.sha)} + %p + - if @commit.refs.present? + %span.attr-name Refs: + - @commit.refs.each do |ref| + #{gitlab_ref_link(@project, ref)} .col-sm-6 - if @commit.git_author_name || @commit.git_author_email %p @@ -22,10 +30,10 @@ %span.attr-name Created at: #{@commit.created_at.to_s(:short)} -- if current_user && can?(current_user, :manage_builds, gl_project) - .pull-right - - if @commit.builds.running_or_pending.any? - = link_to "Cancel", cancel_ci_project_commits_path(@project, @commit), class: 'btn btn-sm btn-danger' + - if current_user && can?(current_user, :manage_builds, gl_project) + - if @commit.builds.running_or_pending.any? + .pull-right + = link_to "Cancel", cancel_ci_project_commits_path(@project, @commit), class: 'btn btn-sm btn-danger' - if @commit.yaml_errors.present? @@ -41,7 +49,7 @@ - @commit.refs.each do |ref| %h3 - Builds for #{ref} + Builds for #{gitlab_ref_link(@project, ref)} - if @commit.duration_for_ref(ref) > 0 %small.pull-right %i.fa.fa-time -- cgit v1.2.1 From e6ab50a754d67ff38e1d358b2222b6db3dbdee80 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 6 Oct 2015 10:34:36 +0200 Subject: Use CI commit status for merge request widget For temporary compatibility with other services like Jenkins we ask for CI status via AJAX request if there is no commit status in GitLab database Signed-off-by: Dmitriy Zaporozhets --- .../merge_requests/widget/_heading.html.haml | 58 ++++++++++++++-------- 1 file changed, 36 insertions(+), 22 deletions(-) (limited to 'app') diff --git a/app/views/projects/merge_requests/widget/_heading.html.haml b/app/views/projects/merge_requests/widget/_heading.html.haml index 10640f746f0..68dda1424cf 100644 --- a/app/views/projects/merge_requests/widget/_heading.html.haml +++ b/app/views/projects/merge_requests/widget/_heading.html.haml @@ -1,30 +1,44 @@ - if @merge_request.has_ci? - .mr-widget-heading - - [:success, :skipped, :canceled, :failed, :running, :pending].each do |status| - .ci_widget{class: "ci-#{status}", style: "display:none"} - - if status == :success - - status = "passed" - = icon("check-circle") - - else - = icon("circle") + - ci_commit = @merge_request.source_project.ci_commit(@merge_request.source_sha) + - if ci_commit + - status = ci_commit.status + .mr-widget-heading + .ci_widget{class: "ci-#{status}"} + = ci_status_icon(ci_commit) %span CI build #{status} for #{@merge_request.last_commit_short_sha}. %span.ci-coverage - - if ci_build_details_path(@merge_request) - = link_to "View build details", ci_build_details_path(@merge_request), :"data-no-turbolink" => "data-no-turbolink" + = link_to "View build details", ci_status_path(ci_commit) - .ci_widget - = icon("spinner spin") - Checking CI status for #{@merge_request.last_commit_short_sha}… + - else + - # Compatibility with old CI integrations (ex jenkins) when you request status from CI server via AJAX + - # Remove in later versions when services like Jenkins will set CI status via Commit status API + .mr-widget-heading + - [:success, :skipped, :canceled, :failed, :running, :pending].each do |status| + .ci_widget{class: "ci-#{status}", style: "display:none"} + - if status == :success + - status = "passed" + = icon("check-circle") + - else + = icon("circle") + %span CI build #{status} + for #{@merge_request.last_commit_short_sha}. + %span.ci-coverage + - if ci_build_details_path(@merge_request) + = link_to "View build details", ci_build_details_path(@merge_request), :"data-no-turbolink" => "data-no-turbolink" - .ci_widget.ci-not_found{style: "display:none"} - = icon("times-circle") - Could not find CI status for #{@merge_request.last_commit_short_sha}. + .ci_widget + = icon("spinner spin") + Checking CI status for #{@merge_request.last_commit_short_sha}… - .ci_widget.ci-error{style: "display:none"} - = icon("times-circle") - Could not connect to the CI server. Please check your settings and try again. + .ci_widget.ci-not_found{style: "display:none"} + = icon("times-circle") + Could not find CI status for #{@merge_request.last_commit_short_sha}. - :coffeescript - $ -> - merge_request_widget.getCiStatus() + .ci_widget.ci-error{style: "display:none"} + = icon("times-circle") + Could not connect to the CI server. Please check your settings and try again. + + :coffeescript + $ -> + merge_request_widget.getCiStatus() -- cgit v1.2.1 From 1a86a00ca338811a0ffb5dd9a4d2a2ec84db13e6 Mon Sep 17 00:00:00 2001 From: Valery Sizov Date: Mon, 5 Oct 2015 18:10:22 +0300 Subject: Fix search in Files --- app/assets/javascripts/tree.js.coffee | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/assets/javascripts/tree.js.coffee b/app/assets/javascripts/tree.js.coffee index d428db5b422..de8eebcd0b2 100644 --- a/app/assets/javascripts/tree.js.coffee +++ b/app/assets/javascripts/tree.js.coffee @@ -16,6 +16,9 @@ class @TreeView li = $("tr.tree-item") liSelected = null $('body').keydown (e) -> + if $("input:focus").length > 0 && (e.which == 38 || e.which == 40) + return false + if e.which is 40 if liSelected next = liSelected.next() @@ -38,4 +41,4 @@ class @TreeView $(liSelected).focus() else if e.which is 13 path = $('.tree-item.selected .tree-item-file-name a').attr('href') - Turbolinks.visit(path) + if path then Turbolinks.visit(path) -- cgit v1.2.1 From a266752821116e4736c493ad865e5ba6e1821c0d Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Tue, 6 Oct 2015 11:59:55 +0200 Subject: Latest builds always include builds with unique name and unique ref --- app/models/ci/build.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index f35224916ed..3c92710968c 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -47,7 +47,7 @@ module Ci scope :failed, ->() { where(status: "failed") } scope :unstarted, ->() { where(runner_id: nil) } scope :running_or_pending, ->() { where(status:[:running, :pending]) } - scope :latest, ->() { where(id: unscope(:select).select('max(id)').group(:name)).order(stage_idx: :asc) } + scope :latest, ->() { where(id: unscope(:select).select('max(id)').group(:name, :ref)).order(stage_idx: :asc) } scope :ignore_failures, ->() { where(allow_failure: false) } scope :for_ref, ->(ref) { where(ref: ref) } scope :similar, ->(build) { where(ref: build.ref, tag: build.tag, trigger_request_id: build.trigger_request_id) } -- cgit v1.2.1 From 065fe557f7c1ec8a520b7c18c83fa062f90d1443 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Tue, 6 Oct 2015 12:00:15 +0200 Subject: Fixed failure reading .gitlab-ci.yml --- app/models/ci/commit.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/models/ci/commit.rb b/app/models/ci/commit.rb index 46370034f9a..fde754a92a1 100644 --- a/app/models/ci/commit.rb +++ b/app/models/ci/commit.rb @@ -211,7 +211,7 @@ module Ci end def ci_yaml_file - gl_project.repository.blob_at(sha, '.gitlab-ci.yml') + gl_project.repository.blob_at(sha, '.gitlab-ci.yml').data rescue nil end -- cgit v1.2.1 From 697b34d786bcbc9b4fdaef485ff4837b850ca5aa Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 6 Oct 2015 13:12:21 +0200 Subject: Render CI statuses on commit page Signed-off-by: Dmitriy Zaporozhets --- app/assets/stylesheets/pages/commit.scss | 13 ++++++ app/controllers/projects/commit_controller.rb | 7 +++ app/views/projects/commit/_ci_menu.html.haml | 7 +++ app/views/projects/commit/ci.html.haml | 62 +++++++++++++++++++++++++++ app/views/projects/commit/show.html.haml | 1 + 5 files changed, 90 insertions(+) create mode 100644 app/views/projects/commit/_ci_menu.html.haml create mode 100644 app/views/projects/commit/ci.html.haml (limited to 'app') diff --git a/app/assets/stylesheets/pages/commit.scss b/app/assets/stylesheets/pages/commit.scss index 741ff9051a2..fbd7c363de1 100644 --- a/app/assets/stylesheets/pages/commit.scss +++ b/app/assets/stylesheets/pages/commit.scss @@ -107,3 +107,16 @@ z-index: 2; } } + +.commit-ci-menu { + padding: 0; + margin: 0; + list-style: none; + margin-top: 5px; + height: 56px; + margin: -16px; + padding: 16px; + text-align: center; + margin-top: 0px; + margin-bottom: 2px; +} diff --git a/app/controllers/projects/commit_controller.rb b/app/controllers/projects/commit_controller.rb index 2fae5057138..1938c63c10c 100644 --- a/app/controllers/projects/commit_controller.rb +++ b/app/controllers/projects/commit_controller.rb @@ -31,6 +31,13 @@ class Projects::CommitController < Projects::ApplicationController end end + def ci + @ci_commit = @project.ci_commit(@commit.sha) + @builds = @ci_commit.builds if @ci_commit + @notes_count = @commit.notes.count + @ci_project = @project.gitlab_ci_project + end + def branches @branches = @project.repository.branch_names_contains(commit.id) @tags = @project.repository.tag_names_contains(commit.id) diff --git a/app/views/projects/commit/_ci_menu.html.haml b/app/views/projects/commit/_ci_menu.html.haml new file mode 100644 index 00000000000..a634ae5dfda --- /dev/null +++ b/app/views/projects/commit/_ci_menu.html.haml @@ -0,0 +1,7 @@ +%ul.center-top-menu.commit-ci-menu + = nav_link(path: 'commit#show') do + = link_to namespace_project_commit_path(@project.namespace, @project, @commit.id) do + Changes + = nav_link(path: 'commit#ci') do + = link_to ci_namespace_project_commit_path(@project.namespace, @project, @commit.id) do + Builds diff --git a/app/views/projects/commit/ci.html.haml b/app/views/projects/commit/ci.html.haml new file mode 100644 index 00000000000..bbb41a80268 --- /dev/null +++ b/app/views/projects/commit/ci.html.haml @@ -0,0 +1,62 @@ +- page_title "#{@commit.title} (#{@commit.short_id})", "Commits" += render "projects/commits/header_title" += render "commit_box" += render "ci_menu" + +- if @ci_project && current_user && can?(current_user, :manage_builds, @project) + .pull-right + - if @ci_commit.builds.running_or_pending.any? + = link_to "Cancel", cancel_ci_project_commits_path(@ci_project, @ci_commit), class: 'btn btn-sm btn-danger' + + +- if @ci_commit.yaml_errors.present? + .bs-callout.bs-callout-danger + %h4 Found errors in your .gitlab-ci.yml: + %ul + - @ci_commit.yaml_errors.split(",").each do |error| + %li= error + +- unless @ci_commit.ci_yaml_file + .bs-callout.bs-callout-warning + \.gitlab-ci.yml not found in this commit + +- @ci_commit.refs.each do |ref| + .gray-content-block.second-block + Builds for #{ref} + - if @ci_commit.duration_for_ref(ref) > 0 + %small.pull-right + %i.fa.fa-time + #{time_interval_in_words @ci_commit.duration_for_ref(ref)} + + %table.table.builds + %thead + %tr + %th Status + %th Build ID + %th Stage + %th Name + %th Duration + %th Finished at + - if @ci_project && @ci_project.coverage_enabled? + %th Coverage + %th + = render partial: "ci/builds/build", collection: @ci_commit.builds_without_retry.for_ref(ref), controls: true + +- if @ci_commit.retried_builds.any? + %h3 + Retried builds + + %table.table.builds + %thead + %tr + %th Status + %th Build ID + %th Ref + %th Stage + %th Name + %th Duration + %th Finished at + - if @ci_project && @ci_project.coverage_enabled? + %th Coverage + %th + = render partial: "ci/builds/build", collection: @ci_commit.retried_builds, ref: true diff --git a/app/views/projects/commit/show.html.haml b/app/views/projects/commit/show.html.haml index f8681024d1b..30a3973828f 100644 --- a/app/views/projects/commit/show.html.haml +++ b/app/views/projects/commit/show.html.haml @@ -1,5 +1,6 @@ - page_title "#{@commit.title} (#{@commit.short_id})", "Commits" = render "projects/commits/header_title" = render "commit_box" += render "ci_menu" if @ci_commit = render "projects/diffs/diffs", diffs: @diffs, project: @project = render "projects/notes/notes_with_form", view: params[:view] -- cgit v1.2.1 From f509e3afeb47158558e417d700bfc42db5ddd3f5 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 6 Oct 2015 16:21:19 +0200 Subject: Link ci_status_path to new ci commit page Signed-off-by: Dmitriy Zaporozhets --- app/helpers/ci_status_helper.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/helpers/ci_status_helper.rb b/app/helpers/ci_status_helper.rb index 794bdc2530e..dbd1e26fa79 100644 --- a/app/helpers/ci_status_helper.rb +++ b/app/helpers/ci_status_helper.rb @@ -1,6 +1,7 @@ module CiStatusHelper def ci_status_path(ci_commit) - ci_project_commits_path(ci_commit.project, ci_commit) + project = ci_commit.gl_project + ci_namespace_project_commit_path(project.namespace, project, ci_commit.sha) end def ci_status_icon(ci_commit) -- cgit v1.2.1 From 17de909a42fa5d641eb9554e94fee59fb0762cbc Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Tue, 6 Oct 2015 16:25:27 +0200 Subject: Fix broken grouping sql clause when rendering commits for CI --- app/controllers/ci/projects_controller.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/controllers/ci/projects_controller.rb b/app/controllers/ci/projects_controller.rb index 64d544acfd9..adb913a783f 100644 --- a/app/controllers/ci/projects_controller.rb +++ b/app/controllers/ci/projects_controller.rb @@ -14,9 +14,10 @@ module Ci def show @ref = params[:ref] - @commits = @project.commits.group(:sha).reverse_order + @commits = @project.commits.reverse_order if @ref - builds = @project.builds.where(ref: @ref).select(:commit_id).distinct + # unscope is required, because of default_scope defined in Ci::Build + builds = @project.builds.unscope(:select, :order).where(ref: @ref).select(:commit_id).distinct @commits = @commits.where(id: builds) end @commits = @commits.page(params[:page]).per(20) -- cgit v1.2.1 From d15eec64604d68093d8f01711c1847ee240eb0d2 Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Tue, 6 Oct 2015 13:52:19 +0200 Subject: Use >= instead of > in TrendingProjectsFinder By using >= we can ensure we actually get all comments of the past month, instead of the comments of the past month minus the first day in the range. --- app/finders/trending_projects_finder.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/finders/trending_projects_finder.rb b/app/finders/trending_projects_finder.rb index 9ea342cb26d..9b710f0751f 100644 --- a/app/finders/trending_projects_finder.rb +++ b/app/finders/trending_projects_finder.rb @@ -6,7 +6,7 @@ class TrendingProjectsFinder # Determine trending projects based on comments count # for period of time - ex. month - projects.joins(:notes).where('notes.created_at > ?', start_date). + projects.joins(:notes).where('notes.created_at >= ?', start_date). group("projects.id").reorder("count(notes.id) DESC") end -- cgit v1.2.1 From b7abba0ca0a4629a854eee0488f94f160452e2f6 Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Tue, 6 Oct 2015 16:35:51 +0200 Subject: Revamp trending projects query This changes the query to use a COUNT nested in an INNER JOIN, instead of a COUNT plus a GROUP BY. There are two reasons for this: 1. Using a COUNT in an INNER JOIN can be quite a bit faster. 2. The use of a GROUP BY means that method calls such as "any?" (and everything else that calls "count") operate on a Hash that counts the amount of notes on a per project basis, instead of just counting the total amount of projects. The query has been moved into Project.trending as its logic is simple enough. As a result of this testing the TrendingProjectsFinder class simply involves testing if the right methods are called, removing the need for setting up database records. --- app/finders/trending_projects_finder.rb | 11 ++--------- app/models/project.rb | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 9 deletions(-) (limited to 'app') diff --git a/app/finders/trending_projects_finder.rb b/app/finders/trending_projects_finder.rb index 9b710f0751f..81a12403801 100644 --- a/app/finders/trending_projects_finder.rb +++ b/app/finders/trending_projects_finder.rb @@ -1,13 +1,6 @@ class TrendingProjectsFinder - def execute(current_user, start_date = nil) - start_date ||= Date.today - 1.month - - projects = projects_for(current_user) - - # Determine trending projects based on comments count - # for period of time - ex. month - projects.joins(:notes).where('notes.created_at >= ?', start_date). - group("projects.id").reorder("count(notes.id) DESC") + def execute(current_user, start_date = 1.month.ago) + projects_for(current_user).trending(start_date) end private diff --git a/app/models/project.rb b/app/models/project.rb index bb47b9abb03..4661522b8a0 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -260,6 +260,20 @@ class Project < ActiveRecord::Base name_pattern = Gitlab::Regex::NAMESPACE_REGEX_STR %r{(?#{name_pattern}/#{name_pattern})} end + + def trending(since = 1.month.ago) + # By counting in the JOIN we don't expose the GROUP BY to the outer query. + # This means that calls such as "any?" and "count" just return a number of + # the total count, instead of the counts grouped per project as a Hash. + join_body = "INNER JOIN ( + SELECT project_id, COUNT(*) AS amount + FROM notes + WHERE created_at >= #{sanitize(since)} + GROUP BY project_id + ) join_note_counts ON projects.id = join_note_counts.project_id" + + joins(join_body).reorder('join_note_counts.amount DESC') + end end def team -- cgit v1.2.1 From f6223ffb318d2e81ec50037810d23bbd86a400e8 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 6 Oct 2015 17:11:10 +0200 Subject: Move CI build page to CE project Signed-off-by: Dmitriy Zaporozhets --- app/assets/stylesheets/ci/builds.scss | 8 +- app/assets/stylesheets/generic/common.scss | 4 + app/controllers/projects/builds_controller.rb | 25 ++++ app/views/projects/builds/_build.html.haml | 50 ++++++++ app/views/projects/builds/show.html.haml | 159 ++++++++++++++++++++++++++ app/views/projects/commit/ci.html.haml | 4 +- 6 files changed, 247 insertions(+), 3 deletions(-) create mode 100644 app/controllers/projects/builds_controller.rb create mode 100644 app/views/projects/builds/_build.html.haml create mode 100644 app/views/projects/builds/show.html.haml (limited to 'app') diff --git a/app/assets/stylesheets/ci/builds.scss b/app/assets/stylesheets/ci/builds.scss index a11a935b54d..a27dd0db581 100644 --- a/app/assets/stylesheets/ci/builds.scss +++ b/app/assets/stylesheets/ci/builds.scss @@ -1,4 +1,4 @@ -.ci-body { +.build-page { pre.trace { background: #111111; color: #fff; @@ -67,4 +67,10 @@ color: #3084bb !important; } } + + .build-top-menu { + margin-top: 0; + margin-bottom: 2px; + } } + diff --git a/app/assets/stylesheets/generic/common.scss b/app/assets/stylesheets/generic/common.scss index 016cc015e9c..45e284542d2 100644 --- a/app/assets/stylesheets/generic/common.scss +++ b/app/assets/stylesheets/generic/common.scss @@ -381,6 +381,10 @@ table { &.no-bottom { margin-bottom: 0; } + + &.no-top { + margin-top: 0; + } } .dropzone .dz-preview .dz-progress { diff --git a/app/controllers/projects/builds_controller.rb b/app/controllers/projects/builds_controller.rb new file mode 100644 index 00000000000..9bb1a9e14ed --- /dev/null +++ b/app/controllers/projects/builds_controller.rb @@ -0,0 +1,25 @@ +class Projects::BuildsController < Projects::ApplicationController + before_action :ci_project + before_action :build + + layout "project" + + def show + @builds = @ci_project.commits.find_by_sha(@build.sha).builds.order('id DESC') + @builds = @builds.where("id not in (?)", @build.id).page(params[:page]).per(20) + @commit = @build.commit + + respond_to do |format| + format.html + format.json do + render json: @build.to_json(methods: :trace_html) + end + end + end + + private + + def build + @build ||= ci_project.builds.unscoped.find_by(id: params[:id]) + end +end diff --git a/app/views/projects/builds/_build.html.haml b/app/views/projects/builds/_build.html.haml new file mode 100644 index 00000000000..21c543b38dd --- /dev/null +++ b/app/views/projects/builds/_build.html.haml @@ -0,0 +1,50 @@ +- gl_project = build.project.gl_project +%tr.build + %td.status + = ci_status_with_icon(build.status) + + %td.build-link + = link_to namespace_project_build_path(gl_project.namespace, gl_project, build) do + %strong Build ##{build.id} + + - if defined?(ref) + %td + = build.ref + + %td + = build.stage + + %td + = build.name + .pull-right + - if build.tags.any? + - build.tag_list.each do |tag| + %span.label.label-primary + = tag + - if build.trigger_request + %span.label.label-info triggered + - if build.allow_failure + %span.label.label-danger allowed to fail + + %td.duration + - if build.duration + #{duration_in_words(build.finished_at, build.started_at)} + + %td.timestamp + - if build.finished_at + %span #{time_ago_in_words build.finished_at} ago + + - if build.project.coverage_enabled? + %td.coverage + - if build.coverage + #{build.coverage}% + + %td + - if defined?(controls) && current_user && can?(current_user, :manage_builds, gl_project) + .pull-right + - if build.active? + = link_to cancel_ci_project_build_path(build.project, build, return_to: request.original_url), title: 'Cancel build' do + %i.fa.fa-remove.cred + - elsif build.commands.present? + = link_to retry_ci_project_build_path(build.project, build, return_to: request.original_url), method: :post, title: 'Retry build' do + %i.fa.fa-repeat diff --git a/app/views/projects/builds/show.html.haml b/app/views/projects/builds/show.html.haml new file mode 100644 index 00000000000..93cd4dcfd93 --- /dev/null +++ b/app/views/projects/builds/show.html.haml @@ -0,0 +1,159 @@ +.build-page + .gray-content-block + Build for commit + %strong.monospace + = link_to @build.commit.short_sha, ci_status_path(@build.commit) + from + %code #{@build.ref} + + #up-build-trace + - if @commit.matrix_for_ref?(@build.ref) + %ul.center-top-menu.build-top-menu + - @commit.builds_without_retry_for_ref(@build.ref).each do |build| + %li{class: ('active' if build == @build) } + = link_to namespace_project_build_path(@project.namespace, @project, build) do + = ci_icon_for_status(build.status) + %span + - if build.name + = build.name + - else + = build.id + + + - unless @commit.builds_without_retry_for_ref(@build.ref).include?(@build) + %li.active + %a + Build ##{@build.id} + · + %i.fa.fa-warning-sign + This build was retried. + + .gray-content-block.second-block + .build-head + .clearfix + = ci_status_with_icon(@build.status) + - if @build.duration + %span + %i.fa.fa-time + #{duration_in_words(@build.finished_at, @build.started_at)} + .pull-right + = @build.updated_at.stamp('19:00 Aug 27') + + .row.prepend-top-default + .col-md-9 + .clearfix + - if @build.active? + .autoscroll-container + %button.btn.btn-success.btn-sm#autoscroll-button{:type => "button", :data => {:state => 'disabled'}} enable autoscroll + .clearfix + .scroll-controls + = link_to '#up-build-trace', class: 'btn' do + %i.fa.fa-angle-up + = link_to '#down-build-trace', class: 'btn' do + %i.fa.fa-angle-down + + %pre.trace#build-trace + %code.bash + = preserve do + = raw @build.trace_html + %div#down-build-trace + + .col-md-3 + - if @build.coverage + .build-widget + %h4.title + Test coverage + %h1 #{@build.coverage}% + + + .build-widget + %h4.title + Build + - if current_user && can?(current_user, :manage_builds, @project) + .pull-right + - if @build.active? + = link_to "Cancel", cancel_ci_project_build_path(@ci_project, @build), class: 'btn btn-sm btn-danger' + - elsif @build.commands.present? + = link_to "Retry", retry_ci_project_build_path(@ci_project, @build), class: 'btn btn-sm btn-primary', method: :post + + - if @build.duration + %p + %span.attr-name Duration: + #{duration_in_words(@build.finished_at, @build.started_at)} + %p + %span.attr-name Created: + #{time_ago_in_words(@build.created_at)} ago + - if @build.finished_at + %p + %span.attr-name Finished: + #{time_ago_in_words(@build.finished_at)} ago + %p + %span.attr-name Runner: + - if @build.runner && current_user && current_user.admin + \#{link_to "##{@build.runner.id}", ci_admin_runner_path(@build.runner.id)} + - elsif @build.runner + \##{@build.runner.id} + + - if @build.trigger_request + .build-widget + %h4.title + Trigger + + %p + %span.attr-name Token: + #{@build.trigger_request.trigger.short_token} + + - if @build.trigger_request.variables + %p + %span.attr-name Variables: + + %code + - @build.trigger_request.variables.each do |key, value| + #{key}=#{value} + + .build-widget + %h4.title + Commit + .pull-right + %small #{build_commit_link @build} + %p + %span.attr-name Branch: + #{build_ref_link @build} + %p + %span.attr-name Author: + #{@build.commit.git_author_name} + %p + %span.attr-name Message: + #{@build.commit.git_commit_message} + + - if @build.tags.any? + .build-widget + %h4.title + Tags + - @build.tag_list.each do |tag| + %span.label.label-primary + = tag + + - if @builds.present? + .build-widget + %h4.title #{pluralize(@builds.count, "other build")} for #{@build.short_sha}: + %table.table.builds + - @builds.each_with_index do |build, i| + %tr.build + %td + = ci_icon_for_status(build.status) + %td + = link_to namespace_project_build_path(@project.namespace, @project, @build) do + - if build.name + = build.name + - else + %span ##{build.id} + + %td.status= build.status + + + = paginate @builds + + + :javascript + new CiBuild("#{namespace_project_build_path(@project.namespace, @project, @build)}", "#{@build.status}") diff --git a/app/views/projects/commit/ci.html.haml b/app/views/projects/commit/ci.html.haml index bbb41a80268..f4382e88046 100644 --- a/app/views/projects/commit/ci.html.haml +++ b/app/views/projects/commit/ci.html.haml @@ -40,7 +40,7 @@ - if @ci_project && @ci_project.coverage_enabled? %th Coverage %th - = render partial: "ci/builds/build", collection: @ci_commit.builds_without_retry.for_ref(ref), controls: true + = render partial: "projects/builds/build", collection: @ci_commit.builds_without_retry.for_ref(ref), controls: true - if @ci_commit.retried_builds.any? %h3 @@ -59,4 +59,4 @@ - if @ci_project && @ci_project.coverage_enabled? %th Coverage %th - = render partial: "ci/builds/build", collection: @ci_commit.retried_builds, ref: true + = render partial: "projects/builds/build", collection: @ci_commit.retried_builds, ref: true -- cgit v1.2.1 From 04c7dc2a9e2385ce47a70205eafd4cf4f91a0bba Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 6 Oct 2015 20:15:06 +0200 Subject: Cleanup CI code after refactoring and fix several 500 errors Signed-off-by: Dmitriy Zaporozhets --- app/controllers/ci/builds_controller.rb | 40 +------ app/controllers/ci/commits_controller.rb | 6 - app/controllers/projects/builds_controller.rb | 2 +- app/helpers/application_helper.rb | 4 + app/helpers/ci/commits_helper.rb | 24 ---- app/views/ci/admin/builds/_build.html.haml | 6 +- app/views/ci/admin/runners/show.html.haml | 10 +- app/views/ci/builds/_build.html.haml | 49 -------- app/views/ci/builds/show.html.haml | 165 -------------------------- app/views/ci/commits/_commit.html.haml | 2 +- app/views/ci/commits/show.html.haml | 89 -------------- app/views/layouts/ci/build.html.haml | 11 -- app/views/layouts/ci/commit.html.haml | 11 -- 13 files changed, 23 insertions(+), 396 deletions(-) delete mode 100644 app/helpers/ci/commits_helper.rb delete mode 100644 app/views/ci/builds/_build.html.haml delete mode 100644 app/views/ci/builds/show.html.haml delete mode 100644 app/views/ci/commits/show.html.haml delete mode 100644 app/views/layouts/ci/build.html.haml delete mode 100644 app/views/layouts/ci/commit.html.haml (limited to 'app') diff --git a/app/controllers/ci/builds_controller.rb b/app/controllers/ci/builds_controller.rb index bf87f81439a..daf3bcf72a9 100644 --- a/app/controllers/ci/builds_controller.rb +++ b/app/controllers/ci/builds_controller.rb @@ -1,41 +1,11 @@ module Ci class BuildsController < Ci::ApplicationController - before_action :authenticate_user!, except: [:status, :show] - before_action :authenticate_public_page!, only: :show + before_action :authenticate_user!, except: [:status] before_action :project - before_action :authorize_access_project!, except: [:status, :show] - before_action :authorize_manage_project!, except: [:status, :show, :retry, :cancel] + before_action :authorize_access_project!, except: [:status] + before_action :authorize_manage_project!, except: [:status, :retry, :cancel] before_action :authorize_manage_builds!, only: [:retry, :cancel] - before_action :build, except: [:show] - layout 'ci/build' - - def show - if params[:id] =~ /\A\d+\Z/ - @build = build - else - # try to find commit by sha - commit = commit_by_sha - - if commit - # Redirect to commit page - redirect_to ci_project_commit_path(@project, @build.commit) - return - end - end - - raise ActiveRecord::RecordNotFound unless @build - - @builds = @project.commits.find_by_sha(@build.sha).builds.order('id DESC') - @builds = @builds.where("id not in (?)", @build.id).page(params[:page]).per(20) - @commit = @build.commit - - respond_to do |format| - format.html - format.json do - render json: @build.to_json(methods: :trace_html) - end - end - end + before_action :build def retry if @build.commands.blank? @@ -68,7 +38,7 @@ module Ci end def build - @build ||= project.builds.unscoped.find_by(id: params[:id]) + @build ||= project.builds.unscoped.find_by!(id: params[:id]) end def commit_by_sha diff --git a/app/controllers/ci/commits_controller.rb b/app/controllers/ci/commits_controller.rb index 887e92f84cf..404e0e4b412 100644 --- a/app/controllers/ci/commits_controller.rb +++ b/app/controllers/ci/commits_controller.rb @@ -5,12 +5,6 @@ module Ci before_action :project before_action :authorize_access_project!, except: [:status, :show, :cancel] before_action :authorize_manage_builds!, only: [:cancel] - before_action :commit, only: :show - layout 'ci/commit' - - def show - @builds = @commit.builds - end def status commit = Ci::Project.find(params[:project_id]).commits.find_by_sha!(params[:id]) diff --git a/app/controllers/projects/builds_controller.rb b/app/controllers/projects/builds_controller.rb index 9bb1a9e14ed..76c7f31f61b 100644 --- a/app/controllers/projects/builds_controller.rb +++ b/app/controllers/projects/builds_controller.rb @@ -20,6 +20,6 @@ class Projects::BuildsController < Projects::ApplicationController private def build - @build ||= ci_project.builds.unscoped.find_by(id: params[:id]) + @build ||= ci_project.builds.unscoped.find_by!(id: params[:id]) end end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 3ab44719d9f..cab2278adb7 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -314,4 +314,8 @@ module ApplicationHelper html.html_safe end + + def truncate_first_line(message, length = 50) + truncate(message.each_line.first.chomp, length: length) if message + end end diff --git a/app/helpers/ci/commits_helper.rb b/app/helpers/ci/commits_helper.rb deleted file mode 100644 index a0df4c3d72d..00000000000 --- a/app/helpers/ci/commits_helper.rb +++ /dev/null @@ -1,24 +0,0 @@ -module Ci - module CommitsHelper - def ci_commit_path(commit) - ci_project_commits_path(commit.project, commit) - end - - def commit_link(commit) - link_to(commit.short_sha, ci_commit_path(commit)) - end - - def truncate_first_line(message, length = 50) - truncate(message.each_line.first.chomp, length: length) if message - end - - def ci_commit_title(commit) - content_tag :span do - link_to( - simple_sanitize(commit.project.name), ci_project_path(commit.project) - ) + ' @ ' + - gitlab_commit_link(@project, @commit.sha) - end - end - end -end diff --git a/app/views/ci/admin/builds/_build.html.haml b/app/views/ci/admin/builds/_build.html.haml index 778d51d03be..2df58713214 100644 --- a/app/views/ci/admin/builds/_build.html.haml +++ b/app/views/ci/admin/builds/_build.html.haml @@ -1,14 +1,16 @@ +- gl_project = build.project.gl_project - if build.commit && build.project %tr.build %td.build-link - = link_to ci_project_build_url(build.project, build) do + = link_to namespace_project_build_path(gl_project.namespace, gl_project, build) do %strong #{build.id} %td.status = ci_status_with_icon(build.status) %td.commit-link - = commit_link(build.commit) + = link_to ci_status_path(build.commit) do + %strong #{build.commit.short_sha} %td.runner - if build.runner diff --git a/app/views/ci/admin/runners/show.html.haml b/app/views/ci/admin/runners/show.html.haml index 09905e0eb47..5bb442cbf92 100644 --- a/app/views/ci/admin/runners/show.html.haml +++ b/app/views/ci/admin/runners/show.html.haml @@ -96,6 +96,7 @@ %table.builds.runner-builds %thead %tr + %th Build ID %th Status %th Project %th Commit @@ -103,6 +104,11 @@ - @builds.each do |build| %tr.build + %td.id + - gl_project = build.project.gl_project + = link_to namespace_project_build_path(gl_project.namespace, gl_project, build) do + = build.id + %td.status = ci_status_with_icon(build.status) @@ -110,8 +116,8 @@ = build.project.name %td.build-link - = link_to ci_project_build_path(build.project, build) do - %strong #{build.short_sha} + = link_to ci_status_path(build.commit) do + %strong #{build.commit.short_sha} %td.timestamp - if build.finished_at diff --git a/app/views/ci/builds/_build.html.haml b/app/views/ci/builds/_build.html.haml deleted file mode 100644 index 8ccc0dff2fb..00000000000 --- a/app/views/ci/builds/_build.html.haml +++ /dev/null @@ -1,49 +0,0 @@ -%tr.build - %td.status - = ci_status_with_icon(build.status) - - %td.build-link - = link_to ci_project_build_path(build.project, build) do - %strong Build ##{build.id} - - - if defined?(ref) - %td - = build.ref - - %td - = build.stage - - %td - = build.name - .pull-right - - if build.tags.any? - - build.tag_list.each do |tag| - %span.label.label-primary - = tag - - if build.trigger_request - %span.label.label-info triggered - - if build.allow_failure - %span.label.label-danger allowed to fail - - %td.duration - - if build.duration - #{duration_in_words(build.finished_at, build.started_at)} - - %td.timestamp - - if build.finished_at - %span #{time_ago_in_words build.finished_at} ago - - - if build.project.coverage_enabled? - %td.coverage - - if build.coverage - #{build.coverage}% - - %td - - if defined?(controls) && current_user && can?(current_user, :manage_builds, gl_project) - .pull-right - - if build.active? - = link_to cancel_ci_project_build_path(build.project, build, return_to: request.original_url), title: 'Cancel build' do - %i.fa.fa-remove.cred - - elsif build.commands.present? - = link_to retry_ci_project_build_path(build.project, build, return_to: request.original_url), method: :post, title: 'Retry build' do - %i.fa.fa-repeat diff --git a/app/views/ci/builds/show.html.haml b/app/views/ci/builds/show.html.haml deleted file mode 100644 index be33c5e8aa4..00000000000 --- a/app/views/ci/builds/show.html.haml +++ /dev/null @@ -1,165 +0,0 @@ -#up-build-trace -- if @commit.matrix_for_ref?(@build.ref) - %ul.center-top-menu - - @commit.builds_without_retry_for_ref(@build.ref).each do |build| - %li{class: ('active' if build == @build) } - = link_to ci_project_build_url(@project, build) do - = ci_icon_for_status(build.status) - %span - - if build.name - = build.name - - else - = build.id - - - - unless @commit.builds_without_retry_for_ref(@build.ref).include?(@build) - %li.active - %a - Build ##{@build.id} - · - %i.fa.fa-warning-sign - This build was retried. - -.gray-content-block - .build-head - %h4 - - if @build.commit.tag? - Build for tag - %code #{@build.ref} - - else - Build for commit - %strong.monospace= commit_link(@build.commit) - from - - = link_to ci_project_path(@build.project, ref: @build.ref) do - %strong.monospace= "#{@build.ref}" - - - if @build.duration - .pull-right - %span - %i.fa.fa-time - #{duration_in_words(@build.finished_at, @build.started_at)} - - .clearfix - = ci_status_with_icon(@build.status) - .pull-right - = @build.updated_at.stamp('19:00 Aug 27') - -.row.prepend-top-default - .col-md-9 - .clearfix - - if @build.active? - .autoscroll-container - %button.btn.btn-success.btn-sm#autoscroll-button{:type => "button", :data => {:state => 'disabled'}} enable autoscroll - .clearfix - .scroll-controls - = link_to '#up-build-trace', class: 'btn' do - %i.fa.fa-angle-up - = link_to '#down-build-trace', class: 'btn' do - %i.fa.fa-angle-down - - %pre.trace#build-trace - %code.bash - = preserve do - = raw @build.trace_html - %div#down-build-trace - - .col-md-3 - - if @build.coverage - .build-widget - %h4.title - Test coverage - %h1 #{@build.coverage}% - - - .build-widget - %h4.title - Build - - if current_user && can?(current_user, :manage_builds, gl_project) - .pull-right - - if @build.active? - = link_to "Cancel", cancel_ci_project_build_path(@project, @build), class: 'btn btn-sm btn-danger' - - elsif @build.commands.present? - = link_to "Retry", retry_ci_project_build_path(@project, @build), class: 'btn btn-sm btn-primary', method: :post - - - if @build.duration - %p - %span.attr-name Duration: - #{duration_in_words(@build.finished_at, @build.started_at)} - %p - %span.attr-name Created: - #{time_ago_in_words(@build.created_at)} ago - - if @build.finished_at - %p - %span.attr-name Finished: - #{time_ago_in_words(@build.finished_at)} ago - %p - %span.attr-name Runner: - - if @build.runner && current_user && current_user.admin - \#{link_to "##{@build.runner.id}", ci_admin_runner_path(@build.runner.id)} - - elsif @build.runner - \##{@build.runner.id} - - - if @build.trigger_request - .build-widget - %h4.title - Trigger - - %p - %span.attr-name Token: - #{@build.trigger_request.trigger.short_token} - - - if @build.trigger_request.variables - %p - %span.attr-name Variables: - - %code - - @build.trigger_request.variables.each do |key, value| - #{key}=#{value} - - .build-widget - %h4.title - Commit - .pull-right - %small #{build_commit_link @build} - %p - %span.attr-name Branch: - #{build_ref_link @build} - %p - %span.attr-name Author: - #{@build.commit.git_author_name} - %p - %span.attr-name Message: - #{@build.commit.git_commit_message} - - - if @build.tags.any? - .build-widget - %h4.title - Tags - - @build.tag_list.each do |tag| - %span.label.label-primary - = tag - - - if @builds.present? - .build-widget - %h4.title #{pluralize(@builds.count, "other build")} for #{@build.short_sha}: - %table.builds - - @builds.each_with_index do |build, i| - %tr.build - %td - = ci_icon_for_status(build.status) - %td - = link_to ci_project_build_url(@project, build) do - - if build.name - = build.name - - else - %span ##{build.id} - - %td.status= build.status - - - = paginate @builds - - -:javascript - new CiBuild("#{ci_project_build_url(@project, @build)}", "#{@build.status}") diff --git a/app/views/ci/commits/_commit.html.haml b/app/views/ci/commits/_commit.html.haml index 6e6cc9b2c37..b24a3b826cf 100644 --- a/app/views/ci/commits/_commit.html.haml +++ b/app/views/ci/commits/_commit.html.haml @@ -7,7 +7,7 @@ %td.build-link - = link_to ci_project_commits_path(commit.project, commit.sha) do + = link_to ci_status_path(commit) do %strong #{commit.short_sha} %td.build-message diff --git a/app/views/ci/commits/show.html.haml b/app/views/ci/commits/show.html.haml deleted file mode 100644 index 7ebef8c5e06..00000000000 --- a/app/views/ci/commits/show.html.haml +++ /dev/null @@ -1,89 +0,0 @@ -.commit-info - .append-bottom-20 - = ci_status_with_icon(@commit.status) - - .gray-content-block.middle-block - %pre.commit-message - - if @commit.git_commit_message - #{@commit.git_commit_message} - - else - No commit message - - .gray-content-block.second-block - .row - .col-sm-6 - %p - %span.attr-name Commit: - #{gitlab_commit_link(@project, @commit.sha)} - %p - - if @commit.refs.present? - %span.attr-name Refs: - - @commit.refs.each do |ref| - #{gitlab_ref_link(@project, ref)} - .col-sm-6 - - if @commit.git_author_name || @commit.git_author_email - %p - %span.attr-name Author: - #{@commit.git_author_name} (#{@commit.git_author_email}) - - if @commit.created_at - %p - %span.attr-name Created at: - #{@commit.created_at.to_s(:short)} - - - if current_user && can?(current_user, :manage_builds, gl_project) - - if @commit.builds.running_or_pending.any? - .pull-right - = link_to "Cancel", cancel_ci_project_commits_path(@project, @commit), class: 'btn btn-sm btn-danger' - - -- if @commit.yaml_errors.present? - .bs-callout.bs-callout-danger - %h4 Found errors in your .gitlab-ci.yml: - %ul - - @commit.yaml_errors.split(",").each do |error| - %li= error - -- unless @commit.ci_yaml_file - .bs-callout.bs-callout-warning - \.gitlab-ci.yml not found in this commit - -- @commit.refs.each do |ref| - %h3 - Builds for #{gitlab_ref_link(@project, ref)} - - if @commit.duration_for_ref(ref) > 0 - %small.pull-right - %i.fa.fa-time - #{time_interval_in_words @commit.duration_for_ref(ref)} - - %table.table.builds - %thead - %tr - %th Status - %th Build ID - %th Stage - %th Name - %th Duration - %th Finished at - - if @project.coverage_enabled? - %th Coverage - %th - = render @commit.builds_without_retry.for_ref(ref), controls: true - -- if @commit.retried_builds.any? - %h3 - Retried builds - - %table.table.builds - %thead - %tr - %th Status - %th Build ID - %th Ref - %th Stage - %th Name - %th Duration - %th Finished at - - if @project.coverage_enabled? - %th Coverage - %th - = render @commit.retried_builds, ref: true diff --git a/app/views/layouts/ci/build.html.haml b/app/views/layouts/ci/build.html.haml deleted file mode 100644 index a1356f0dc2e..00000000000 --- a/app/views/layouts/ci/build.html.haml +++ /dev/null @@ -1,11 +0,0 @@ -!!! 5 -%html{ lang: "en"} - = render 'layouts/head' - %body{class: "ci-body #{user_application_theme}", 'data-page' => body_data_page} - - header_title ci_commit_title(@commit) - - if current_user - = render "layouts/header/default", title: header_title - - else - = render "layouts/header/public", title: header_title - - = render 'layouts/ci/page', sidebar: 'nav_project' diff --git a/app/views/layouts/ci/commit.html.haml b/app/views/layouts/ci/commit.html.haml deleted file mode 100644 index a1356f0dc2e..00000000000 --- a/app/views/layouts/ci/commit.html.haml +++ /dev/null @@ -1,11 +0,0 @@ -!!! 5 -%html{ lang: "en"} - = render 'layouts/head' - %body{class: "ci-body #{user_application_theme}", 'data-page' => body_data_page} - - header_title ci_commit_title(@commit) - - if current_user - = render "layouts/header/default", title: header_title - - else - = render "layouts/header/public", title: header_title - - = render 'layouts/ci/page', sidebar: 'nav_project' -- cgit v1.2.1 From 27b75b2b2d9c274fca005949f645d97ce9333d71 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 6 Oct 2015 20:36:22 +0200 Subject: Refactor commit/build tests and fix CI cancel Signed-off-by: Dmitriy Zaporozhets --- app/controllers/ci/commits_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/controllers/ci/commits_controller.rb b/app/controllers/ci/commits_controller.rb index 404e0e4b412..7e6705c9702 100644 --- a/app/controllers/ci/commits_controller.rb +++ b/app/controllers/ci/commits_controller.rb @@ -16,7 +16,7 @@ module Ci def cancel commit.builds.running_or_pending.each(&:cancel) - redirect_to ci_project_commits_path(project, commit.sha) + redirect_to namespace_project_commit_path(commit.gl_project.namespace, commit.gl_project, commit.sha) end private -- cgit v1.2.1 From 82b6a17ca70a20015e654b4a0fdb8aec6d244f95 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 6 Oct 2015 21:41:37 +0200 Subject: Fix ci build routing and few tests Signed-off-by: Dmitriy Zaporozhets --- app/controllers/ci/builds_controller.rb | 8 ++++++-- app/helpers/builds_helper.rb | 2 +- app/models/ci/build.rb | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) (limited to 'app') diff --git a/app/controllers/ci/builds_controller.rb b/app/controllers/ci/builds_controller.rb index daf3bcf72a9..b0b8b62fced 100644 --- a/app/controllers/ci/builds_controller.rb +++ b/app/controllers/ci/builds_controller.rb @@ -17,7 +17,7 @@ module Ci if params[:return_to] redirect_to URI.parse(params[:return_to]).path else - redirect_to ci_project_build_path(project, build) + redirect_to build_path(build) end end @@ -28,7 +28,7 @@ module Ci def cancel @build.cancel - redirect_to ci_project_build_path(@project, @build) + redirect_to build_path(@build) end protected @@ -44,5 +44,9 @@ module Ci def commit_by_sha @project.commits.find_by(sha: params[:id]) end + + def build_path(build) + namespace_project_build_path(build.gl_project.namespace, build.gl_project, build) + end end end diff --git a/app/helpers/builds_helper.rb b/app/helpers/builds_helper.rb index 626f4e2f4c0..1b5a2c31d74 100644 --- a/app/helpers/builds_helper.rb +++ b/app/helpers/builds_helper.rb @@ -8,6 +8,6 @@ module BuildsHelper end def build_url(build) - ci_project_build_url(build.project, build) + namespace_project_build_path(build.gl_project, build.project, build) end end diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index 3c92710968c..5d17f4418ed 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -144,7 +144,7 @@ module Ci state :canceled, value: 'canceled' end - delegate :sha, :short_sha, :project, + delegate :sha, :short_sha, :project, :gl_project, to: :commit, prefix: false def before_sha -- cgit v1.2.1 From 8dcc8e5db61b602baaf6390c6cbbaa28d49b3ee1 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 7 Oct 2015 10:26:40 +0200 Subject: Fix routing in CI mailer Signed-off-by: Dmitriy Zaporozhets --- app/models/project_services/ci/hip_chat_message.rb | 2 +- app/models/project_services/ci/slack_message.rb | 4 ++-- app/models/project_services/gitlab_ci_service.rb | 2 +- app/views/ci/notify/build_fail_email.html.haml | 2 +- app/views/ci/notify/build_fail_email.text.erb | 2 +- app/views/ci/notify/build_success_email.html.haml | 2 +- app/views/ci/notify/build_success_email.text.erb | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) (limited to 'app') diff --git a/app/models/project_services/ci/hip_chat_message.rb b/app/models/project_services/ci/hip_chat_message.rb index 0bf448d47f2..cbf325cc525 100644 --- a/app/models/project_services/ci/hip_chat_message.rb +++ b/app/models/project_services/ci/hip_chat_message.rb @@ -11,7 +11,7 @@ module Ci def to_s lines = Array.new lines.push("#{project.name} - ") - lines.push("Commit ##{commit.id}
") + lines.push("Commit ##{commit.id}
") lines.push("#{commit.short_sha} #{commit.git_author_name} - #{commit.git_commit_message}
") lines.push("#{humanized_status(commit_status)} in #{commit.duration} second(s).") lines.join('') diff --git a/app/models/project_services/ci/slack_message.rb b/app/models/project_services/ci/slack_message.rb index a89c01517b7..5ac8907ecd0 100644 --- a/app/models/project_services/ci/slack_message.rb +++ b/app/models/project_services/ci/slack_message.rb @@ -28,7 +28,7 @@ module Ci next unless build.failed? fields << { title: build.name, - value: "Build <#{ci_project_build_url(project, build)}|\##{build.id}> failed in #{build.duration.to_i} second(s)." + value: "Build <#{namespace_project_build_url(build.gl_project.namespace, build.gl_project, build)}|\##{build.id}> failed in #{build.duration.to_i} second(s)." } end @@ -45,7 +45,7 @@ module Ci def attachment_message out = "<#{ci_project_url(project)}|#{project_name}>: " - out << "Commit <#{ci_project_commits_url(project, commit.sha)}|\##{commit.id}> " + out << "Commit <#{ci_namespace_project_commit_url(commit.gl_project.namespace, commit.gl_project, commit.sha)}|\##{commit.id}> " out << "(<#{commit_sha_link}|#{commit.short_sha}>) " out << "of <#{commit_ref_link}|#{commit.ref}> " out << "by #{commit.git_author_name} " if commit.git_author_name diff --git a/app/models/project_services/gitlab_ci_service.rb b/app/models/project_services/gitlab_ci_service.rb index b63a75cf3af..4dcd16ede3a 100644 --- a/app/models/project_services/gitlab_ci_service.rb +++ b/app/models/project_services/gitlab_ci_service.rb @@ -71,7 +71,7 @@ class GitlabCiService < CiService def build_page(sha, ref) if project.gitlab_ci_project.present? - ci_project_commits_url(project.gitlab_ci_project, sha) + ci_namespace_project_commit_url(project.namespace, project, sha) end end diff --git a/app/views/ci/notify/build_fail_email.html.haml b/app/views/ci/notify/build_fail_email.html.haml index 4ebdfa1b6c0..69689a75022 100644 --- a/app/views/ci/notify/build_fail_email.html.haml +++ b/app/views/ci/notify/build_fail_email.html.haml @@ -16,4 +16,4 @@ Message: #{@build.commit.git_commit_message} %p - Url: #{link_to @build.short_sha, ci_project_build_url(@project, @build)} + Url: #{link_to @build.short_sha, namespace_project_build_url(@build.gl_project.namespace, @build.gl_project, @build)} diff --git a/app/views/ci/notify/build_fail_email.text.erb b/app/views/ci/notify/build_fail_email.text.erb index 177827f9a3c..6de5dc10f17 100644 --- a/app/views/ci/notify/build_fail_email.text.erb +++ b/app/views/ci/notify/build_fail_email.text.erb @@ -6,4 +6,4 @@ Author: <%= @build.commit.git_author_name %> Branch: <%= @build.ref %> Message: <%= @build.commit.git_commit_message %> -Url: <%= ci_project_build_url(@build.project, @build) %> +Url: <%= namespace_project_build_url(@build.gl_project.namespace, @build.gl_project, @build) %> diff --git a/app/views/ci/notify/build_success_email.html.haml b/app/views/ci/notify/build_success_email.html.haml index 7cc43300e88..4e3015a356b 100644 --- a/app/views/ci/notify/build_success_email.html.haml +++ b/app/views/ci/notify/build_success_email.html.haml @@ -17,4 +17,4 @@ Message: #{@build.commit.git_commit_message} %p - Url: #{link_to @build.short_sha, ci_project_build_url(@project, @build)} + Url: #{link_to @build.short_sha, namespace_project_build_url(@build.gl_project.namespace, @build.gl_project, @build)} diff --git a/app/views/ci/notify/build_success_email.text.erb b/app/views/ci/notify/build_success_email.text.erb index 4d55c39b0fb..d0a43ae1c12 100644 --- a/app/views/ci/notify/build_success_email.text.erb +++ b/app/views/ci/notify/build_success_email.text.erb @@ -6,4 +6,4 @@ Author: <%= @build.commit.git_author_name %> Branch: <%= @build.ref %> Message: <%= @build.commit.git_commit_message %> -Url: <%= ci_project_build_url(@build.project, @build) %> +Url: <%= namespace_project_build_url(@build.gl_project.namespace, @build.gl_project, @build) %> -- cgit v1.2.1 From 0ab6ca93aadaf08f65f36e7fbdb5b837bac6e160 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Wed, 16 Sep 2015 22:45:22 -0700 Subject: Add directory feature button Change "+" icon under "Files" section to have three options: * Create file * Upload file * New directory Upload file is no longer accessible from the "Create file" page. Users can now select a target branch in upload file as well. Closes #2799: Fixes a bug where file modes were overwritten after a commit Closes https://github.com/gitlabhq/gitlabhq/issues/8253: Existing files can no longer be overwritten in the "Create file" section. Closes #2557 --- .../javascripts/blob/blob_file_dropzone.js.coffee | 1 + app/controllers/projects/blob_controller.rb | 8 ++--- app/controllers/projects/tree_controller.rb | 37 ++++++++++++++++++++++ app/models/repository.rb | 29 ++++++++++++----- app/services/files/create_dir_service.rb | 9 ++++++ app/services/files/create_service.rb | 2 +- app/services/files/update_service.rb | 2 +- app/services/merge_requests/merge_service.rb | 2 +- app/views/projects/blob/_new_dir.html.haml | 25 +++++++++++++++ app/views/projects/blob/_upload.html.haml | 9 ++++-- app/views/projects/blob/new.html.haml | 7 +--- app/views/projects/tree/_tree.html.haml | 26 ++++++++++++--- 12 files changed, 129 insertions(+), 28 deletions(-) create mode 100644 app/services/files/create_dir_service.rb create mode 100644 app/views/projects/blob/_new_dir.html.haml (limited to 'app') diff --git a/app/assets/javascripts/blob/blob_file_dropzone.js.coffee b/app/assets/javascripts/blob/blob_file_dropzone.js.coffee index 3ab3ba66754..5b604adbbb1 100644 --- a/app/assets/javascripts/blob/blob_file_dropzone.js.coffee +++ b/app/assets/javascripts/blob/blob_file_dropzone.js.coffee @@ -47,6 +47,7 @@ class @BlobFileDropzone return this.on 'sending', (file, xhr, formData) -> + formData.append('new_branch', form.find('#new_branch').val()) formData.append('commit_message', form.find('#commit_message').val()) return diff --git a/app/controllers/projects/blob_controller.rb b/app/controllers/projects/blob_controller.rb index 8776721d243..ae9b1384463 100644 --- a/app/controllers/projects/blob_controller.rb +++ b/app/controllers/projects/blob_controller.rb @@ -8,7 +8,7 @@ class Projects::BlobController < Projects::ApplicationController before_action :require_non_empty_project, except: [:new, :create] before_action :authorize_download_code! - before_action :authorize_push_code!, only: [:destroy] + before_action :authorize_push_code!, only: [:destroy, :create] before_action :assign_blob_vars before_action :commit, except: [:new, :create] before_action :blob, except: [:new, :create] @@ -25,7 +25,7 @@ class Projects::BlobController < Projects::ApplicationController result = Files::CreateService.new(@project, current_user, @commit_params).execute if result[:status] == :success - flash[:notice] = "Your changes have been successfully committed" + flash[:notice] = "The changes have been successfully committed" respond_to do |format| format.html { redirect_to namespace_project_blob_path(@project.namespace, @project, File.join(@target_branch, @file_path)) } format.json { render json: { message: "success", filePath: namespace_project_blob_path(@project.namespace, @project, File.join(@target_branch, @file_path)) } } @@ -34,7 +34,7 @@ class Projects::BlobController < Projects::ApplicationController flash[:alert] = result[:message] respond_to do |format| format.html { render :new } - format.json { render json: { message: "failed", filePath: namespace_project_new_blob_path(@project.namespace, @project, @id) } } + format.json { render json: { message: "failed", filePath: namespace_project_blob_path(@project.namespace, @project, @id) } } end end end @@ -154,7 +154,7 @@ class Projects::BlobController < Projects::ApplicationController def editor_variables @current_branch = @ref - @target_branch = (sanitized_new_branch_name || @ref) + @target_branch = params[:new_branch].present? ? sanitized_new_branch_name : @ref @file_path = if action_name.to_s == 'create' diff --git a/app/controllers/projects/tree_controller.rb b/app/controllers/projects/tree_controller.rb index 92e4bc16d9d..7eaff1d61ee 100644 --- a/app/controllers/projects/tree_controller.rb +++ b/app/controllers/projects/tree_controller.rb @@ -1,10 +1,13 @@ # Controller for viewing a repository's file structure class Projects::TreeController < Projects::ApplicationController include ExtractsPath + include ActionView::Helpers::SanitizeHelper before_action :require_non_empty_project, except: [:new, :create] before_action :assign_ref_vars + before_action :assign_dir_vars, only: [:create_dir] before_action :authorize_download_code! + before_action :authorize_push_code!, only: [:create_dir] def show return not_found! unless @repository.commit(@ref) @@ -26,4 +29,38 @@ class Projects::TreeController < Projects::ApplicationController format.js { no_cache_headers } end end + + def create_dir + return not_found! unless @commit_params.values.all? + + begin + result = Files::CreateDirService.new(@project, current_user, @commit_params).execute + message = result[:message] + rescue => e + message = e.to_s + end + + if result && result[:status] == :success + flash[:notice] = "The directory has been successfully created" + respond_to do |format| + format.html { redirect_to namespace_project_blob_path(@project.namespace, @project, File.join(@new_branch, @dir_name)) } + end + else + flash[:alert] = message + respond_to do |format| + format.html { redirect_to namespace_project_blob_path(@project.namespace, @project, @new_branch) } + end + end + end + + def assign_dir_vars + @new_branch = params[:new_branch].present? ? sanitize(strip_tags(params[:new_branch])) : @ref + @dir_name = File.join(@path, params[:dir_name]) + @commit_params = { + file_path: @dir_name, + current_branch: @ref, + target_branch: @new_branch, + commit_message: params[:commit_message], + } + end end diff --git a/app/models/repository.rb b/app/models/repository.rb index 2c5ab62d22c..8b51602bc23 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -373,11 +373,25 @@ class Repository @root_ref ||= raw_repository.root_ref end - def commit_file(user, path, content, message, branch) + def commit_dir(user, path, message, branch) commit_with_hooks(user, branch) do |ref| - path[0] = '' if path[0] == '/' + committer = user_to_committer(user) + options = {} + options[:committer] = committer + options[:author] = committer + + options[:commit] = { + message: message, + branch: ref, + } + + raw_repository.mkdir(path, options) + end + end - committer = user_to_comitter(user) + def commit_file(user, path, content, message, branch, update) + commit_with_hooks(user, branch) do |ref| + committer = user_to_committer(user) options = {} options[:committer] = committer options[:author] = committer @@ -388,7 +402,8 @@ class Repository options[:file] = { content: content, - path: path + path: path, + update: update } Gitlab::Git::Blob.commit(raw_repository, options) @@ -397,9 +412,7 @@ class Repository def remove_file(user, path, message, branch) commit_with_hooks(user, branch) do |ref| - path[0] = '' if path[0] == '/' - - committer = user_to_comitter(user) + committer = user_to_committer(user) options = {} options[:committer] = committer options[:author] = committer @@ -416,7 +429,7 @@ class Repository end end - def user_to_comitter(user) + def user_to_committer(user) { email: user.email, name: user.name, diff --git a/app/services/files/create_dir_service.rb b/app/services/files/create_dir_service.rb new file mode 100644 index 00000000000..71272fb5707 --- /dev/null +++ b/app/services/files/create_dir_service.rb @@ -0,0 +1,9 @@ +require_relative "base_service" + +module Files + class CreateDirService < Files::BaseService + def commit + repository.commit_dir(current_user, @file_path, @commit_message, @target_branch) + end + end +end diff --git a/app/services/files/create_service.rb b/app/services/files/create_service.rb index ffbb5993279..c8e3a910bba 100644 --- a/app/services/files/create_service.rb +++ b/app/services/files/create_service.rb @@ -3,7 +3,7 @@ require_relative "base_service" module Files class CreateService < Files::BaseService def commit - repository.commit_file(current_user, @file_path, @file_content, @commit_message, @target_branch) + repository.commit_file(current_user, @file_path, @file_content, @commit_message, @target_branch, false) end def validate diff --git a/app/services/files/update_service.rb b/app/services/files/update_service.rb index a20903c6f02..1960dc7d949 100644 --- a/app/services/files/update_service.rb +++ b/app/services/files/update_service.rb @@ -3,7 +3,7 @@ require_relative "base_service" module Files class UpdateService < Files::BaseService def commit - repository.commit_file(current_user, @file_path, @file_content, @commit_message, @target_branch) + repository.commit_file(current_user, @file_path, @file_content, @commit_message, @target_branch, true) end end end diff --git a/app/services/merge_requests/merge_service.rb b/app/services/merge_requests/merge_service.rb index fcc0f2a6a8d..7963af127e1 100644 --- a/app/services/merge_requests/merge_service.rb +++ b/app/services/merge_requests/merge_service.rb @@ -29,7 +29,7 @@ module MergeRequests private def commit - committer = repository.user_to_comitter(current_user) + committer = repository.user_to_committer(current_user) options = { message: commit_message, diff --git a/app/views/projects/blob/_new_dir.html.haml b/app/views/projects/blob/_new_dir.html.haml new file mode 100644 index 00000000000..cb1567a2e68 --- /dev/null +++ b/app/views/projects/blob/_new_dir.html.haml @@ -0,0 +1,25 @@ +#modal-create-new-dir.modal + .modal-dialog + .modal-content + .modal-header + %a.close{href: "#", "data-dismiss" => "modal"} × + %h3.page-title Create New Directory + .modal-body + = form_tag namespace_project_create_dir_path(@project.namespace, @project, @id), method: :post, remote: false, id: 'dir-create-form', class: 'form-horizontal' do + .form-group + = label_tag :dir_name, 'Directory Name', class: 'control-label' + .col-sm-10 + = text_field_tag :dir_name, params[:dir_name], placeholder: "Directory name", required: true, class: 'form-control' + = render 'shared/commit_message_container', params: params, placeholder: '' + - unless @project.empty_repo? + .form-group + = label_tag :branch_name, 'Branch', class: 'control-label' + .col-sm-10 + = text_field_tag 'new_branch', @ref, class: "form-control" + .form-group + .col-sm-offset-2.col-sm-10 + = submit_tag "Create directory", class: 'btn btn-primary btn-create' + = link_to "Cancel", '#', class: "btn btn-cancel", "data-dismiss" => "modal" + +:coffeescript + disableButtonIfAnyEmptyField($("#dir-create-form"), ".form-control", ".btn-create"); diff --git a/app/views/projects/blob/_upload.html.haml b/app/views/projects/blob/_upload.html.haml index 1a1df127703..e27f1707527 100644 --- a/app/views/projects/blob/_upload.html.haml +++ b/app/views/projects/blob/_upload.html.haml @@ -4,9 +4,6 @@ .modal-header %a.close{href: "#", "data-dismiss" => "modal"} × %h3.page-title #{title} - %p.light - From branch - %strong= @ref .modal-body = form_tag form_path, method: method, class: 'blob-file-upload-form-js form-horizontal' do .dropzone @@ -18,6 +15,12 @@ .dropzone-alerts{class: "alert alert-danger data", style: "display:none"} = render 'shared/commit_message_container', params: params, placeholder: placeholder + - unless @project.empty_repo? + .form-group.branch + = label_tag 'branch', class: 'control-label' do + Branch + .col-sm-10 + = text_field_tag 'new_branch', @ref, class: "form-control" .form-group .col-sm-offset-2.col-sm-10 = button_tag button_title, class: 'btn btn-small btn-primary btn-upload-file', id: 'submit-all' diff --git a/app/views/projects/blob/new.html.haml b/app/views/projects/blob/new.html.haml index 1950586b112..d7987e24ef3 100644 --- a/app/views/projects/blob/new.html.haml +++ b/app/views/projects/blob/new.html.haml @@ -2,12 +2,7 @@ = render "header_title" .gray-content-block.top-block - Create a new file or - = link_to 'upload', '#modal-upload-blob', - { class: 'upload-link', 'data-target' => '#modal-upload-blob', 'data-toggle' => 'modal'} - an existing one - -= render 'projects/blob/upload', title: 'Upload', placeholder: 'Upload new file', button_title: 'Upload file', form_path: namespace_project_create_blob_path(@project.namespace, @project, @id), method: :post + Create a new file .file-editor = form_tag(namespace_project_create_blob_path(@project.namespace, @project, @id), method: :post, class: 'form-horizontal form-new-file js-requires-input') do diff --git a/app/views/projects/tree/_tree.html.haml b/app/views/projects/tree/_tree.html.haml index 367a87927d7..457f8a4a585 100644 --- a/app/views/projects/tree/_tree.html.haml +++ b/app/views/projects/tree/_tree.html.haml @@ -8,11 +8,25 @@ = link_to truncate(title, length: 40), namespace_project_tree_path(@project.namespace, @project, path) - else = link_to title, '#' - - if current_user && can_push_branch?(@project, @ref) + - if allowed_tree_edit? %li - = link_to namespace_project_new_blob_path(@project.namespace, @project, @id), title: 'New file', id: 'new-file-link' do - %small - %i.fa.fa-plus + %span.dropdown + %a.dropdown-toggle.btn.btn-xs.add-to-tree{href: '#', "data-toggle" => "dropdown"} + = icon('plus') + %ul.dropdown-menu + %li + = link_to namespace_project_new_blob_path(@project.namespace, @project, @id), title: 'Create file', id: 'new-file-link' do + = icon('pencil fw') + Create file + %li + = link_to '#modal-upload-blob', { 'data-target' => '#modal-upload-blob', 'data-toggle' => 'modal'} do + = icon('file fw') + Upload file + %li.divider + %li + = link_to '#modal-create-new-dir', { 'data-target' => '#modal-create-new-dir', 'data-toggle' => 'modal'} do + = icon('folder fw') + New directory %div#tree-content-holder.tree-content-holder.prepend-top-20 %table#tree-slider{class: "table_#{@hex_path} tree-table" } @@ -46,6 +60,10 @@ %div.tree_progress +- if allowed_tree_edit? + = render 'projects/blob/upload', title: 'Upload', placeholder: 'Upload new file', button_title: 'Upload file', form_path: namespace_project_create_blob_path(@project.namespace, @project, @id), method: :post + = render 'projects/blob/new_dir' + :javascript // Load last commit log for each file in tree $('#tree-slider').waitForImages(function() { -- cgit v1.2.1 From 6f6097713ca593c7a7177df0f06420b124d478aa Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 7 Oct 2015 14:26:07 +0200 Subject: Move status badge helper to CI project settings for now Signed-off-by: Dmitriy Zaporozhets --- app/views/ci/projects/show.html.haml | 16 ---------------- app/views/projects/ci_settings/_form.html.haml | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 16 deletions(-) (limited to 'app') diff --git a/app/views/ci/projects/show.html.haml b/app/views/ci/projects/show.html.haml index 888b1ea41d5..f5244696c5d 100644 --- a/app/views/ci/projects/show.html.haml +++ b/app/views/ci/projects/show.html.haml @@ -19,22 +19,6 @@ %li.pull-right = link_to 'Go to project', project_path(gl_project), class: 'btn btn-sm' -- if @ref - %p - Paste build status image for #{@ref} with next link - = link_to '#', class: 'badge-codes-toggle btn btn-default btn-xs' do - Status Badge - .badge-codes-block.bs-callout.bs-callout-info.hide - %p - Status badge for - %span.label.label-info #{@ref} - branch - %div - %label Markdown: - = text_field_tag 'badge_md', markdown_badge_code(@project, @ref), readonly: true, class: 'form-control' - %label Html: - = text_field_tag 'badge_html', html_badge_code(@project, @ref), readonly: true, class: 'form-control' - diff --git a/app/views/projects/ci_settings/_form.html.haml b/app/views/projects/ci_settings/_form.html.haml index 9f891f557a9..34125550206 100644 --- a/app/views/projects/ci_settings/_form.html.haml +++ b/app/views/projects/ci_settings/_form.html.haml @@ -8,6 +8,22 @@ Edit your #{link_to ".gitlab-ci.yml using web-editor", yaml_web_editor_link(@ci_project)} +- if @repository + %p + Paste build status image for #{@repository.root_ref} with next link + = link_to '#', class: 'badge-codes-toggle btn btn-default btn-xs' do + Status Badge + .badge-codes-block.bs-callout.bs-callout-info.hide + %p + Status badge for + %span.label.label-info #{@ref} + branch + %div + %label Markdown: + = text_field_tag 'badge_md', markdown_badge_code(@ci_project, @repository.root_ref), readonly: true, class: 'form-control' + %label Html: + = text_field_tag 'badge_html', html_badge_code(@ci_project, @repository.root_ref), readonly: true, class: 'form-control' + = nested_form_for @ci_project, url: namespace_project_ci_settings_path(@project.namespace, @project), html: { class: 'form-horizontal' } do |f| - if @ci_project.errors.any? #error_explanation -- cgit v1.2.1 From c0b79a751c8cbf676900956b14b70edd5dca5010 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 7 Oct 2015 14:35:54 +0200 Subject: Move no runners alert to project ci settings Signed-off-by: Dmitriy Zaporozhets --- app/views/ci/projects/_info.html.haml | 2 -- app/views/ci/projects/_no_runners.html.haml | 8 -------- app/views/projects/ci_settings/_no_runners.html.haml | 8 ++++++++ app/views/projects/ci_settings/edit.html.haml | 3 +++ 4 files changed, 11 insertions(+), 10 deletions(-) delete mode 100644 app/views/ci/projects/_no_runners.html.haml create mode 100644 app/views/projects/ci_settings/_no_runners.html.haml (limited to 'app') diff --git a/app/views/ci/projects/_info.html.haml b/app/views/ci/projects/_info.html.haml index 1888e1bde93..e69de29bb2d 100644 --- a/app/views/ci/projects/_info.html.haml +++ b/app/views/ci/projects/_info.html.haml @@ -1,2 +0,0 @@ -- if no_runners_for_project?(@project) - = render 'no_runners' diff --git a/app/views/ci/projects/_no_runners.html.haml b/app/views/ci/projects/_no_runners.html.haml deleted file mode 100644 index c0a296fb17d..00000000000 --- a/app/views/ci/projects/_no_runners.html.haml +++ /dev/null @@ -1,8 +0,0 @@ -.alert.alert-danger - %p - There are NO runners to build this project. - %br - You can add Specific runner for this project on Runners page - - - if current_user.is_admin - or add Shared runner for whole application in admin are. diff --git a/app/views/projects/ci_settings/_no_runners.html.haml b/app/views/projects/ci_settings/_no_runners.html.haml new file mode 100644 index 00000000000..33038c52978 --- /dev/null +++ b/app/views/projects/ci_settings/_no_runners.html.haml @@ -0,0 +1,8 @@ +.alert.alert-danger + %p + There are NO runners to build this project. + %br + You can add Specific runner for this project on Runners page + + - if current_user.admin + or add Shared runner for whole application in admin are. diff --git a/app/views/projects/ci_settings/edit.html.haml b/app/views/projects/ci_settings/edit.html.haml index e9040fe4337..eedf484bf00 100644 --- a/app/views/projects/ci_settings/edit.html.haml +++ b/app/views/projects/ci_settings/edit.html.haml @@ -6,6 +6,9 @@ yaml file which is based on your old jobs. Put this file to the root of your project and name it .gitlab-ci.yml +- if no_runners_for_project?(@ci_project) + = render 'no_runners' + = render 'form' - if @ci_project.generated_yaml_config -- cgit v1.2.1 From e52de6771f6bf9629fc85213b94ec60721354e80 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 7 Oct 2015 14:43:58 +0200 Subject: Remove Continuous Integration from project menu Signed-off-by: Dmitriy Zaporozhets --- app/controllers/ci/projects_controller.rb | 23 ++---------- app/views/ci/projects/_info.html.haml | 0 app/views/ci/projects/show.html.haml | 44 ----------------------- app/views/layouts/ci/_nav_project.html.haml | 6 ---- app/views/layouts/nav/_project.html.haml | 7 ---- app/views/layouts/nav/_project_settings.html.haml | 10 ++++++ 6 files changed, 13 insertions(+), 77 deletions(-) delete mode 100644 app/views/ci/projects/_info.html.haml delete mode 100644 app/views/ci/projects/show.html.haml (limited to 'app') diff --git a/app/controllers/ci/projects_controller.rb b/app/controllers/ci/projects_controller.rb index adb913a783f..5484ae643a6 100644 --- a/app/controllers/ci/projects_controller.rb +++ b/app/controllers/ci/projects_controller.rb @@ -1,27 +1,10 @@ module Ci class ProjectsController < Ci::ApplicationController - before_action :authenticate_user!, except: [:build, :badge, :show] - before_action :authenticate_public_page!, only: :show - before_action :project, only: [:build, :show, :badge, :toggle_shared_runners, :dumped_yaml] - before_action :authorize_access_project!, except: [:build, :badge, :show, :new] + before_action :authenticate_user!, except: [:build, :badge] + before_action :authorize_access_project!, except: [:badge] before_action :authorize_manage_project!, only: [:toggle_shared_runners, :dumped_yaml] - before_action :authenticate_token!, only: [:build] before_action :no_cache, only: [:badge] - protect_from_forgery except: :build - - layout 'ci/project', except: [:index] - - def show - @ref = params[:ref] - - @commits = @project.commits.reverse_order - if @ref - # unscope is required, because of default_scope defined in Ci::Build - builds = @project.builds.unscope(:select, :order).where(ref: @ref).select(:commit_id).distinct - @commits = @commits.where(id: builds) - end - @commits = @commits.page(params[:page]).per(20) - end + protect_from_forgery # Project status badge # Image with build status for sha or ref diff --git a/app/views/ci/projects/_info.html.haml b/app/views/ci/projects/_info.html.haml deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/app/views/ci/projects/show.html.haml b/app/views/ci/projects/show.html.haml deleted file mode 100644 index f5244696c5d..00000000000 --- a/app/views/ci/projects/show.html.haml +++ /dev/null @@ -1,44 +0,0 @@ -= render 'ci/shared/guide' unless @project.setup_finished? - -- if current_user && can?(current_user, :manage_project, gl_project) && !@project.any_runners? - .alert.alert-danger - Builds for this project wont be served unless you configure runners on - = link_to "Runners page", runners_path(@project.gl_project) - -%ul.nav.nav-tabs.append-bottom-20 - %li{class: ref_tab_class} - = link_to 'All commits', ci_project_path(@project) - - @project.tracked_refs.each do |ref| - %li{class: ref_tab_class(ref)} - = link_to ref, ci_project_path(@project, ref: ref) - - - if @ref && !@project.tracked_refs.include?(@ref) - %li{class: 'active'} - = link_to @ref, ci_project_path(@project, ref: @ref) - - %li.pull-right - = link_to 'Go to project', project_path(gl_project), class: 'btn btn-sm' - - - - -%table.table.builds - %thead - %tr - %th Status - %th Commit - %th Message - %th Branch - %th Total duration - %th Finished at - - if @project.coverage_enabled? - %th Coverage - - = render @commits - -= paginate @commits - -- if @commits.empty? - .bs-callout - %h4 No commits yet - diff --git a/app/views/layouts/ci/_nav_project.html.haml b/app/views/layouts/ci/_nav_project.html.haml index 545abc23d99..db631f24656 100644 --- a/app/views/layouts/ci/_nav_project.html.haml +++ b/app/views/layouts/ci/_nav_project.html.haml @@ -5,12 +5,6 @@ %span Back to project %li.separate-item - = nav_link path: ['projects#show', 'commits#show', 'builds#show'] do - = link_to ci_project_path(@project) do - = icon('list-alt fw') - %span - Commits - %span.count= @project.commits.count = nav_link path: ['services#index', 'services#edit'] do = link_to ci_project_services_path(@project) do = icon('share fw') diff --git a/app/views/layouts/nav/_project.html.haml b/app/views/layouts/nav/_project.html.haml index a218ec7486c..8ce46d4865b 100644 --- a/app/views/layouts/nav/_project.html.haml +++ b/app/views/layouts/nav/_project.html.haml @@ -76,13 +76,6 @@ Merge Requests %span.count.merge_counter= @project.merge_requests.opened.count - - if @project.gitlab_ci? - = nav_link(controller: [:ci, :project]) do - = link_to ci_project_path(@project.gitlab_ci_project), title: 'Continuous Integration', data: {placement: 'right'} do - = icon('building fw') - %span - Continuous Integration - - if project_nav_tab? :settings = nav_link(controller: [:project_members, :teams]) do = link_to namespace_project_project_members_path(@project.namespace, @project), title: 'Members', class: 'team-tab tab', data: {placement: 'right'} do diff --git a/app/views/layouts/nav/_project_settings.html.haml b/app/views/layouts/nav/_project_settings.html.haml index 9279a846623..f618a18870b 100644 --- a/app/views/layouts/nav/_project_settings.html.haml +++ b/app/views/layouts/nav/_project_settings.html.haml @@ -60,3 +60,13 @@ = icon('building fw') %span CI Settings + = nav_link path: ['ci/services#index', 'ci/services#edit'] do + = link_to ci_project_services_path(@project.gitlab_ci_project) do + = icon('share fw') + %span + CI Services + = nav_link path: 'events#index' do + = link_to ci_project_events_path(@project.gitlab_ci_project) do + = icon('book fw') + %span + CI Events -- cgit v1.2.1 From 7d220c1e7936b39affe1d819b7731c608795c7e9 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 7 Oct 2015 14:56:21 +0200 Subject: Remove test for removed page and add menu highlight for build page Signed-off-by: Dmitriy Zaporozhets --- app/views/layouts/nav/_project.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/views/layouts/nav/_project.html.haml b/app/views/layouts/nav/_project.html.haml index 8ce46d4865b..e4c285d8023 100644 --- a/app/views/layouts/nav/_project.html.haml +++ b/app/views/layouts/nav/_project.html.haml @@ -32,7 +32,7 @@ Files - if project_nav_tab? :commits - = nav_link(controller: %w(commit commits compare repositories tags branches)) do + = nav_link(controller: %w(commit commits compare repositories tags branches builds)) do = link_to project_commits_path(@project), title: 'Commits', class: 'shortcuts-commits', data: {placement: 'right'} do = icon('history fw') %span -- cgit v1.2.1 From 3fa2cb93353720e1b70e01ec9e664ebf54d1fc29 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 7 Oct 2015 14:59:37 +0200 Subject: Remove unused JS Signed-off-by: Dmitriy Zaporozhets --- app/assets/javascripts/ci/Chart.min.js | 39 ---------------------------- app/assets/javascripts/ci/projects.js.coffee | 3 --- 2 files changed, 42 deletions(-) delete mode 100644 app/assets/javascripts/ci/Chart.min.js (limited to 'app') diff --git a/app/assets/javascripts/ci/Chart.min.js b/app/assets/javascripts/ci/Chart.min.js deleted file mode 100644 index ab635881087..00000000000 --- a/app/assets/javascripts/ci/Chart.min.js +++ /dev/null @@ -1,39 +0,0 @@ -var Chart=function(s){function v(a,c,b){a=A((a-c.graphMin)/(c.steps*c.stepValue),1,0);return b*c.steps*a}function x(a,c,b,e){function h(){g+=f;var k=a.animation?A(d(g),null,0):1;e.clearRect(0,0,q,u);a.scaleOverlay?(b(k),c()):(c(),b(k));if(1>=g)D(h);else if("function"==typeof a.onAnimationComplete)a.onAnimationComplete()}var f=a.animation?1/A(a.animationSteps,Number.MAX_VALUE,1):1,d=B[a.animationEasing],g=a.animation?0:1;"function"!==typeof c&&(c=function(){});D(h)}function C(a,c,b,e,h,f){var d;a= -Math.floor(Math.log(e-h)/Math.LN10);h=Math.floor(h/(1*Math.pow(10,a)))*Math.pow(10,a);e=Math.ceil(e/(1*Math.pow(10,a)))*Math.pow(10,a)-h;a=Math.pow(10,a);for(d=Math.round(e/a);dc;)a=dc?c:!isNaN(parseFloat(b))&& -isFinite(b)&&a)[^\t]*)'/g,"$1\r").replace(/\t=(.*?)%>/g,"',$1,'").split("\t").join("');").split("%>").join("p.push('").split("\r").join("\\'")+"');}return p.join('');");return c? -b(c):b}var r=this,B={linear:function(a){return a},easeInQuad:function(a){return a*a},easeOutQuad:function(a){return-1*a*(a-2)},easeInOutQuad:function(a){return 1>(a/=0.5)?0.5*a*a:-0.5*(--a*(a-2)-1)},easeInCubic:function(a){return a*a*a},easeOutCubic:function(a){return 1*((a=a/1-1)*a*a+1)},easeInOutCubic:function(a){return 1>(a/=0.5)?0.5*a*a*a:0.5*((a-=2)*a*a+2)},easeInQuart:function(a){return a*a*a*a},easeOutQuart:function(a){return-1*((a=a/1-1)*a*a*a-1)},easeInOutQuart:function(a){return 1>(a/=0.5)? -0.5*a*a*a*a:-0.5*((a-=2)*a*a*a-2)},easeInQuint:function(a){return 1*(a/=1)*a*a*a*a},easeOutQuint:function(a){return 1*((a=a/1-1)*a*a*a*a+1)},easeInOutQuint:function(a){return 1>(a/=0.5)?0.5*a*a*a*a*a:0.5*((a-=2)*a*a*a*a+2)},easeInSine:function(a){return-1*Math.cos(a/1*(Math.PI/2))+1},easeOutSine:function(a){return 1*Math.sin(a/1*(Math.PI/2))},easeInOutSine:function(a){return-0.5*(Math.cos(Math.PI*a/1)-1)},easeInExpo:function(a){return 0==a?1:1*Math.pow(2,10*(a/1-1))},easeOutExpo:function(a){return 1== -a?1:1*(-Math.pow(2,-10*a/1)+1)},easeInOutExpo:function(a){return 0==a?0:1==a?1:1>(a/=0.5)?0.5*Math.pow(2,10*(a-1)):0.5*(-Math.pow(2,-10*--a)+2)},easeInCirc:function(a){return 1<=a?a:-1*(Math.sqrt(1-(a/=1)*a)-1)},easeOutCirc:function(a){return 1*Math.sqrt(1-(a=a/1-1)*a)},easeInOutCirc:function(a){return 1>(a/=0.5)?-0.5*(Math.sqrt(1-a*a)-1):0.5*(Math.sqrt(1-(a-=2)*a)+1)},easeInElastic:function(a){var c=1.70158,b=0,e=1;if(0==a)return 0;if(1==(a/=1))return 1;b||(b=0.3);ea?-0.5*e*Math.pow(2,10* -(a-=1))*Math.sin((1*a-c)*2*Math.PI/b):0.5*e*Math.pow(2,-10*(a-=1))*Math.sin((1*a-c)*2*Math.PI/b)+1},easeInBack:function(a){return 1*(a/=1)*a*(2.70158*a-1.70158)},easeOutBack:function(a){return 1*((a=a/1-1)*a*(2.70158*a+1.70158)+1)},easeInOutBack:function(a){var c=1.70158;return 1>(a/=0.5)?0.5*a*a*(((c*=1.525)+1)*a-c):0.5*((a-=2)*a*(((c*=1.525)+1)*a+c)+2)},easeInBounce:function(a){return 1-B.easeOutBounce(1-a)},easeOutBounce:function(a){return(a/=1)<1/2.75?1*7.5625*a*a:a<2/2.75?1*(7.5625*(a-=1.5/2.75)* -a+0.75):a<2.5/2.75?1*(7.5625*(a-=2.25/2.75)*a+0.9375):1*(7.5625*(a-=2.625/2.75)*a+0.984375)},easeInOutBounce:function(a){return 0.5>a?0.5*B.easeInBounce(2*a):0.5*B.easeOutBounce(2*a-1)+0.5}},q=s.canvas.width,u=s.canvas.height;window.devicePixelRatio&&(s.canvas.style.width=q+"px",s.canvas.style.height=u+"px",s.canvas.height=u*window.devicePixelRatio,s.canvas.width=q*window.devicePixelRatio,s.scale(window.devicePixelRatio,window.devicePixelRatio));this.PolarArea=function(a,c){r.PolarArea.defaults={scaleOverlay:!0, -scaleOverride:!1,scaleSteps:null,scaleStepWidth:null,scaleStartValue:null,scaleShowLine:!0,scaleLineColor:"rgba(0,0,0,.1)",scaleLineWidth:1,scaleShowLabels:!0,scaleLabel:"<%=value%>",scaleFontFamily:"'Arial'",scaleFontSize:12,scaleFontStyle:"normal",scaleFontColor:"#666",scaleShowLabelBackdrop:!0,scaleBackdropColor:"rgba(255,255,255,0.75)",scaleBackdropPaddingY:2,scaleBackdropPaddingX:2,segmentShowStroke:!0,segmentStrokeColor:"#fff",segmentStrokeWidth:2,animation:!0,animationSteps:100,animationEasing:"easeOutBounce", -animateRotate:!0,animateScale:!1,onAnimationComplete:null};var b=c?y(r.PolarArea.defaults,c):r.PolarArea.defaults;return new G(a,b,s)};this.Radar=function(a,c){r.Radar.defaults={scaleOverlay:!1,scaleOverride:!1,scaleSteps:null,scaleStepWidth:null,scaleStartValue:null,scaleShowLine:!0,scaleLineColor:"rgba(0,0,0,.1)",scaleLineWidth:1,scaleShowLabels:!1,scaleLabel:"<%=value%>",scaleFontFamily:"'Arial'",scaleFontSize:12,scaleFontStyle:"normal",scaleFontColor:"#666",scaleShowLabelBackdrop:!0,scaleBackdropColor:"rgba(255,255,255,0.75)", -scaleBackdropPaddingY:2,scaleBackdropPaddingX:2,angleShowLineOut:!0,angleLineColor:"rgba(0,0,0,.1)",angleLineWidth:1,pointLabelFontFamily:"'Arial'",pointLabelFontStyle:"normal",pointLabelFontSize:12,pointLabelFontColor:"#666",pointDot:!0,pointDotRadius:3,pointDotStrokeWidth:1,datasetStroke:!0,datasetStrokeWidth:2,datasetFill:!0,animation:!0,animationSteps:60,animationEasing:"easeOutQuart",onAnimationComplete:null};var b=c?y(r.Radar.defaults,c):r.Radar.defaults;return new H(a,b,s)};this.Pie=function(a, -c){r.Pie.defaults={segmentShowStroke:!0,segmentStrokeColor:"#fff",segmentStrokeWidth:2,animation:!0,animationSteps:100,animationEasing:"easeOutBounce",animateRotate:!0,animateScale:!1,onAnimationComplete:null};var b=c?y(r.Pie.defaults,c):r.Pie.defaults;return new I(a,b,s)};this.Doughnut=function(a,c){r.Doughnut.defaults={segmentShowStroke:!0,segmentStrokeColor:"#fff",segmentStrokeWidth:2,percentageInnerCutout:50,animation:!0,animationSteps:100,animationEasing:"easeOutBounce",animateRotate:!0,animateScale:!1, -onAnimationComplete:null};var b=c?y(r.Doughnut.defaults,c):r.Doughnut.defaults;return new J(a,b,s)};this.Line=function(a,c){r.Line.defaults={scaleOverlay:!1,scaleOverride:!1,scaleSteps:null,scaleStepWidth:null,scaleStartValue:null,scaleLineColor:"rgba(0,0,0,.1)",scaleLineWidth:1,scaleShowLabels:!0,scaleLabel:"<%=value%>",scaleFontFamily:"'Arial'",scaleFontSize:12,scaleFontStyle:"normal",scaleFontColor:"#666",scaleShowGridLines:!0,scaleGridLineColor:"rgba(0,0,0,.05)",scaleGridLineWidth:1,bezierCurve:!0, -pointDot:!0,pointDotRadius:4,pointDotStrokeWidth:2,datasetStroke:!0,datasetStrokeWidth:2,datasetFill:!0,animation:!0,animationSteps:60,animationEasing:"easeOutQuart",onAnimationComplete:null};var b=c?y(r.Line.defaults,c):r.Line.defaults;return new K(a,b,s)};this.Bar=function(a,c){r.Bar.defaults={scaleOverlay:!1,scaleOverride:!1,scaleSteps:null,scaleStepWidth:null,scaleStartValue:null,scaleLineColor:"rgba(0,0,0,.1)",scaleLineWidth:1,scaleShowLabels:!0,scaleLabel:"<%=value%>",scaleFontFamily:"'Arial'", -scaleFontSize:12,scaleFontStyle:"normal",scaleFontColor:"#666",scaleShowGridLines:!0,scaleGridLineColor:"rgba(0,0,0,.05)",scaleGridLineWidth:1,barShowStroke:!0,barStrokeWidth:2,barValueSpacing:5,barDatasetSpacing:1,animation:!0,animationSteps:60,animationEasing:"easeOutQuart",onAnimationComplete:null};var b=c?y(r.Bar.defaults,c):r.Bar.defaults;return new L(a,b,s)};var G=function(a,c,b){var e,h,f,d,g,k,j,l,m;g=Math.min.apply(Math,[q,u])/2;g-=Math.max.apply(Math,[0.5*c.scaleFontSize,0.5*c.scaleLineWidth]); -d=2*c.scaleFontSize;c.scaleShowLabelBackdrop&&(d+=2*c.scaleBackdropPaddingY,g-=1.5*c.scaleBackdropPaddingY);l=g;d=d?d:5;e=Number.MIN_VALUE;h=Number.MAX_VALUE;for(f=0;fe&&(e=a[f].value),a[f].valuel&&(l=h);g-=Math.max.apply(Math,[l,1.5*(c.pointLabelFontSize/2)]);g-=c.pointLabelFontSize;l=g=A(g,null,0);d=d?d:5;e=Number.MIN_VALUE; -h=Number.MAX_VALUE;for(f=0;fe&&(e=a.datasets[f].data[m]),a.datasets[f].data[m]Math.PI?"right":"left";b.textBaseline="middle";b.fillText(a.labels[d],f,-h)}b.restore()},function(d){var e=2*Math.PI/a.datasets[0].data.length;b.save();b.translate(q/2,u/2);for(var g=0;gt?e:t;q/a.labels.lengthe&&(e=a.datasets[f].data[l]),a.datasets[f].data[l]d?h:d;d+=10}r=q-d-t;m=Math.floor(r/(a.labels.length-1));n=q-t/2-r;p=g+c.scaleFontSize/2;x(c,function(){b.lineWidth=c.scaleLineWidth;b.strokeStyle=c.scaleLineColor;b.beginPath();b.moveTo(q-t/2+5,p);b.lineTo(q-t/2-r-5,p);b.stroke();0t?e:t;q/a.labels.lengthe&&(e=a.datasets[f].data[l]),a.datasets[f].data[l]< -h&&(h=a.datasets[f].data[l]);f=Math.floor(g/(0.66*d));d=Math.floor(0.5*(g/d));l=c.scaleShowLabels?c.scaleLabel:"";c.scaleOverride?(j={steps:c.scaleSteps,stepValue:c.scaleStepWidth,graphMin:c.scaleStartValue,labels:[]},z(l,j.labels,j.steps,c.scaleStartValue,c.scaleStepWidth)):j=C(g,f,d,e,h,l);k=Math.floor(g/j.steps);d=1;if(c.scaleShowLabels){b.font=c.scaleFontStyle+" "+c.scaleFontSize+"px "+c.scaleFontFamily;for(e=0;ed?h:d;d+=10}r=q-d-t;m= -Math.floor(r/a.labels.length);s=(m-2*c.scaleGridLineWidth-2*c.barValueSpacing-(c.barDatasetSpacing*a.datasets.length-1)-(c.barStrokeWidth/2*a.datasets.length-1))/a.datasets.length;n=q-t/2-r;p=g+c.scaleFontSize/2;x(c,function(){b.lineWidth=c.scaleLineWidth;b.strokeStyle=c.scaleLineColor;b.beginPath();b.moveTo(q-t/2+5,p);b.lineTo(q-t/2-r-5,p);b.stroke();0 $('.badge-codes-block').toggleClass("hide") return false - -$(document).on 'click', '.sync-now', -> - $(this).find('i').addClass('fa-spin') -- cgit v1.2.1 From 1e06cabf4a8fa4d4c7acb9898682a5b4b41a9f58 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 7 Oct 2015 15:24:32 +0200 Subject: Remove Ci::Commit and Ci::Build controllers Signed-off-by: Dmitriy Zaporozhets --- app/controllers/ci/builds_controller.rb | 52 --------------------------- app/controllers/ci/commits_controller.rb | 32 ----------------- app/controllers/projects/builds_controller.rb | 30 ++++++++++++++++ app/controllers/projects/commit_controller.rb | 8 +++++ app/views/projects/builds/_build.html.haml | 4 +-- app/views/projects/builds/show.html.haml | 4 +-- app/views/projects/commit/ci.html.haml | 2 +- 7 files changed, 43 insertions(+), 89 deletions(-) delete mode 100644 app/controllers/ci/builds_controller.rb delete mode 100644 app/controllers/ci/commits_controller.rb (limited to 'app') diff --git a/app/controllers/ci/builds_controller.rb b/app/controllers/ci/builds_controller.rb deleted file mode 100644 index b0b8b62fced..00000000000 --- a/app/controllers/ci/builds_controller.rb +++ /dev/null @@ -1,52 +0,0 @@ -module Ci - class BuildsController < Ci::ApplicationController - before_action :authenticate_user!, except: [:status] - before_action :project - before_action :authorize_access_project!, except: [:status] - before_action :authorize_manage_project!, except: [:status, :retry, :cancel] - before_action :authorize_manage_builds!, only: [:retry, :cancel] - before_action :build - - def retry - if @build.commands.blank? - return page_404 - end - - build = Ci::Build.retry(@build) - - if params[:return_to] - redirect_to URI.parse(params[:return_to]).path - else - redirect_to build_path(build) - end - end - - def status - render json: @build.to_json(only: [:status, :id, :sha, :coverage], methods: :sha) - end - - def cancel - @build.cancel - - redirect_to build_path(@build) - end - - protected - - def project - @project = Ci::Project.find(params[:project_id]) - end - - def build - @build ||= project.builds.unscoped.find_by!(id: params[:id]) - end - - def commit_by_sha - @project.commits.find_by(sha: params[:id]) - end - - def build_path(build) - namespace_project_build_path(build.gl_project.namespace, build.gl_project, build) - end - end -end diff --git a/app/controllers/ci/commits_controller.rb b/app/controllers/ci/commits_controller.rb deleted file mode 100644 index 7e6705c9702..00000000000 --- a/app/controllers/ci/commits_controller.rb +++ /dev/null @@ -1,32 +0,0 @@ -module Ci - class CommitsController < Ci::ApplicationController - before_action :authenticate_user!, except: [:status, :show] - before_action :authenticate_public_page!, only: :show - before_action :project - before_action :authorize_access_project!, except: [:status, :show, :cancel] - before_action :authorize_manage_builds!, only: [:cancel] - - def status - commit = Ci::Project.find(params[:project_id]).commits.find_by_sha!(params[:id]) - render json: commit.to_json(only: [:id, :sha], methods: [:status, :coverage]) - rescue ActiveRecord::RecordNotFound - render json: { status: "not_found" } - end - - def cancel - commit.builds.running_or_pending.each(&:cancel) - - redirect_to namespace_project_commit_path(commit.gl_project.namespace, commit.gl_project, commit.sha) - end - - private - - def project - @project ||= Ci::Project.find(params[:project_id]) - end - - def commit - @commit ||= Ci::Project.find(params[:project_id]).commits.find_by_sha!(params[:id]) - end - end -end diff --git a/app/controllers/projects/builds_controller.rb b/app/controllers/projects/builds_controller.rb index 76c7f31f61b..4e4ac6689d3 100644 --- a/app/controllers/projects/builds_controller.rb +++ b/app/controllers/projects/builds_controller.rb @@ -2,6 +2,8 @@ class Projects::BuildsController < Projects::ApplicationController before_action :ci_project before_action :build + before_action :authorize_admin_project!, except: [:show, :status] + layout "project" def show @@ -17,9 +19,37 @@ class Projects::BuildsController < Projects::ApplicationController end end + def retry + if @build.commands.blank? + return page_404 + end + + build = Ci::Build.retry(@build) + + if params[:return_to] + redirect_to URI.parse(params[:return_to]).path + else + redirect_to build_path(build) + end + end + + def status + render json: @build.to_json(only: [:status, :id, :sha, :coverage], methods: :sha) + end + + def cancel + @build.cancel + + redirect_to build_path(@build) + end + private def build @build ||= ci_project.builds.unscoped.find_by!(id: params[:id]) end + + def build_path(build) + namespace_project_build_path(build.gl_project.namespace, build.gl_project, build) + end end diff --git a/app/controllers/projects/commit_controller.rb b/app/controllers/projects/commit_controller.rb index 1938c63c10c..c08a90bddf0 100644 --- a/app/controllers/projects/commit_controller.rb +++ b/app/controllers/projects/commit_controller.rb @@ -38,6 +38,14 @@ class Projects::CommitController < Projects::ApplicationController @ci_project = @project.gitlab_ci_project end + def cancel_builds + @ci_commit = @project.ci_commit(@commit.sha) + @ci_commit.builds.running_or_pending.each(&:cancel) + + redirect_to namespace_project_commit_path(project.namespace, project, commit.sha) + end + + def branches @branches = @project.repository.branch_names_contains(commit.id) @tags = @project.repository.tag_names_contains(commit.id) diff --git a/app/views/projects/builds/_build.html.haml b/app/views/projects/builds/_build.html.haml index 21c543b38dd..65fd9413b60 100644 --- a/app/views/projects/builds/_build.html.haml +++ b/app/views/projects/builds/_build.html.haml @@ -43,8 +43,8 @@ - if defined?(controls) && current_user && can?(current_user, :manage_builds, gl_project) .pull-right - if build.active? - = link_to cancel_ci_project_build_path(build.project, build, return_to: request.original_url), title: 'Cancel build' do + = link_to cancel_namespace_project_build_path(gl_project.namespace, gl_project, build, return_to: request.original_url), title: 'Cancel build' do %i.fa.fa-remove.cred - elsif build.commands.present? - = link_to retry_ci_project_build_path(build.project, build, return_to: request.original_url), method: :post, title: 'Retry build' do + = link_to retry_namespace_project_build_path(gl_project.namespace, gl_project, build, return_to: request.original_url), method: :post, title: 'Retry build' do %i.fa.fa-repeat diff --git a/app/views/projects/builds/show.html.haml b/app/views/projects/builds/show.html.haml index 93cd4dcfd93..b561078e8c7 100644 --- a/app/views/projects/builds/show.html.haml +++ b/app/views/projects/builds/show.html.haml @@ -72,9 +72,9 @@ - if current_user && can?(current_user, :manage_builds, @project) .pull-right - if @build.active? - = link_to "Cancel", cancel_ci_project_build_path(@ci_project, @build), class: 'btn btn-sm btn-danger' + = link_to "Cancel", cancel_namespace_project_build_path(@project.namespace, @project, @build), class: 'btn btn-sm btn-danger' - elsif @build.commands.present? - = link_to "Retry", retry_ci_project_build_path(@ci_project, @build), class: 'btn btn-sm btn-primary', method: :post + = link_to "Retry", retry_namespace_project_build_path(@project.namespace, @project, @build), class: 'btn btn-sm btn-primary', method: :post - if @build.duration %p diff --git a/app/views/projects/commit/ci.html.haml b/app/views/projects/commit/ci.html.haml index f4382e88046..26ab38445c2 100644 --- a/app/views/projects/commit/ci.html.haml +++ b/app/views/projects/commit/ci.html.haml @@ -6,7 +6,7 @@ - if @ci_project && current_user && can?(current_user, :manage_builds, @project) .pull-right - if @ci_commit.builds.running_or_pending.any? - = link_to "Cancel", cancel_ci_project_commits_path(@ci_project, @ci_commit), class: 'btn btn-sm btn-danger' + = link_to "Cancel", cancel_builds_namespace_project_commit_path(@project.namespace, @project, @commit.sha), class: 'btn btn-sm btn-danger' - if @ci_commit.yaml_errors.present? -- cgit v1.2.1 From 75bb1087df785e75fb343a9e8721e8d636f7ce81 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Tue, 6 Oct 2015 21:08:27 -0700 Subject: Allow removing of project without confirmation when JavaScript is disabled Closes #2485 --- app/views/projects/edit.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/views/projects/edit.html.haml b/app/views/projects/edit.html.haml index 90dce739992..1882a82fba5 100644 --- a/app/views/projects/edit.html.haml +++ b/app/views/projects/edit.html.haml @@ -193,13 +193,13 @@ .panel.panel-default.panel.panel-danger .panel-heading Remove project .panel-body - = form_tag(namespace_project_path(@project.namespace, @project), method: :delete, html: { class: 'form-horizontal'}) do + = form_tag(namespace_project_path(@project.namespace, @project), method: :delete, class: 'form-horizontal') do %p Removing the project will delete its repository and all related resources including issues, merge requests etc. %br %strong Removed projects cannot be restored! - = link_to 'Remove project', '#', class: "btn btn-remove js-confirm-danger", data: { "confirm-danger-message" => remove_project_message(@project) } + = button_to 'Remove project', '#', class: "btn btn-remove js-confirm-danger", data: { "confirm-danger-message" => remove_project_message(@project) } - else .nothing-here-block Only project owner can remove a project -- cgit v1.2.1 From a30b68fe1ded96c5aafe4348d1afec269354c469 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 7 Oct 2015 16:20:31 +0200 Subject: Move CI services to project settings area Signed-off-by: Dmitriy Zaporozhets --- app/controllers/ci/services_controller.rb | 59 ---------------------- app/controllers/projects/ci_services_controller.rb | 49 ++++++++++++++++++ app/views/ci/services/_form.html.haml | 57 --------------------- app/views/ci/services/edit.html.haml | 1 - app/views/ci/services/index.html.haml | 22 -------- app/views/layouts/ci/_nav_project.html.haml | 5 -- app/views/layouts/nav/_project_settings.html.haml | 4 +- app/views/projects/ci_services/_form.html.haml | 54 ++++++++++++++++++++ app/views/projects/ci_services/edit.html.haml | 1 + app/views/projects/ci_services/index.html.haml | 22 ++++++++ 10 files changed, 128 insertions(+), 146 deletions(-) delete mode 100644 app/controllers/ci/services_controller.rb create mode 100644 app/controllers/projects/ci_services_controller.rb delete mode 100644 app/views/ci/services/_form.html.haml delete mode 100644 app/views/ci/services/edit.html.haml delete mode 100644 app/views/ci/services/index.html.haml create mode 100644 app/views/projects/ci_services/_form.html.haml create mode 100644 app/views/projects/ci_services/edit.html.haml create mode 100644 app/views/projects/ci_services/index.html.haml (limited to 'app') diff --git a/app/controllers/ci/services_controller.rb b/app/controllers/ci/services_controller.rb deleted file mode 100644 index 52c96a34ce8..00000000000 --- a/app/controllers/ci/services_controller.rb +++ /dev/null @@ -1,59 +0,0 @@ -module Ci - class ServicesController < Ci::ApplicationController - before_action :authenticate_user! - before_action :project - before_action :authorize_access_project! - before_action :authorize_manage_project! - before_action :service, only: [:edit, :update, :test] - - respond_to :html - - layout 'ci/project' - - def index - @project.build_missing_services - @services = @project.services.reload - end - - def edit - end - - def update - if @service.update_attributes(service_params) - redirect_to edit_ci_project_service_path(@project, @service.to_param) - else - render 'edit' - end - end - - def test - last_build = @project.builds.last - - if @service.execute(last_build) - message = { notice: 'We successfully tested the service' } - else - message = { alert: 'We tried to test the service but error occurred' } - end - - redirect_to :back, message - end - - private - - def project - @project = Ci::Project.find(params[:project_id]) - end - - def service - @service ||= @project.services.find { |service| service.to_param == params[:id] } - end - - def service_params - params.require(:service).permit( - :type, :active, :webhook, :notify_only_broken_builds, - :email_recipients, :email_only_broken_builds, :email_add_pusher, - :hipchat_token, :hipchat_room, :hipchat_server - ) - end - end -end diff --git a/app/controllers/projects/ci_services_controller.rb b/app/controllers/projects/ci_services_controller.rb new file mode 100644 index 00000000000..6d2756eba3d --- /dev/null +++ b/app/controllers/projects/ci_services_controller.rb @@ -0,0 +1,49 @@ +class Projects::CiServicesController < Projects::ApplicationController + before_action :ci_project + before_action :authorize_admin_project! + + layout "project_settings" + + def index + @ci_project.build_missing_services + @services = @ci_project.services.reload + end + + def edit + service + end + + def update + if @service.update_attributes(service_params) + redirect_to edit_namespace_project_ci_service_path(@project, @project.namespace, @service.to_param) + else + render 'edit' + end + end + + def test + last_build = @project.builds.last + + if @service.execute(last_build) + message = { notice: 'We successfully tested the service' } + else + message = { alert: 'We tried to test the service but error occurred' } + end + + redirect_to :back, message + end + + private + + def service + @service ||= @ci_project.services.find { |service| service.to_param == params[:id] } + end + + def service_params + params.require(:service).permit( + :type, :active, :webhook, :notify_only_broken_builds, + :email_recipients, :email_only_broken_builds, :email_add_pusher, + :hipchat_token, :hipchat_room, :hipchat_server + ) + end +end diff --git a/app/views/ci/services/_form.html.haml b/app/views/ci/services/_form.html.haml deleted file mode 100644 index 9110aaa0528..00000000000 --- a/app/views/ci/services/_form.html.haml +++ /dev/null @@ -1,57 +0,0 @@ -%h3.page-title - = @service.title - = boolean_to_icon @service.activated? - -%p= @service.description - -.back-link - = link_to ci_project_services_path(@project) do - ← to services - -%hr - -= form_for(@service, as: :service, url: ci_project_service_path(@project, @service.to_param), method: :put, html: { class: 'form-horizontal' }) do |f| - - if @service.errors.any? - .alert.alert-danger - %ul - - @service.errors.full_messages.each do |msg| - %li= msg - - - if @service.help.present? - .bs-callout - = @service.help - - .form-group - = f.label :active, "Active", class: "control-label" - .col-sm-10 - = f.check_box :active - - - @service.fields.each do |field| - - name = field[:name] - - label = field[:label] || name - - value = @service.send(name) - - type = field[:type] - - placeholder = field[:placeholder] - - choices = field[:choices] - - default_choice = field[:default_choice] - - help = field[:help] - - .form-group - = f.label label, class: "control-label" - .col-sm-10 - - if type == 'text' - = f.text_field name, class: "form-control", placeholder: placeholder - - elsif type == 'textarea' - = f.text_area name, rows: 5, class: "form-control", placeholder: placeholder - - elsif type == 'checkbox' - = f.check_box name - - elsif type == 'select' - = f.select name, options_for_select(choices, value ? value : default_choice), {}, { class: "form-control" } - - if help - .light #{help} - - .form-actions - = f.submit 'Save', class: 'btn btn-save' -   - - if @service.valid? && @service.activated? && @service.can_test? - = link_to 'Test settings', test_ci_project_service_path(@project, @service.to_param), class: 'btn' diff --git a/app/views/ci/services/edit.html.haml b/app/views/ci/services/edit.html.haml deleted file mode 100644 index bcc5832792f..00000000000 --- a/app/views/ci/services/edit.html.haml +++ /dev/null @@ -1 +0,0 @@ -= render 'form' diff --git a/app/views/ci/services/index.html.haml b/app/views/ci/services/index.html.haml deleted file mode 100644 index 37e5723b541..00000000000 --- a/app/views/ci/services/index.html.haml +++ /dev/null @@ -1,22 +0,0 @@ -%h3.page-title Project services -%p.light Project services allow you to integrate GitLab CI with other applications - -%table.table - %thead - %tr - %th - %th Service - %th Desription - %th Last edit - - @services.sort_by(&:title).each do |service| - %tr - %td - = boolean_to_icon service.activated? - %td - = link_to edit_ci_project_service_path(@project, service.to_param) do - %strong= service.title - %td - = service.description - %td.light - = time_ago_in_words service.updated_at - ago diff --git a/app/views/layouts/ci/_nav_project.html.haml b/app/views/layouts/ci/_nav_project.html.haml index db631f24656..f094edbfa87 100644 --- a/app/views/layouts/ci/_nav_project.html.haml +++ b/app/views/layouts/ci/_nav_project.html.haml @@ -5,11 +5,6 @@ %span Back to project %li.separate-item - = nav_link path: ['services#index', 'services#edit'] do - = link_to ci_project_services_path(@project) do - = icon('share fw') - %span - Services = nav_link path: 'events#index' do = link_to ci_project_events_path(@project) do = icon('book fw') diff --git a/app/views/layouts/nav/_project_settings.html.haml b/app/views/layouts/nav/_project_settings.html.haml index f618a18870b..954dbe5d2b9 100644 --- a/app/views/layouts/nav/_project_settings.html.haml +++ b/app/views/layouts/nav/_project_settings.html.haml @@ -60,8 +60,8 @@ = icon('building fw') %span CI Settings - = nav_link path: ['ci/services#index', 'ci/services#edit'] do - = link_to ci_project_services_path(@project.gitlab_ci_project) do + = nav_link controller: 'ci_services' do + = link_to namespace_project_ci_services_path(@project.namespace, @project) do = icon('share fw') %span CI Services diff --git a/app/views/projects/ci_services/_form.html.haml b/app/views/projects/ci_services/_form.html.haml new file mode 100644 index 00000000000..397832e56db --- /dev/null +++ b/app/views/projects/ci_services/_form.html.haml @@ -0,0 +1,54 @@ +%h3.page-title + = @service.title + = boolean_to_icon @service.activated? + +%p= @service.description + + +%hr + += form_for(@service, as: :service, url: namespace_project_ci_service_path(@project.namespace, @project, @service.to_param), method: :put, html: { class: 'form-horizontal' }) do |f| + - if @service.errors.any? + .alert.alert-danger + %ul + - @service.errors.full_messages.each do |msg| + %li= msg + + - if @service.help.present? + .bs-callout + = @service.help + + .form-group + = f.label :active, "Active", class: "control-label" + .col-sm-10 + = f.check_box :active + + - @service.fields.each do |field| + - name = field[:name] + - label = field[:label] || name + - value = @service.send(name) + - type = field[:type] + - placeholder = field[:placeholder] + - choices = field[:choices] + - default_choice = field[:default_choice] + - help = field[:help] + + .form-group + = f.label label, class: "control-label" + .col-sm-10 + - if type == 'text' + = f.text_field name, class: "form-control", placeholder: placeholder + - elsif type == 'textarea' + = f.text_area name, rows: 5, class: "form-control", placeholder: placeholder + - elsif type == 'checkbox' + = f.check_box name + - elsif type == 'select' + = f.select name, options_for_select(choices, value ? value : default_choice), {}, { class: "form-control" } + - if help + .light #{help} + + .form-actions + = f.submit 'Save', class: 'btn btn-save' +   + - if @service.valid? && @service.activated? && @service.can_test? + = link_to 'Test settings', test_namespace_project_ci_service_path(@project.namespace, @project, @service.to_param), class: 'btn' diff --git a/app/views/projects/ci_services/edit.html.haml b/app/views/projects/ci_services/edit.html.haml new file mode 100644 index 00000000000..bcc5832792f --- /dev/null +++ b/app/views/projects/ci_services/edit.html.haml @@ -0,0 +1 @@ += render 'form' diff --git a/app/views/projects/ci_services/index.html.haml b/app/views/projects/ci_services/index.html.haml new file mode 100644 index 00000000000..c78b21884a3 --- /dev/null +++ b/app/views/projects/ci_services/index.html.haml @@ -0,0 +1,22 @@ +%h3.page-title Project services +%p.light Project services allow you to integrate GitLab CI with other applications + +%table.table + %thead + %tr + %th + %th Service + %th Desription + %th Last edit + - @services.sort_by(&:title).each do |service| + %tr + %td + = boolean_to_icon service.activated? + %td + = link_to edit_namespace_project_ci_service_path(@project.namespace, @project, service.to_param) do + %strong= service.title + %td + = service.description + %td.light + = time_ago_in_words service.updated_at + ago -- cgit v1.2.1 From dfbbc80611fbdafe6f5ed809f98fc63987d104a6 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Tue, 6 Oct 2015 09:57:13 -0700 Subject: Support filtering by "Any" milestone or issue and fix "No Milestone" and "No Label" filters Closes #2619 Closes https://github.com/gitlabhq/gitlabhq/issues/9631 --- app/finders/issuable_finder.rb | 28 +++++++++++++++++++++------- app/helpers/labels_helper.rb | 4 +++- app/models/label.rb | 3 +++ app/views/shared/issuable/_filter.html.haml | 4 ++-- 4 files changed, 29 insertions(+), 10 deletions(-) (limited to 'app') diff --git a/app/finders/issuable_finder.rb b/app/finders/issuable_finder.rb index 6aa16673d63..97c7e74c294 100644 --- a/app/finders/issuable_finder.rb +++ b/app/finders/issuable_finder.rb @@ -72,11 +72,15 @@ class IssuableFinder params[:milestone_title].present? end + def no_milestones? + milestones? && params[:milestone_title] == Milestone::None.title + end + def milestones return @milestones if defined?(@milestones) @milestones = - if milestones? && params[:milestone_title] != Milestone::None.title + if milestones? Milestone.where(title: params[:milestone_title]) else nil @@ -183,7 +187,11 @@ class IssuableFinder def by_milestone(items) if milestones? - items = items.where(milestone_id: milestones.try(:pluck, :id)) + if no_milestones? + items = items.where(milestone_id: [-1, nil]) + else + items = items.where(milestone_id: milestones.try(:pluck, :id)) + end end items @@ -207,13 +215,19 @@ class IssuableFinder def by_label(items) if params[:label_name].present? - label_names = params[:label_name].split(",") + if params[:label_name] == Label::None.title + item_ids = LabelLink.where(target_type: klass.name).pluck(:target_id) - item_ids = LabelLink.joins(:label). - where('labels.title in (?)', label_names). - where(target_type: klass.name).pluck(:target_id) + items = items.where('id NOT IN (?)', item_ids) + else + label_names = params[:label_name].split(",") + + item_ids = LabelLink.joins(:label). + where('labels.title in (?)', label_names). + where(target_type: klass.name).pluck(:target_id) - items = items.where(id: item_ids) + items = items.where(id: item_ids) + end end items diff --git a/app/helpers/labels_helper.rb b/app/helpers/labels_helper.rb index 8036303851b..662ace367b9 100644 --- a/app/helpers/labels_helper.rb +++ b/app/helpers/labels_helper.rb @@ -93,7 +93,9 @@ module LabelsHelper end def project_labels_options(project) - options_from_collection_for_select(project.labels, 'name', 'name', params[:label_name]) + labels = project.labels.to_a + labels.unshift(Label::None) + options_from_collection_for_select(labels, 'name', 'name', params[:label_name]) end # Required for Gitlab::Markdown::LabelReferenceFilter diff --git a/app/models/label.rb b/app/models/label.rb index 4a22bd53400..14b544b3756 100644 --- a/app/models/label.rb +++ b/app/models/label.rb @@ -12,6 +12,9 @@ class Label < ActiveRecord::Base include Referable + # Represents a "No Label" state used for filtering Issues and Merge + # Requests that have no label assigned. + None = Struct.new(:title, :name).new('No Label', 'No Label') DEFAULT_COLOR = '#428BCA' diff --git a/app/views/shared/issuable/_filter.html.haml b/app/views/shared/issuable/_filter.html.haml index 8f16773077e..6e6d497c1d2 100644 --- a/app/views/shared/issuable/_filter.html.haml +++ b/app/views/shared/issuable/_filter.html.haml @@ -39,13 +39,13 @@ .filter-item.inline.milestone-filter = select_tag('milestone_title', projects_milestones_options, - class: 'select2 trigger-submit', include_blank: true, + class: 'select2 trigger-submit', include_blank: 'Any', data: {placeholder: 'Milestone'}) - if @project .filter-item.inline.labels-filter = select_tag('label_name', project_labels_options(@project), - class: 'select2 trigger-submit', include_blank: true, + class: 'select2 trigger-submit', include_blank: 'Any', data: {placeholder: 'Label'}) .pull-right -- cgit v1.2.1 From 7ad4521f66b578c0aecf9afb09194626a4c2aa6a Mon Sep 17 00:00:00 2001 From: Andrey Date: Mon, 5 Oct 2015 21:18:21 +0200 Subject: Fixes to dropdown, font colors for new project and merge request --- app/assets/stylesheets/generic/buttons.scss | 229 +++++++++++++--------- app/assets/stylesheets/generic/common.scss | 8 + app/assets/stylesheets/generic/forms.scss | 24 ++- app/assets/stylesheets/generic/issue_box.scss | 2 +- app/assets/stylesheets/generic/selects.scss | 42 +++- app/assets/stylesheets/generic/timeline.scss | 4 +- app/assets/stylesheets/pages/issuable.scss | 9 +- app/assets/stylesheets/pages/merge_requests.scss | 23 ++- app/assets/stylesheets/pages/note_form.scss | 8 +- app/assets/stylesheets/pages/notes.scss | 2 +- app/assets/stylesheets/pages/projects.scss | 37 ++-- app/views/projects/merge_requests/_show.html.haml | 2 +- app/views/projects/new.html.haml | 20 +- app/views/projects/notes/_form.html.haml | 2 +- 14 files changed, 262 insertions(+), 150 deletions(-) (limited to 'app') diff --git a/app/assets/stylesheets/generic/buttons.scss b/app/assets/stylesheets/generic/buttons.scss index cf76f538e01..50c3de089f3 100644 --- a/app/assets/stylesheets/generic/buttons.scss +++ b/app/assets/stylesheets/generic/buttons.scss @@ -1,98 +1,8 @@ body { text-rendering: geometricPrecision; } -.btn { - @extend .btn-default; - - &.btn-new { - @extend .btn-success; - } - - &.btn-create { - @extend .btn-success; - } - - &.btn-save { - @extend .btn-success; - } - - &.btn-remove { - @extend .btn-danger; - } - - &.btn-cancel { - float: right; - } - - &.btn-close { - color: $gl-danger; - border-color: $gl-danger; - &:hover { - color: #B94A48; - } - } - - &.btn-reopen { - color: $gl-success; - border-color: $gl-success; - &:hover { - color: #468847; - } - } - - &.btn-grouped { - margin-right: 7px; - float: left; - &:last-child { - margin-right: 0px; - } - } - - &.btn-save { - @extend .btn-primary; - } - - &.btn-new, &.btn-create { - @extend .btn-success; - } -} - -.btn-block { - width: 100%; - margin: 0; - margin-bottom: 15px; - &.btn { - padding: 6px 0; - } -} - -.btn-group { - &.btn-grouped { - margin-right: 7px; - float: left; - &:last-child { - margin-right: 0px; - } - } -} -.btn-group-next { - .btn { - padding: 9px 0px; - font-size: 15px; - color: #7f8fa4; - border-color: #e7e9ed; - width: 140px; - - &.active { - border-color: $gl-info; - background: $gl-info; - color: #fff; - } - } -} - -@mixin btn-info { +@mixin btn-default { @include border-radius(2px); border-width: 1px; @@ -179,7 +89,7 @@ body { /*Butons*/ -@mixin bnt-project { +@mixin btn-project { background-color: #f0f2f5; border-color: #dce0e5; color: #313236; @@ -199,9 +109,35 @@ body { &:active { @include box-shadow(inset 0 0 4px rgba(0, 0, 0, 0.12)); - color: #313236 !important; - border-color: #c6cacf !important; - background-color: #e4e7ed !important; + color: #313236 !important; + border-color: #c6cacf !important; + background-color: #e4e7ed !important; + } +} + +@mixin btn-light { + background-color: #fff; + border-color: #dce0e5; + color: #313236; + + &:hover { + border-color:#dce0e5; + background-color: #f0f2f5; + color: #313236; + } + + &:focus { + border-color: #dce0e5; + background-color: #f0f2f5; + color: #313236; + } + + &:active { + @include box-shadow(inset 0 0 4px rgba(0, 0, 0, 0.12)); + + color: #313236 !important; + border-color: #c6cacf !important; + background-color: #e4e7ed !important; } } @@ -225,4 +161,107 @@ body { border-color: #e12554 !important; } +} + + +.btn-info { + @include btn-default; + @include btn-project; +} + +.btn-success { + @include btn-default; + @include btn-green; + +} + +.btn { + @include btn-default; + + &.btn-new { + @extend .btn-success; + } + + &.btn-create { + @extend .btn-success; + } + + &.btn-save { + @extend .btn-success; + } + + &.btn-remove { + @extend .btn-danger; + } + + &.btn-cancel { + float: right; + } + + &.btn-close { + color: $gl-danger; + border-color: $gl-danger; + &:hover { + color: #B94A48; + } + } + + &.btn-reopen { + color: $gl-success; + border-color: $gl-success; + &:hover { + color: #468847; + } + } + + &.btn-grouped { + margin-right: 7px; + float: left; + &:last-child { + margin-right: 0px; + } + } + + &.btn-save { + @extend .btn-primary; + } + + &.btn-new, &.btn-create { + @extend .btn-success; + } +} + +.btn-block { + width: 100%; + margin: 0; + margin-bottom: 15px; + &.btn { + padding: 6px 0; + } +} + +.btn-group { + &.btn-grouped { + margin-right: 7px; + float: left; + &:last-child { + margin-right: 0px; + } + } +} + +.btn-group-next { + .btn { + padding: 9px 0px; + font-size: 15px; + color: #7f8fa4; + border-color: #e7e9ed; + width: 140px; + + &.active { + border-color: $gl-info; + background: $gl-info; + color: #fff; + } + } } \ No newline at end of file diff --git a/app/assets/stylesheets/generic/common.scss b/app/assets/stylesheets/generic/common.scss index 45e284542d2..03919f15f1f 100644 --- a/app/assets/stylesheets/generic/common.scss +++ b/app/assets/stylesheets/generic/common.scss @@ -394,3 +394,11 @@ table { .dropzone .dz-preview .dz-progress .dz-upload { background: $gl-success !important; } + +.space-right { + margin-right: 10px; +} + +.in-line { + display: inline-block; +} diff --git a/app/assets/stylesheets/generic/forms.scss b/app/assets/stylesheets/generic/forms.scss index 4282832e2bf..98a7c3ad8ac 100644 --- a/app/assets/stylesheets/generic/forms.scss +++ b/app/assets/stylesheets/generic/forms.scss @@ -30,9 +30,6 @@ input[type='text'].danger { } @media (min-width: $screen-sm-min) { - .form-actions { - padding-left: 17%; - } } label { @@ -84,3 +81,24 @@ label { .wiki-content { margin-top: 35px; } + +.form-group .control-label { + font-weight: normal; + font-color: #313236 !important; +} + +.form-control { + @include border-radius (2px); +} + +.form-control::-webkit-input-placeholder{ + color:#7f8fa4; +} + +.input-group { + @include border-radius (2px); + + .input-group-addon { + background-color: #f7f8fa; + } +} diff --git a/app/assets/stylesheets/generic/issue_box.scss b/app/assets/stylesheets/generic/issue_box.scss index b1fb87a6830..93377e45e70 100644 --- a/app/assets/stylesheets/generic/issue_box.scss +++ b/app/assets/stylesheets/generic/issue_box.scss @@ -5,7 +5,7 @@ */ .issue-box { - @include border-radius(3px); + @include border-radius(2px); display: inline-block; padding: 10px $gl-padding; diff --git a/app/assets/stylesheets/generic/selects.scss b/app/assets/stylesheets/generic/selects.scss index f0860de1c49..633dfea5228 100644 --- a/app/assets/stylesheets/generic/selects.scss +++ b/app/assets/stylesheets/generic/selects.scss @@ -8,7 +8,7 @@ font-size: $gl-font-size; line-height: 1.42857143; - @include border-radius(4px); + @include border-radius(2px); .select2-arrow { background: #FFF; @@ -18,8 +18,39 @@ } } +.select2-container .select2-choice, .select2-container.select2-drop-above .select2-choice{ + color: #7f8fa4; + border: 1px solid #e7e9ed; +} + +.select2-drop { + @include box-shadow(rgba(76, 86, 103, 0.247059) 0px 0px 1px 0px, rgba(31, 37, 50, 0.317647) 0px 2px 18px 0px); + @include border-radius (0px); + + padding: 16px 20px; + border: none !important; +} + +.select2-results .select2-result-label { + padding: 16px 20px; +} + +.select2-drop{ + color: #7f8fa4; +} + +.select2-highlighted { + background: #3084bb !important; +} + +.select2-results li.select2-result-with-children > .select2-result-label { + font-weight: 600; + color: #313236; +} + + .select2-container-multi .select2-choices { - @include border-radius(4px); + @include border-radius(2px); border-color: #CCC; } @@ -63,7 +94,7 @@ .ajax-users-dropdown, .ajax-project-users-dropdown { .select2-search { - padding-top: 4px; + padding-top: 2px; } } @@ -97,9 +128,6 @@ } .user-name { } - .user-username { - color: #999; - } } .namespace-result { @@ -115,4 +143,4 @@ .ajax-users-dropdown { min-width: 225px !important; -} +} \ No newline at end of file diff --git a/app/assets/stylesheets/generic/timeline.scss b/app/assets/stylesheets/generic/timeline.scss index 74bbaabad39..bf21d7fce76 100644 --- a/app/assets/stylesheets/generic/timeline.scss +++ b/app/assets/stylesheets/generic/timeline.scss @@ -10,8 +10,8 @@ margin-left: -$gl-padding; margin-right: -$gl-padding; color: $gl-gray; - border-bottom: 1px solid #f1f2f4; - border-right: 1px solid #f1f2f4; + border-bottom: 1px solid #ECEEF1; + border-right: 1px solid #ECEEF1; &:last-child { border-bottom: none; diff --git a/app/assets/stylesheets/pages/issuable.scss b/app/assets/stylesheets/pages/issuable.scss index b5c61f7f91d..9da085a3473 100644 --- a/app/assets/stylesheets/pages/issuable.scss +++ b/app/assets/stylesheets/pages/issuable.scss @@ -54,21 +54,22 @@ margin-top: -15px; padding: 10px 0; margin-bottom: 0; - color: $gl-gray; + color: #5c5d5e; font-size: 16px; .author { - color: $gl-gray; + color: #5c5d5e; } .issue-id { - font-size: 19px; - color: $gl-text-color; + color: #5c5d5e; } } .issue-title { margin: 0; + font-size: 23px; + color: #313236; } .description { diff --git a/app/assets/stylesheets/pages/merge_requests.scss b/app/assets/stylesheets/pages/merge_requests.scss index d8c8e5ad0a4..fe69d16fc4b 100644 --- a/app/assets/stylesheets/pages/merge_requests.scss +++ b/app/assets/stylesheets/pages/merge_requests.scss @@ -3,12 +3,11 @@ * */ .mr-state-widget { - background: #f8fafc; + background: #F7F8FA; margin-bottom: 20px; color: $gl-gray; - border: 1px solid #eef0f2; - @include box-shadow(0 1px 1px rgba(0, 0, 0, 0.05)); - @include border-radius(3px); + border: 1px solid #dce0e6; + @include border-radius(2px); form { margin-bottom: 0; @@ -76,11 +75,17 @@ .mr-widget-footer { padding: 15px; } + + .normal { + color: #5c5d5e; + } .mr-widget-body { h4 { - font-weight: bold; + font-weight: 600; + font-size: 17px; margin: 5px 0; + color: #313236; } p:last-child { @@ -102,9 +107,7 @@ margin: -$gl-padding; padding: $gl-padding; text-align: center; - border-top: 1px solid #e7e9ed; - margin-top: 18px; - margin-bottom: 3px; + margin-bottom: 1px; } .mr_source_commit, @@ -120,10 +123,12 @@ } .label-branch { - color: #222; + color: #313236; font-family: $monospace_font; font-weight: bold; overflow: hidden; + font-size: 14px; + margin: 0 3px; } .mr-list { diff --git a/app/assets/stylesheets/pages/note_form.scss b/app/assets/stylesheets/pages/note_form.scss index fdc2c3332df..dcd1aed7196 100644 --- a/app/assets/stylesheets/pages/note_form.scss +++ b/app/assets/stylesheets/pages/note_form.scss @@ -72,12 +72,12 @@ .common-note-form { margin: 0; - background: #f8fafc; + background: #F7F8FA; padding: $gl-padding; margin-left: -$gl-padding; margin-right: -$gl-padding; - border-right: 1px solid #f1f2f4; - border-top: 1px solid #f1f2f4; + border-right: 1px solid #ECEEF1; + border-top: 1px solid #ECEEF1; margin-bottom: -$gl-padding; } @@ -168,7 +168,7 @@ .comment-hints { color: #999; background: #FFF; - padding: 5px; + padding: 7px; margin-top: -11px; border: 1px solid $border-color; font-size: 13px; diff --git a/app/assets/stylesheets/pages/notes.scss b/app/assets/stylesheets/pages/notes.scss index 2a77f065aed..abb03b07f51 100644 --- a/app/assets/stylesheets/pages/notes.scss +++ b/app/assets/stylesheets/pages/notes.scss @@ -18,7 +18,7 @@ ul.notes { font-size: 14px; padding-top: 10px; padding-bottom: 10px; - background: #f8fafc; + background: #FDFDFD; .timeline-icon { .avatar { diff --git a/app/assets/stylesheets/pages/projects.scss b/app/assets/stylesheets/pages/projects.scss index 818aa10aefe..38b17be7980 100644 --- a/app/assets/stylesheets/pages/projects.scss +++ b/app/assets/stylesheets/pages/projects.scss @@ -13,11 +13,19 @@ .edit_project { fieldset.features { .control-label { - font-weight: bold; + font-weight: normal; } } } +.btn, .commits-compare-switch { + @include btn-light; +} + +.project-edit-content { + padding: 7px; +} + .project-name-holder { .help-inline { vertical-align: top; @@ -92,8 +100,8 @@ margin-bottom: 0px; .btn { - @include bnt-project; - @include btn-info; + @include btn-project; + @include btn-default; .count { display: inline-block; @@ -139,7 +147,11 @@ } } } +.btn-green { + @include btn-green; + cursor: pointer; +} .projects-search-form { .input-group .form-control { @@ -149,7 +161,7 @@ .input-group-btn { .btn { - @include bnt-project; + @include btn-project; @include btn-middle; &:hover { @@ -183,8 +195,8 @@ margin: 0 12px 0 12px; .btn{ - @include bnt-project; - @include btn-info; + @include btn-project; + @include btn-default; } .dropdown-toggle { @@ -251,18 +263,19 @@ margin-bottom: 10px; i { - margin: 0 3px; + margin: 2px 0; font-size: 20px; } .option-title { - font-weight: bold; + font-weight: normal; display: inline-block; + color: #313236; } .option-descr { - margin-left: 36px; - color: $gray; + margin-left: 29px; + color: #54565b; } } } @@ -376,8 +389,8 @@ table.table.protected-branches-list tr.no-border { } .nav > li > a { - @include btn-info; - @include bnt-project; + @include btn-default; + @include btn-project; background-color: transparent; border: 1px solid #f7f8fa; diff --git a/app/views/projects/merge_requests/_show.html.haml b/app/views/projects/merge_requests/_show.html.haml index 0b0f52c653c..58d8478744e 100644 --- a/app/views/projects/merge_requests/_show.html.haml +++ b/app/views/projects/merge_requests/_show.html.haml @@ -24,7 +24,7 @@ %ul.dropdown-menu %li= link_to "Email Patches", merge_request_path(@merge_request, format: :patch) %li= link_to "Plain Diff", merge_request_path(@merge_request, format: :diff) - .light + .normal %span Request to merge %span.label-branch #{source_branch_with_namespace(@merge_request)} %span into diff --git a/app/views/projects/new.html.haml b/app/views/projects/new.html.haml index bccea21e7a8..1b093c8f514 100644 --- a/app/views/projects/new.html.haml +++ b/app/views/projects/new.html.haml @@ -8,7 +8,7 @@ = form_for @project, html: { class: 'new_project form-horizontal js-requires-input' } do |f| .form-group.project-name-holder = f.label :path, class: 'control-label' do - %strong Project path + Project path .col-sm-10 .input-group = f.text_field :path, placeholder: "my-awesome-project", class: "form-control", tabindex: 1, autofocus: true, required: true @@ -23,7 +23,6 @@ = f.select :namespace_id, namespaces_options(params[:namespace_id] || :current_user), {}, {class: 'select2', tabindex: 2} - if import_sources_enabled? - %hr .project-import.js-toggle-container .form-group @@ -35,7 +34,7 @@ %i.fa.fa-github GitHub - else - = link_to '#', class: 'how_to_import_link light btn import_github' do + = link_to '#', class: 'how_to_import_link btn import_github' do %i.fa.fa-github GitHub = render 'github_import_modal' @@ -46,7 +45,7 @@ %i.fa.fa-bitbucket Bitbucket - else - = link_to status_import_bitbucket_path, class: 'how_to_import_link light btn import_bitbucket', "data-no-turbolink" => "true" do + = link_to status_import_bitbucket_path, class: 'how_to_import_link btn import_bitbucket', "data-no-turbolink" => "true" do %i.fa.fa-bitbucket Bitbucket = render 'bitbucket_import_modal' @@ -57,7 +56,7 @@ %i.fa.fa-heart GitLab.com - else - = link_to status_import_gitlab_path, class: 'how_to_import_link light btn import_gitlab' do + = link_to status_import_gitlab_path, class: 'how_to_import_link btn import_gitlab' do %i.fa.fa-heart GitLab.com = render 'gitlab_import_modal' @@ -97,7 +96,7 @@ %li To migrate an SVN repository, check out #{link_to "this document", "http://doc.gitlab.com/ce/workflow/importing/migrating_from_svn.html"}. - %hr.prepend-botton-10 + .prepend-botton-10 .form-group = f.label :description, class: 'control-label' do @@ -112,10 +111,11 @@ - if current_user.can_create_group? .pull-right - .light - Need a group for several dependent projects? - = link_to new_group_path, class: "btn btn-xs" do - Create a group + .light.in-line + .space-right + Need a group for several dependent projects? + = link_to new_group_path, class: "btn btn-xs" do + Create a group .save-project-loader.hide .center diff --git a/app/views/projects/notes/_form.html.haml b/app/views/projects/notes/_form.html.haml index d99445da59a..512ccd48b38 100644 --- a/app/views/projects/notes/_form.html.haml +++ b/app/views/projects/notes/_form.html.haml @@ -14,6 +14,6 @@ .note-form-actions .buttons.clearfix - = f.submit 'Add Comment', class: "btn comment-btn btn-grouped js-comment-button" + = f.submit 'Add Comment', class: "btn btn-green comment-btn btn-grouped js-comment-button" = yield(:note_actions) %a.btn.grouped.js-close-discussion-note-form Cancel -- cgit v1.2.1 From 2acb030beaf4a04969340d7d0ede12992f8dd6fe Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 7 Oct 2015 17:21:15 +0200 Subject: Refactor button css and do some cleanup Signed-off-by: Dmitriy Zaporozhets --- app/assets/stylesheets/base/gl_variables.scss | 4 +- app/assets/stylesheets/base/layout.scss | 1 + app/assets/stylesheets/generic/buttons.scss | 129 ++++++++++++-------------- app/assets/stylesheets/generic/forms.scss | 14 +-- app/assets/stylesheets/generic/selects.scss | 10 +- app/assets/stylesheets/pages/projects.scss | 15 +-- 6 files changed, 75 insertions(+), 98 deletions(-) (limited to 'app') diff --git a/app/assets/stylesheets/base/gl_variables.scss b/app/assets/stylesheets/base/gl_variables.scss index 7378d404008..18632da4f2a 100644 --- a/app/assets/stylesheets/base/gl_variables.scss +++ b/app/assets/stylesheets/base/gl_variables.scss @@ -22,8 +22,8 @@ $brand-info: $gl-info; $brand-warning: $gl-warning; $brand-danger: $gl-danger; -$border-radius-base: 3px !default; -$border-radius-large: 5px !default; +$border-radius-base: 2px !default; +$border-radius-large: 2px !default; $border-radius-small: 2px !default; diff --git a/app/assets/stylesheets/base/layout.scss b/app/assets/stylesheets/base/layout.scss index b91c15d8910..c7b3b60e769 100644 --- a/app/assets/stylesheets/base/layout.scss +++ b/app/assets/stylesheets/base/layout.scss @@ -5,6 +5,7 @@ html { body { padding-top: $header-height; + text-rendering: geometricPrecision; } } diff --git a/app/assets/stylesheets/generic/buttons.scss b/app/assets/stylesheets/generic/buttons.scss index 50c3de089f3..086a056bbf5 100644 --- a/app/assets/stylesheets/generic/buttons.scss +++ b/app/assets/stylesheets/generic/buttons.scss @@ -1,10 +1,6 @@ -body { - text-rendering: geometricPrecision; -} - @mixin btn-default { @include border-radius(2px); - + border-width: 1px; border-style: solid; text-transform: uppercase; @@ -13,17 +9,17 @@ body { line-height: 18px; padding: 11px 16px; letter-spacing: .4px; - + &:hover { border-width: 1px; border-style: solid; } - + &:focus { border-width: 1px; border-style: solid; } - + &:active { @include box-shadow(inset 0 0 4px rgba(0, 0, 0, 0.12)); border-width: 1px; @@ -33,7 +29,7 @@ body { @mixin btn-middle { @include border-radius(2px); - + border-width: 1px; border-style: solid; text-transform: uppercase; @@ -42,22 +38,22 @@ body { line-height: 18px; padding: 11px 24px; letter-spacing: .4px; - + &:hover { border-width: 1px; border-style: solid; } - + &:focus { border-width: 1px; border-style: solid; } - + &:active { @include box-shadow(inset 0 0 4px rgba(0, 0, 0, 0.12)); border-width: 1px; border-style: solid; - } + } } @@ -65,118 +61,113 @@ body { background-color: #28b061; border: 1px solid #26a65c; color: #fff; - - &:hover { - background-color: #26ab5d; - border: 1px solid #229954; - color: #fff; - } - - &:focus { - background-color: #26ab5d; - border: 1px solid #229954; - color: #fff; - } - - &:active { - @include box-shadow (inset 0 0 4px rgba(0, 0, 0, 0.12)); - - background-color: #23a158 !important; - border: 1px solid #229954 !important; - color: #fff !important; - } -} -/*Butons*/ + &:hover { + background-color: #26ab5d; + border: 1px solid #229954; + color: #fff; + } + + &:focus { + background-color: #26ab5d; + border: 1px solid #229954; + color: #fff; + } + + &:active { + @include box-shadow (inset 0 0 4px rgba(0, 0, 0, 0.12)); + + background-color: #23a158 !important; + border: 1px solid #229954 !important; + color: #fff !important; + } +} -@mixin btn-project { +@mixin btn-gray { background-color: #f0f2f5; border-color: #dce0e5; color: #313236; - + &:hover { border-color:#dce0e5; background-color: #ebeef2; color: #313236; } - + &:focus { border-color: #dce0e5; background-color: #ebeef2; color: #313236; } - + &:active { - @include box-shadow(inset 0 0 4px rgba(0, 0, 0, 0.12)); - - color: #313236 !important; - border-color: #c6cacf !important; - background-color: #e4e7ed !important; + @include box-shadow(inset 0 0 4px rgba(0, 0, 0, 0.12)); + + color: #313236 !important; + border-color: #c6cacf !important; + background-color: #e4e7ed !important; } } -@mixin btn-light { +@mixin btn-white { background-color: #fff; border-color: #dce0e5; color: #313236; - + &:hover { border-color:#dce0e5; background-color: #f0f2f5; color: #313236; } - + &:focus { border-color: #dce0e5; background-color: #f0f2f5; color: #313236; } - + &:active { - @include box-shadow(inset 0 0 4px rgba(0, 0, 0, 0.12)); - - color: #313236 !important; - border-color: #c6cacf !important; - background-color: #e4e7ed !important; + @include box-shadow(inset 0 0 4px rgba(0, 0, 0, 0.12)); + + color: #313236 !important; + border-color: #c6cacf !important; + background-color: #e4e7ed !important; } } -@mixin btn-remove { +@mixin btn-red { background-color: #f72e60; border-color: #ee295a; - + &:hover { background-color: #e82757; border-color: #e32555; } - + &:focus { background-color: #e82757; border-color: #e32555; } - + &:active { @include box-shadow(inset 0 0 4px rgba(0, 0, 0, 0.12)); background-color: #d42450 !important; border-color: #e12554 !important; } - } -.btn-info { +.btn { @include btn-default; - @include btn-project; -} + @include btn-white; -.btn-success { - @include btn-default; - @include btn-green; - -} + &.btn-success { + @include btn-green; + } -.btn { - @include btn-default; + &.btn-gray { + @include btn-gray; + } &.btn-new { @extend .btn-success; @@ -264,4 +255,4 @@ body { color: #fff; } } -} \ No newline at end of file +} diff --git a/app/assets/stylesheets/generic/forms.scss b/app/assets/stylesheets/generic/forms.scss index 98a7c3ad8ac..0edfe24f195 100644 --- a/app/assets/stylesheets/generic/forms.scss +++ b/app/assets/stylesheets/generic/forms.scss @@ -29,9 +29,6 @@ input[type='text'].danger { border-top: 1px solid $border-color; } -@media (min-width: $screen-sm-min) { -} - label { &.control-label { @extend .col-sm-2; @@ -84,20 +81,13 @@ label { .form-group .control-label { font-weight: normal; - font-color: #313236 !important; -} - -.form-control { - @include border-radius (2px); } -.form-control::-webkit-input-placeholder{ - color:#7f8fa4; +.form-control::-webkit-input-placeholder { + color: #7f8fa4; } .input-group { - @include border-radius (2px); - .input-group-addon { background-color: #f7f8fa; } diff --git a/app/assets/stylesheets/generic/selects.scss b/app/assets/stylesheets/generic/selects.scss index 633dfea5228..cba621635b6 100644 --- a/app/assets/stylesheets/generic/selects.scss +++ b/app/assets/stylesheets/generic/selects.scss @@ -26,13 +26,13 @@ .select2-drop { @include box-shadow(rgba(76, 86, 103, 0.247059) 0px 0px 1px 0px, rgba(31, 37, 50, 0.317647) 0px 2px 18px 0px); @include border-radius (0px); - - padding: 16px 20px; + + padding: 16px; border: none !important; } .select2-results .select2-result-label { - padding: 16px 20px; + padding: 16px; } .select2-drop{ @@ -142,5 +142,5 @@ } .ajax-users-dropdown { - min-width: 225px !important; -} \ No newline at end of file + min-width: 250px !important; +} diff --git a/app/assets/stylesheets/pages/projects.scss b/app/assets/stylesheets/pages/projects.scss index 38b17be7980..c36f5a394d8 100644 --- a/app/assets/stylesheets/pages/projects.scss +++ b/app/assets/stylesheets/pages/projects.scss @@ -18,10 +18,6 @@ } } -.btn, .commits-compare-switch { - @include btn-light; -} - .project-edit-content { padding: 7px; } @@ -100,8 +96,7 @@ margin-bottom: 0px; .btn { - @include btn-project; - @include btn-default; + @include btn-gray; .count { display: inline-block; @@ -161,7 +156,7 @@ .input-group-btn { .btn { - @include btn-project; + @include btn-gray; @include btn-middle; &:hover { @@ -195,7 +190,7 @@ margin: 0 12px 0 12px; .btn{ - @include btn-project; + @include btn-gray; @include btn-default; } @@ -390,7 +385,7 @@ table.table.protected-branches-list tr.no-border { .nav > li > a { @include btn-default; - @include btn-project; + @include btn-gray; background-color: transparent; border: 1px solid #f7f8fa; @@ -450,7 +445,7 @@ pre.light-well { .btn-remove { @include btn-middle; - @include btn-remove; + @include btn-red; float: left !important; } -- cgit v1.2.1 From b8e4d6bdbec8631663a017c1b651dc223f0cba16 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 7 Oct 2015 17:32:00 +0200 Subject: Refactor buttons Signed-off-by: Dmitriy Zaporozhets --- app/assets/stylesheets/generic/buttons.scss | 33 ++++++++--------------------- app/assets/stylesheets/pages/projects.scss | 4 ---- 2 files changed, 9 insertions(+), 28 deletions(-) (limited to 'app') diff --git a/app/assets/stylesheets/generic/buttons.scss b/app/assets/stylesheets/generic/buttons.scss index 086a056bbf5..62922e6a330 100644 --- a/app/assets/stylesheets/generic/buttons.scss +++ b/app/assets/stylesheets/generic/buttons.scss @@ -156,12 +156,15 @@ } } - .btn { @include btn-default; @include btn-white; - &.btn-success { + &.btn-success, + &.btn-new, + &.btn-create, + &.btn-save, + &.btn-green { @include btn-green; } @@ -169,20 +172,10 @@ @include btn-gray; } - &.btn-new { - @extend .btn-success; - } - - &.btn-create { - @extend .btn-success; - } - - &.btn-save { - @extend .btn-success; - } - - &.btn-remove { - @extend .btn-danger; + &.btn-danger, + &.btn-remove, + &.btn-red { + @include btn-red; } &.btn-cancel { @@ -212,14 +205,6 @@ margin-right: 0px; } } - - &.btn-save { - @extend .btn-primary; - } - - &.btn-new, &.btn-create { - @extend .btn-success; - } } .btn-block { diff --git a/app/assets/stylesheets/pages/projects.scss b/app/assets/stylesheets/pages/projects.scss index c36f5a394d8..0031ab5151b 100644 --- a/app/assets/stylesheets/pages/projects.scss +++ b/app/assets/stylesheets/pages/projects.scss @@ -142,11 +142,7 @@ } } } -.btn-green { - @include btn-green; - cursor: pointer; -} .projects-search-form { .input-group .form-control { -- cgit v1.2.1 From 7f63a8787ce454a61f72393ccbe22fc283ba8313 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 7 Oct 2015 17:54:49 +0200 Subject: Fix tests and few CI features Signed-off-by: Dmitriy Zaporozhets --- app/controllers/ci/projects_controller.rb | 1 + app/controllers/projects/commit_controller.rb | 2 +- app/views/projects/ci_settings/_form.html.haml | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/controllers/ci/projects_controller.rb b/app/controllers/ci/projects_controller.rb index 5484ae643a6..7777aa18031 100644 --- a/app/controllers/ci/projects_controller.rb +++ b/app/controllers/ci/projects_controller.rb @@ -1,5 +1,6 @@ module Ci class ProjectsController < Ci::ApplicationController + before_action :project before_action :authenticate_user!, except: [:build, :badge] before_action :authorize_access_project!, except: [:badge] before_action :authorize_manage_project!, only: [:toggle_shared_runners, :dumped_yaml] diff --git a/app/controllers/projects/commit_controller.rb b/app/controllers/projects/commit_controller.rb index c08a90bddf0..7886f3c6deb 100644 --- a/app/controllers/projects/commit_controller.rb +++ b/app/controllers/projects/commit_controller.rb @@ -42,7 +42,7 @@ class Projects::CommitController < Projects::ApplicationController @ci_commit = @project.ci_commit(@commit.sha) @ci_commit.builds.running_or_pending.each(&:cancel) - redirect_to namespace_project_commit_path(project.namespace, project, commit.sha) + redirect_to ci_namespace_project_commit_path(project.namespace, project, commit.sha) end diff --git a/app/views/projects/ci_settings/_form.html.haml b/app/views/projects/ci_settings/_form.html.haml index 34125550206..d711413c6b9 100644 --- a/app/views/projects/ci_settings/_form.html.haml +++ b/app/views/projects/ci_settings/_form.html.haml @@ -8,7 +8,7 @@ Edit your #{link_to ".gitlab-ci.yml using web-editor", yaml_web_editor_link(@ci_project)} -- if @repository +- unless @project.empty_repo? %p Paste build status image for #{@repository.root_ref} with next link = link_to '#', class: 'badge-codes-toggle btn btn-default btn-xs' do -- cgit v1.2.1 From 38fbfb9fe6d52e1a36b16ccc2a9da9ae01561cca Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Mon, 5 Oct 2015 18:03:14 -0400 Subject: Require jquery.turbolinks in all JS specs Side-effect: This simplifies the requiresInput handler --- app/assets/javascripts/behaviors/requires_input.js.coffee | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'app') diff --git a/app/assets/javascripts/behaviors/requires_input.js.coffee b/app/assets/javascripts/behaviors/requires_input.js.coffee index 8318fe435b3..79d750d1847 100644 --- a/app/assets/javascripts/behaviors/requires_input.js.coffee +++ b/app/assets/javascripts/behaviors/requires_input.js.coffee @@ -34,6 +34,5 @@ $.fn.requiresInput = -> $form.on 'change input', fieldSelector, requireInput -# Triggered on standard document `ready` and on Turbolinks `page:load` events -$(document).on 'ready page:load', -> +$ -> $('form.js-requires-input').requiresInput() -- cgit v1.2.1 From 01d0926bc16bb82ef676c35a5a61b8e90a82654c Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Mon, 5 Oct 2015 18:19:11 -0400 Subject: Add "Quick Submit" JS behavior --- .../javascripts/behaviors/quick_submit.js.coffee | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 app/assets/javascripts/behaviors/quick_submit.js.coffee (limited to 'app') diff --git a/app/assets/javascripts/behaviors/quick_submit.js.coffee b/app/assets/javascripts/behaviors/quick_submit.js.coffee new file mode 100644 index 00000000000..dc9bd4d94cc --- /dev/null +++ b/app/assets/javascripts/behaviors/quick_submit.js.coffee @@ -0,0 +1,29 @@ +# Quick Submit behavior +# +# When an input field with the `js-quick-submit` class receives a "Meta+Enter" +# (Mac) or "Ctrl+Enter" (Linux/Windows) key combination, its parent form is +# submitted. +# +#= require extensions/jquery +# +# ### Example Markup +# +#
+# +# +#
+# +$(document).on 'keydown.quick_submit', '.js-quick-submit', (e) -> + return if e.repeat + return unless e.keyCode == 13 # Enter + + if navigator.userAgent.match(/Macintosh/) + return unless (e.metaKey && !e.altKey && !e.ctrlKey && !e.shiftKey) + else + return unless (e.ctrlKey && !e.altKey && !e.metaKey && !e.shiftKey) + + e.preventDefault() + + $form = $(e.target).closest('form') + $form.find('input[type=submit], button[type=submit]').disable() + $form.submit() -- cgit v1.2.1 From 2ed5a5b70df6e4c9b4b9afd0e1cac12f267676e8 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Mon, 5 Oct 2015 18:20:00 -0400 Subject: Remove "quick submit" behavior specific to the Notes JS --- app/assets/javascripts/notes.js.coffee | 7 ------- 1 file changed, 7 deletions(-) (limited to 'app') diff --git a/app/assets/javascripts/notes.js.coffee b/app/assets/javascripts/notes.js.coffee index 4b9f0d68912..ea75c656bcc 100644 --- a/app/assets/javascripts/notes.js.coffee +++ b/app/assets/javascripts/notes.js.coffee @@ -63,12 +63,6 @@ class @Notes # fetch notes when tab becomes visible $(document).on "visibilitychange", @visibilityChange - # Chrome doesn't fire keypress or keyup for Command+Enter, so we need keydown. - $(document).on 'keydown', '.js-note-text', (e) -> - return if e.originalEvent.repeat - if e.keyCode == 10 || ((e.metaKey || e.ctrlKey) && e.keyCode == 13) - $(@).closest('form').submit() - cleanBinding: -> $(document).off "ajax:success", ".js-main-target-form" $(document).off "ajax:success", ".js-discussion-note-form" @@ -82,7 +76,6 @@ class @Notes $(document).off "click", ".js-discussion-reply-button" $(document).off "click", ".js-add-diff-note-button" $(document).off "visibilitychange" - $(document).off "keydown", ".js-note-text" $(document).off "keyup", ".js-note-text" $(document).off "click", ".js-note-target-reopen" $(document).off "click", ".js-note-target-close" -- cgit v1.2.1 From de3ff174e70a9048fc8f23cd5ee0c709471f3651 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Mon, 5 Oct 2015 18:20:43 -0400 Subject: Quick Submit all the things! Adds quick submit behavior to the forms for: - Blobs ("new file") - Commit messages - Issuables - Notes - Labels - Milestones - Wikis --- app/views/projects/blob/_editor.html.haml | 2 +- app/views/projects/blob/new.html.haml | 2 +- app/views/projects/labels/_form.html.haml | 2 +- app/views/projects/milestones/_form.html.haml | 4 ++-- app/views/projects/notes/_edit_form.html.haml | 2 +- app/views/projects/notes/_form.html.haml | 2 +- app/views/projects/wikis/_form.html.haml | 2 +- app/views/shared/_commit_message_container.html.haml | 2 +- app/views/shared/issuable/_form.html.haml | 4 ++-- 9 files changed, 11 insertions(+), 11 deletions(-) (limited to 'app') diff --git a/app/views/projects/blob/_editor.html.haml b/app/views/projects/blob/_editor.html.haml index 9c3e1703c89..f1ad0c3c403 100644 --- a/app/views/projects/blob/_editor.html.haml +++ b/app/views/projects/blob/_editor.html.haml @@ -11,7 +11,7 @@ - if current_action?(:new) || current_action?(:create) \/ = text_field_tag 'file_name', params[:file_name], placeholder: "File name", - required: true, class: 'form-control new-file-name' + required: true, class: 'form-control new-file-name js-quick-submit' .pull-right = select_tag :encoding, options_for_select([ "base64", "text" ], "text"), class: 'form-control' diff --git a/app/views/projects/blob/new.html.haml b/app/views/projects/blob/new.html.haml index d7987e24ef3..7975137c37f 100644 --- a/app/views/projects/blob/new.html.haml +++ b/app/views/projects/blob/new.html.haml @@ -15,7 +15,7 @@ = label_tag 'branch', class: 'control-label' do Branch .col-sm-10 - = text_field_tag 'new_branch', @ref, class: "form-control" + = text_field_tag 'new_branch', @ref, class: "form-control js-quick-submit" = hidden_field_tag 'content', '', id: 'file-content' = render 'projects/commit_button', ref: @ref, diff --git a/app/views/projects/labels/_form.html.haml b/app/views/projects/labels/_form.html.haml index 534c545329b..4cf13492e99 100644 --- a/app/views/projects/labels/_form.html.haml +++ b/app/views/projects/labels/_form.html.haml @@ -10,7 +10,7 @@ .form-group = f.label :title, class: 'control-label' .col-sm-10 - = f.text_field :title, class: "form-control", required: true + = f.text_field :title, class: "form-control js-quick-submit", required: true .form-group = f.label :color, "Background Color", class: 'control-label' .col-sm-10 diff --git a/app/views/projects/milestones/_form.html.haml b/app/views/projects/milestones/_form.html.haml index 74e9668052d..255ddab479f 100644 --- a/app/views/projects/milestones/_form.html.haml +++ b/app/views/projects/milestones/_form.html.haml @@ -16,13 +16,13 @@ .form-group = f.label :title, "Title", class: "control-label" .col-sm-10 - = f.text_field :title, maxlength: 255, class: "form-control", required: true + = f.text_field :title, maxlength: 255, class: "form-control js-quick-submit", required: true %p.hint Required .form-group.milestone-description = f.label :description, "Description", class: "control-label" .col-sm-10 = render layout: 'projects/md_preview', locals: { preview_class: "md-preview" } do - = render 'projects/zen', f: f, attr: :description, classes: 'description form-control' + = render 'projects/zen', f: f, attr: :description, classes: 'description form-control js-quick-submit' .hint .pull-left Milestones are parsed with #{link_to "GitLab Flavored Markdown", help_page_path("markdown", "markdown"), target: '_blank'}. .pull-left Attach files by dragging & dropping or #{link_to "selecting them", '#', class: 'markdown-selector' }. diff --git a/app/views/projects/notes/_edit_form.html.haml b/app/views/projects/notes/_edit_form.html.haml index a0e26f9827e..a21c019986a 100644 --- a/app/views/projects/notes/_edit_form.html.haml +++ b/app/views/projects/notes/_edit_form.html.haml @@ -2,7 +2,7 @@ = form_for note, url: namespace_project_note_path(@project.namespace, @project, note), method: :put, remote: true, authenticity_token: true do |f| = note_target_fields(note) = render layout: 'projects/md_preview', locals: { preview_class: 'md-preview' } do - = render 'projects/zen', f: f, attr: :note, classes: 'note_text js-note-text js-task-list-field' + = render 'projects/zen', f: f, attr: :note, classes: 'note_text js-note-text js-task-list-field js-quick-submit' = render 'projects/notes/hints' .note-form-actions diff --git a/app/views/projects/notes/_form.html.haml b/app/views/projects/notes/_form.html.haml index 512ccd48b38..13dfa0a1bb3 100644 --- a/app/views/projects/notes/_form.html.haml +++ b/app/views/projects/notes/_form.html.haml @@ -8,7 +8,7 @@ = f.hidden_field :noteable_type = render layout: 'projects/md_preview', locals: { preview_class: "md-preview", referenced_users: true } do - = render 'projects/zen', f: f, attr: :note, classes: 'note_text js-note-text' + = render 'projects/zen', f: f, attr: :note, classes: 'note_text js-note-text js-quick-submit' = render 'projects/notes/hints' .error-alert diff --git a/app/views/projects/wikis/_form.html.haml b/app/views/projects/wikis/_form.html.haml index 05d754adbe5..261d4a92d7d 100644 --- a/app/views/projects/wikis/_form.html.haml +++ b/app/views/projects/wikis/_form.html.haml @@ -22,7 +22,7 @@ = f.label :content, class: 'control-label' .col-sm-10 = render layout: 'projects/md_preview', locals: { preview_class: "md-preview" } do - = render 'projects/zen', f: f, attr: :content, classes: 'description form-control' + = render 'projects/zen', f: f, attr: :content, classes: 'description form-control js-quick-submit' .col-sm-12.hint .pull-left Wiki content is parsed with #{link_to "GitLab Flavored Markdown", help_page_path("markdown", "markdown"), target: '_blank'} .pull-right Attach files by dragging & dropping or #{link_to "selecting them", '#', class: 'markdown-selector' }. diff --git a/app/views/shared/_commit_message_container.html.haml b/app/views/shared/_commit_message_container.html.haml index 5071ff640f1..cc3f1268f8b 100644 --- a/app/views/shared/_commit_message_container.html.haml +++ b/app/views/shared/_commit_message_container.html.haml @@ -6,7 +6,7 @@ .max-width-marker = text_area_tag 'commit_message', (params[:commit_message] || local_assigns[:text]), - class: 'form-control', placeholder: local_assigns[:placeholder], + class: 'form-control js-quick-submit', placeholder: local_assigns[:placeholder], required: true, rows: (local_assigns[:rows] || 3) - if local_assigns[:hint] %p.hint diff --git a/app/views/shared/issuable/_form.html.haml b/app/views/shared/issuable/_form.html.haml index 33ec726e93c..594e54f404c 100644 --- a/app/views/shared/issuable/_form.html.haml +++ b/app/views/shared/issuable/_form.html.haml @@ -10,7 +10,7 @@ %strong= 'Title *' .col-sm-10 = f.text_field :title, maxlength: 255, autofocus: true, autocomplete: 'off', - class: 'form-control pad js-gfm-input', required: true + class: 'form-control pad js-gfm-input js-quick-submit', required: true - if issuable.is_a?(MergeRequest) %p.help-block @@ -26,7 +26,7 @@ = render layout: 'projects/md_preview', locals: { preview_class: "md-preview", referenced_users: true } do = render 'projects/zen', f: f, attr: :description, - classes: 'description form-control' + classes: 'description form-control js-quick-submit' .col-sm-12.hint .pull-left Parsed with -- cgit v1.2.1 From fcf99d0d09d63d0662290658ebc1e366bfc11bf0 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Wed, 7 Oct 2015 15:19:26 -0400 Subject: Check originalEvent.repeat --- app/assets/javascripts/behaviors/quick_submit.js.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/assets/javascripts/behaviors/quick_submit.js.coffee b/app/assets/javascripts/behaviors/quick_submit.js.coffee index dc9bd4d94cc..0748eed763c 100644 --- a/app/assets/javascripts/behaviors/quick_submit.js.coffee +++ b/app/assets/javascripts/behaviors/quick_submit.js.coffee @@ -14,7 +14,7 @@ # # $(document).on 'keydown.quick_submit', '.js-quick-submit', (e) -> - return if e.repeat + return if e.originalEvent.repeat return unless e.keyCode == 13 # Enter if navigator.userAgent.match(/Macintosh/) -- cgit v1.2.1 From 1190d0ab3dc7a3025bf55b666f34d1a0b51a8d89 Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Wed, 7 Oct 2015 14:03:18 +0200 Subject: Added concern for case-insensitive WHERE queries On PostgreSQL these queries use LOWER(...) to compare columns and values. For MySQL a regular WHERE is performed as MySQL is already case-insensitive. --- app/models/concerns/case_sensitivity.rb | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 app/models/concerns/case_sensitivity.rb (limited to 'app') diff --git a/app/models/concerns/case_sensitivity.rb b/app/models/concerns/case_sensitivity.rb new file mode 100644 index 00000000000..49d350e092b --- /dev/null +++ b/app/models/concerns/case_sensitivity.rb @@ -0,0 +1,28 @@ +# Concern for querying columns with specific case sensitivity handling. +module CaseSensitivity + extend ActiveSupport::Concern + + module ClassMethods + # Queries the given columns regardless of the casing used. + # + # Unlike other ActiveRecord methods this method only operates on a Hash. + def case_insensitive_where(params) + criteria = self + cast_lower = Gitlab::Database.postgresql? + + params.each do |key, value| + column = ActiveRecord::Base.connection.quote_table_name(key) + + if cast_lower + condition = "LOWER(#{column}) = LOWER(:value)" + else + condition = "#{column} = :value" + end + + criteria = criteria.where(condition, value: value) + end + + criteria + end + end +end -- cgit v1.2.1 From dbf9ccbcfe788beb24cda34b0d86b7e12ecdf4bb Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Wed, 7 Oct 2015 17:59:10 -0400 Subject: Check originalEvent.repeat *and* event.repeat phantomjs < 2.0 doesn't support creating `KeyboardEvent` so the tests were failing on CI --- app/assets/javascripts/behaviors/quick_submit.js.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/assets/javascripts/behaviors/quick_submit.js.coffee b/app/assets/javascripts/behaviors/quick_submit.js.coffee index 0748eed763c..4ec8531d580 100644 --- a/app/assets/javascripts/behaviors/quick_submit.js.coffee +++ b/app/assets/javascripts/behaviors/quick_submit.js.coffee @@ -14,7 +14,7 @@ # # $(document).on 'keydown.quick_submit', '.js-quick-submit', (e) -> - return if e.originalEvent.repeat + return if (e.originalEvent && e.originalEvent.repeat) || e.repeat return unless e.keyCode == 13 # Enter if navigator.userAgent.match(/Macintosh/) -- cgit v1.2.1 From 63f2510740d8f8756b04dbdf0f3b78d1f6a1ff84 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 8 Oct 2015 11:00:10 +0200 Subject: Fix build highlight Signed-off-by: Dmitriy Zaporozhets --- app/assets/stylesheets/ci/builds.scss | 1 - app/assets/stylesheets/ci/xterm.scss | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'app') diff --git a/app/assets/stylesheets/ci/builds.scss b/app/assets/stylesheets/ci/builds.scss index a27dd0db581..74dc3e321c1 100644 --- a/app/assets/stylesheets/ci/builds.scss +++ b/app/assets/stylesheets/ci/builds.scss @@ -73,4 +73,3 @@ margin-bottom: 2px; } } - diff --git a/app/assets/stylesheets/ci/xterm.scss b/app/assets/stylesheets/ci/xterm.scss index 532dede0b23..9a50096c0d0 100644 --- a/app/assets/stylesheets/ci/xterm.scss +++ b/app/assets/stylesheets/ci/xterm.scss @@ -1,4 +1,4 @@ -.ci-body { +.build-page { // color codes are based on http://en.wikipedia.org/wiki/File:Xterm_256color_chart.svg // see also: https://gist.github.com/jasonm23/2868981 -- cgit v1.2.1 From 057b1c317bd27461cce93d93399909e67869b159 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 8 Oct 2015 13:29:14 +0200 Subject: Add new GitLab colors Signed-off-by: Dmitriy Zaporozhets --- app/assets/stylesheets/base/variables.scss | 62 ++++++++- app/assets/stylesheets/generic/buttons.scss | 154 ++++++---------------- app/assets/stylesheets/pages/commits.scss | 3 +- app/views/help/ui.html.haml | 1 + app/views/projects/merge_requests/_show.html.haml | 2 +- 5 files changed, 98 insertions(+), 124 deletions(-) (limited to 'app') diff --git a/app/assets/stylesheets/base/variables.scss b/app/assets/stylesheets/base/variables.scss index befd63832d5..eb9a2966389 100644 --- a/app/assets/stylesheets/base/variables.scss +++ b/app/assets/stylesheets/base/variables.scss @@ -23,15 +23,67 @@ $gl-gray: #7f8fa4; $gl-padding: 16px; $gl-avatar-size: 46px; +/* + * Color schema + */ + +$white-light: #FFFFFF; +$white-normal: #DCE0E5; +$white-dark: #E4E7ED; + +$gray-light: #F0F2F5; +$gray-normal: #DCE0E5; +$gray-dark: #E4E7ED; + +$green-light: #31AF64; +$green-normal: #2FAA60; +$green-dark: #2CA05B; + +$blue-light: #2EA8E5; +$blue-normal: #2D9FD8; +$blue-dark: #2897CE; + +$orange-light: #FC6443; +$orange-normal: #E75E40; +$orange-dark: #CE5237; + +$red-light: #F43263; +$red-normal: #E52C5A; +$red-dark: #D22852; + +$border-white-light: #E3E7EC; +$border-white-normal: #D6DAE2; +$border-white-dark: #C6CACF; + +$border-gray-light: #DCE0E5; +$border-gray-normal: #D6DAE2; +$border-gray-dark: #C6CACF; + +$border-green-light: #2FAA60; +$border-green-normal: #2CA05B; +$border-green-dark: #279654; + +$border-blue-light: #2D9FD8; +$border-blue-normal: #2897CE; +$border-blue-dark: #258DC1; + +$border-orange-light: #ED5C3D; +$border-orange-normal: #CE5237; +$border-orange-dark: #C14E35; + +$border-red-light: #E52C5A; +$border-red-normal: #D22852; +$border-red-dark: #CA264F; + /* * State colors: */ -$gl-primary: #446e9b; -$gl-success: #44c679; -$gl-info: #00aaff; -$gl-warning: #EB9532; -$gl-danger: #d9534f; +$gl-primary: $blue-normal; +$gl-success: $green-normal; +$gl-info: $blue-normal; +$gl-warning: $orange-normal; +$gl-danger: $red-normal; /* * Commit Diff Colors diff --git a/app/assets/stylesheets/generic/buttons.scss b/app/assets/stylesheets/generic/buttons.scss index 62922e6a330..11acbe3adfa 100644 --- a/app/assets/stylesheets/generic/buttons.scss +++ b/app/assets/stylesheets/generic/buttons.scss @@ -1,6 +1,5 @@ @mixin btn-default { @include border-radius(2px); - border-width: 1px; border-style: solid; text-transform: uppercase; @@ -10,150 +9,62 @@ padding: 11px 16px; letter-spacing: .4px; - &:hover { - border-width: 1px; - border-style: solid; - } - - &:focus { - border-width: 1px; - border-style: solid; - } - + &:focus, &:active { + outline: none; @include box-shadow(inset 0 0 4px rgba(0, 0, 0, 0.12)); - border-width: 1px; - border-style: solid; } } @mixin btn-middle { + @include btn-default; @include border-radius(2px); - - border-width: 1px; - border-style: solid; - text-transform: uppercase; - font-size: 13px; - font-weight: 600; - line-height: 18px; padding: 11px 24px; - letter-spacing: .4px; - - &:hover { - border-width: 1px; - border-style: solid; - } - - &:focus { - border-width: 1px; - border-style: solid; - } - - &:active { - @include box-shadow(inset 0 0 4px rgba(0, 0, 0, 0.12)); - border-width: 1px; - border-style: solid; - } } +@mixin btn-color($light, $border-light, $normal, $border-normal, $dark, $border-dark, $color) { + background-color: $light; + border-color: $border-light; + color: $color; -@mixin btn-green { - background-color: #28b061; - border: 1px solid #26a65c; - color: #fff; - - &:hover { - background-color: #26ab5d; - border: 1px solid #229954; - color: #fff; - } - + &:hover, &:focus { - background-color: #26ab5d; - border: 1px solid #229954; - color: #fff; + background-color: $normal; + border-color: $border-normal; + color: $color; } &:active { @include box-shadow (inset 0 0 4px rgba(0, 0, 0, 0.12)); - background-color: #23a158 !important; - border: 1px solid #229954 !important; - color: #fff !important; + background-color: $dark; + border-color: $border-dark; + color: $color; } } -@mixin btn-gray { - background-color: #f0f2f5; - border-color: #dce0e5; - color: #313236; - - &:hover { - border-color:#dce0e5; - background-color: #ebeef2; - color: #313236; - } - - &:focus { - border-color: #dce0e5; - background-color: #ebeef2; - color: #313236; - } - - &:active { - @include box-shadow(inset 0 0 4px rgba(0, 0, 0, 0.12)); - - color: #313236 !important; - border-color: #c6cacf !important; - background-color: #e4e7ed !important; - } +@mixin btn-green { + @include btn-color($green-light, $border-green-light, $green-normal, $border-green-normal, $green-dark, $border-green-dark, #FFFFFF); } -@mixin btn-white { - background-color: #fff; - border-color: #dce0e5; - color: #313236; - - &:hover { - border-color:#dce0e5; - background-color: #f0f2f5; - color: #313236; - } - - &:focus { - border-color: #dce0e5; - background-color: #f0f2f5; - color: #313236; - } - - &:active { - @include box-shadow(inset 0 0 4px rgba(0, 0, 0, 0.12)); +@mixin btn-blue { + @include btn-color($blue-light, $border-blue-light, $blue-normal, $border-blue-normal, $blue-dark, $border-blue-dark, #FFFFFF); +} - color: #313236 !important; - border-color: #c6cacf !important; - background-color: #e4e7ed !important; - } +@mixin btn-orange { + @include btn-color($orange-light, $border-orange-light, $orange-normal, $border-orange-normal, $orange-dark, $border-orange-dark, #FFFFFF); } @mixin btn-red { - background-color: #f72e60; - border-color: #ee295a; - - &:hover { - background-color: #e82757; - border-color: #e32555; - } + @include btn-color($red-light, $border-red-light, $red-normal, $border-red-normal, $red-dark, $border-red-dark, #FFFFFF); +} - &:focus { - background-color: #e82757; - border-color: #e32555; - } +@mixin btn-gray { + @include btn-color($gray-light, $border-gray-light, $gray-normal, $border-gray-normal, $gray-dark, $border-gray-dark, #313236); +} - &:active { - @include box-shadow(inset 0 0 4px rgba(0, 0, 0, 0.12)); - background-color: #d42450 !important; - border-color: #e12554 !important; - } +@mixin btn-white { + @include btn-color($white-light, $border-white-light, $white-normal, $border-white-normal, $white-dark, $border-white-dark, #313236); } .btn { @@ -172,6 +83,15 @@ @include btn-gray; } + &.btn-primary, + &.btn-info { + @include btn-blue; + } + + &.btn-warning { + @include btn-orange; + } + &.btn-danger, &.btn-remove, &.btn-red { diff --git a/app/assets/stylesheets/pages/commits.scss b/app/assets/stylesheets/pages/commits.scss index de2ae93df37..4e121b95d13 100644 --- a/app/assets/stylesheets/pages/commits.scss +++ b/app/assets/stylesheets/pages/commits.scss @@ -1,5 +1,6 @@ .commits-compare-switch{ - @extend .btn; + @include btn-default; + @include btn-white; background: image-url("switch_icon.png") no-repeat center center; text-indent: -9999px; float: left; diff --git a/app/views/help/ui.html.haml b/app/views/help/ui.html.haml index 7c89457ace3..1bd271477e4 100644 --- a/app/views/help/ui.html.haml +++ b/app/views/help/ui.html.haml @@ -107,6 +107,7 @@ .example %button.btn.btn-default{:type => "button"} Default + %button.btn.btn-gray{:type => "button"} Gray %button.btn.btn-primary{:type => "button"} Primary %button.btn.btn-success{:type => "button"} Success %button.btn.btn-info{:type => "button"} Info diff --git a/app/views/projects/merge_requests/_show.html.haml b/app/views/projects/merge_requests/_show.html.haml index 58d8478744e..e7ac7a0eaa4 100644 --- a/app/views/projects/merge_requests/_show.html.haml +++ b/app/views/projects/merge_requests/_show.html.haml @@ -34,7 +34,7 @@ = render "projects/merge_requests/widget/show.html.haml" - if @merge_request.open? && @merge_request.can_be_merged? - .light + .light.append-bottom-20 You can also accept this merge request manually using the = link_to "command line", "#modal_merge_info", class: "how_to_merge_link vlink", title: "How To Merge", "data-toggle" => "modal" -- cgit v1.2.1 From dc400a7414e5b26893d002ce42bfaf15c0ccae79 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 8 Oct 2015 13:47:59 +0200 Subject: Improve help/ui page Signed-off-by: Dmitriy Zaporozhets --- app/views/help/ui.html.haml | 51 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 48 insertions(+), 3 deletions(-) (limited to 'app') diff --git a/app/views/help/ui.html.haml b/app/views/help/ui.html.haml index 1bd271477e4..2169a821fb2 100644 --- a/app/views/help/ui.html.haml +++ b/app/views/help/ui.html.haml @@ -14,6 +14,8 @@ = link_to 'Lists', '#lists' %li = link_to 'Tables', '#tables' + %li + = link_to 'Nav', '#nav' %li = link_to 'Buttons', '#buttons' %li @@ -30,16 +32,31 @@ %h2#blocks Blocks %h3 - %code .well + %code .gray-content-block + - .well - %h4 Something + .gray-content-block.middle-block + %h4 Normal block inside content + = lorem + + .gray-content-block.second-block + %h4 Second block = lorem %h2#lists Lists + %h3 + %code .content-list + %ul.content-list + %li + One item + %li + One item + %li + One item + %h3 %code .well-list %ul.well-list @@ -102,6 +119,34 @@ %td the Bird %td @twitter + %h2#navs Navigation + + %h3 + %code .center-top-menu + .example + %ul.center-top-menu + %li.active + %a Open + %li + %a Closed + + %h3 + %code .btn-group.btn-group-next + .example + %div.btn-group.btn-group-next + %a.btn.active Open + %a.btn Closed + + + %h3 + %code .nav.nav-tabs + .example + %ul.nav.nav-tabs + %li.active + %a Open + %li + %a Closed + %h2#buttons Buttons -- cgit v1.2.1 From 03417456f0b7db408bfefd28e5b9342889b7f711 Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Wed, 7 Oct 2015 17:37:39 +0200 Subject: Revamp finding projects by namespaces By using a JOIN we can remove the need for using 2 separate queries to find a project by its namespace. Combined with an index (only needed for PostgreSQL) this reduces the query time from ~245 ms (~520 ms for the first call) down to roughly 10 ms (~15 ms for the first call). --- app/models/concerns/case_sensitivity.rb | 2 +- app/models/project.rb | 20 +++++++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) (limited to 'app') diff --git a/app/models/concerns/case_sensitivity.rb b/app/models/concerns/case_sensitivity.rb index 49d350e092b..fe0cea8465f 100644 --- a/app/models/concerns/case_sensitivity.rb +++ b/app/models/concerns/case_sensitivity.rb @@ -6,7 +6,7 @@ module CaseSensitivity # Queries the given columns regardless of the casing used. # # Unlike other ActiveRecord methods this method only operates on a Hash. - def case_insensitive_where(params) + def iwhere(params) criteria = self cast_lower = Gitlab::Database.postgresql? diff --git a/app/models/project.rb b/app/models/project.rb index bb47b9abb03..f75082a35d0 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -40,6 +40,7 @@ class Project < ActiveRecord::Base include Referable include Sortable include AfterCommitQueue + include CaseSensitivity extend Gitlab::ConfigHelper extend Enumerize @@ -235,13 +236,18 @@ class Project < ActiveRecord::Base end def find_with_namespace(id) - return nil unless id.include?('/') - - id = id.split('/') - namespace = Namespace.by_path(id.first) - return nil unless namespace - - where(namespace_id: namespace.id).where("LOWER(projects.path) = :path", path: id.second.downcase).first + namespace_path, project_path = id.split('/') + + return nil if !namespace_path || !project_path + + # Use of unscoped ensures we're not secretly adding any ORDER BYs, which + # have a negative impact on performance (and aren't needed for this + # query). + unscoped. + joins(:namespace). + iwhere('namespaces.path' => namespace_path). + iwhere('projects.path' => project_path). + take end def visibility_levels -- cgit v1.2.1 From 380392212f87fc80bd45c322eda54461d47745b0 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Wed, 30 Sep 2015 17:12:33 -0400 Subject: merge_request: coerce work_in_progress? into a boolean --- app/models/merge_request.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb index eb468c6cd53..f69b7a13c4b 100644 --- a/app/models/merge_request.rb +++ b/app/models/merge_request.rb @@ -227,7 +227,7 @@ class MergeRequest < ActiveRecord::Base end def work_in_progress? - title =~ /\A\[?WIP\]?:? /i + !!(title =~ /\A\[?WIP\]?:? /i) end def mergeable? -- cgit v1.2.1 From fce4f1380319d3436e66cc530f272e25350c3cf9 Mon Sep 17 00:00:00 2001 From: Drew Blessing Date: Fri, 25 Sep 2015 13:38:12 -0500 Subject: Show message if user tries to fork and has no available namespaces --- app/views/projects/forks/new.html.haml | 63 ++++++++++++++++++---------------- 1 file changed, 34 insertions(+), 29 deletions(-) (limited to 'app') diff --git a/app/views/projects/forks/new.html.haml b/app/views/projects/forks/new.html.haml index cd5f3a5d39e..f0b0a11c04a 100644 --- a/app/views/projects/forks/new.html.haml +++ b/app/views/projects/forks/new.html.haml @@ -1,36 +1,41 @@ - page_title "Fork project" -%h3.page-title Fork project -%p.lead - Click to fork the project to a user or group -%hr +- if @namespaces.present? + %h3.page-title Fork project + %p.lead + Click to fork the project to a user or group + %hr -.fork-namespaces - - @namespaces.in_groups_of(6, false) do |group| - .row - - group.each do |namespace| - .col-md-2.col-sm-3 - - if fork = namespace.find_fork_of(@project) - .fork-thumbnail - = link_to project_path(fork), title: "Visit project fork", class: 'has_tooltip' do - = image_tag namespace_icon(namespace, 100) - .caption - %strong - = namespace.human_name - %div.text-primary - Already forked + .fork-namespaces + - @namespaces.in_groups_of(6, false) do |group| + .row + - group.each do |namespace| + .col-md-2.col-sm-3 + - if fork = namespace.find_fork_of(@project) + .fork-thumbnail + = link_to project_path(fork), title: "Visit project fork", class: 'has_tooltip' do + = image_tag namespace_icon(namespace, 100) + .caption + %strong + = namespace.human_name + %div.text-primary + Already forked - - else - .fork-thumbnail - = link_to namespace_project_fork_path(@project.namespace, @project, namespace_key: namespace.id), title: "Fork here", method: "POST", class: 'has_tooltip' do - = image_tag namespace_icon(namespace, 100) - .caption - %strong - = namespace.human_name + - else + .fork-thumbnail + = link_to namespace_project_fork_path(@project.namespace, @project, namespace_key: namespace.id), title: "Fork here", method: "POST", class: 'has_tooltip' do + = image_tag namespace_icon(namespace, 100) + .caption + %strong + = namespace.human_name - %p.light - Fork is a copy of a project repository. - %br - Forking a repository allows you to do changes without affecting the original project. + %p.light + Fork is a copy of a project repository. + %br + Forking a repository allows you to do changes without affecting the original project. +- else + %h3 No available namespaces to fork the project + %p.slead + You must have permission to create a project in a namespace before forking. .save-project-loader.hide .center -- cgit v1.2.1 From 6b739027330cb07484b71c748e30d5966f63d647 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Fri, 25 Sep 2015 16:07:08 -0400 Subject: merge_request: add work_in_progress to MR hooks --- app/models/merge_request.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb index f69b7a13c4b..c83b15c7d39 100644 --- a/app/models/merge_request.rb +++ b/app/models/merge_request.rb @@ -275,7 +275,8 @@ class MergeRequest < ActiveRecord::Base attrs = { source: source_project.hook_attrs, target: target_project.hook_attrs, - last_commit: nil + last_commit: nil, + work_in_progress: work_in_progress? } unless last_commit.nil? -- cgit v1.2.1 From 29fe488b0cf9f8a79aad774c912be94bb737d36a Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Thu, 8 Oct 2015 20:53:29 -0400 Subject: Make the loading spinner toggle more explicit Occasionally the loading spinner would stay visible after the tab finished loading. This change makes the toggle explicit so that it's always shown on `beforeSend`, and always hidden on `complete`. Plus a bonus semi-colon eradication! :boom: --- app/assets/javascripts/merge_request_tabs.js.coffee | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'app') diff --git a/app/assets/javascripts/merge_request_tabs.js.coffee b/app/assets/javascripts/merge_request_tabs.js.coffee index 4e56791bde4..3e77ea515f8 100644 --- a/app/assets/javascripts/merge_request_tabs.js.coffee +++ b/app/assets/javascripts/merge_request_tabs.js.coffee @@ -69,7 +69,7 @@ class @MergeRequestTabs scrollToElement: (container) -> if window.location.hash top = $(container + " " + window.location.hash).offset().top - $('body').scrollTo(top); + $('body').scrollTo(top) # Activate a tab based on the current action activateTab: (action) -> @@ -139,13 +139,16 @@ class @MergeRequestTabs @diffsLoaded = true @scrollToElement(".diffs") - toggleLoading: -> - $('.mr-loading-status .loading').toggle() + # Show or hide the loading spinner + # + # status - Boolean, true to show, false to hide + toggleLoading: (status) -> + $('.mr-loading-status .loading').toggle(status) _get: (options) -> defaults = { - beforeSend: @toggleLoading - complete: @toggleLoading + beforeSend: => @toggleLoading(true) + complete: => @toggleLoading(false) dataType: 'json' type: 'GET' } -- cgit v1.2.1 From 95411f7151a8e1058731a6eb5fefcf7d91312b58 Mon Sep 17 00:00:00 2001 From: Han Loong Liauw Date: Fri, 9 Oct 2015 14:05:55 +1100 Subject: fixed positioning of hamburger menu on header - Changed to margin for vertical allign as used in bootstrap 3 original - Also added an `active` state to show when the extra items are enabled --- app/assets/javascripts/application.js.coffee | 1 + app/assets/stylesheets/generic/header.scss | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/assets/javascripts/application.js.coffee b/app/assets/javascripts/application.js.coffee index 8e987ac4e83..945ffb660e6 100644 --- a/app/assets/javascripts/application.js.coffee +++ b/app/assets/javascripts/application.js.coffee @@ -180,6 +180,7 @@ $ -> $('.navbar-toggle').on 'click', -> $('.header-content .title').toggle() $('.header-content .navbar-collapse').toggle() + $('.navbar-toggle').toggleClass('active') # Show/hide comments on diff $("body").on "click", ".js-toggle-diff-comments", (e) -> diff --git a/app/assets/stylesheets/generic/header.scss b/app/assets/stylesheets/generic/header.scss index 543ce41ab52..91e6975e269 100644 --- a/app/assets/stylesheets/generic/header.scss +++ b/app/assets/stylesheets/generic/header.scss @@ -50,15 +50,17 @@ header { .navbar-toggle { color: #666; - margin: 0; + margin: 6px 0; border-radius: 0; position: absolute; right: 2px; - top: 15px; &:hover { background-color: #EEE; } + &.active { + color: #7f8fa4; + } } } } @@ -87,6 +89,7 @@ header { .navbar-collapse { float: right; + border-top: none; } } -- cgit v1.2.1 From b60bc655f2e1318f448f3a3d884437677c1135b7 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Thu, 8 Oct 2015 21:24:55 -0700 Subject: Restore placeholders in issue filters from "Any" to "Milestone" and "Label" 1f11096c included new filters but made it hard to determine which dropdown did what. This patch restores the original placeholders. --- app/helpers/labels_helper.rb | 3 ++- app/helpers/milestones_helper.rb | 3 ++- app/models/group_milestone.rb | 2 ++ app/models/label.rb | 4 +++- app/models/milestone.rb | 6 +++++- app/views/shared/issuable/_filter.html.haml | 4 ++-- 6 files changed, 16 insertions(+), 6 deletions(-) (limited to 'app') diff --git a/app/helpers/labels_helper.rb b/app/helpers/labels_helper.rb index 662ace367b9..66b18eea699 100644 --- a/app/helpers/labels_helper.rb +++ b/app/helpers/labels_helper.rb @@ -95,7 +95,8 @@ module LabelsHelper def project_labels_options(project) labels = project.labels.to_a labels.unshift(Label::None) - options_from_collection_for_select(labels, 'name', 'name', params[:label_name]) + labels.unshift(Label::Any) + options_from_collection_for_select(labels, 'name', 'title', params[:label_name]) end # Required for Gitlab::Markdown::LabelReferenceFilter diff --git a/app/helpers/milestones_helper.rb b/app/helpers/milestones_helper.rb index 132a893e532..37a5b58cce8 100644 --- a/app/helpers/milestones_helper.rb +++ b/app/helpers/milestones_helper.rb @@ -30,7 +30,8 @@ module MilestonesHelper grouped_milestones = Milestones::GroupService.new(milestones).execute grouped_milestones.unshift(Milestone::None) + grouped_milestones.unshift(Milestone::Any) - options_from_collection_for_select(grouped_milestones, 'title', 'title', params[:milestone_title]) + options_from_collection_for_select(grouped_milestones, 'name', 'title', params[:milestone_title]) end end diff --git a/app/models/group_milestone.rb b/app/models/group_milestone.rb index ab055f6b80b..1dd2be68ebf 100644 --- a/app/models/group_milestone.rb +++ b/app/models/group_milestone.rb @@ -1,5 +1,7 @@ class GroupMilestone + alias_attribute :name, :title + def initialize(title, milestones) @title = title @milestones = milestones diff --git a/app/models/label.rb b/app/models/label.rb index 14b544b3756..1bb4b5f55cf 100644 --- a/app/models/label.rb +++ b/app/models/label.rb @@ -14,7 +14,9 @@ class Label < ActiveRecord::Base include Referable # Represents a "No Label" state used for filtering Issues and Merge # Requests that have no label assigned. - None = Struct.new(:title, :name).new('No Label', 'No Label') + LabelStruct = Struct.new(:title, :name) + None = LabelStruct.new('No Label', 'No Label') + Any = LabelStruct.new('Any', '') DEFAULT_COLOR = '#428BCA' diff --git a/app/models/milestone.rb b/app/models/milestone.rb index d979a35084b..84acba30b6b 100644 --- a/app/models/milestone.rb +++ b/app/models/milestone.rb @@ -16,7 +16,9 @@ class Milestone < ActiveRecord::Base # Represents a "No Milestone" state used for filtering Issues and Merge # Requests that have no milestone assigned. - None = Struct.new(:title).new('No Milestone') + MilestoneStruct = Struct.new(:title, :name) + None = MilestoneStruct.new('No Milestone', 'No Milestone') + Any = MilestoneStruct.new('Any', '') include InternalId include Sortable @@ -47,6 +49,8 @@ class Milestone < ActiveRecord::Base state :active end + alias_attribute :name, :title + class << self def search(query) query = "%#{query}%" diff --git a/app/views/shared/issuable/_filter.html.haml b/app/views/shared/issuable/_filter.html.haml index 6e6d497c1d2..8f16773077e 100644 --- a/app/views/shared/issuable/_filter.html.haml +++ b/app/views/shared/issuable/_filter.html.haml @@ -39,13 +39,13 @@ .filter-item.inline.milestone-filter = select_tag('milestone_title', projects_milestones_options, - class: 'select2 trigger-submit', include_blank: 'Any', + class: 'select2 trigger-submit', include_blank: true, data: {placeholder: 'Milestone'}) - if @project .filter-item.inline.labels-filter = select_tag('label_name', project_labels_options(@project), - class: 'select2 trigger-submit', include_blank: 'Any', + class: 'select2 trigger-submit', include_blank: true, data: {placeholder: 'Label'}) .pull-right -- cgit v1.2.1 From b5d9a613d98dc5ae629bdc004f19be7c8e5fcd8e Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Thu, 8 Oct 2015 13:22:34 -0700 Subject: Make diff file view easier to use on mobile screens --- app/assets/stylesheets/pages/diff.scss | 114 ++++++++++++++--------- app/assets/stylesheets/pages/merge_requests.scss | 18 +++- app/views/projects/diffs/_file.html.haml | 2 +- 3 files changed, 89 insertions(+), 45 deletions(-) (limited to 'app') diff --git a/app/assets/stylesheets/pages/diff.scss b/app/assets/stylesheets/pages/diff.scss index 5e7e59a6af8..d9ef06dc6b6 100644 --- a/app/assets/stylesheets/pages/diff.scss +++ b/app/assets/stylesheets/pages/diff.scss @@ -1,3 +1,4 @@ +// Common .diff-file { margin-left: -$gl-padding; margin-right: -$gl-padding; @@ -12,24 +13,17 @@ color: #555; z-index: 10; - > span { + .diff-title { font-family: $monospace_font; word-break: break-all; - margin-right: 200px; display: block; .file-mode { - margin-left: 10px; color: #777; } } - .diff-btn-group { - float: right; - position: absolute; - top: 5px; - right: 15px; - + .diff-controls { .btn { padding: 0px 10px; font-size: 13px; @@ -90,12 +84,12 @@ } } - tr.line_holder.parallel{ + tr.line_holder.parallel { .old_line, .new_line, .diff_line { min-width: 50px; } - td.line_content.parallel{ + td.line_content.parallel { width: 50%; } } @@ -105,7 +99,7 @@ padding: 0px; border: none; background: $background-color; - color: rgba(0,0,0,0.3); + color: rgba(0, 0, 0, 0.3); padding: 0px 5px; border-right: 1px solid $border-color; text-align: right; @@ -117,7 +111,7 @@ float: left; width: 35px; font-weight: normal; - color: rgba(0,0,0,0.3); + color: rgba(0, 0, 0, 0.3); &:hover { text-decoration: underline; } @@ -168,7 +162,7 @@ background: #ddd; text-align: center; padding: 30px; - .wrap{ + .wrap { display: inline-block; } @@ -176,7 +170,7 @@ display: inline-block; background-color: #fff; line-height: 0; - img{ + img { border: 1px solid #FFF; background: image-url('trans_bg.gif'); max-width: 100%; @@ -189,21 +183,21 @@ border: 1px solid $added; } } - .image-info{ + .image-info { font-size: 12px; margin: 5px 0 0 0; color: grey; } - .view.swipe{ + .view.swipe { position: relative; - .swipe-frame{ + .swipe-frame { display: block; margin: auto; position: relative; } - .swipe-wrap{ + .swipe-wrap { overflow: hidden; border-left: 1px solid #999; position: absolute; @@ -211,33 +205,33 @@ top: 13px; right: 7px; } - .frame{ + .frame { top: 0; right: 0; position: absolute; - &.deleted{ + &.deleted { margin: 0; display: block; top: 13px; right: 7px; } } - .swipe-bar{ + .swipe-bar { display: block; height: 100%; width: 15px; z-index: 100; position: absolute; cursor: pointer; - &:hover{ - .top-handle{ + &:hover { + .top-handle { background-position: -15px 3px; } - .bottom-handle{ + .bottom-handle { background-position: -15px -11px; } - }; - .top-handle{ + } + .top-handle { display: block; height: 14px; width: 15px; @@ -245,7 +239,7 @@ top: 0px; background: image-url('swipemode_sprites.gif') 0 3px no-repeat; } - .bottom-handle{ + .bottom-handle { display: block; height: 14px; width: 15px; @@ -254,9 +248,10 @@ background: image-url('swipemode_sprites.gif') 0 -11px no-repeat; } } - } //.view.swipe - .view.onion-skin{ - .onion-skin-frame{ + } + //.view.swipe + .view.onion-skin { + .onion-skin-frame { display: block; margin: auto; position: relative; @@ -267,7 +262,7 @@ top: 0px; left: 0px; } - .controls{ + .controls { display: block; height: 14px; width: 300px; @@ -277,7 +272,7 @@ left: 50%; margin-left: -150px; - .drag-track{ + .drag-track { display: block; position: absolute; left: 12px; @@ -317,39 +312,40 @@ background: image-url('onion_skin_sprites.gif') -2px -10px no-repeat; } } - } //.view.onion-skin + } + //.view.onion-skin } - .view-modes{ + .view-modes { padding: 10px; text-align: center; background: #EEE; - ul, li{ + ul, li { list-style: none; margin: 0; padding: 0; display: inline-block; } - li{ + li { color: grey; border-left: 1px solid #c1c1c1; padding: 0 12px 0 16px; cursor: pointer; - &:first-child{ + &:first-child { border-left: none; } - &:hover{ + &:hover { text-decoration: underline; } - &.active{ - &:hover{ + &.active { + &:hover { text-decoration: none; } cursor: default; color: #333; } - &.disabled{ + &.disabled { display: none; } } @@ -373,3 +369,37 @@ float: right; margin-top: -5px; } + +// Mobile +@media (max-width: 480px) { + .diff-title { + margin: 0; + + .file-mode { + display: none; + } + } + + .diff-controls { + position: static; + text-align: center; + } +} + +// Bigger screens +@media (min-width: 481px) { + .diff-title { + margin-right: 200px; + + .file-mode { + margin-left: 10px; + } + } + + .diff-controls { + float: right; + position: absolute; + top: 5px; + right: 15px; + } +} diff --git a/app/assets/stylesheets/pages/merge_requests.scss b/app/assets/stylesheets/pages/merge_requests.scss index fe69d16fc4b..a1a5208c59c 100644 --- a/app/assets/stylesheets/pages/merge_requests.scss +++ b/app/assets/stylesheets/pages/merge_requests.scss @@ -75,7 +75,7 @@ .mr-widget-footer { padding: 15px; } - + .normal { color: #5c5d5e; } @@ -102,7 +102,7 @@ } } -.merge-request .merge-request-tabs{ +.merge-request .merge-request-tabs { @include nav-menu; margin: -$gl-padding; padding: $gl-padding; @@ -110,6 +110,20 @@ margin-bottom: 1px; } +// Mobile +@media (max-width: 480px) { + .merge-request .merge-request-tabs { + margin: 0; + padding: 0; + + li { + a { + padding: 0; + } + } + } +} + .mr_source_commit, .mr_target_commit { .commit { diff --git a/app/views/projects/diffs/_file.html.haml b/app/views/projects/diffs/_file.html.haml index 4617b188150..9698921f6da 100644 --- a/app/views/projects/diffs/_file.html.haml +++ b/app/views/projects/diffs/_file.html.haml @@ -16,7 +16,7 @@ - if diff_file.mode_changed? %span.file-mode= "#{diff_file.diff.a_mode} → #{diff_file.diff.b_mode}" - .diff-btn-group + .diff-controls - if blob.text? = link_to '#', class: 'js-toggle-diff-comments btn btn-sm active has_tooltip', title: "Toggle comments for this file" do %i.fa.fa-comments -- cgit v1.2.1 From 972b6370819f61eb04d1f0e795b4b6c4ddc2327a Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Fri, 9 Oct 2015 05:30:42 -0700 Subject: In SSH key detailed view, align the "Remove" button with the right container --- app/views/profiles/keys/_key_details.html.haml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/views/profiles/keys/_key_details.html.haml b/app/views/profiles/keys/_key_details.html.haml index e0ae4d9720f..0ca8bd95157 100644 --- a/app/views/profiles/keys/_key_details.html.haml +++ b/app/views/profiles/keys/_key_details.html.haml @@ -18,5 +18,6 @@ %code.key-fingerprint= @key.fingerprint %pre.well-pre = @key.key - .pull-right - = link_to 'Remove', path_to_key(@key, is_admin), data: {confirm: 'Are you sure?'}, method: :delete, class: "btn btn-remove delete-key" + .col-md-12 + .pull-right + = link_to 'Remove', path_to_key(@key, is_admin), data: {confirm: 'Are you sure?'}, method: :delete, class: "btn btn-remove delete-key" -- cgit v1.2.1 From a972ce17caadc64fc6fa1888301e99c149848f36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A7=D0=B8=D0=BD=D0=B3=D0=B8=D0=B7=20=D0=90=D1=83=D0=B0?= =?UTF-8?q?=D0=BD=D0=B0=D1=81=D0=BE=D0=B2?= Date: Sat, 10 Oct 2015 14:07:12 +0600 Subject: + and Titleize New Project button on dashboard --- app/views/dashboard/projects/_projects.html.haml | 2 +- app/views/groups/_projects.html.haml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/views/dashboard/projects/_projects.html.haml b/app/views/dashboard/projects/_projects.html.haml index e09e032a7f1..30372e98430 100644 --- a/app/views/dashboard/projects/_projects.html.haml +++ b/app/views/dashboard/projects/_projects.html.haml @@ -5,6 +5,6 @@ - if current_user.can_create_project? %span.input-group-btn = link_to new_project_path, class: 'btn btn-green' do - New project + + New Project = render 'shared/projects/list', projects: @projects, ci: true diff --git a/app/views/groups/_projects.html.haml b/app/views/groups/_projects.html.haml index 2b27a88794d..9c73f7a0ef7 100644 --- a/app/views/groups/_projects.html.haml +++ b/app/views/groups/_projects.html.haml @@ -5,6 +5,6 @@ - if can? current_user, :create_projects, @group %span.input-group-btn = link_to new_project_path(namespace_id: @group.id), class: 'btn btn-green' do - New project + + New Project = render 'shared/projects/list', projects: @projects, projects_limit: 20, stars: false -- cgit v1.2.1 From 78de79d779c1eb8b462fd1b5beb9f9e38bfb6f36 Mon Sep 17 00:00:00 2001 From: Jerry Lukins Date: Thu, 8 Oct 2015 07:53:05 -0400 Subject: Persist filters when sorting on user admin page --- app/views/admin/users/index.html.haml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'app') diff --git a/app/views/admin/users/index.html.haml b/app/views/admin/users/index.html.haml index e3698ac1c46..97e4bb2fd73 100644 --- a/app/views/admin/users/index.html.haml +++ b/app/views/admin/users/index.html.haml @@ -54,19 +54,19 @@ %b.caret %ul.dropdown-menu %li - = link_to admin_users_path(sort: sort_value_name) do + = link_to admin_users_path(sort: sort_value_name, filter: params[:filter]) do = sort_title_name - = link_to admin_users_path(sort: sort_value_recently_signin) do + = link_to admin_users_path(sort: sort_value_recently_signin, filter: params[:filter]) do = sort_title_recently_signin - = link_to admin_users_path(sort: sort_value_oldest_signin) do + = link_to admin_users_path(sort: sort_value_oldest_signin, filter: params[:filter]) do = sort_title_oldest_signin - = link_to admin_users_path(sort: sort_value_recently_created) do + = link_to admin_users_path(sort: sort_value_recently_created, filter: params[:filter]) do = sort_title_recently_created - = link_to admin_users_path(sort: sort_value_oldest_created) do + = link_to admin_users_path(sort: sort_value_oldest_created, filter: params[:filter]) do = sort_title_oldest_created - = link_to admin_users_path(sort: sort_value_recently_updated) do + = link_to admin_users_path(sort: sort_value_recently_updated, filter: params[:filter]) do = sort_title_recently_updated - = link_to admin_users_path(sort: sort_value_oldest_updated) do + = link_to admin_users_path(sort: sort_value_oldest_updated, filter: params[:filter]) do = sort_title_oldest_updated = link_to 'New User', new_admin_user_path, class: "btn btn-new btn-sm" -- cgit v1.2.1 From 914cfbd2f154ed3154a7dc3cee3309713eea786f Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Tue, 6 Oct 2015 12:01:16 +0200 Subject: Implement Commit Status API --- app/models/ability.rb | 2 + app/models/ci/build.rb | 87 ++++----------------- app/models/ci/commit.rb | 88 ++++++++++------------ app/models/commit.rb | 8 ++ app/models/commit_status.rb | 79 +++++++++++++++++++ app/models/generic_commit_status.rb | 15 ++++ app/services/ci/create_commit_service.rb | 2 + app/views/projects/builds/_build.html.haml | 50 ------------ app/views/projects/builds/show.html.haml | 6 +- app/views/projects/commit/ci.html.haml | 36 +++++++-- .../commit_statuses/_commit_status.html.haml | 52 +++++++++++++ 11 files changed, 246 insertions(+), 179 deletions(-) create mode 100644 app/models/commit_status.rb create mode 100644 app/models/generic_commit_status.rb delete mode 100644 app/views/projects/builds/_build.html.haml create mode 100644 app/views/projects/commit_statuses/_commit_status.html.haml (limited to 'app') diff --git a/app/models/ability.rb b/app/models/ability.rb index a020b24a550..77c121ca5e8 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -135,6 +135,8 @@ class Ability def project_report_rules project_guest_rules + [ + :create_commit_status, + :read_commit_statuses, :download_code, :fork_project, :create_project_snippet, diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index 5d17f4418ed..41ce522b2ff 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -24,32 +24,19 @@ # module Ci - class Build < ActiveRecord::Base - extend Ci::Model - + class Build < CommitStatus LAZY_ATTRIBUTES = ['trace'] - belongs_to :commit, class_name: 'Ci::Commit' belongs_to :runner, class_name: 'Ci::Runner' belongs_to :trigger_request, class_name: 'Ci::TriggerRequest' - belongs_to :user serialize :options - validates :commit, presence: true - validates :status, presence: true validates :coverage, numericality: true, allow_blank: true validates_presence_of :ref - scope :running, ->() { where(status: "running") } - scope :pending, ->() { where(status: "pending") } - scope :success, ->() { where(status: "success") } - scope :failed, ->() { where(status: "failed") } scope :unstarted, ->() { where(runner_id: nil) } - scope :running_or_pending, ->() { where(status:[:running, :pending]) } - scope :latest, ->() { where(id: unscope(:select).select('max(id)').group(:name, :ref)).order(stage_idx: :asc) } scope :ignore_failures, ->() { where(allow_failure: false) } - scope :for_ref, ->(ref) { where(ref: ref) } scope :similar, ->(build) { where(ref: build.ref, tag: build.tag, trigger_request_id: build.trigger_request_id) } acts_as_taggable @@ -74,13 +61,14 @@ module Ci def create_from(build) new_build = build.dup - new_build.status = :pending + new_build.status = 'pending' new_build.runner_id = nil + new_build.trigger_request_id = nil new_build.save end def retry(build) - new_build = Ci::Build.new(status: :pending) + new_build = Ci::Build.new(status: 'pending') new_build.ref = build.ref new_build.tag = build.tag new_build.options = build.options @@ -98,28 +86,7 @@ module Ci end state_machine :status, initial: :pending do - event :run do - transition pending: :running - end - - event :drop do - transition running: :failed - end - - event :success do - transition running: :success - end - - event :cancel do - transition [:pending, :running] => :canceled - end - - after_transition pending: :running do |build, transition| - build.update_attributes started_at: Time.now - end - after_transition any => [:success, :failed, :canceled] do |build, transition| - build.update_attributes finished_at: Time.now project = build.project if project.web_hooks? @@ -136,19 +103,10 @@ module Ci build.update_coverage end end - - state :pending, value: 'pending' - state :running, value: 'running' - state :failed, value: 'failed' - state :success, value: 'success' - state :canceled, value: 'canceled' end - delegate :sha, :short_sha, :project, :gl_project, - to: :commit, prefix: false - - def before_sha - Gitlab::Git::BLANK_SHA + def ignored? + failed? && allow_failure? end def trace_html @@ -156,22 +114,6 @@ module Ci html || '' end - def started? - !pending? && !canceled? && started_at - end - - def active? - running? || pending? - end - - def complete? - canceled? || success? || failed? - end - - def ignored? - failed? && allow_failure? - end - def timeout project.timeout end @@ -180,14 +122,6 @@ module Ci yaml_variables + project_variables + trigger_variables end - def duration - if started_at && finished_at - finished_at - started_at - elsif started_at - Time.now - started_at - end - end - def project commit.project end @@ -278,6 +212,15 @@ module Ci "#{dir_to_trace}/#{id}.log" end + def description + name + end + + def target_url + Gitlab::Application.routes.url_helpers. + namespace_project_build_url(gl_project.namespace, gl_project, self) + end + private def yaml_variables diff --git a/app/models/ci/commit.rb b/app/models/ci/commit.rb index fde754a92a1..042a68681bb 100644 --- a/app/models/ci/commit.rb +++ b/app/models/ci/commit.rb @@ -20,7 +20,8 @@ module Ci extend Ci::Model belongs_to :gl_project, class_name: '::Project', foreign_key: :gl_project_id - has_many :builds, dependent: :destroy, class_name: 'Ci::Build' + has_many :statuses, dependent: :destroy, class_name: 'CommitStatus' + has_many :builds, class_name: 'Ci::Build' has_many :trigger_requests, dependent: :destroy, class_name: 'Ci::TriggerRequest' validates_presence_of :sha @@ -81,12 +82,11 @@ module Ci end def stage - running_or_pending = builds_without_retry.running_or_pending - running_or_pending.limit(1).pluck(:stage).first + running_or_pending = statuses.latest.running_or_pending + running_or_pending.first.try(:stage) end def create_builds(ref, tag, user, trigger_request = nil) - return if skip_ci? && trigger_request.blank? return unless config_processor config_processor.stages.any? do |stage| CreateBuildsService.new.execute(self, stage, ref, tag, user, trigger_request).present? @@ -94,7 +94,6 @@ module Ci end def create_next_builds(ref, tag, user, trigger_request) - return if skip_ci? && trigger_request.blank? return unless config_processor stages = builds.where(ref: ref, tag: tag, trigger_request: trigger_request).group_by(&:stage) @@ -107,39 +106,47 @@ module Ci end def refs - builds.group(:ref).pluck(:ref) + statuses.pluck(:ref).compact.uniq end - def last_ref - builds.latest.first.try(:ref) - end - - def builds_without_retry - builds.latest + def statuses_for_ref(ref = nil) + if ref + statuses.for_ref(ref) + else + statuses + end end - def builds_without_retry_for_ref(ref) - builds.for_ref(ref).latest + def builds_without_retry(ref = nil) + if ref + builds.for_ref(ref).latest + else + builds.latest + end end - def retried_builds - @retried_builds ||= (builds.order(id: :desc) - builds_without_retry) + def retried + @retried ||= (statuses.order(id: :desc) - statuses.latest) end - def status - if skip_ci? - return 'skipped' - elsif yaml_errors.present? + def status(ref = nil) + if yaml_errors.present? return 'failed' - elsif builds.none? + end + + latest_statuses = statuses.latest.to_a + latest_statuses.reject! { |status| status.try(&:allow_failure?) } + latest_statuses.select! { |status| status.ref == nil || status.ref == ref } if ref + + if latest_statuses.none? return 'skipped' - elsif success? + elsif latest_statuses.all?(&:success?) 'success' - elsif pending? + elsif latest_statuses.all?(&:pending?) 'pending' - elsif running? + elsif latest_statuses.any?(&:running?) || latest_statuses.any?(&:pending?) 'running' - elsif canceled? + elsif latest_statuses.all?(&:canceled?) 'canceled' else 'failed' @@ -147,21 +154,15 @@ module Ci end def pending? - builds_without_retry.all? do |build| - build.pending? - end + status == 'pending' end def running? - builds_without_retry.any? do |build| - build.running? || build.pending? - end + status == 'running' end def success? - builds_without_retry.all? do |build| - build.success? || build.ignored? - end + status == 'success' end def failed? @@ -169,21 +170,15 @@ module Ci end def canceled? - builds_without_retry.all? do |build| - build.canceled? - end - end - - def duration - @duration ||= builds_without_retry.select(&:duration).sum(&:duration).to_i + status == 'canceled' end - def duration_for_ref(ref) - builds_without_retry_for_ref(ref).select(&:duration).sum(&:duration).to_i + def duration(ref = nil) + statuses_for_ref(ref).latest.select(&:duration).sum(&:duration).to_i end def finished_at - @finished_at ||= builds.order('finished_at DESC').first.try(:finished_at) + @finished_at ||= statuses.order('finished_at DESC').first.try(:finished_at) end def coverage @@ -195,8 +190,8 @@ module Ci end end - def matrix_for_ref?(ref) - builds_without_retry_for_ref(ref).pluck(:id).size > 1 + def matrix?(ref) + builds_without_retry(ref).pluck(:id).size > 1 end def config_processor @@ -217,7 +212,6 @@ module Ci end def skip_ci? - return false if builds.any? git_commit_message =~ /(\[ci skip\])/ if git_commit_message end diff --git a/app/models/commit.rb b/app/models/commit.rb index aff329d71fa..d5c50013525 100644 --- a/app/models/commit.rb +++ b/app/models/commit.rb @@ -184,4 +184,12 @@ class Commit def parents @parents ||= Commit.decorate(super, project) end + + def ci_commit + project.ci_commit(sha) + end + + def status + ci_commit.try(:status) || :not_found + end end diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb new file mode 100644 index 00000000000..4c6de18527b --- /dev/null +++ b/app/models/commit_status.rb @@ -0,0 +1,79 @@ +class CommitStatus < ActiveRecord::Base + self.table_name = 'ci_builds' + + belongs_to :commit, class_name: 'Ci::Commit' + belongs_to :user + + validates :commit, presence: true + validates :status, inclusion: {in: %w(pending running failed success canceled)} + + validates_presence_of :name + + scope :running, ->() { where(status: 'running') } + scope :pending, ->() { where(status: 'pending') } + scope :success, ->() { where(status: 'success') } + scope :failed, ->() { where(status: 'failed') } + scope :running_or_pending, ->() { where(status:[:running, :pending]) } + scope :latest, ->() { where(id: unscope(:select).select('max(id)').group(:name, :ref)).order(stage_idx: :asc) } + scope :for_ref, ->(ref) { where(ref: [ref, nil]) } + scope :running_or_pending, ->() { where(status: [:running, :pending]) } + + state_machine :status, initial: :pending do + event :run do + transition pending: :running + end + + event :drop do + transition running: :failed + end + + event :success do + transition [:pending, :running] => :success + end + + event :cancel do + transition [:pending, :running] => :canceled + end + + after_transition pending: :running do |build, transition| + build.update_attributes started_at: Time.now + end + + after_transition any => [:success, :failed, :canceled] do |build, transition| + build.update_attributes finished_at: Time.now + end + + state :pending, value: 'pending' + state :running, value: 'running' + state :failed, value: 'failed' + state :success, value: 'success' + state :canceled, value: 'canceled' + end + + delegate :sha, :short_sha, :gl_project, + to: :commit, prefix: false + + def before_sha + Gitlab::Git::BLANK_SHA + end + + def started? + !pending? && !canceled? && started_at + end + + def active? + running? || pending? + end + + def complete? + canceled? || success? || failed? + end + + def duration + if started_at && finished_at + finished_at - started_at + elsif started_at + Time.now - started_at + end + end +end diff --git a/app/models/generic_commit_status.rb b/app/models/generic_commit_status.rb new file mode 100644 index 00000000000..fa54e3540d0 --- /dev/null +++ b/app/models/generic_commit_status.rb @@ -0,0 +1,15 @@ +class GenericCommitStatus < CommitStatus + before_validation :set_default_values + + # GitHub compatible API + alias_attribute :context, :name + + def set_default_values + self.context ||= 'default' + self.stage ||= 'external' + end + + def tags + [:external] + end +end diff --git a/app/services/ci/create_commit_service.rb b/app/services/ci/create_commit_service.rb index fc1ae5774d5..0ae35387579 100644 --- a/app/services/ci/create_commit_service.rb +++ b/app/services/ci/create_commit_service.rb @@ -17,6 +17,8 @@ module Ci tag = origin_ref.start_with?('refs/tags/') commit = project.gl_project.ensure_ci_commit(sha) + return false if commit.skip_ci? + commit.update_committed! commit.create_builds(ref, tag, user) diff --git a/app/views/projects/builds/_build.html.haml b/app/views/projects/builds/_build.html.haml deleted file mode 100644 index 65fd9413b60..00000000000 --- a/app/views/projects/builds/_build.html.haml +++ /dev/null @@ -1,50 +0,0 @@ -- gl_project = build.project.gl_project -%tr.build - %td.status - = ci_status_with_icon(build.status) - - %td.build-link - = link_to namespace_project_build_path(gl_project.namespace, gl_project, build) do - %strong Build ##{build.id} - - - if defined?(ref) - %td - = build.ref - - %td - = build.stage - - %td - = build.name - .pull-right - - if build.tags.any? - - build.tag_list.each do |tag| - %span.label.label-primary - = tag - - if build.trigger_request - %span.label.label-info triggered - - if build.allow_failure - %span.label.label-danger allowed to fail - - %td.duration - - if build.duration - #{duration_in_words(build.finished_at, build.started_at)} - - %td.timestamp - - if build.finished_at - %span #{time_ago_in_words build.finished_at} ago - - - if build.project.coverage_enabled? - %td.coverage - - if build.coverage - #{build.coverage}% - - %td - - if defined?(controls) && current_user && can?(current_user, :manage_builds, gl_project) - .pull-right - - if build.active? - = link_to cancel_namespace_project_build_path(gl_project.namespace, gl_project, build, return_to: request.original_url), title: 'Cancel build' do - %i.fa.fa-remove.cred - - elsif build.commands.present? - = link_to retry_namespace_project_build_path(gl_project.namespace, gl_project, build, return_to: request.original_url), method: :post, title: 'Retry build' do - %i.fa.fa-repeat diff --git a/app/views/projects/builds/show.html.haml b/app/views/projects/builds/show.html.haml index b561078e8c7..66e668f3771 100644 --- a/app/views/projects/builds/show.html.haml +++ b/app/views/projects/builds/show.html.haml @@ -7,9 +7,9 @@ %code #{@build.ref} #up-build-trace - - if @commit.matrix_for_ref?(@build.ref) + - if @commit.matrix?(@build.ref) %ul.center-top-menu.build-top-menu - - @commit.builds_without_retry_for_ref(@build.ref).each do |build| + - @commit.builds_without_retry(@build.ref).each do |build| %li{class: ('active' if build == @build) } = link_to namespace_project_build_path(@project.namespace, @project, build) do = ci_icon_for_status(build.status) @@ -20,7 +20,7 @@ = build.id - - unless @commit.builds_without_retry_for_ref(@build.ref).include?(@build) + - unless @commit.builds_without_retry(@build.ref).include?(@build) %li.active %a Build ##{@build.id} diff --git a/app/views/projects/commit/ci.html.haml b/app/views/projects/commit/ci.html.haml index 26ab38445c2..7f106631cac 100644 --- a/app/views/projects/commit/ci.html.haml +++ b/app/views/projects/commit/ci.html.haml @@ -20,13 +20,35 @@ .bs-callout.bs-callout-warning \.gitlab-ci.yml not found in this commit -- @ci_commit.refs.each do |ref| +- if @ci_commit.refs.blank? + .gray-content-block.second-block + Latest builds + - if @ci_commit.duration > 0 + %small.pull-right + %i.fa.fa-time + #{time_interval_in_words @ci_commit.duration} + + %table.table.builds + %thead + %tr + %th Status + %th Build ID + %th Stage + %th Name + %th Duration + %th Finished at + - if @ci_project && @ci_project.coverage_enabled? + %th Coverage + %th + = render partial: "projects/commit_statuses/commit_status", collection: @ci_commit.statuses.latest, coverage: @ci_project.try(:coverage_enabled?), controls: true + +- @ci_commit.refs.sort.each do |ref| .gray-content-block.second-block Builds for #{ref} - - if @ci_commit.duration_for_ref(ref) > 0 + - if @ci_commit.duration(ref) > 0 %small.pull-right %i.fa.fa-time - #{time_interval_in_words @ci_commit.duration_for_ref(ref)} + #{time_interval_in_words @ci_commit.duration(ref)} %table.table.builds %thead @@ -40,10 +62,10 @@ - if @ci_project && @ci_project.coverage_enabled? %th Coverage %th - = render partial: "projects/builds/build", collection: @ci_commit.builds_without_retry.for_ref(ref), controls: true + = render partial: "projects/commit_statuses/commit_status", collection: @ci_commit.statuses.for_ref(ref).latest, coverage: @ci_project.try(:coverage_enabled?), controls: true -- if @ci_commit.retried_builds.any? - %h3 +- if @ci_commit.retried.any? + .gray-content-block.second-block Retried builds %table.table.builds @@ -59,4 +81,4 @@ - if @ci_project && @ci_project.coverage_enabled? %th Coverage %th - = render partial: "projects/builds/build", collection: @ci_commit.retried_builds, ref: true + = render partial: "projects/commit_statuses/commit_status", collection: @ci_commit.retried, coverage: @ci_project.try(:coverage_enabled?), ref: true diff --git a/app/views/projects/commit_statuses/_commit_status.html.haml b/app/views/projects/commit_statuses/_commit_status.html.haml new file mode 100644 index 00000000000..f79929c70bf --- /dev/null +++ b/app/views/projects/commit_statuses/_commit_status.html.haml @@ -0,0 +1,52 @@ +%tr.commit_status + %td.status + = ci_status_with_icon(commit_status.status) + + %td.commit_status-link + - if commit_status.target_url + = link_to commit_status.target_url do + %strong Build ##{commit_status.id} + - else + %strong Build ##{commit_status.id} + + - if defined?(ref) + %td + = commit_status.ref + + %td + = commit_status.stage + + %td + = commit_status.description + .pull-right + - if commit_status.tags.any? + - commit_status.tags.each do |tag| + %span.label.label-primary + = tag + - if commit_status.try(:trigger_request) + %span.label.label-info triggered + - if commit_status.try(:allow_failure) + %span.label.label-danger allowed to fail + + %td.duration + - if commit_status.duration + #{duration_in_words(commit_status.finished_at, commit_status.started_at)} + + %td.timestamp + - if commit_status.finished_at + %span #{time_ago_in_words commit_status.finished_at} ago + + - if defined?(coverage) + %td.coverage + - if commit_status.try(:coverage) + #{commit_status.coverage}% + + %td + - if defined?(controls) && current_user && can?(current_user, :manage_builds, gl_project) + .pull-right + - if commit_status.active? + = link_to cancel_namespace_project_build_path(gl_project.namespace, gl_project, commit_status, return_to: request.original_url), title: 'Cancel commit_status' do + %i.fa.fa-remove.cred + - elsif commit_status.commands.present? + = link_to retry_namespace_project_build_path(gl_project.namespace, gl_project, commit_status, return_to: request.original_url), method: :post, title: 'Retry commit_status' do + %i.fa.fa-repeat -- cgit v1.2.1 From b0164771ec693ff58504ece560371ffec11f9ca9 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Mon, 12 Oct 2015 11:54:46 +0200 Subject: Simplify code around (cross)-references --- app/controllers/projects/issues_controller.rb | 2 +- .../projects/merge_requests_controller.rb | 2 +- app/models/concerns/mentionable.rb | 38 ++++++++-------- app/models/concerns/participable.rb | 16 +++---- app/models/note.rb | 2 +- app/services/git_push_service.rb | 50 +++++++--------------- app/services/issues/create_service.rb | 2 +- app/services/issues/update_service.rb | 2 +- app/services/merge_requests/create_service.rb | 2 +- app/services/merge_requests/update_service.rb | 2 +- 10 files changed, 49 insertions(+), 69 deletions(-) (limited to 'app') diff --git a/app/controllers/projects/issues_controller.rb b/app/controllers/projects/issues_controller.rb index 0f89f2e88cc..4612abcbae8 100644 --- a/app/controllers/projects/issues_controller.rb +++ b/app/controllers/projects/issues_controller.rb @@ -55,7 +55,7 @@ class Projects::IssuesController < Projects::ApplicationController end def show - @participants = @issue.participants(current_user, @project) + @participants = @issue.participants(current_user) @note = @project.notes.new(noteable: @issue) @notes = @issue.notes.inc_author.fresh @noteable = @issue diff --git a/app/controllers/projects/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb index 7570934e727..98df6984bf7 100644 --- a/app/controllers/projects/merge_requests_controller.rb +++ b/app/controllers/projects/merge_requests_controller.rb @@ -246,7 +246,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController end def define_show_vars - @participants = @merge_request.participants(current_user, @project) + @participants = @merge_request.participants(current_user) # Build a note object for comment form @note = @project.notes.new(noteable: @merge_request) diff --git a/app/models/concerns/mentionable.rb b/app/models/concerns/mentionable.rb index 5b0ae411642..694403949c1 100644 --- a/app/models/concerns/mentionable.rb +++ b/app/models/concerns/mentionable.rb @@ -43,53 +43,53 @@ module Mentionable # Determine whether or not a cross-reference Note has already been created between this Mentionable and # the specified target. - def has_mentioned?(target) + def cross_reference_exists?(target) SystemNoteService.cross_reference_exists?(target, local_reference) end - def mentioned_users(current_user = nil) - return [] if mentionable_text.blank? - + def all_references(current_user = self.author, text = self.mentionable_text) ext = Gitlab::ReferenceExtractor.new(self.project, current_user) - ext.analyze(mentionable_text) - ext.users.uniq + ext.analyze(text) + ext + end + + def mentioned_users(current_user = nil) + all_references(current_user).users.uniq end # Extract GFM references to other Mentionables from this Mentionable. Always excludes its #local_reference. - def references(p = project, current_user = self.author, text = mentionable_text) + def referenced_mentionables(current_user = self.author, text = self.mentionable_text) return [] if text.blank? - ext = Gitlab::ReferenceExtractor.new(p, current_user) - ext.analyze(text) - - (ext.issues + ext.merge_requests + ext.commits).uniq - [local_reference] + refs = all_references(current_user, text) + (refs.issues + refs.merge_requests + refs.commits).uniq - [local_reference] end # Create a cross-reference Note for each GFM reference to another Mentionable found in +mentionable_text+. - def create_cross_references!(p = project, a = author, without = []) - refs = references(p) - + def create_cross_references!(author = self.author, without = []) + refs = referenced_mentionables(author) + # We're using this method instead of Array diffing because that requires # both of the object's `hash` values to be the same, which may not be the # case for otherwise identical Commit objects. - refs.reject! { |ref| without.include?(ref) } + refs.reject! { |ref| without.include?(ref) || cross_reference_exists?(ref) } refs.each do |ref| - SystemNoteService.cross_reference(ref, local_reference, a) + SystemNoteService.cross_reference(ref, local_reference, author) end end # When a mentionable field is changed, creates cross-reference notes that # don't already exist - def create_new_cross_references!(p = project, a = author) + def create_new_cross_references!(author = self.author) changes = detect_mentionable_changes return if changes.empty? original_text = changes.collect { |_, vals| vals.first }.join(' ') - preexisting = references(p, self.author, original_text) - create_cross_references!(p, a, preexisting) + preexisting = referenced_mentionables(author, original_text) + create_cross_references!(author, preexisting) end private diff --git a/app/models/concerns/participable.rb b/app/models/concerns/participable.rb index 7c9597333dd..d697c125c7d 100644 --- a/app/models/concerns/participable.rb +++ b/app/models/concerns/participable.rb @@ -37,7 +37,7 @@ module Participable # Be aware that this method makes a lot of sql queries. # Save result into variable if you are going to reuse it inside same request - def participants(current_user = self.author, project = self.project) + def participants(current_user = self.author) participants = self.class.participant_attrs.flat_map do |attr| meth = method(attr) @@ -48,13 +48,11 @@ module Participable meth.call end - participants_for(value, current_user, project) + participants_for(value, current_user) end.compact.uniq - if project - participants.select! do |user| - user.can?(:read_project, project) - end + participants.select! do |user| + user.can?(:read_project, self.project) end participants @@ -62,14 +60,14 @@ module Participable private - def participants_for(value, current_user = nil, project = nil) + def participants_for(value, current_user = nil) case value when User [value] when Enumerable, ActiveRecord::Relation - value.flat_map { |v| participants_for(v, current_user, project) } + value.flat_map { |v| participants_for(v, current_user) } when Participable - value.participants(current_user, project) + value.participants(current_user) end end end diff --git a/app/models/note.rb b/app/models/note.rb index de3b6df88f7..13eb28f5718 100644 --- a/app/models/note.rb +++ b/app/models/note.rb @@ -358,7 +358,7 @@ class Note < ActiveRecord::Base end def set_references - create_new_cross_references!(project, author) + create_new_cross_references! end def system? diff --git a/app/services/git_push_service.rb b/app/services/git_push_service.rb index f9a8265d2d4..81d47602f13 100644 --- a/app/services/git_push_service.rb +++ b/app/services/git_push_service.rb @@ -74,48 +74,30 @@ class GitPushService def process_commit_messages(ref) is_default_branch = is_default_branch?(ref) - @push_commits.each do |commit| - # Close issues if these commits were pushed to the project's default branch and the commit message matches the - # closing regex. Exclude any mentioned Issues from cross-referencing even if the commits are being pushed to - # a different branch. - issues_to_close = commit.closes_issues(user) + authors = Hash.new do |hash, commit| + email = commit.author_email + return hash[email] if hash.has_key?(email) - # Load commit author only if needed. - # For push with 1k commits it prevents 900+ requests in database - author = nil + hash[email] = commit_user(commit) + end + @push_commits.each do |commit| # Keep track of the issues that will be actually closed because they are on a default branch. # Hence, when creating cross-reference notes, the not-closed issues (on non-default branches) # will also have cross-reference. - actually_closed_issues = [] - - if issues_to_close.present? && is_default_branch - author ||= commit_user(commit) - actually_closed_issues = issues_to_close - issues_to_close.each do |issue| - Issues::CloseService.new(project, author, {}).execute(issue, commit) + closed_issues = [] + + if is_default_branch + # Close issues if these commits were pushed to the project's default branch and the commit message matches the + # closing regex. Exclude any mentioned Issues from cross-referencing even if the commits are being pushed to + # a different branch. + closed_issues = commit.closes_issues(user) + closed_issues.each do |issue| + Issues::CloseService.new(project, authors[commit], {}).execute(issue, commit) end end - if project.default_issues_tracker? - create_cross_reference_notes(commit, actually_closed_issues) - end - end - end - - def create_cross_reference_notes(commit, issues_to_close) - # Create cross-reference notes for any other references than those given in issues_to_close. - # Omit any issues that were referenced in an issue-closing phrase, or have already been - # mentioned from this commit (probably from this commit being pushed to a different branch). - refs = commit.references(project, user) - issues_to_close - refs.reject! { |r| commit.has_mentioned?(r) } - - if refs.present? - author ||= commit_user(commit) - - refs.each do |r| - SystemNoteService.cross_reference(r, commit, author) - end + commit.create_cross_references!(authors[commit], closed_issues) end end diff --git a/app/services/issues/create_service.rb b/app/services/issues/create_service.rb index 1ea4b72216c..bcb380d3215 100644 --- a/app/services/issues/create_service.rb +++ b/app/services/issues/create_service.rb @@ -10,7 +10,7 @@ module Issues issue.update_attributes(label_ids: label_params) notification_service.new_issue(issue, current_user) event_service.open_issue(issue, current_user) - issue.create_cross_references!(issue.project, current_user) + issue.create_cross_references!(current_user) execute_hooks(issue, 'open') end diff --git a/app/services/issues/update_service.rb b/app/services/issues/update_service.rb index 2fc6ef7f356..2b5426ad452 100644 --- a/app/services/issues/update_service.rb +++ b/app/services/issues/update_service.rb @@ -35,7 +35,7 @@ module Issues create_title_change_note(issue, issue.previous_changes['title'].first) end - issue.create_new_cross_references!(issue.project, current_user) + issue.create_new_cross_references! execute_hooks(issue, 'update') end diff --git a/app/services/merge_requests/create_service.rb b/app/services/merge_requests/create_service.rb index 9651b16462c..009d5a6867e 100644 --- a/app/services/merge_requests/create_service.rb +++ b/app/services/merge_requests/create_service.rb @@ -18,7 +18,7 @@ module MergeRequests merge_request.update_attributes(label_ids: label_params) event_service.open_mr(merge_request, current_user) notification_service.new_merge_request(merge_request, current_user) - merge_request.create_cross_references!(merge_request.project, current_user) + merge_request.create_cross_references!(current_user) execute_hooks(merge_request) end diff --git a/app/services/merge_requests/update_service.rb b/app/services/merge_requests/update_service.rb index 25d79e22e39..ebbe0af803b 100644 --- a/app/services/merge_requests/update_service.rb +++ b/app/services/merge_requests/update_service.rb @@ -59,7 +59,7 @@ module MergeRequests merge_request.mark_as_unchecked end - merge_request.create_new_cross_references!(merge_request.project, current_user) + merge_request.create_new_cross_references! execute_hooks(merge_request, 'update') end -- cgit v1.2.1 From d805c5dbb3c2fde0a3b97f86a2dd3abc35e72bd9 Mon Sep 17 00:00:00 2001 From: Valery Sizov Date: Fri, 9 Oct 2015 19:08:37 +0300 Subject: Add spellcheck=false to certain input fields --- app/views/admin/users/index.html.haml | 2 +- app/views/ci/admin/runners/index.html.haml | 2 +- app/views/ci/admin/runners/show.html.haml | 2 +- app/views/dashboard/projects/_projects.html.haml | 2 +- app/views/explore/groups/index.html.haml | 2 +- app/views/explore/projects/_filter.html.haml | 2 +- app/views/groups/_projects.html.haml | 2 +- app/views/groups/group_members/index.html.haml | 2 +- app/views/layouts/_search.html.haml | 2 +- app/views/projects/project_members/index.html.haml | 2 +- app/views/search/_form.html.haml | 2 +- app/views/shared/issuable/_search_form.html.haml | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) (limited to 'app') diff --git a/app/views/admin/users/index.html.haml b/app/views/admin/users/index.html.haml index e3698ac1c46..71e15d555d3 100644 --- a/app/views/admin/users/index.html.haml +++ b/app/views/admin/users/index.html.haml @@ -32,7 +32,7 @@ %hr = form_tag admin_users_path, method: :get, class: 'form-inline' do .form-group - = search_field_tag :name, params[:name], placeholder: 'Name, email or username', class: 'form-control' + = search_field_tag :name, params[:name], placeholder: 'Name, email or username', class: 'form-control', spellcheck: false = hidden_field_tag "filter", params[:filter] = button_tag class: 'btn btn-primary' do %i.fa.fa-search diff --git a/app/views/ci/admin/runners/index.html.haml b/app/views/ci/admin/runners/index.html.haml index b9d6703ff41..01ce81b4476 100644 --- a/app/views/ci/admin/runners/index.html.haml +++ b/app/views/ci/admin/runners/index.html.haml @@ -27,7 +27,7 @@ .pull-left = form_tag ci_admin_runners_path, id: 'runners-search', class: 'form-inline', method: :get do .form-group - = search_field_tag :search, params[:search], class: 'form-control', placeholder: 'Runner description or token' + = search_field_tag :search, params[:search], class: 'form-control', placeholder: 'Runner description or token', spellcheck: false = submit_tag 'Search', class: 'btn' .pull-right.light diff --git a/app/views/ci/admin/runners/show.html.haml b/app/views/ci/admin/runners/show.html.haml index 5bb442cbf92..92787b2e6ac 100644 --- a/app/views/ci/admin/runners/show.html.haml +++ b/app/views/ci/admin/runners/show.html.haml @@ -76,7 +76,7 @@ %td = form_tag ci_admin_runner_path(@runner), id: 'runner-projects-search', class: 'form-inline', method: :get do .form-group - = search_field_tag :search, params[:search], class: 'form-control' + = search_field_tag :search, params[:search], class: 'form-control', spellcheck: false = submit_tag 'Search', class: 'btn' %td diff --git a/app/views/dashboard/projects/_projects.html.haml b/app/views/dashboard/projects/_projects.html.haml index e09e032a7f1..d0194a17b01 100644 --- a/app/views/dashboard/projects/_projects.html.haml +++ b/app/views/dashboard/projects/_projects.html.haml @@ -1,7 +1,7 @@ .projects-list-holder .projects-search-form .input-group - = search_field_tag :filter_projects, nil, placeholder: 'Filter by name', class: 'projects-list-filter form-control' + = search_field_tag :filter_projects, nil, placeholder: 'Filter by name', class: 'projects-list-filter form-control', spellcheck: false - if current_user.can_create_project? %span.input-group-btn = link_to new_project_path, class: 'btn btn-green' do diff --git a/app/views/explore/groups/index.html.haml b/app/views/explore/groups/index.html.haml index 83d4d321c83..fcb07b04083 100644 --- a/app/views/explore/groups/index.html.haml +++ b/app/views/explore/groups/index.html.haml @@ -11,7 +11,7 @@ = form_tag explore_groups_path, method: :get, class: 'form-inline form-tiny' do |f| = hidden_field_tag :sort, @sort .form-group - = search_field_tag :search, params[:search], placeholder: "Filter by name", class: "form-control search-text-input", id: "groups_search" + = search_field_tag :search, params[:search], placeholder: "Filter by name", class: "form-control search-text-input", id: "groups_search", spellcheck: false .form-group = button_tag 'Search', class: "btn btn-default" diff --git a/app/views/explore/projects/_filter.html.haml b/app/views/explore/projects/_filter.html.haml index 5a3d689d1e5..2761272aa8a 100644 --- a/app/views/explore/projects/_filter.html.haml +++ b/app/views/explore/projects/_filter.html.haml @@ -1,7 +1,7 @@ .pull-left = form_tag explore_projects_filter_path, method: :get, class: 'form-inline form-tiny' do |f| .form-group - = search_field_tag :search, params[:search], placeholder: "Filter by name", class: "form-control search-text-input", id: "projects_search" + = search_field_tag :search, params[:search], placeholder: "Filter by name", class: "form-control search-text-input", id: "projects_search", spellcheck: false .form-group = button_tag 'Search', class: "btn btn-success" diff --git a/app/views/groups/_projects.html.haml b/app/views/groups/_projects.html.haml index 2b27a88794d..76da3276e47 100644 --- a/app/views/groups/_projects.html.haml +++ b/app/views/groups/_projects.html.haml @@ -1,7 +1,7 @@ .panel.panel-default.projects-list-holder .panel-heading.clearfix .input-group - = search_field_tag :filter_projects, nil, placeholder: 'Filter by name', class: 'projects-list-filter form-control' + = search_field_tag :filter_projects, nil, placeholder: 'Filter by name', class: 'projects-list-filter form-control', spellcheck: false - if can? current_user, :create_projects, @group %span.input-group-btn = link_to new_project_path(namespace_id: @group.id), class: 'btn btn-green' do diff --git a/app/views/groups/group_members/index.html.haml b/app/views/groups/group_members/index.html.haml index 3a6d07ebddf..fee4b0052b5 100644 --- a/app/views/groups/group_members/index.html.haml +++ b/app/views/groups/group_members/index.html.haml @@ -12,7 +12,7 @@ .clearfix.js-toggle-container = form_tag group_group_members_path(@group), method: :get, class: 'form-inline member-search-form' do .form-group - = search_field_tag :search, params[:search], { placeholder: 'Find existing member by name', class: 'form-control search-text-input' } + = search_field_tag :search, params[:search], { placeholder: 'Find existing member by name', class: 'form-control search-text-input', spellcheck: false } = button_tag 'Search', class: 'btn' - if current_user && current_user.can?(:admin_group_member, @group) diff --git a/app/views/layouts/_search.html.haml b/app/views/layouts/_search.html.haml index e2d2dec7ab8..ceb64ce3157 100644 --- a/app/views/layouts/_search.html.haml +++ b/app/views/layouts/_search.html.haml @@ -1,6 +1,6 @@ .search = form_tag search_path, method: :get, class: 'navbar-form pull-left' do |f| - = search_field_tag "search", nil, placeholder: search_placeholder, class: "search-input form-control" + = search_field_tag "search", nil, placeholder: search_placeholder, class: "search-input form-control", spellcheck: false = hidden_field_tag :group_id, @group.try(:id) - if @project && @project.persisted? = hidden_field_tag :project_id, @project.id diff --git a/app/views/projects/project_members/index.html.haml b/app/views/projects/project_members/index.html.haml index 9a0a824b811..82809bec5b8 100644 --- a/app/views/projects/project_members/index.html.haml +++ b/app/views/projects/project_members/index.html.haml @@ -5,7 +5,7 @@ .clearfix.js-toggle-container = form_tag namespace_project_project_members_path(@project.namespace, @project), method: :get, class: 'form-inline member-search-form' do .form-group - = search_field_tag :search, params[:search], { placeholder: 'Find existing member by name', class: 'form-control search-text-input' } + = search_field_tag :search, params[:search], { placeholder: 'Find existing member by name', class: 'form-control search-text-input', spellcheck: false } = button_tag 'Search', class: 'btn' - if can?(current_user, :admin_project_member, @project) diff --git a/app/views/search/_form.html.haml b/app/views/search/_form.html.haml index 3938c545cad..17b0981f073 100644 --- a/app/views/search/_form.html.haml +++ b/app/views/search/_form.html.haml @@ -6,7 +6,7 @@ .search-holder.clearfix .input-group - = search_field_tag :search, params[:search], placeholder: "Search for projects, issues etc", class: "form-control search-text-input", id: "dashboard_search", autofocus: true + = search_field_tag :search, params[:search], placeholder: "Search for projects, issues etc", class: "form-control search-text-input", id: "dashboard_search", autofocus: true, spellcheck: false %span.input-group-btn = button_tag 'Search', class: "btn btn-primary" - unless params[:snippets].eql? 'true' diff --git a/app/views/shared/issuable/_search_form.html.haml b/app/views/shared/issuable/_search_form.html.haml index 58c3de64b77..3a5ad00aa91 100644 --- a/app/views/shared/issuable/_search_form.html.haml +++ b/app/views/shared/issuable/_search_form.html.haml @@ -1,6 +1,6 @@ = form_tag(path, method: :get, id: "issue_search_form", class: 'pull-left issue-search-form') do .append-right-10.hidden-xs.hidden-sm - = search_field_tag :issue_search, params[:issue_search], { placeholder: 'Filter by title or description', class: 'form-control issue_search search-text-input' } + = search_field_tag :issue_search, params[:issue_search], { placeholder: 'Filter by title or description', class: 'form-control issue_search search-text-input', spellcheck: false } = hidden_field_tag :state, params['state'] = hidden_field_tag :scope, params['scope'] = hidden_field_tag :assignee_id, params['assignee_id'] -- cgit v1.2.1 From 7ef156a24292f98d89bc424cc245f00548831863 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Mon, 12 Oct 2015 12:15:48 +0200 Subject: Add author to statuses --- app/models/commit_status.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app') diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb index 4c6de18527b..de7b29a649d 100644 --- a/app/models/commit_status.rb +++ b/app/models/commit_status.rb @@ -9,6 +9,8 @@ class CommitStatus < ActiveRecord::Base validates_presence_of :name + alias_attribute :author, :user + scope :running, ->() { where(status: 'running') } scope :pending, ->() { where(status: 'pending') } scope :success, ->() { where(status: 'success') } -- cgit v1.2.1 From 07f60552728db7276ad24dafd1ff601ae49442d2 Mon Sep 17 00:00:00 2001 From: Valery Sizov Date: Fri, 9 Oct 2015 13:20:38 +0300 Subject: Invalidate stored service password if the endpoint URL is changed --- app/models/project_services/bamboo_service.rb | 7 +++++++ app/models/project_services/teamcity_service.rb | 7 +++++++ app/models/service.rb | 9 +++++++++ 3 files changed, 23 insertions(+) (limited to 'app') diff --git a/app/models/project_services/bamboo_service.rb b/app/models/project_services/bamboo_service.rb index d8aedbd2ab4..5f5255ab487 100644 --- a/app/models/project_services/bamboo_service.rb +++ b/app/models/project_services/bamboo_service.rb @@ -40,12 +40,19 @@ class BambooService < CiService attr_accessor :response after_save :compose_service_hook, if: :activated? + before_update :reset_password def compose_service_hook hook = service_hook || build_service_hook hook.save end + def reset_password + if prop_updated?(:bamboo_url) + self.password = nil + end + end + def title 'Atlassian Bamboo CI' end diff --git a/app/models/project_services/teamcity_service.rb b/app/models/project_services/teamcity_service.rb index 3c002a1634b..fb11cad352e 100644 --- a/app/models/project_services/teamcity_service.rb +++ b/app/models/project_services/teamcity_service.rb @@ -37,12 +37,19 @@ class TeamcityService < CiService attr_accessor :response after_save :compose_service_hook, if: :activated? + before_update :reset_password def compose_service_hook hook = service_hook || build_service_hook hook.save end + def reset_password + if prop_updated?(:teamcity_url) + self.password = nil + end + end + def title 'JetBrains TeamCity CI' end diff --git a/app/models/service.rb b/app/models/service.rb index 60fcc9d2857..7e845d565b1 100644 --- a/app/models/service.rb +++ b/app/models/service.rb @@ -117,6 +117,15 @@ class Service < ActiveRecord::Base end end + # ActiveRecord does not provide a mechanism to track changes in serialized keys. + # This is why we need to perform extra query to do it mannually. + def prop_updated?(prop_name) + relation_name = self.type.underscore + previous_value = project.send(relation_name).send(prop_name) + return false if previous_value.nil? + previous_value != send(prop_name) + end + def async_execute(data) return unless supported_events.include?(data[:object_kind]) -- cgit v1.2.1 From 0aefeeb882b40d740b80f15ac6610a88a340d30b Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Mon, 12 Oct 2015 12:16:00 +0200 Subject: Add Commit Status documentation --- app/models/ci/commit.rb | 2 +- app/models/commit_status.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/models/ci/commit.rb b/app/models/ci/commit.rb index 042a68681bb..623ff619c49 100644 --- a/app/models/ci/commit.rb +++ b/app/models/ci/commit.rb @@ -136,7 +136,7 @@ module Ci latest_statuses = statuses.latest.to_a latest_statuses.reject! { |status| status.try(&:allow_failure?) } - latest_statuses.select! { |status| status.ref == nil || status.ref == ref } if ref + latest_statuses.select! { |status| status.ref.nil? || status.ref == ref } if ref if latest_statuses.none? return 'skipped' diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb index de7b29a649d..a4896a76316 100644 --- a/app/models/commit_status.rb +++ b/app/models/commit_status.rb @@ -5,7 +5,7 @@ class CommitStatus < ActiveRecord::Base belongs_to :user validates :commit, presence: true - validates :status, inclusion: {in: %w(pending running failed success canceled)} + validates :status, inclusion: { in: %w(pending running failed success canceled) } validates_presence_of :name -- cgit v1.2.1 From 27d952b1197f2dc615c383c21eb287313d81c74c Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Mon, 12 Oct 2015 14:30:44 +0200 Subject: Fix cross-references originating from notes --- app/models/concerns/mentionable.rb | 4 ++-- app/models/note.rb | 13 +++---------- app/services/notes/create_service.rb | 8 +------- app/services/notes/update_service.rb | 2 +- 4 files changed, 7 insertions(+), 20 deletions(-) (limited to 'app') diff --git a/app/models/concerns/mentionable.rb b/app/models/concerns/mentionable.rb index 694403949c1..5f53ea25630 100644 --- a/app/models/concerns/mentionable.rb +++ b/app/models/concerns/mentionable.rb @@ -66,8 +66,8 @@ module Mentionable end # Create a cross-reference Note for each GFM reference to another Mentionable found in +mentionable_text+. - def create_cross_references!(author = self.author, without = []) - refs = referenced_mentionables(author) + def create_cross_references!(author = self.author, without = [], text = self.mentionable_text) + refs = referenced_mentionables(author, text) # We're using this method instead of Array diffing because that requires # both of the object's `hash` values to be the same, which may not be the diff --git a/app/models/note.rb b/app/models/note.rb index 13eb28f5718..ee0c14598f3 100644 --- a/app/models/note.rb +++ b/app/models/note.rb @@ -62,7 +62,6 @@ class Note < ActiveRecord::Base serialize :st_diff before_create :set_diff, if: ->(n) { n.line_code.present? } - after_update :set_references class << self def discussions_from_notes(notes) @@ -333,15 +332,13 @@ class Note < ActiveRecord::Base end def noteable_type_name - if noteable_type.present? - noteable_type.downcase - end + noteable_type.downcase if noteable_type.present? end # FIXME: Hack for polymorphic associations with STI # For more information visit http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html#label-Polymorphic+Associations - def noteable_type=(sType) - super(sType.to_s.classify.constantize.base_class.to_s) + def noteable_type=(noteable_type) + super(noteable_type.to_s.classify.constantize.base_class.to_s) end # Reset notes events cache @@ -357,10 +354,6 @@ class Note < ActiveRecord::Base Event.reset_event_cache_for(self) end - def set_references - create_new_cross_references! - end - def system? read_attribute(:system) end diff --git a/app/services/notes/create_service.rb b/app/services/notes/create_service.rb index 482c0444049..2001dc89c33 100644 --- a/app/services/notes/create_service.rb +++ b/app/services/notes/create_service.rb @@ -11,13 +11,7 @@ module Notes # Skip system notes, like status changes and cross-references. unless note.system event_service.leave_note(note, note.author) - - # Create a cross-reference note if this Note contains GFM that names an - # issue, merge request, or commit. - note.references.each do |mentioned| - SystemNoteService.cross_reference(mentioned, note.noteable, note.author) - end - + note.create_cross_references! execute_hooks(note) end end diff --git a/app/services/notes/update_service.rb b/app/services/notes/update_service.rb index c22a9333ef6..6c2f08e5963 100644 --- a/app/services/notes/update_service.rb +++ b/app/services/notes/update_service.rb @@ -4,7 +4,7 @@ module Notes return note unless note.editable? note.update_attributes(params.merge(updated_by: current_user)) - + note.create_new_cross_references! note.reset_events_cache note -- cgit v1.2.1 From d6a523d78569020a00cf707f34a1824996261037 Mon Sep 17 00:00:00 2001 From: teuneboon Date: Mon, 12 Oct 2015 14:37:07 +0200 Subject: Fix typo(missing quote) when deleting groups --- app/controllers/groups_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb index 524218290c6..735de309fd6 100644 --- a/app/controllers/groups_controller.rb +++ b/app/controllers/groups_controller.rb @@ -88,7 +88,7 @@ class GroupsController < Groups::ApplicationController def destroy DestroyGroupService.new(@group, current_user).execute - redirect_to root_path, alert: "Group '#{@group.name} was deleted." + redirect_to root_path, alert: "Group '#{@group.name}' was deleted." end protected -- cgit v1.2.1 From 5479797f0a3a648824fd98d17360bbf886957bf1 Mon Sep 17 00:00:00 2001 From: teuneboon Date: Mon, 12 Oct 2015 14:37:56 +0200 Subject: Make group deleted text consistent with group created and updated texts --- app/controllers/groups_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb index 735de309fd6..40fb15a5b36 100644 --- a/app/controllers/groups_controller.rb +++ b/app/controllers/groups_controller.rb @@ -88,7 +88,7 @@ class GroupsController < Groups::ApplicationController def destroy DestroyGroupService.new(@group, current_user).execute - redirect_to root_path, alert: "Group '#{@group.name}' was deleted." + redirect_to root_path, alert: "Group '#{@group.name}' was successfully deleted." end protected -- cgit v1.2.1 From 41075bad8daeed07bceaa44cbfe54ab1b470ca87 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Mon, 12 Oct 2015 14:39:33 +0200 Subject: Chaining ftw --- app/models/concerns/participable.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'app') diff --git a/app/models/concerns/participable.rb b/app/models/concerns/participable.rb index d697c125c7d..22182445978 100644 --- a/app/models/concerns/participable.rb +++ b/app/models/concerns/participable.rb @@ -49,13 +49,9 @@ module Participable end participants_for(value, current_user) - end.compact.uniq - - participants.select! do |user| + end.compact.uniq.select do |user| user.can?(:read_project, self.project) end - - participants end private -- cgit v1.2.1 From cba6d62323eba2286f78e8aea12a5ecd26903728 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 12 Oct 2015 14:49:23 +0200 Subject: Move CI styles to pages dir Signed-off-by: Dmitriy Zaporozhets --- app/assets/stylesheets/ci/builds.scss | 75 --- app/assets/stylesheets/ci/lint.scss | 10 - app/assets/stylesheets/ci/projects.scss | 59 -- app/assets/stylesheets/ci/runners.scss | 36 - app/assets/stylesheets/ci/status.scss | 37 -- app/assets/stylesheets/ci/xterm.scss | 906 -------------------------- app/assets/stylesheets/pages/builds.scss | 75 +++ app/assets/stylesheets/pages/ci_projects.scss | 59 ++ app/assets/stylesheets/pages/lint.scss | 10 + app/assets/stylesheets/pages/runners.scss | 36 + app/assets/stylesheets/pages/status.scss | 37 ++ app/assets/stylesheets/pages/xterm.scss | 906 ++++++++++++++++++++++++++ 12 files changed, 1123 insertions(+), 1123 deletions(-) delete mode 100644 app/assets/stylesheets/ci/builds.scss delete mode 100644 app/assets/stylesheets/ci/lint.scss delete mode 100644 app/assets/stylesheets/ci/projects.scss delete mode 100644 app/assets/stylesheets/ci/runners.scss delete mode 100644 app/assets/stylesheets/ci/status.scss delete mode 100644 app/assets/stylesheets/ci/xterm.scss create mode 100644 app/assets/stylesheets/pages/builds.scss create mode 100644 app/assets/stylesheets/pages/ci_projects.scss create mode 100644 app/assets/stylesheets/pages/lint.scss create mode 100644 app/assets/stylesheets/pages/runners.scss create mode 100644 app/assets/stylesheets/pages/status.scss create mode 100644 app/assets/stylesheets/pages/xterm.scss (limited to 'app') diff --git a/app/assets/stylesheets/ci/builds.scss b/app/assets/stylesheets/ci/builds.scss deleted file mode 100644 index 74dc3e321c1..00000000000 --- a/app/assets/stylesheets/ci/builds.scss +++ /dev/null @@ -1,75 +0,0 @@ -.build-page { - pre.trace { - background: #111111; - color: #fff; - font-family: $monospace_font; - white-space: pre; - white-space: pre-wrap; /* css-3 */ - white-space: -moz-pre-wrap; /* Mozilla, since 1999 */ - white-space: -pre-wrap; /* Opera 4-6 */ - white-space: -o-pre-wrap; /* Opera 7 */ - word-wrap: break-word; /* Internet Explorer 5.5+ */ - overflow: auto; - overflow-y: hidden; - font-size: 12px; - - .fa-refresh { - font-size: 24px; - margin-left: 20px; - } - } - - .autoscroll-container { - position: fixed; - bottom: 10px; - right: 20px; - z-index: 100; - } - - .scroll-controls { - position: fixed; - bottom: 10px; - left: 250px; - z-index: 100; - - a { - display: block; - margin-bottom: 5px; - } - } - - .page-sidebar-collapsed { - .scroll-controls { - left: 70px; - } - } - - .build-widget { - padding: 10px; - background: $background-color; - margin-bottom: 20px; - border-radius: 4px; - - .title { - margin-top: 0; - color: #666; - line-height: 1.5; - } - .attr-name { - color: #777; - } - } - - .alert-disabled { - background: $background-color; - - a { - color: #3084bb !important; - } - } - - .build-top-menu { - margin-top: 0; - margin-bottom: 2px; - } -} diff --git a/app/assets/stylesheets/ci/lint.scss b/app/assets/stylesheets/ci/lint.scss deleted file mode 100644 index 6d2bd33b28b..00000000000 --- a/app/assets/stylesheets/ci/lint.scss +++ /dev/null @@ -1,10 +0,0 @@ -.ci-body { - .incorrect-syntax{ - font-size: 19px; - color: red; - } - .correct-syntax{ - font-size: 19px; - color: #47a447; - } -} diff --git a/app/assets/stylesheets/ci/projects.scss b/app/assets/stylesheets/ci/projects.scss deleted file mode 100644 index 8c5273abcda..00000000000 --- a/app/assets/stylesheets/ci/projects.scss +++ /dev/null @@ -1,59 +0,0 @@ -.ci-body { - .project-title { - margin: 0; - color: #444; - font-size: 20px; - line-height: 1.5; - } - - .wide-table-holder { - margin-left: -$gl-padding; - margin-right: -$gl-padding; - } - - .builds, - .projects-table { - .light { - border-color: $border-color; - } - - th, td { - padding: 10px $gl-padding; - } - - td { - color: $gl-gray; - vertical-align: middle !important; - - a { - font-weight: normal; - text-decoration: none; - } - } - } - - .commit-info { - .attr-name { - margin-right: 5px; - } - - pre.commit-message { - background: none; - padding: 0; - margin: 0; - border: none; - margin: 20px 0; - border-radius: 0; - } - } - - .loading{ - font-size: 20px; - } - - .ci-charts { - fieldset { - margin-bottom: 16px; - } - } -} diff --git a/app/assets/stylesheets/ci/runners.scss b/app/assets/stylesheets/ci/runners.scss deleted file mode 100644 index 2b15ab83129..00000000000 --- a/app/assets/stylesheets/ci/runners.scss +++ /dev/null @@ -1,36 +0,0 @@ -.ci-body { - .runner-state { - padding: 6px 12px; - margin-right: 10px; - color: #FFF; - - &.runner-state-shared { - background: #32b186; - } - &.runner-state-specific { - background: #3498db; - } - } - - .runner-status-online { - color: green; - } - - .runner-status-offline { - color: gray; - } - - .runner-status-paused { - color: red; - } - - .runner { - .btn { - padding: 1px 6px; - } - - h4 { - font-weight: normal; - } - } -} diff --git a/app/assets/stylesheets/ci/status.scss b/app/assets/stylesheets/ci/status.scss deleted file mode 100644 index a7d3b2197f1..00000000000 --- a/app/assets/stylesheets/ci/status.scss +++ /dev/null @@ -1,37 +0,0 @@ -.ci-status { - padding: 2px 7px; - margin-right: 5px; - border: 1px solid #EEE; - white-space: nowrap; - @include border-radius(4px); - - &:hover { - text-decoration: none; - } - - &.ci-failed { - color: $gl-danger; - border-color: $gl-danger; - } - - &.ci-success { - color: $gl-success; - border-color: $gl-success; - } - - &.ci-info { - color: $gl-info; - border-color: $gl-info; - } - - &.ci-disabled { - color: $gl-gray; - border-color: $gl-gray; - } - - &.ci-pending, - &.ci-running { - color: $gl-warning; - border-color: $gl-warning; - } -} diff --git a/app/assets/stylesheets/ci/xterm.scss b/app/assets/stylesheets/ci/xterm.scss deleted file mode 100644 index 9a50096c0d0..00000000000 --- a/app/assets/stylesheets/ci/xterm.scss +++ /dev/null @@ -1,906 +0,0 @@ -.build-page { - // color codes are based on http://en.wikipedia.org/wiki/File:Xterm_256color_chart.svg - // see also: https://gist.github.com/jasonm23/2868981 - - $black: #000000; - $red: #cd0000; - $green: #00cd00; - $yellow: #cdcd00; - $blue: #0000ee; // according to wikipedia, this is the xterm standard - //$blue: #1e90ff; // this is used by all the terminals I tried (when configured with the xterm color profile) - $magenta: #cd00cd; - $cyan: #00cdcd; - $white: #e5e5e5; - $l-black: #7f7f7f; - $l-red: #ff0000; - $l-green: #00ff00; - $l-yellow: #ffff00; - $l-blue: #5c5cff; - $l-magenta: #ff00ff; - $l-cyan: #00ffff; - $l-white: #ffffff; - - .term-bold { - font-weight: bold; - } - .term-italic { - font-style: italic; - } - .term-conceal { - visibility: hidden; - } - .term-underline { - text-decoration: underline; - } - .term-cross { - text-decoration: line-through; - } - - .term-fg-black { - color: $black; - } - .term-fg-red { - color: $red; - } - .term-fg-green { - color: $green; - } - .term-fg-yellow { - color: $yellow; - } - .term-fg-blue { - color: $blue; - } - .term-fg-magenta { - color: $magenta; - } - .term-fg-cyan { - color: $cyan; - } - .term-fg-white { - color: $white; - } - .term-fg-l-black { - color: $l-black; - } - .term-fg-l-red { - color: $l-red; - } - .term-fg-l-green { - color: $l-green; - } - .term-fg-l-yellow { - color: $l-yellow; - } - .term-fg-l-blue { - color: $l-blue; - } - .term-fg-l-magenta { - color: $l-magenta; - } - .term-fg-l-cyan { - color: $l-cyan; - } - .term-fg-l-white { - color: $l-white; - } - - .term-bg-black { - background-color: $black; - } - .term-bg-red { - background-color: $red; - } - .term-bg-green { - background-color: $green; - } - .term-bg-yellow { - background-color: $yellow; - } - .term-bg-blue { - background-color: $blue; - } - .term-bg-magenta { - background-color: $magenta; - } - .term-bg-cyan { - background-color: $cyan; - } - .term-bg-white { - background-color: $white; - } - .term-bg-l-black { - background-color: $l-black; - } - .term-bg-l-red { - background-color: $l-red; - } - .term-bg-l-green { - background-color: $l-green; - } - .term-bg-l-yellow { - background-color: $l-yellow; - } - .term-bg-l-blue { - background-color: $l-blue; - } - .term-bg-l-magenta { - background-color: $l-magenta; - } - .term-bg-l-cyan { - background-color: $l-cyan; - } - .term-bg-l-white { - background-color: $l-white; - } - - - .xterm-fg-0 { - color: #000000; - } - .xterm-fg-1 { - color: #800000; - } - .xterm-fg-2 { - color: #008000; - } - .xterm-fg-3 { - color: #808000; - } - .xterm-fg-4 { - color: #000080; - } - .xterm-fg-5 { - color: #800080; - } - .xterm-fg-6 { - color: #008080; - } - .xterm-fg-7 { - color: #c0c0c0; - } - .xterm-fg-8 { - color: #808080; - } - .xterm-fg-9 { - color: #ff0000; - } - .xterm-fg-10 { - color: #00ff00; - } - .xterm-fg-11 { - color: #ffff00; - } - .xterm-fg-12 { - color: #0000ff; - } - .xterm-fg-13 { - color: #ff00ff; - } - .xterm-fg-14 { - color: #00ffff; - } - .xterm-fg-15 { - color: #ffffff; - } - .xterm-fg-16 { - color: #000000; - } - .xterm-fg-17 { - color: #00005f; - } - .xterm-fg-18 { - color: #000087; - } - .xterm-fg-19 { - color: #0000af; - } - .xterm-fg-20 { - color: #0000d7; - } - .xterm-fg-21 { - color: #0000ff; - } - .xterm-fg-22 { - color: #005f00; - } - .xterm-fg-23 { - color: #005f5f; - } - .xterm-fg-24 { - color: #005f87; - } - .xterm-fg-25 { - color: #005faf; - } - .xterm-fg-26 { - color: #005fd7; - } - .xterm-fg-27 { - color: #005fff; - } - .xterm-fg-28 { - color: #008700; - } - .xterm-fg-29 { - color: #00875f; - } - .xterm-fg-30 { - color: #008787; - } - .xterm-fg-31 { - color: #0087af; - } - .xterm-fg-32 { - color: #0087d7; - } - .xterm-fg-33 { - color: #0087ff; - } - .xterm-fg-34 { - color: #00af00; - } - .xterm-fg-35 { - color: #00af5f; - } - .xterm-fg-36 { - color: #00af87; - } - .xterm-fg-37 { - color: #00afaf; - } - .xterm-fg-38 { - color: #00afd7; - } - .xterm-fg-39 { - color: #00afff; - } - .xterm-fg-40 { - color: #00d700; - } - .xterm-fg-41 { - color: #00d75f; - } - .xterm-fg-42 { - color: #00d787; - } - .xterm-fg-43 { - color: #00d7af; - } - .xterm-fg-44 { - color: #00d7d7; - } - .xterm-fg-45 { - color: #00d7ff; - } - .xterm-fg-46 { - color: #00ff00; - } - .xterm-fg-47 { - color: #00ff5f; - } - .xterm-fg-48 { - color: #00ff87; - } - .xterm-fg-49 { - color: #00ffaf; - } - .xterm-fg-50 { - color: #00ffd7; - } - .xterm-fg-51 { - color: #00ffff; - } - .xterm-fg-52 { - color: #5f0000; - } - .xterm-fg-53 { - color: #5f005f; - } - .xterm-fg-54 { - color: #5f0087; - } - .xterm-fg-55 { - color: #5f00af; - } - .xterm-fg-56 { - color: #5f00d7; - } - .xterm-fg-57 { - color: #5f00ff; - } - .xterm-fg-58 { - color: #5f5f00; - } - .xterm-fg-59 { - color: #5f5f5f; - } - .xterm-fg-60 { - color: #5f5f87; - } - .xterm-fg-61 { - color: #5f5faf; - } - .xterm-fg-62 { - color: #5f5fd7; - } - .xterm-fg-63 { - color: #5f5fff; - } - .xterm-fg-64 { - color: #5f8700; - } - .xterm-fg-65 { - color: #5f875f; - } - .xterm-fg-66 { - color: #5f8787; - } - .xterm-fg-67 { - color: #5f87af; - } - .xterm-fg-68 { - color: #5f87d7; - } - .xterm-fg-69 { - color: #5f87ff; - } - .xterm-fg-70 { - color: #5faf00; - } - .xterm-fg-71 { - color: #5faf5f; - } - .xterm-fg-72 { - color: #5faf87; - } - .xterm-fg-73 { - color: #5fafaf; - } - .xterm-fg-74 { - color: #5fafd7; - } - .xterm-fg-75 { - color: #5fafff; - } - .xterm-fg-76 { - color: #5fd700; - } - .xterm-fg-77 { - color: #5fd75f; - } - .xterm-fg-78 { - color: #5fd787; - } - .xterm-fg-79 { - color: #5fd7af; - } - .xterm-fg-80 { - color: #5fd7d7; - } - .xterm-fg-81 { - color: #5fd7ff; - } - .xterm-fg-82 { - color: #5fff00; - } - .xterm-fg-83 { - color: #5fff5f; - } - .xterm-fg-84 { - color: #5fff87; - } - .xterm-fg-85 { - color: #5fffaf; - } - .xterm-fg-86 { - color: #5fffd7; - } - .xterm-fg-87 { - color: #5fffff; - } - .xterm-fg-88 { - color: #870000; - } - .xterm-fg-89 { - color: #87005f; - } - .xterm-fg-90 { - color: #870087; - } - .xterm-fg-91 { - color: #8700af; - } - .xterm-fg-92 { - color: #8700d7; - } - .xterm-fg-93 { - color: #8700ff; - } - .xterm-fg-94 { - color: #875f00; - } - .xterm-fg-95 { - color: #875f5f; - } - .xterm-fg-96 { - color: #875f87; - } - .xterm-fg-97 { - color: #875faf; - } - .xterm-fg-98 { - color: #875fd7; - } - .xterm-fg-99 { - color: #875fff; - } - .xterm-fg-100 { - color: #878700; - } - .xterm-fg-101 { - color: #87875f; - } - .xterm-fg-102 { - color: #878787; - } - .xterm-fg-103 { - color: #8787af; - } - .xterm-fg-104 { - color: #8787d7; - } - .xterm-fg-105 { - color: #8787ff; - } - .xterm-fg-106 { - color: #87af00; - } - .xterm-fg-107 { - color: #87af5f; - } - .xterm-fg-108 { - color: #87af87; - } - .xterm-fg-109 { - color: #87afaf; - } - .xterm-fg-110 { - color: #87afd7; - } - .xterm-fg-111 { - color: #87afff; - } - .xterm-fg-112 { - color: #87d700; - } - .xterm-fg-113 { - color: #87d75f; - } - .xterm-fg-114 { - color: #87d787; - } - .xterm-fg-115 { - color: #87d7af; - } - .xterm-fg-116 { - color: #87d7d7; - } - .xterm-fg-117 { - color: #87d7ff; - } - .xterm-fg-118 { - color: #87ff00; - } - .xterm-fg-119 { - color: #87ff5f; - } - .xterm-fg-120 { - color: #87ff87; - } - .xterm-fg-121 { - color: #87ffaf; - } - .xterm-fg-122 { - color: #87ffd7; - } - .xterm-fg-123 { - color: #87ffff; - } - .xterm-fg-124 { - color: #af0000; - } - .xterm-fg-125 { - color: #af005f; - } - .xterm-fg-126 { - color: #af0087; - } - .xterm-fg-127 { - color: #af00af; - } - .xterm-fg-128 { - color: #af00d7; - } - .xterm-fg-129 { - color: #af00ff; - } - .xterm-fg-130 { - color: #af5f00; - } - .xterm-fg-131 { - color: #af5f5f; - } - .xterm-fg-132 { - color: #af5f87; - } - .xterm-fg-133 { - color: #af5faf; - } - .xterm-fg-134 { - color: #af5fd7; - } - .xterm-fg-135 { - color: #af5fff; - } - .xterm-fg-136 { - color: #af8700; - } - .xterm-fg-137 { - color: #af875f; - } - .xterm-fg-138 { - color: #af8787; - } - .xterm-fg-139 { - color: #af87af; - } - .xterm-fg-140 { - color: #af87d7; - } - .xterm-fg-141 { - color: #af87ff; - } - .xterm-fg-142 { - color: #afaf00; - } - .xterm-fg-143 { - color: #afaf5f; - } - .xterm-fg-144 { - color: #afaf87; - } - .xterm-fg-145 { - color: #afafaf; - } - .xterm-fg-146 { - color: #afafd7; - } - .xterm-fg-147 { - color: #afafff; - } - .xterm-fg-148 { - color: #afd700; - } - .xterm-fg-149 { - color: #afd75f; - } - .xterm-fg-150 { - color: #afd787; - } - .xterm-fg-151 { - color: #afd7af; - } - .xterm-fg-152 { - color: #afd7d7; - } - .xterm-fg-153 { - color: #afd7ff; - } - .xterm-fg-154 { - color: #afff00; - } - .xterm-fg-155 { - color: #afff5f; - } - .xterm-fg-156 { - color: #afff87; - } - .xterm-fg-157 { - color: #afffaf; - } - .xterm-fg-158 { - color: #afffd7; - } - .xterm-fg-159 { - color: #afffff; - } - .xterm-fg-160 { - color: #d70000; - } - .xterm-fg-161 { - color: #d7005f; - } - .xterm-fg-162 { - color: #d70087; - } - .xterm-fg-163 { - color: #d700af; - } - .xterm-fg-164 { - color: #d700d7; - } - .xterm-fg-165 { - color: #d700ff; - } - .xterm-fg-166 { - color: #d75f00; - } - .xterm-fg-167 { - color: #d75f5f; - } - .xterm-fg-168 { - color: #d75f87; - } - .xterm-fg-169 { - color: #d75faf; - } - .xterm-fg-170 { - color: #d75fd7; - } - .xterm-fg-171 { - color: #d75fff; - } - .xterm-fg-172 { - color: #d78700; - } - .xterm-fg-173 { - color: #d7875f; - } - .xterm-fg-174 { - color: #d78787; - } - .xterm-fg-175 { - color: #d787af; - } - .xterm-fg-176 { - color: #d787d7; - } - .xterm-fg-177 { - color: #d787ff; - } - .xterm-fg-178 { - color: #d7af00; - } - .xterm-fg-179 { - color: #d7af5f; - } - .xterm-fg-180 { - color: #d7af87; - } - .xterm-fg-181 { - color: #d7afaf; - } - .xterm-fg-182 { - color: #d7afd7; - } - .xterm-fg-183 { - color: #d7afff; - } - .xterm-fg-184 { - color: #d7d700; - } - .xterm-fg-185 { - color: #d7d75f; - } - .xterm-fg-186 { - color: #d7d787; - } - .xterm-fg-187 { - color: #d7d7af; - } - .xterm-fg-188 { - color: #d7d7d7; - } - .xterm-fg-189 { - color: #d7d7ff; - } - .xterm-fg-190 { - color: #d7ff00; - } - .xterm-fg-191 { - color: #d7ff5f; - } - .xterm-fg-192 { - color: #d7ff87; - } - .xterm-fg-193 { - color: #d7ffaf; - } - .xterm-fg-194 { - color: #d7ffd7; - } - .xterm-fg-195 { - color: #d7ffff; - } - .xterm-fg-196 { - color: #ff0000; - } - .xterm-fg-197 { - color: #ff005f; - } - .xterm-fg-198 { - color: #ff0087; - } - .xterm-fg-199 { - color: #ff00af; - } - .xterm-fg-200 { - color: #ff00d7; - } - .xterm-fg-201 { - color: #ff00ff; - } - .xterm-fg-202 { - color: #ff5f00; - } - .xterm-fg-203 { - color: #ff5f5f; - } - .xterm-fg-204 { - color: #ff5f87; - } - .xterm-fg-205 { - color: #ff5faf; - } - .xterm-fg-206 { - color: #ff5fd7; - } - .xterm-fg-207 { - color: #ff5fff; - } - .xterm-fg-208 { - color: #ff8700; - } - .xterm-fg-209 { - color: #ff875f; - } - .xterm-fg-210 { - color: #ff8787; - } - .xterm-fg-211 { - color: #ff87af; - } - .xterm-fg-212 { - color: #ff87d7; - } - .xterm-fg-213 { - color: #ff87ff; - } - .xterm-fg-214 { - color: #ffaf00; - } - .xterm-fg-215 { - color: #ffaf5f; - } - .xterm-fg-216 { - color: #ffaf87; - } - .xterm-fg-217 { - color: #ffafaf; - } - .xterm-fg-218 { - color: #ffafd7; - } - .xterm-fg-219 { - color: #ffafff; - } - .xterm-fg-220 { - color: #ffd700; - } - .xterm-fg-221 { - color: #ffd75f; - } - .xterm-fg-222 { - color: #ffd787; - } - .xterm-fg-223 { - color: #ffd7af; - } - .xterm-fg-224 { - color: #ffd7d7; - } - .xterm-fg-225 { - color: #ffd7ff; - } - .xterm-fg-226 { - color: #ffff00; - } - .xterm-fg-227 { - color: #ffff5f; - } - .xterm-fg-228 { - color: #ffff87; - } - .xterm-fg-229 { - color: #ffffaf; - } - .xterm-fg-230 { - color: #ffffd7; - } - .xterm-fg-231 { - color: #ffffff; - } - .xterm-fg-232 { - color: #080808; - } - .xterm-fg-233 { - color: #121212; - } - .xterm-fg-234 { - color: #1c1c1c; - } - .xterm-fg-235 { - color: #262626; - } - .xterm-fg-236 { - color: #303030; - } - .xterm-fg-237 { - color: #3a3a3a; - } - .xterm-fg-238 { - color: #444444; - } - .xterm-fg-239 { - color: #4e4e4e; - } - .xterm-fg-240 { - color: #585858; - } - .xterm-fg-241 { - color: #626262; - } - .xterm-fg-242 { - color: #6c6c6c; - } - .xterm-fg-243 { - color: #767676; - } - .xterm-fg-244 { - color: #808080; - } - .xterm-fg-245 { - color: #8a8a8a; - } - .xterm-fg-246 { - color: #949494; - } - .xterm-fg-247 { - color: #9e9e9e; - } - .xterm-fg-248 { - color: #a8a8a8; - } - .xterm-fg-249 { - color: #b2b2b2; - } - .xterm-fg-250 { - color: #bcbcbc; - } - .xterm-fg-251 { - color: #c6c6c6; - } - .xterm-fg-252 { - color: #d0d0d0; - } - .xterm-fg-253 { - color: #dadada; - } - .xterm-fg-254 { - color: #e4e4e4; - } - .xterm-fg-255 { - color: #eeeeee; - } -} diff --git a/app/assets/stylesheets/pages/builds.scss b/app/assets/stylesheets/pages/builds.scss new file mode 100644 index 00000000000..74dc3e321c1 --- /dev/null +++ b/app/assets/stylesheets/pages/builds.scss @@ -0,0 +1,75 @@ +.build-page { + pre.trace { + background: #111111; + color: #fff; + font-family: $monospace_font; + white-space: pre; + white-space: pre-wrap; /* css-3 */ + white-space: -moz-pre-wrap; /* Mozilla, since 1999 */ + white-space: -pre-wrap; /* Opera 4-6 */ + white-space: -o-pre-wrap; /* Opera 7 */ + word-wrap: break-word; /* Internet Explorer 5.5+ */ + overflow: auto; + overflow-y: hidden; + font-size: 12px; + + .fa-refresh { + font-size: 24px; + margin-left: 20px; + } + } + + .autoscroll-container { + position: fixed; + bottom: 10px; + right: 20px; + z-index: 100; + } + + .scroll-controls { + position: fixed; + bottom: 10px; + left: 250px; + z-index: 100; + + a { + display: block; + margin-bottom: 5px; + } + } + + .page-sidebar-collapsed { + .scroll-controls { + left: 70px; + } + } + + .build-widget { + padding: 10px; + background: $background-color; + margin-bottom: 20px; + border-radius: 4px; + + .title { + margin-top: 0; + color: #666; + line-height: 1.5; + } + .attr-name { + color: #777; + } + } + + .alert-disabled { + background: $background-color; + + a { + color: #3084bb !important; + } + } + + .build-top-menu { + margin-top: 0; + margin-bottom: 2px; + } +} diff --git a/app/assets/stylesheets/pages/ci_projects.scss b/app/assets/stylesheets/pages/ci_projects.scss new file mode 100644 index 00000000000..8c5273abcda --- /dev/null +++ b/app/assets/stylesheets/pages/ci_projects.scss @@ -0,0 +1,59 @@ +.ci-body { + .project-title { + margin: 0; + color: #444; + font-size: 20px; + line-height: 1.5; + } + + .wide-table-holder { + margin-left: -$gl-padding; + margin-right: -$gl-padding; + } + + .builds, + .projects-table { + .light { + border-color: $border-color; + } + + th, td { + padding: 10px $gl-padding; + } + + td { + color: $gl-gray; + vertical-align: middle !important; + + a { + font-weight: normal; + text-decoration: none; + } + } + } + + .commit-info { + .attr-name { + margin-right: 5px; + } + + pre.commit-message { + background: none; + padding: 0; + margin: 0; + border: none; + margin: 20px 0; + border-radius: 0; + } + } + + .loading{ + font-size: 20px; + } + + .ci-charts { + fieldset { + margin-bottom: 16px; + } + } +} diff --git a/app/assets/stylesheets/pages/lint.scss b/app/assets/stylesheets/pages/lint.scss new file mode 100644 index 00000000000..6d2bd33b28b --- /dev/null +++ b/app/assets/stylesheets/pages/lint.scss @@ -0,0 +1,10 @@ +.ci-body { + .incorrect-syntax{ + font-size: 19px; + color: red; + } + .correct-syntax{ + font-size: 19px; + color: #47a447; + } +} diff --git a/app/assets/stylesheets/pages/runners.scss b/app/assets/stylesheets/pages/runners.scss new file mode 100644 index 00000000000..2b15ab83129 --- /dev/null +++ b/app/assets/stylesheets/pages/runners.scss @@ -0,0 +1,36 @@ +.ci-body { + .runner-state { + padding: 6px 12px; + margin-right: 10px; + color: #FFF; + + &.runner-state-shared { + background: #32b186; + } + &.runner-state-specific { + background: #3498db; + } + } + + .runner-status-online { + color: green; + } + + .runner-status-offline { + color: gray; + } + + .runner-status-paused { + color: red; + } + + .runner { + .btn { + padding: 1px 6px; + } + + h4 { + font-weight: normal; + } + } +} diff --git a/app/assets/stylesheets/pages/status.scss b/app/assets/stylesheets/pages/status.scss new file mode 100644 index 00000000000..a7d3b2197f1 --- /dev/null +++ b/app/assets/stylesheets/pages/status.scss @@ -0,0 +1,37 @@ +.ci-status { + padding: 2px 7px; + margin-right: 5px; + border: 1px solid #EEE; + white-space: nowrap; + @include border-radius(4px); + + &:hover { + text-decoration: none; + } + + &.ci-failed { + color: $gl-danger; + border-color: $gl-danger; + } + + &.ci-success { + color: $gl-success; + border-color: $gl-success; + } + + &.ci-info { + color: $gl-info; + border-color: $gl-info; + } + + &.ci-disabled { + color: $gl-gray; + border-color: $gl-gray; + } + + &.ci-pending, + &.ci-running { + color: $gl-warning; + border-color: $gl-warning; + } +} diff --git a/app/assets/stylesheets/pages/xterm.scss b/app/assets/stylesheets/pages/xterm.scss new file mode 100644 index 00000000000..9a50096c0d0 --- /dev/null +++ b/app/assets/stylesheets/pages/xterm.scss @@ -0,0 +1,906 @@ +.build-page { + // color codes are based on http://en.wikipedia.org/wiki/File:Xterm_256color_chart.svg + // see also: https://gist.github.com/jasonm23/2868981 + + $black: #000000; + $red: #cd0000; + $green: #00cd00; + $yellow: #cdcd00; + $blue: #0000ee; // according to wikipedia, this is the xterm standard + //$blue: #1e90ff; // this is used by all the terminals I tried (when configured with the xterm color profile) + $magenta: #cd00cd; + $cyan: #00cdcd; + $white: #e5e5e5; + $l-black: #7f7f7f; + $l-red: #ff0000; + $l-green: #00ff00; + $l-yellow: #ffff00; + $l-blue: #5c5cff; + $l-magenta: #ff00ff; + $l-cyan: #00ffff; + $l-white: #ffffff; + + .term-bold { + font-weight: bold; + } + .term-italic { + font-style: italic; + } + .term-conceal { + visibility: hidden; + } + .term-underline { + text-decoration: underline; + } + .term-cross { + text-decoration: line-through; + } + + .term-fg-black { + color: $black; + } + .term-fg-red { + color: $red; + } + .term-fg-green { + color: $green; + } + .term-fg-yellow { + color: $yellow; + } + .term-fg-blue { + color: $blue; + } + .term-fg-magenta { + color: $magenta; + } + .term-fg-cyan { + color: $cyan; + } + .term-fg-white { + color: $white; + } + .term-fg-l-black { + color: $l-black; + } + .term-fg-l-red { + color: $l-red; + } + .term-fg-l-green { + color: $l-green; + } + .term-fg-l-yellow { + color: $l-yellow; + } + .term-fg-l-blue { + color: $l-blue; + } + .term-fg-l-magenta { + color: $l-magenta; + } + .term-fg-l-cyan { + color: $l-cyan; + } + .term-fg-l-white { + color: $l-white; + } + + .term-bg-black { + background-color: $black; + } + .term-bg-red { + background-color: $red; + } + .term-bg-green { + background-color: $green; + } + .term-bg-yellow { + background-color: $yellow; + } + .term-bg-blue { + background-color: $blue; + } + .term-bg-magenta { + background-color: $magenta; + } + .term-bg-cyan { + background-color: $cyan; + } + .term-bg-white { + background-color: $white; + } + .term-bg-l-black { + background-color: $l-black; + } + .term-bg-l-red { + background-color: $l-red; + } + .term-bg-l-green { + background-color: $l-green; + } + .term-bg-l-yellow { + background-color: $l-yellow; + } + .term-bg-l-blue { + background-color: $l-blue; + } + .term-bg-l-magenta { + background-color: $l-magenta; + } + .term-bg-l-cyan { + background-color: $l-cyan; + } + .term-bg-l-white { + background-color: $l-white; + } + + + .xterm-fg-0 { + color: #000000; + } + .xterm-fg-1 { + color: #800000; + } + .xterm-fg-2 { + color: #008000; + } + .xterm-fg-3 { + color: #808000; + } + .xterm-fg-4 { + color: #000080; + } + .xterm-fg-5 { + color: #800080; + } + .xterm-fg-6 { + color: #008080; + } + .xterm-fg-7 { + color: #c0c0c0; + } + .xterm-fg-8 { + color: #808080; + } + .xterm-fg-9 { + color: #ff0000; + } + .xterm-fg-10 { + color: #00ff00; + } + .xterm-fg-11 { + color: #ffff00; + } + .xterm-fg-12 { + color: #0000ff; + } + .xterm-fg-13 { + color: #ff00ff; + } + .xterm-fg-14 { + color: #00ffff; + } + .xterm-fg-15 { + color: #ffffff; + } + .xterm-fg-16 { + color: #000000; + } + .xterm-fg-17 { + color: #00005f; + } + .xterm-fg-18 { + color: #000087; + } + .xterm-fg-19 { + color: #0000af; + } + .xterm-fg-20 { + color: #0000d7; + } + .xterm-fg-21 { + color: #0000ff; + } + .xterm-fg-22 { + color: #005f00; + } + .xterm-fg-23 { + color: #005f5f; + } + .xterm-fg-24 { + color: #005f87; + } + .xterm-fg-25 { + color: #005faf; + } + .xterm-fg-26 { + color: #005fd7; + } + .xterm-fg-27 { + color: #005fff; + } + .xterm-fg-28 { + color: #008700; + } + .xterm-fg-29 { + color: #00875f; + } + .xterm-fg-30 { + color: #008787; + } + .xterm-fg-31 { + color: #0087af; + } + .xterm-fg-32 { + color: #0087d7; + } + .xterm-fg-33 { + color: #0087ff; + } + .xterm-fg-34 { + color: #00af00; + } + .xterm-fg-35 { + color: #00af5f; + } + .xterm-fg-36 { + color: #00af87; + } + .xterm-fg-37 { + color: #00afaf; + } + .xterm-fg-38 { + color: #00afd7; + } + .xterm-fg-39 { + color: #00afff; + } + .xterm-fg-40 { + color: #00d700; + } + .xterm-fg-41 { + color: #00d75f; + } + .xterm-fg-42 { + color: #00d787; + } + .xterm-fg-43 { + color: #00d7af; + } + .xterm-fg-44 { + color: #00d7d7; + } + .xterm-fg-45 { + color: #00d7ff; + } + .xterm-fg-46 { + color: #00ff00; + } + .xterm-fg-47 { + color: #00ff5f; + } + .xterm-fg-48 { + color: #00ff87; + } + .xterm-fg-49 { + color: #00ffaf; + } + .xterm-fg-50 { + color: #00ffd7; + } + .xterm-fg-51 { + color: #00ffff; + } + .xterm-fg-52 { + color: #5f0000; + } + .xterm-fg-53 { + color: #5f005f; + } + .xterm-fg-54 { + color: #5f0087; + } + .xterm-fg-55 { + color: #5f00af; + } + .xterm-fg-56 { + color: #5f00d7; + } + .xterm-fg-57 { + color: #5f00ff; + } + .xterm-fg-58 { + color: #5f5f00; + } + .xterm-fg-59 { + color: #5f5f5f; + } + .xterm-fg-60 { + color: #5f5f87; + } + .xterm-fg-61 { + color: #5f5faf; + } + .xterm-fg-62 { + color: #5f5fd7; + } + .xterm-fg-63 { + color: #5f5fff; + } + .xterm-fg-64 { + color: #5f8700; + } + .xterm-fg-65 { + color: #5f875f; + } + .xterm-fg-66 { + color: #5f8787; + } + .xterm-fg-67 { + color: #5f87af; + } + .xterm-fg-68 { + color: #5f87d7; + } + .xterm-fg-69 { + color: #5f87ff; + } + .xterm-fg-70 { + color: #5faf00; + } + .xterm-fg-71 { + color: #5faf5f; + } + .xterm-fg-72 { + color: #5faf87; + } + .xterm-fg-73 { + color: #5fafaf; + } + .xterm-fg-74 { + color: #5fafd7; + } + .xterm-fg-75 { + color: #5fafff; + } + .xterm-fg-76 { + color: #5fd700; + } + .xterm-fg-77 { + color: #5fd75f; + } + .xterm-fg-78 { + color: #5fd787; + } + .xterm-fg-79 { + color: #5fd7af; + } + .xterm-fg-80 { + color: #5fd7d7; + } + .xterm-fg-81 { + color: #5fd7ff; + } + .xterm-fg-82 { + color: #5fff00; + } + .xterm-fg-83 { + color: #5fff5f; + } + .xterm-fg-84 { + color: #5fff87; + } + .xterm-fg-85 { + color: #5fffaf; + } + .xterm-fg-86 { + color: #5fffd7; + } + .xterm-fg-87 { + color: #5fffff; + } + .xterm-fg-88 { + color: #870000; + } + .xterm-fg-89 { + color: #87005f; + } + .xterm-fg-90 { + color: #870087; + } + .xterm-fg-91 { + color: #8700af; + } + .xterm-fg-92 { + color: #8700d7; + } + .xterm-fg-93 { + color: #8700ff; + } + .xterm-fg-94 { + color: #875f00; + } + .xterm-fg-95 { + color: #875f5f; + } + .xterm-fg-96 { + color: #875f87; + } + .xterm-fg-97 { + color: #875faf; + } + .xterm-fg-98 { + color: #875fd7; + } + .xterm-fg-99 { + color: #875fff; + } + .xterm-fg-100 { + color: #878700; + } + .xterm-fg-101 { + color: #87875f; + } + .xterm-fg-102 { + color: #878787; + } + .xterm-fg-103 { + color: #8787af; + } + .xterm-fg-104 { + color: #8787d7; + } + .xterm-fg-105 { + color: #8787ff; + } + .xterm-fg-106 { + color: #87af00; + } + .xterm-fg-107 { + color: #87af5f; + } + .xterm-fg-108 { + color: #87af87; + } + .xterm-fg-109 { + color: #87afaf; + } + .xterm-fg-110 { + color: #87afd7; + } + .xterm-fg-111 { + color: #87afff; + } + .xterm-fg-112 { + color: #87d700; + } + .xterm-fg-113 { + color: #87d75f; + } + .xterm-fg-114 { + color: #87d787; + } + .xterm-fg-115 { + color: #87d7af; + } + .xterm-fg-116 { + color: #87d7d7; + } + .xterm-fg-117 { + color: #87d7ff; + } + .xterm-fg-118 { + color: #87ff00; + } + .xterm-fg-119 { + color: #87ff5f; + } + .xterm-fg-120 { + color: #87ff87; + } + .xterm-fg-121 { + color: #87ffaf; + } + .xterm-fg-122 { + color: #87ffd7; + } + .xterm-fg-123 { + color: #87ffff; + } + .xterm-fg-124 { + color: #af0000; + } + .xterm-fg-125 { + color: #af005f; + } + .xterm-fg-126 { + color: #af0087; + } + .xterm-fg-127 { + color: #af00af; + } + .xterm-fg-128 { + color: #af00d7; + } + .xterm-fg-129 { + color: #af00ff; + } + .xterm-fg-130 { + color: #af5f00; + } + .xterm-fg-131 { + color: #af5f5f; + } + .xterm-fg-132 { + color: #af5f87; + } + .xterm-fg-133 { + color: #af5faf; + } + .xterm-fg-134 { + color: #af5fd7; + } + .xterm-fg-135 { + color: #af5fff; + } + .xterm-fg-136 { + color: #af8700; + } + .xterm-fg-137 { + color: #af875f; + } + .xterm-fg-138 { + color: #af8787; + } + .xterm-fg-139 { + color: #af87af; + } + .xterm-fg-140 { + color: #af87d7; + } + .xterm-fg-141 { + color: #af87ff; + } + .xterm-fg-142 { + color: #afaf00; + } + .xterm-fg-143 { + color: #afaf5f; + } + .xterm-fg-144 { + color: #afaf87; + } + .xterm-fg-145 { + color: #afafaf; + } + .xterm-fg-146 { + color: #afafd7; + } + .xterm-fg-147 { + color: #afafff; + } + .xterm-fg-148 { + color: #afd700; + } + .xterm-fg-149 { + color: #afd75f; + } + .xterm-fg-150 { + color: #afd787; + } + .xterm-fg-151 { + color: #afd7af; + } + .xterm-fg-152 { + color: #afd7d7; + } + .xterm-fg-153 { + color: #afd7ff; + } + .xterm-fg-154 { + color: #afff00; + } + .xterm-fg-155 { + color: #afff5f; + } + .xterm-fg-156 { + color: #afff87; + } + .xterm-fg-157 { + color: #afffaf; + } + .xterm-fg-158 { + color: #afffd7; + } + .xterm-fg-159 { + color: #afffff; + } + .xterm-fg-160 { + color: #d70000; + } + .xterm-fg-161 { + color: #d7005f; + } + .xterm-fg-162 { + color: #d70087; + } + .xterm-fg-163 { + color: #d700af; + } + .xterm-fg-164 { + color: #d700d7; + } + .xterm-fg-165 { + color: #d700ff; + } + .xterm-fg-166 { + color: #d75f00; + } + .xterm-fg-167 { + color: #d75f5f; + } + .xterm-fg-168 { + color: #d75f87; + } + .xterm-fg-169 { + color: #d75faf; + } + .xterm-fg-170 { + color: #d75fd7; + } + .xterm-fg-171 { + color: #d75fff; + } + .xterm-fg-172 { + color: #d78700; + } + .xterm-fg-173 { + color: #d7875f; + } + .xterm-fg-174 { + color: #d78787; + } + .xterm-fg-175 { + color: #d787af; + } + .xterm-fg-176 { + color: #d787d7; + } + .xterm-fg-177 { + color: #d787ff; + } + .xterm-fg-178 { + color: #d7af00; + } + .xterm-fg-179 { + color: #d7af5f; + } + .xterm-fg-180 { + color: #d7af87; + } + .xterm-fg-181 { + color: #d7afaf; + } + .xterm-fg-182 { + color: #d7afd7; + } + .xterm-fg-183 { + color: #d7afff; + } + .xterm-fg-184 { + color: #d7d700; + } + .xterm-fg-185 { + color: #d7d75f; + } + .xterm-fg-186 { + color: #d7d787; + } + .xterm-fg-187 { + color: #d7d7af; + } + .xterm-fg-188 { + color: #d7d7d7; + } + .xterm-fg-189 { + color: #d7d7ff; + } + .xterm-fg-190 { + color: #d7ff00; + } + .xterm-fg-191 { + color: #d7ff5f; + } + .xterm-fg-192 { + color: #d7ff87; + } + .xterm-fg-193 { + color: #d7ffaf; + } + .xterm-fg-194 { + color: #d7ffd7; + } + .xterm-fg-195 { + color: #d7ffff; + } + .xterm-fg-196 { + color: #ff0000; + } + .xterm-fg-197 { + color: #ff005f; + } + .xterm-fg-198 { + color: #ff0087; + } + .xterm-fg-199 { + color: #ff00af; + } + .xterm-fg-200 { + color: #ff00d7; + } + .xterm-fg-201 { + color: #ff00ff; + } + .xterm-fg-202 { + color: #ff5f00; + } + .xterm-fg-203 { + color: #ff5f5f; + } + .xterm-fg-204 { + color: #ff5f87; + } + .xterm-fg-205 { + color: #ff5faf; + } + .xterm-fg-206 { + color: #ff5fd7; + } + .xterm-fg-207 { + color: #ff5fff; + } + .xterm-fg-208 { + color: #ff8700; + } + .xterm-fg-209 { + color: #ff875f; + } + .xterm-fg-210 { + color: #ff8787; + } + .xterm-fg-211 { + color: #ff87af; + } + .xterm-fg-212 { + color: #ff87d7; + } + .xterm-fg-213 { + color: #ff87ff; + } + .xterm-fg-214 { + color: #ffaf00; + } + .xterm-fg-215 { + color: #ffaf5f; + } + .xterm-fg-216 { + color: #ffaf87; + } + .xterm-fg-217 { + color: #ffafaf; + } + .xterm-fg-218 { + color: #ffafd7; + } + .xterm-fg-219 { + color: #ffafff; + } + .xterm-fg-220 { + color: #ffd700; + } + .xterm-fg-221 { + color: #ffd75f; + } + .xterm-fg-222 { + color: #ffd787; + } + .xterm-fg-223 { + color: #ffd7af; + } + .xterm-fg-224 { + color: #ffd7d7; + } + .xterm-fg-225 { + color: #ffd7ff; + } + .xterm-fg-226 { + color: #ffff00; + } + .xterm-fg-227 { + color: #ffff5f; + } + .xterm-fg-228 { + color: #ffff87; + } + .xterm-fg-229 { + color: #ffffaf; + } + .xterm-fg-230 { + color: #ffffd7; + } + .xterm-fg-231 { + color: #ffffff; + } + .xterm-fg-232 { + color: #080808; + } + .xterm-fg-233 { + color: #121212; + } + .xterm-fg-234 { + color: #1c1c1c; + } + .xterm-fg-235 { + color: #262626; + } + .xterm-fg-236 { + color: #303030; + } + .xterm-fg-237 { + color: #3a3a3a; + } + .xterm-fg-238 { + color: #444444; + } + .xterm-fg-239 { + color: #4e4e4e; + } + .xterm-fg-240 { + color: #585858; + } + .xterm-fg-241 { + color: #626262; + } + .xterm-fg-242 { + color: #6c6c6c; + } + .xterm-fg-243 { + color: #767676; + } + .xterm-fg-244 { + color: #808080; + } + .xterm-fg-245 { + color: #8a8a8a; + } + .xterm-fg-246 { + color: #949494; + } + .xterm-fg-247 { + color: #9e9e9e; + } + .xterm-fg-248 { + color: #a8a8a8; + } + .xterm-fg-249 { + color: #b2b2b2; + } + .xterm-fg-250 { + color: #bcbcbc; + } + .xterm-fg-251 { + color: #c6c6c6; + } + .xterm-fg-252 { + color: #d0d0d0; + } + .xterm-fg-253 { + color: #dadada; + } + .xterm-fg-254 { + color: #e4e4e4; + } + .xterm-fg-255 { + color: #eeeeee; + } +} -- cgit v1.2.1 From bdd477a0f800328a527f2fad92d1303441689341 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 12 Oct 2015 15:00:04 +0200 Subject: Re-organize GitLab css into 2 directories: framework and page specific css Signed-off-by: Dmitriy Zaporozhets --- app/assets/stylesheets/application.scss | 30 +- app/assets/stylesheets/base/fonts.scss | 25 -- app/assets/stylesheets/base/gl_bootstrap.scss | 273 -------------- app/assets/stylesheets/base/gl_variables.scss | 158 -------- app/assets/stylesheets/base/layout.scss | 27 -- app/assets/stylesheets/base/mixins.scss | 301 --------------- app/assets/stylesheets/base/variables.scss | 98 ----- app/assets/stylesheets/framework.scss | 32 ++ app/assets/stylesheets/framework/avatar.scss | 49 +++ app/assets/stylesheets/framework/blocks.scss | 62 ++++ app/assets/stylesheets/framework/buttons.scss | 163 +++++++++ app/assets/stylesheets/framework/calendar.scss | 90 +++++ app/assets/stylesheets/framework/callout.scss | 45 +++ app/assets/stylesheets/framework/common.scss | 404 +++++++++++++++++++++ app/assets/stylesheets/framework/files.scss | 171 +++++++++ app/assets/stylesheets/framework/filters.scss | 30 ++ app/assets/stylesheets/framework/flash.scss | 17 + app/assets/stylesheets/framework/fonts.scss | 25 ++ app/assets/stylesheets/framework/forms.scss | 94 +++++ app/assets/stylesheets/framework/gfm.scss | 25 ++ app/assets/stylesheets/framework/gitlab-theme.scss | 120 ++++++ app/assets/stylesheets/framework/gl_bootstrap.scss | 273 ++++++++++++++ app/assets/stylesheets/framework/gl_variables.scss | 158 ++++++++ app/assets/stylesheets/framework/header.scss | 169 +++++++++ app/assets/stylesheets/framework/highlight.scss | 70 ++++ app/assets/stylesheets/framework/issue_box.scss | 35 ++ app/assets/stylesheets/framework/jquery.scss | 55 +++ app/assets/stylesheets/framework/layout.scss | 27 ++ app/assets/stylesheets/framework/lists.scss | 125 +++++++ .../stylesheets/framework/markdown_area.scss | 115 ++++++ app/assets/stylesheets/framework/mixins.scss | 301 +++++++++++++++ app/assets/stylesheets/framework/mobile.scss | 139 +++++++ app/assets/stylesheets/framework/pagination.scss | 34 ++ app/assets/stylesheets/framework/selects.scss | 146 ++++++++ app/assets/stylesheets/framework/sidebar.scss | 267 ++++++++++++++ app/assets/stylesheets/framework/tables.scss | 20 + app/assets/stylesheets/framework/timeline.scss | 70 ++++ app/assets/stylesheets/framework/typography.scss | 130 +++++++ app/assets/stylesheets/framework/variables.scss | 98 +++++ app/assets/stylesheets/framework/zen.scss | 86 +++++ app/assets/stylesheets/generic/avatar.scss | 49 --- app/assets/stylesheets/generic/blocks.scss | 62 ---- app/assets/stylesheets/generic/buttons.scss | 163 --------- app/assets/stylesheets/generic/calendar.scss | 90 ----- app/assets/stylesheets/generic/callout.scss | 45 --- app/assets/stylesheets/generic/common.scss | 404 --------------------- app/assets/stylesheets/generic/files.scss | 171 --------- app/assets/stylesheets/generic/filters.scss | 30 -- app/assets/stylesheets/generic/flash.scss | 17 - app/assets/stylesheets/generic/forms.scss | 94 ----- app/assets/stylesheets/generic/gfm.scss | 25 -- app/assets/stylesheets/generic/header.scss | 169 --------- app/assets/stylesheets/generic/highlight.scss | 70 ---- app/assets/stylesheets/generic/issue_box.scss | 35 -- app/assets/stylesheets/generic/jquery.scss | 55 --- app/assets/stylesheets/generic/lists.scss | 125 ------- app/assets/stylesheets/generic/markdown_area.scss | 115 ------ app/assets/stylesheets/generic/mobile.scss | 139 ------- app/assets/stylesheets/generic/pagination.scss | 34 -- app/assets/stylesheets/generic/selects.scss | 146 -------- app/assets/stylesheets/generic/sidebar.scss | 267 -------------- app/assets/stylesheets/generic/tables.scss | 20 - app/assets/stylesheets/generic/timeline.scss | 70 ---- app/assets/stylesheets/generic/typography.scss | 130 ------- app/assets/stylesheets/generic/zen.scss | 86 ----- app/assets/stylesheets/themes/gitlab-theme.scss | 120 ------ 66 files changed, 3647 insertions(+), 3641 deletions(-) delete mode 100644 app/assets/stylesheets/base/fonts.scss delete mode 100644 app/assets/stylesheets/base/gl_bootstrap.scss delete mode 100644 app/assets/stylesheets/base/gl_variables.scss delete mode 100644 app/assets/stylesheets/base/layout.scss delete mode 100644 app/assets/stylesheets/base/mixins.scss delete mode 100644 app/assets/stylesheets/base/variables.scss create mode 100644 app/assets/stylesheets/framework.scss create mode 100644 app/assets/stylesheets/framework/avatar.scss create mode 100644 app/assets/stylesheets/framework/blocks.scss create mode 100644 app/assets/stylesheets/framework/buttons.scss create mode 100644 app/assets/stylesheets/framework/calendar.scss create mode 100644 app/assets/stylesheets/framework/callout.scss create mode 100644 app/assets/stylesheets/framework/common.scss create mode 100644 app/assets/stylesheets/framework/files.scss create mode 100644 app/assets/stylesheets/framework/filters.scss create mode 100644 app/assets/stylesheets/framework/flash.scss create mode 100644 app/assets/stylesheets/framework/fonts.scss create mode 100644 app/assets/stylesheets/framework/forms.scss create mode 100644 app/assets/stylesheets/framework/gfm.scss create mode 100644 app/assets/stylesheets/framework/gitlab-theme.scss create mode 100644 app/assets/stylesheets/framework/gl_bootstrap.scss create mode 100644 app/assets/stylesheets/framework/gl_variables.scss create mode 100644 app/assets/stylesheets/framework/header.scss create mode 100644 app/assets/stylesheets/framework/highlight.scss create mode 100644 app/assets/stylesheets/framework/issue_box.scss create mode 100644 app/assets/stylesheets/framework/jquery.scss create mode 100644 app/assets/stylesheets/framework/layout.scss create mode 100644 app/assets/stylesheets/framework/lists.scss create mode 100644 app/assets/stylesheets/framework/markdown_area.scss create mode 100644 app/assets/stylesheets/framework/mixins.scss create mode 100644 app/assets/stylesheets/framework/mobile.scss create mode 100644 app/assets/stylesheets/framework/pagination.scss create mode 100644 app/assets/stylesheets/framework/selects.scss create mode 100644 app/assets/stylesheets/framework/sidebar.scss create mode 100644 app/assets/stylesheets/framework/tables.scss create mode 100644 app/assets/stylesheets/framework/timeline.scss create mode 100644 app/assets/stylesheets/framework/typography.scss create mode 100644 app/assets/stylesheets/framework/variables.scss create mode 100644 app/assets/stylesheets/framework/zen.scss delete mode 100644 app/assets/stylesheets/generic/avatar.scss delete mode 100644 app/assets/stylesheets/generic/blocks.scss delete mode 100644 app/assets/stylesheets/generic/buttons.scss delete mode 100644 app/assets/stylesheets/generic/calendar.scss delete mode 100644 app/assets/stylesheets/generic/callout.scss delete mode 100644 app/assets/stylesheets/generic/common.scss delete mode 100644 app/assets/stylesheets/generic/files.scss delete mode 100644 app/assets/stylesheets/generic/filters.scss delete mode 100644 app/assets/stylesheets/generic/flash.scss delete mode 100644 app/assets/stylesheets/generic/forms.scss delete mode 100644 app/assets/stylesheets/generic/gfm.scss delete mode 100644 app/assets/stylesheets/generic/header.scss delete mode 100644 app/assets/stylesheets/generic/highlight.scss delete mode 100644 app/assets/stylesheets/generic/issue_box.scss delete mode 100644 app/assets/stylesheets/generic/jquery.scss delete mode 100644 app/assets/stylesheets/generic/lists.scss delete mode 100644 app/assets/stylesheets/generic/markdown_area.scss delete mode 100644 app/assets/stylesheets/generic/mobile.scss delete mode 100644 app/assets/stylesheets/generic/pagination.scss delete mode 100644 app/assets/stylesheets/generic/selects.scss delete mode 100644 app/assets/stylesheets/generic/sidebar.scss delete mode 100644 app/assets/stylesheets/generic/tables.scss delete mode 100644 app/assets/stylesheets/generic/timeline.scss delete mode 100644 app/assets/stylesheets/generic/typography.scss delete mode 100644 app/assets/stylesheets/generic/zen.scss delete mode 100644 app/assets/stylesheets/themes/gitlab-theme.scss (limited to 'app') diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index d9ede637944..233e01cc06b 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -11,18 +11,10 @@ *= require cal-heatmap */ - -@import "base/fonts"; -@import "base/variables"; -@import "base/mixins"; -@import "base/layout"; - - /** - * Customized Twitter bootstrap + * GitLab UI framework */ -@import 'base/gl_variables'; -@import 'base/gl_bootstrap'; +@import "framework"; /** * NProgress load bar css @@ -32,24 +24,12 @@ /** * Font icons - * */ @import "font-awesome"; -/** - * UI themes: - */ -@import "themes/**/*"; - -/** - * Generic css (forms, nav etc): - */ -@import "generic/**/*"; - /** * Page specific styles (issues, projects etc): */ - @import "pages/**/*"; /** @@ -61,9 +41,3 @@ * Styles for JS behaviors. */ @import "behaviors.scss"; - -/** - * CI specific styles: - */ -@import "ci/**/*"; - diff --git a/app/assets/stylesheets/base/fonts.scss b/app/assets/stylesheets/base/fonts.scss deleted file mode 100644 index e214567eca1..00000000000 --- a/app/assets/stylesheets/base/fonts.scss +++ /dev/null @@ -1,25 +0,0 @@ -/* latin-ext */ -@font-face { - font-family: 'Source Sans Pro'; - font-style: normal; - font-weight: 300; - src: local('Source Sans Pro Light'), local('SourceSansPro-Light'), font-url('SourceSansPro-Light.ttf'); -} -@font-face { - font-family: 'Source Sans Pro'; - font-style: normal; - font-weight: 400; - src: local('Source Sans Pro'), local('SourceSansPro-Regular'), font-url('SourceSansPro-Regular.ttf'); -} -@font-face { - font-family: 'Source Sans Pro'; - font-style: normal; - font-weight: 600; - src: local('Source Sans Pro Semibold'), local('SourceSansPro-Semibold'), font-url('SourceSansPro-Semibold.ttf'); -} -@font-face { - font-family: 'Source Sans Pro'; - font-style: normal; - font-weight: 700; - src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), font-url('SourceSansPro-Bold.ttf'); -} diff --git a/app/assets/stylesheets/base/gl_bootstrap.scss b/app/assets/stylesheets/base/gl_bootstrap.scss deleted file mode 100644 index eb8d23d6453..00000000000 --- a/app/assets/stylesheets/base/gl_bootstrap.scss +++ /dev/null @@ -1,273 +0,0 @@ -/* - * Twitter bootstrap with GitLab customizations/additions - * - */ - -// Core variables and mixins -@import "bootstrap/variables"; -@import "bootstrap/mixins"; - -// Reset -@import "bootstrap/normalize"; -@import "bootstrap/print"; - -// Core CSS -@import "bootstrap/scaffolding"; -@import "bootstrap/type"; -@import "bootstrap/code"; -@import "bootstrap/grid"; -@import "bootstrap/tables"; -@import "bootstrap/forms"; -@import "bootstrap/buttons"; - -// Components -@import "bootstrap/component-animations"; -@import "bootstrap/dropdowns"; -@import "bootstrap/button-groups"; -@import "bootstrap/input-groups"; -@import "bootstrap/navs"; -@import "bootstrap/navbar"; -@import "bootstrap/breadcrumbs"; -@import "bootstrap/pagination"; -@import "bootstrap/pager"; -@import "bootstrap/labels"; -@import "bootstrap/badges"; -@import "bootstrap/jumbotron"; -@import "bootstrap/thumbnails"; -@import "bootstrap/alerts"; -@import "bootstrap/progress-bars"; -@import "bootstrap/list-group"; -@import "bootstrap/wells"; -@import "bootstrap/close"; -@import "bootstrap/panels"; - -// Components w/ JavaScript -@import "bootstrap/modals"; -@import "bootstrap/tooltip"; -@import "bootstrap/popovers"; -@import "bootstrap/carousel"; - -// Utility classes -.clearfix { - @include clearfix(); -} -.center-block { - @include center-block(); -} -.pull-right { - float: right !important; -} -.pull-left { - float: left !important; -} -.hide { - display: none; -} -.show { - display: block !important; -} -.invisible { - visibility: hidden; -} -.text-hide { - @include text-hide(); -} -.hidden { - display: none !important; - visibility: hidden !important; -} -.affix { - position: fixed; -} - -@import "bootstrap/responsive-utilities"; - -// Labels -.label { - padding: 2px 4px; - font-size: 13px; - font-style: normal; - font-weight: normal; - display: inline-block; - - &.label-gray { - background-color: #f8fafc; - color: $gl-gray; - text-shadow: none; - } - - &.label-inverse { - background-color: #333333; - } -} - -// Nav tabs -.nav.nav-tabs { - margin-bottom: 15px; - - li { - > a { - margin-right: 5px; - line-height: 20px; - border-color: #EEE; - color: #888; - border-bottom: 1px solid #ddd; - .badge { - background-color: #eee; - color: #888; - text-shadow: 0 1px 1px #fff; - } - i.fa { - line-height: 14px; - } - } - &.active { - > a { - border-color: #CCC; - border-bottom: 1px solid #fff; - color: #333; - font-weight: bold; - } - } - } -} - -.nav-tabs > li > a, -.nav-pills > li > a { - color: #666; -} - -.nav-pills > .active > a > span > .badge { - background-color: #fff; - color: $gl-primary; -} - - -/** - * fix to keep tooltips position in top navigation bar - * - */ -.navbar .nav > li { - position: relative; - white-space: nowrap; -} - -/** - * Add some extra stuff to panels - * - */ - -.container-blank .panel .panel-heading { - font-size: 17px; - line-height: 38px; -} - -.panel { - box-shadow: none; - - .panel-heading { - .panel-head-actions { - position: relative; - top: -5px; - float: right; - } - } - - .panel-body { - form { - margin: 0; - } - - .form-actions { - margin: -15px; - margin-top: 18px; - } - } - - .panel-footer { - .pagination { - margin: 0; - } - - .btn { - min-width: 124px; - } - } - - &.panel-small { - .panel-heading { - padding: 6px 15px; - font-size: 13px; - font-weight: normal; - a { - color: #777; - } - } - } -} - -.panel-succes .panel-heading, -.panel-info .panel-heading, -.panel-danger .panel-heading, -.panel-warning .panel-heading, -.panel-primary .panel-heading, -.alert { - a:not(.btn) { - @extend .alert-link; - color: #fff; - text-decoration: underline; - } -} - -.alert-help { - background-color: $background-color; - border: 1px solid $border-color; - color: $gl-gray; -} - -// Typography ================================================================= - -.text-primary, -.text-primary:hover { - color: $brand-primary; -} - -.text-success, -.text-success:hover { - color: $brand-success; -} - -.text-danger, -.text-danger:hover { - color: $brand-danger; -} - -.text-warning, -.text-warning:hover { - color: $brand-warning; -} - -.text-info, -.text-info:hover { - color: $brand-info; -} - -// Tables ===================================================================== - -table.table { - .dropdown-menu a { - text-decoration: none; - } - - .success, - .warning, - .danger, - .info { - color: #fff; - - a:not(.btn) { - text-decoration: underline; - color: #fff; - } - } -} diff --git a/app/assets/stylesheets/base/gl_variables.scss b/app/assets/stylesheets/base/gl_variables.scss deleted file mode 100644 index 18632da4f2a..00000000000 --- a/app/assets/stylesheets/base/gl_variables.scss +++ /dev/null @@ -1,158 +0,0 @@ -// Override Bootstrap variables here (defaults from bootstrap-sass v3.3.3): -// For all variables see https://github.com/twbs/bootstrap-sass/blob/master/templates/project/_bootstrap-variables.sass -// -// Variables -// -------------------------------------------------- - - -//== Colors -// -//## Gray and brand colors for use across Bootstrap. - -// $gray-base: #000 -// $gray-darker: lighten($gray-base, 13.5%) // #222 -// $gray-dark: lighten($gray-base, 20%) // #333 -// $gray: lighten($gray-base, 33.5%) // #555 -// $gray-light: lighten($gray-base, 46.7%) // #777 -// $gray-lighter: lighten($gray-base, 93.5%) // #eee - -$brand-primary: $gl-primary; -$brand-success: $gl-success; -$brand-info: $gl-info; -$brand-warning: $gl-warning; -$brand-danger: $gl-danger; - -$border-radius-base: 2px !default; -$border-radius-large: 2px !default; -$border-radius-small: 2px !default; - - -//== Scaffolding -// -$text-color: $gl-text-color; -$link-color: $gl-link-color; - - -//== Typography -// -//## Font, line-height, and color for body text, headings, and more. - -$font-family-sans-serif: $regular_font; -$font-family-monospace: $monospace_font; -$font-size-base: $gl-font-size; - - -//== Components -// -//## Define common padding and border radius sizes and more. Values based on 14px text and 1.428 line-height (~20px to start). - -$padding-base-vertical: 9px; -$padding-base-horizontal: $gl-padding; -$component-active-color: #fff; -$component-active-bg: $brand-info; - -//== Forms -// -//## - -$input-color: $text-color; -$input-border: #e7e9ed; -$input-border-focus: #7F8FA4; -$legend-color: $text-color; - - -//== Pagination -// -//## - -$pagination-color: $gl-gray; -$pagination-bg: $background-color; -$pagination-border: transparent; - -$pagination-hover-color: #fff; -$pagination-hover-bg: $brand-info; -$pagination-hover-border: transparent; - -$pagination-active-color: #fff; -$pagination-active-bg: $brand-info; -$pagination-active-border: transparent; - -$pagination-disabled-color: #fff; -$pagination-disabled-bg: lighten($brand-info, 15%); -$pagination-disabled-border: transparent; - - -//== Form states and alerts -// -//## Define colors for form feedback states and, by default, alerts. - -$state-success-text: #fff; -$state-success-bg: $brand-success; -$state-success-border: $brand-success; - -$state-info-text: #fff; -$state-info-bg: $brand-info; -$state-info-border: $brand-info; - -$state-warning-text: #fff; -$state-warning-bg: $brand-warning; -$state-warning-border: $brand-warning; - -$state-danger-text: #fff; -$state-danger-bg: $brand-danger; -$state-danger-border: $brand-danger; - - -//== Alerts -// -//## Define alert colors, border radius, and padding. - -$alert-border-radius: 0; - - -//== Panels -// -//## - -$panel-border-radius: 2px; -$panel-default-text: $text-color; -$panel-default-border: $border-color; -$panel-default-heading-bg: $background-color; -$panel-footer-bg: $background-color; -$panel-inner-border: $border-color; - -//== Wells -// -//## - -$well-bg: #F9F9F9; -$well-border: #EEE; - -//== Code -// -//## - -$code-color: #c7254e; -$code-bg: #f9f2f4; - -$kbd-color: #fff; -$kbd-bg: #333; - -//== Buttons -// -//## -$btn-default-color: $gl-text-color; -$btn-default-bg: #fff; -$btn-default-border: #e7e9ed; - -//== Nav -// -//## -$nav-link-padding: 13px $gl-padding; - -//== Code -// -//## -$pre-bg: #f8fafc !default; -$pre-color: $gl-gray !default; -$pre-border-color: #e7e9ed; diff --git a/app/assets/stylesheets/base/layout.scss b/app/assets/stylesheets/base/layout.scss deleted file mode 100644 index c7b3b60e769..00000000000 --- a/app/assets/stylesheets/base/layout.scss +++ /dev/null @@ -1,27 +0,0 @@ -html { - overflow-y: scroll; - - &.touch .tooltip { display: none !important; } - - body { - padding-top: $header-height; - text-rendering: geometricPrecision; - } -} - -.container { - padding-top: 0; - z-index: 5; -} - -.container .content { - margin: 0 0; -} - -.navless-container { - margin-top: 30px; -} - -.container-limited { - max-width: $fixed-layout-width; -} diff --git a/app/assets/stylesheets/base/mixins.scss b/app/assets/stylesheets/base/mixins.scss deleted file mode 100644 index c74a6d39824..00000000000 --- a/app/assets/stylesheets/base/mixins.scss +++ /dev/null @@ -1,301 +0,0 @@ -/** - * Generic mixins - */ - @mixin box-shadow($shadow) { - -webkit-box-shadow: $shadow; - -moz-box-shadow: $shadow; - -ms-box-shadow: $shadow; - -o-box-shadow: $shadow; - box-shadow: $shadow; -} - -@mixin border-radius($radius) { - -webkit-border-radius: $radius; - -moz-border-radius: $radius; - -ms-border-radius: $radius; - -o-border-radius: $radius; - border-radius: $radius; -} - -@mixin border-radius-left($radius) { - @include border-radius($radius 0 0 $radius) -} - -@mixin border-radius-right($radius) { - @include border-radius(0 0 $radius $radius) -} - -@mixin linear-gradient($from, $to) { - background-image: -webkit-gradient(linear, 0 0, 0 100%, from($from), to($to)); - background-image: -webkit-linear-gradient($from, $to); - background-image: -moz-linear-gradient($from, $to); - background-image: -ms-linear-gradient($from, $to); - background-image: -o-linear-gradient($from, $to); -} - -@mixin transition($transition) { - -webkit-transition: $transition; - -moz-transition: $transition; - -ms-transition: $transition; - -o-transition: $transition; - transition: $transition; -} - -/** - * Prefilled mixins - * Mixins with fixed values - */ - -@mixin shade { - @include box-shadow(0 0 3px #ddd); -} - -@mixin solid-shade { - @include box-shadow(0 0 0 3px #f1f1f1); -} - -@mixin md-typography { - color: $md-text-color; - - a { - color: $md-link-color; - } - - img { - max-width: 100%; - } - - *:first-child { - margin-top: 0; - } - - code { - font-family: $monospace_font; - white-space: pre; - word-wrap: normal; - padding: 1px 2px; - } - - kbd { - display: inline-block; - padding: 3px 5px; - font-size: 11px; - line-height: 10px; - color: #555; - vertical-align: middle; - background-color: #FCFCFC; - border-width: 1px; - border-style: solid; - border-color: #CCC #CCC #BBB; - border-image: none; - border-radius: 3px; - box-shadow: 0px -1px 0px #BBB inset; - } - - h1 { - font-size: 1.3em; - font-weight: 600; - margin: 24px 0 12px 0; - padding: 0 0 10px 0; - border-bottom: 1px solid #e7e9ed; - color: #313236; - } - - h2 { - font-size: 1.2em; - font-weight: 600; - margin: 24px 0 12px 0; - color: #313236; - } - - h3 { - margin: 24px 0 12px 0; - font-size: 1.25em; - } - - h4 { - margin: 24px 0 12px 0; - font-size: 1.1em; - } - - h5 { - margin: 24px 0 12px 0; - font-size: 1em; - } - - h6 { - margin: 24px 0 12px 0; - font-size: 0.90em; - } - - blockquote { - padding: 8px 21px; - margin: 12px 0 12px; - border-left: 3px solid #e7e9ed; - } - - blockquote p { - color: #7f8fa4 !important; - font-size: 15px; - line-height: 1.5; - } - - p { - color:#5c5d5e; - margin:6px 0 0 0; - } - - table { - @extend .table; - @extend .table-bordered; - margin: 12px 0 12px 0; - color: #5c5d5e; - th { - background: #f8fafc; - } - } - - pre { - margin: 12px 0 12px 0 !important; - background-color: #f8fafc !important; - font-size: 13px !important; - color: #5b6169 !important; - line-height: 1.6em !important; - @include border-radius(2px); - } - - p > code { - font-weight: inherit; - } - - - ul { - color: #5c5d5e; - } - - li { - line-height: 1.6em; - } - - a[href*="/uploads/"], a[href*="storage.googleapis.com/google-code-attachments/"] { - &:before { - margin-right: 4px; - - font: normal normal normal 14px/1 FontAwesome; - font-size: inherit; - text-rendering: auto; - -webkit-font-smoothing: antialiased; - content: "\f0c6"; - } - - &:hover:before { - text-decoration: none; - } - } -} - - -@mixin str-truncated($max_width: 82%) { - display: inline-block; - overflow: hidden; - text-overflow: ellipsis; - vertical-align: top; - white-space: nowrap; - max-width: $max_width; -} - -/* - * Base mixin for lists in GitLab - */ -@mixin basic-list { - margin: 5px 0px; - padding: 0px; - list-style: none; - - > li { - padding: 10px 0; - border-bottom: 1px solid #EEE; - overflow: hidden; - display: block; - margin: 0px; - - &:last-child { - border-bottom: none; - } - - &.active { - background: #f9f9f9; - a { - font-weight: 600; - } - } - - &.hide { - display: none; - } - - &.light { - a { - color: $gl-gray; - } - } - } -} - -@mixin input-big { - height: 36px; - padding: 5px 10px; - font-size: 16px; - line-height: 24px; - color: #7f8fa4; - background-color: #fff; - border-color: #e7e9ed; -} - -@mixin btn-big { - height: 36px; - padding: 5px 10px; - font-size: 16px; - line-height: 24px; -} - -@mixin nav-menu { - padding: 0; - margin: 0; - list-style: none; - margin-top: 5px; - height: 56px; - - li { - display: inline-block; - - a { - padding: 14px; - font-size: 17px; - line-height: 28px; - color: #7f8fa4; - border-bottom: 2px solid transparent; - - &:hover, &:active, &:focus { - text-decoration: none; - } - } - - &.active a { - color: #4c4e54; - border-bottom: 2px solid #1cacfc; - } - - .badge { - font-weight: normal; - background-color: #fff; - background-color: #eee; - color: #78a; - } - } -} - -.fa-align { - top: 20px; - position: relative; -} diff --git a/app/assets/stylesheets/base/variables.scss b/app/assets/stylesheets/base/variables.scss deleted file mode 100644 index eb9a2966389..00000000000 --- a/app/assets/stylesheets/base/variables.scss +++ /dev/null @@ -1,98 +0,0 @@ -$hover: #FFFAF1; -$gl-text-color: #54565B; -$gl-text-green: #4A2; -$gl-text-red: #D12F19; -$gl-text-orange: #D90; -$gl-header-color: #4c4e54; -$gl-link-color: #333c48; -$md-text-color: #444; -$md-link-color: #3084bb; -$nprogress-color: #c0392b; -$gl-font-size: 15px; -$list-font-size: 15px; -$sidebar_collapsed_width: 62px; -$sidebar_width: 230px; -$avatar_radius: 50%; -$code_font_size: 13px; -$code_line_height: 1.5; -$border-color: #dce0e6; -$background-color: #F7F8FA; -$header-height: 58px; -$fixed-layout-width: 1200px; -$gl-gray: #7f8fa4; -$gl-padding: 16px; -$gl-avatar-size: 46px; - -/* - * Color schema - */ - -$white-light: #FFFFFF; -$white-normal: #DCE0E5; -$white-dark: #E4E7ED; - -$gray-light: #F0F2F5; -$gray-normal: #DCE0E5; -$gray-dark: #E4E7ED; - -$green-light: #31AF64; -$green-normal: #2FAA60; -$green-dark: #2CA05B; - -$blue-light: #2EA8E5; -$blue-normal: #2D9FD8; -$blue-dark: #2897CE; - -$orange-light: #FC6443; -$orange-normal: #E75E40; -$orange-dark: #CE5237; - -$red-light: #F43263; -$red-normal: #E52C5A; -$red-dark: #D22852; - -$border-white-light: #E3E7EC; -$border-white-normal: #D6DAE2; -$border-white-dark: #C6CACF; - -$border-gray-light: #DCE0E5; -$border-gray-normal: #D6DAE2; -$border-gray-dark: #C6CACF; - -$border-green-light: #2FAA60; -$border-green-normal: #2CA05B; -$border-green-dark: #279654; - -$border-blue-light: #2D9FD8; -$border-blue-normal: #2897CE; -$border-blue-dark: #258DC1; - -$border-orange-light: #ED5C3D; -$border-orange-normal: #CE5237; -$border-orange-dark: #C14E35; - -$border-red-light: #E52C5A; -$border-red-normal: #D22852; -$border-red-dark: #CA264F; - - -/* - * State colors: - */ -$gl-primary: $blue-normal; -$gl-success: $green-normal; -$gl-info: $blue-normal; -$gl-warning: $orange-normal; -$gl-danger: $red-normal; - -/* - * Commit Diff Colors - */ -$added: #63c363; -$deleted: #f77; - -/* - * Fonts - */ -$monospace_font: 'Menlo', 'Liberation Mono', 'Consolas', 'DejaVu Sans Mono', 'Ubuntu Mono', 'Courier New', 'andale mono', 'lucida console', monospace; -$regular_font: 'Source Sans Pro', "Helvetica Neue", Helvetica, Arial, sans-serif; diff --git a/app/assets/stylesheets/framework.scss b/app/assets/stylesheets/framework.scss new file mode 100644 index 00000000000..c5e23c1c328 --- /dev/null +++ b/app/assets/stylesheets/framework.scss @@ -0,0 +1,32 @@ +@import "framework/fonts"; +@import "framework/variables"; +@import "framework/mixins"; +@import "framework/layout"; +@import 'framework/gl_variables'; +@import 'framework/gl_bootstrap'; +@import "framework/avatar.scss"; +@import "framework/blocks.scss"; +@import "framework/buttons.scss"; +@import "framework/calendar.scss"; +@import "framework/callout.scss"; +@import "framework/common.scss"; +@import "framework/files.scss"; +@import "framework/filters.scss"; +@import "framework/flash.scss"; +@import "framework/forms.scss"; +@import "framework/gfm.scss"; +@import "framework/gitlab-theme.scss"; +@import "framework/header.scss"; +@import "framework/highlight.scss"; +@import "framework/issue_box.scss"; +@import "framework/jquery.scss"; +@import "framework/lists.scss"; +@import "framework/markdown_area.scss"; +@import "framework/mobile.scss"; +@import "framework/pagination.scss"; +@import "framework/selects.scss"; +@import "framework/sidebar.scss"; +@import "framework/tables.scss"; +@import "framework/timeline.scss"; +@import "framework/typography.scss"; +@import "framework/zen.scss"; diff --git a/app/assets/stylesheets/framework/avatar.scss b/app/assets/stylesheets/framework/avatar.scss new file mode 100644 index 00000000000..36e582d4854 --- /dev/null +++ b/app/assets/stylesheets/framework/avatar.scss @@ -0,0 +1,49 @@ +.avatar { + float: left; + margin-right: 12px; + width: 40px; + height: 40px; + padding: 0; + @include border-radius($avatar_radius); + + &.avatar-inline { + float: none; + margin-left: 4px; + margin-bottom: 2px; + + &.s16 { margin-right: 4px; } + &.s24 { margin-right: 4px; } + } + + &.group-avatar, &.project-avatar, &.avatar-tile { + @include border-radius(0px); + } + + &.s16 { width: 16px; height: 16px; margin-right: 6px; } + &.s24 { width: 24px; height: 24px; margin-right: 8px; } + &.s26 { width: 26px; height: 26px; margin-right: 8px; } + &.s32 { width: 32px; height: 32px; margin-right: 10px; } + &.s36 { width: 36px; height: 36px; margin-right: 10px; } + &.s46 { width: 46px; height: 46px; margin-right: 15px; } + &.s48 { width: 48px; height: 48px; margin-right: 10px; } + &.s60 { width: 60px; height: 60px; margin-right: 12px; } + &.s90 { width: 90px; height: 90px; margin-right: 15px; } + &.s110 { width: 110px; height: 110px; margin-right: 15px; } + &.s140 { width: 140px; height: 140px; margin-right: 20px; } + &.s160 { width: 160px; height: 160px; margin-right: 20px; } +} + +.identicon { + text-align: center; + vertical-align: top; + + &.s16 { font-size: 12px; line-height: 1.33; } + &.s24 { font-size: 14px; line-height: 1.8; } + &.s26 { font-size: 20px; line-height: 1.33; } + &.s32 { font-size: 22px; line-height: 32px; } + &.s60 { font-size: 32px; line-height: 60px; } + &.s90 { font-size: 36px; line-height: 90px; } + &.s110 { font-size: 40px; line-height: 112px; font-weight: 300; } + &.s140 { font-size: 72px; line-height: 140px; } + &.s160 { font-size: 96px; line-height: 160px; } +} diff --git a/app/assets/stylesheets/framework/blocks.scss b/app/assets/stylesheets/framework/blocks.scss new file mode 100644 index 00000000000..6ce34b5c3e8 --- /dev/null +++ b/app/assets/stylesheets/framework/blocks.scss @@ -0,0 +1,62 @@ +.light-well { + background-color: #f8fafc; + padding: 15px; +} + +.centered-light-block { + text-align: center; + color: $gl-gray; + margin: 20px; +} + +.nothing-here-block { + text-align: center; + padding: 20px; + color: $gl-gray; + font-weight: normal; + font-size: 16px; + line-height: 36px; +} + +.gray-content-block { + margin: -$gl-padding; + background-color: $background-color; + padding: $gl-padding; + margin-bottom: 0px; + border-top: 1px solid $border-color; + border-bottom: 1px solid $border-color; + color: $gl-gray; + + &.top-block { + border-top: none; + } + + &.middle-block { + margin-top: 0; + margin-bottom: 0; + } + + &.clear-block { + margin-bottom: $gl-padding - 1px; + padding-bottom: $gl-padding; + } + + &.second-block { + margin-top: -1px; + margin-bottom: 0; + } + + &.footer-block { + margin-top: 0; + border-bottom: none; + margin-bottom: -$gl-padding; + } + + .title { + color: $gl-text-color; + } + + .oneline { + line-height: 42px; + } +} diff --git a/app/assets/stylesheets/framework/buttons.scss b/app/assets/stylesheets/framework/buttons.scss new file mode 100644 index 00000000000..11acbe3adfa --- /dev/null +++ b/app/assets/stylesheets/framework/buttons.scss @@ -0,0 +1,163 @@ +@mixin btn-default { + @include border-radius(2px); + border-width: 1px; + border-style: solid; + text-transform: uppercase; + font-size: 13px; + font-weight: 600; + line-height: 18px; + padding: 11px 16px; + letter-spacing: .4px; + + &:focus, + &:active { + outline: none; + @include box-shadow(inset 0 0 4px rgba(0, 0, 0, 0.12)); + } +} + +@mixin btn-middle { + @include btn-default; + @include border-radius(2px); + padding: 11px 24px; +} + +@mixin btn-color($light, $border-light, $normal, $border-normal, $dark, $border-dark, $color) { + background-color: $light; + border-color: $border-light; + color: $color; + + &:hover, + &:focus { + background-color: $normal; + border-color: $border-normal; + color: $color; + } + + &:active { + @include box-shadow (inset 0 0 4px rgba(0, 0, 0, 0.12)); + + background-color: $dark; + border-color: $border-dark; + color: $color; + } +} + +@mixin btn-green { + @include btn-color($green-light, $border-green-light, $green-normal, $border-green-normal, $green-dark, $border-green-dark, #FFFFFF); +} + +@mixin btn-blue { + @include btn-color($blue-light, $border-blue-light, $blue-normal, $border-blue-normal, $blue-dark, $border-blue-dark, #FFFFFF); +} + +@mixin btn-orange { + @include btn-color($orange-light, $border-orange-light, $orange-normal, $border-orange-normal, $orange-dark, $border-orange-dark, #FFFFFF); +} + +@mixin btn-red { + @include btn-color($red-light, $border-red-light, $red-normal, $border-red-normal, $red-dark, $border-red-dark, #FFFFFF); +} + +@mixin btn-gray { + @include btn-color($gray-light, $border-gray-light, $gray-normal, $border-gray-normal, $gray-dark, $border-gray-dark, #313236); +} + +@mixin btn-white { + @include btn-color($white-light, $border-white-light, $white-normal, $border-white-normal, $white-dark, $border-white-dark, #313236); +} + +.btn { + @include btn-default; + @include btn-white; + + &.btn-success, + &.btn-new, + &.btn-create, + &.btn-save, + &.btn-green { + @include btn-green; + } + + &.btn-gray { + @include btn-gray; + } + + &.btn-primary, + &.btn-info { + @include btn-blue; + } + + &.btn-warning { + @include btn-orange; + } + + &.btn-danger, + &.btn-remove, + &.btn-red { + @include btn-red; + } + + &.btn-cancel { + float: right; + } + + &.btn-close { + color: $gl-danger; + border-color: $gl-danger; + &:hover { + color: #B94A48; + } + } + + &.btn-reopen { + color: $gl-success; + border-color: $gl-success; + &:hover { + color: #468847; + } + } + + &.btn-grouped { + margin-right: 7px; + float: left; + &:last-child { + margin-right: 0px; + } + } +} + +.btn-block { + width: 100%; + margin: 0; + margin-bottom: 15px; + &.btn { + padding: 6px 0; + } +} + +.btn-group { + &.btn-grouped { + margin-right: 7px; + float: left; + &:last-child { + margin-right: 0px; + } + } +} + +.btn-group-next { + .btn { + padding: 9px 0px; + font-size: 15px; + color: #7f8fa4; + border-color: #e7e9ed; + width: 140px; + + &.active { + border-color: $gl-info; + background: $gl-info; + color: #fff; + } + } +} diff --git a/app/assets/stylesheets/framework/calendar.scss b/app/assets/stylesheets/framework/calendar.scss new file mode 100644 index 00000000000..a36fefe22c5 --- /dev/null +++ b/app/assets/stylesheets/framework/calendar.scss @@ -0,0 +1,90 @@ +.user-calendar-activities { + .calendar_onclick_hr { + padding: 0; + margin: 10px 0; + } + + .str-truncated { + max-width: 70%; + } + + .text-expander { + background: #eee; + color: #555; + padding: 0 5px; + cursor: pointer; + margin-left: 4px; + &:hover { + background-color: #ddd; + } + } +} +/** +* This overwrites the default values of the cal-heatmap gem +*/ +.calendar { + .qi { + background-color: #999; + fill: #fff; + } + + .q1 { + background-color: #dae289; + fill: #ededed; + } + + .q2 { + background-color: #cedb9c; + fill: #ACD5F2; + } + + .q3 { + background-color: #b5cf6b; + fill: #7FA8D1; + } + + .q4 { + background-color: #637939; + fill: #49729B; + } + + .q5 { + background-color: #3b6427; + fill: #254E77; + } + + .domain-background { + fill: none; + shape-rendering: crispedges; + } + + .ch-tooltip { + position: absolute; + display: none; + margin-top: 22px; + margin-left: 1px; + font-size: 13px; + padding: 3px; + font-weight: 550; + background-color: #222; + span { + position: absolute; + width: 200px; + text-align: center; + visibility: hidden; + border-radius: 10px; + &:after { + content: ''; + position: absolute; + top: 100%; + left: 50%; + margin-left: -8px; + width: 0; + height: 0; + border-top: 8px solid #000000; + border-right: 8px solid transparent; + border-left: 8px solid transparent; + } + } + } +} diff --git a/app/assets/stylesheets/framework/callout.scss b/app/assets/stylesheets/framework/callout.scss new file mode 100644 index 00000000000..f1699d21c9b --- /dev/null +++ b/app/assets/stylesheets/framework/callout.scss @@ -0,0 +1,45 @@ +/* + * Callouts from Bootstrap3 docs + * + * Not quite alerts, but custom and helpful notes for folks reading the docs. + * Requires a base and modifier class. + */ + +/* Common styles for all types */ +.bs-callout { + margin: 20px 0; + padding: 20px; + border-left: 3px solid #eee; + color: #666; + background: #f9f9f9; +} +.bs-callout h4 { + margin-top: 0; + margin-bottom: 5px; +} +.bs-callout p:last-child { + margin-bottom: 0; +} + +/* Variations */ +.bs-callout-danger { + background-color: #fdf7f7; + border-color: #eed3d7; + color: #b94a48; +} +.bs-callout-warning { + background-color: #faf8f0; + border-color: #faebcc; + color: #8a6d3b; +} +.bs-callout-info { + background-color: #f4f8fa; + border-color: #bce8f1; + color: #34789a; +} +.bs-callout-success { + background-color: #dff0d8; + border-color: #5cA64d; + color: #3c763d; +} + diff --git a/app/assets/stylesheets/framework/common.scss b/app/assets/stylesheets/framework/common.scss new file mode 100644 index 00000000000..03919f15f1f --- /dev/null +++ b/app/assets/stylesheets/framework/common.scss @@ -0,0 +1,404 @@ +/** COLORS **/ +.cgray { color: $gl-gray; } +.clgray { color: #BBB } +.cred { color: $gl-text-red; } +.cgreen { color: $gl-text-green; } +.cdark { color: #444 } + +/** COMMON CLASSES **/ +.prepend-top-10 { margin-top:10px } +.prepend-top-default { margin-top: $gl-padding; } +.prepend-top-20 { margin-top:20px } +.prepend-left-10 { margin-left:10px } +.prepend-left-20 { margin-left:20px } +.append-right-10 { margin-right:10px } +.append-right-20 { margin-right:20px } +.append-bottom-10 { margin-bottom:10px } +.append-bottom-15 { margin-bottom:15px } +.append-bottom-20 { margin-bottom:20px } +.inline { display: inline-block } +.center { text-align: center } + +.underlined-link { text-decoration: underline; } +.hint { font-style: italic; color: #999; } +.light { color: $gl-gray; } + +.slead { + color: $gl-gray; + font-size: 15px; + margin-bottom: 12px; + font-weight: normal; + line-height: 24px; +} + +.tab-content { + overflow: visible; +} + +pre { + &.clean { + background: none; + border: none; + margin: 0; + padding: 0; + } + + &.well-pre { + border: 1px solid #EEE; + background: #f9f9f9; + border-radius: 0; + color: #555; + } +} + +.dropdown-menu > li > a { + text-shadow: none; +} + +.dropdown-menu-align-right { + left: auto; + right: 0px; +} + +.dropdown-menu > li > a:hover, +.dropdown-menu > li > a:focus { + background: $gl-primary; + color: #FFF +} + +.str-truncated { + @include str-truncated; +} + +/** FLASH message **/ +.author_link { + color: $gl-link-color; +} + +.back-link { + font-size: 14px; +} + +table a code { + position: relative; + top: -2px; + margin-right: 3px; +} + +.loading { + margin: 20px auto; + height: 40px; + color: #555; + font-size: 32px; + text-align: center; +} + +span.update-author { + display: block; + color: #999; + font-weight: normal; + font-style: italic; + strong { + font-weight: bold; + font-style: normal; + } +} + +.user-mention { + color: #2FA0BB; + font-weight: bold; +} + +.field_with_errors { + display: inline; +} + +.line_holder { + &:hover { + td { + background: #FFFFCF !important; + } + } +} + +p.time { + color: #999; + font-size: 90%; + margin: 30px 3px 3px 2px; +} + +.highlight { + text-shadow: none; +} + +.thin_area{ + height: 150px; +} + +// Fixes alignment on notes. +.new_note { + label { + text-align: left; + } +} + +// Fix issue with notes & lists creating a bunch of bottom borders. +li.note { + img { max-width:100% } + .note-title { + li { + border-bottom:none !important; + } + } +} + +.markdown { + img { + max-width: 100%; + } +} + +.wiki_content code, .readme code{ + background-color: inherit; +} + +.project_member_show { + td:first-child { + color: #aaa; + } +} + +.rss-icon { + img { + width: 24px; + vertical-align: top; + } + + strong { + line-height: 24px; + } +} + +.show-suppressed-diff, +.show-all-commits { + cursor: pointer; +} + +.git_error_tips { + @extend .col-md-6; + text-align: left; + margin-top: 40px; + pre { + background: white; + border: none; + font-size: 12px; + } +} + +.error-message { + padding: 10px; + background: #C67; + margin: 0; + color: #FFF; + + a { + color: #fff; + text-decoration: underline; + } +} + +.browser-alert { + padding: 10px; + text-align: center; + background: #C67; + color: #fff; + font-weight: bold; + a { + color: #fff; + text-decoration: underline; + } +} + +.warning_message { + border-left: 4px solid #ed9; + color: #b90; + padding: 10px; + margin-bottom: 10px; + background: #ffffe6; + padding-left: 20px; + + &.centered { + text-align: center; + } +} + +.gitlab-promo { + a { + color: #aaa; + margin-right: 30px; + } +} + +.milestone { + &.milestone-closed { + background: #f9f9f9; + } + .progress { + margin-bottom: 0; + margin-top: 4px; + } +} + +.control-group { + .controls { + span { + &.descr { + position: relative; + top: 2px; + left: 5px; + color: #666; + } + } + } +} + +img.emoji { + height: 20px; + vertical-align: middle; + width: 20px; +} + +.chart { + overflow: hidden; + height: 220px; +} + +.description-block { + @extend .light-well; + @extend .light; + margin-bottom: 10px; +} + +table { + td.permission-x { + background: #D9EDF7 !important; + text-align: center; + } +} + +.dashboard-intro-icon { + float: left; + text-align: center; + font-size: 32px; + color: #AAA; + width: 60px; +} + +.dashboard-intro-text { + display: inline-block; + margin-left: -60px; + padding-left: 60px; + width: 100%; +} + +.btn-sign-in { + margin-top: 8px; + text-shadow: none; +} + +.side-filters { + fieldset { + margin-bottom: 15px; + } +} + +.wiki .highlight, .note-body .highlight { + margin: 12px 0 12px 0; +} + +.wiki .code { + overflow-x: auto; +} + +.footer-links { + margin-bottom: 20px; + a { + margin-right: 15px; + } +} + +.search_box { + @extend .well; + text-align: center; +} + +.task-status { + margin-left: 10px; +} + +#nprogress .spinner { + top: 15px !important; + right: 10px !important; +} + +.header-with-avatar { + h3 { + margin: 0; + font-weight: bold; + } + + .username { + font-size: 18px; + color: #666; + margin-top: 8px; + } + + .description { + font-size: $gl-font-size; + color: #666; + margin-top: 8px; + } +} + +.profiler-results { + top: 73px !important; + + .profiler-button, + .profiler-controls { + border-color: #EEE !important; + } +} + +.center-top-menu { + @include nav-menu; + text-align: center; + margin-top: 5px; + margin-bottom: $gl-padding; + height: 56px; + margin-top: -$gl-padding; + padding-top: $gl-padding; + + &.no-bottom { + margin-bottom: 0; + } + + &.no-top { + margin-top: 0; + } +} + +.dropzone .dz-preview .dz-progress { + border-color: $border-color !important; +} + +.dropzone .dz-preview .dz-progress .dz-upload { + background: $gl-success !important; +} + +.space-right { + margin-right: 10px; +} + +.in-line { + display: inline-block; +} diff --git a/app/assets/stylesheets/framework/files.scss b/app/assets/stylesheets/framework/files.scss new file mode 100644 index 00000000000..9dd77747884 --- /dev/null +++ b/app/assets/stylesheets/framework/files.scss @@ -0,0 +1,171 @@ +/** + * File content holder + * + */ +.file-holder { + margin-left: -$gl-padding; + margin-right: -$gl-padding; + border: none; + border-top: 1px solid #E7E9EE; + border-bottom: 1px solid #E7E9EE; + margin-bottom: 1em; + + table { + @extend .table; + } + + .file-title { + position: relative; + background: $background-color; + border-bottom: 1px solid $border-color; + text-shadow: 0 1px 1px #fff; + margin: 0; + text-align: left; + padding: 10px 15px; + + .file-actions { + float: right; + position: absolute; + top: 5px; + right: 15px; + + .btn { + padding: 0px 10px; + font-size: 13px; + line-height: 28px; + } + } + + .left-options { + margin-top: -3px; + } + } + .file-content { + background: #fff; + + &.image_file { + background: #eee; + text-align: center; + img { + padding: 100px; + max-width: 50%; + } + } + + &.wiki { + padding: $gl-padding; + + .highlight { + margin-bottom: 9px; + + > pre { + margin: 0; + } + } + } + + &.blob_file { + + } + + &.blob-no-preview { + background: #eee; + text-shadow: 0 1px 2px #FFF; + padding: 100px 0; + } + + /** + * Blame file + */ + &.blame { + table { + border: none; + box-shadow: none; + margin: 0; + } + tr { + border-bottom: 1px solid #eee; + } + td { + &:first-child { + border-left: none; + } + &:last-child { + border-right: none; + } + background: #fff; + padding: 10px $gl-padding; + } + .lines { + pre { + padding: 0; + margin: 0; + background: none; + border: none; + } + } + img.avatar { + border: 0 none; + float: none; + margin: 0; + padding: 0; + } + td.blame-commit { + background: #f9f9f9; + min-width: 350px; + + .commit-author-link { + color: #888; + } + } + td.blame-numbers { + pre { + color: #AAA; + white-space: pre; + } + background: #f1f1f1; + border-left: 1px solid #DDD; + } + td.lines { + code { + font-family: $monospace_font; + } + } + } + + &.logs { + background: #eee; + max-height: 700px; + overflow-y: auto; + + ol { + margin-left: 40px; + padding: 10px 0; + border-left: 1px solid $border-color; + margin-bottom: 0; + background: white; + li { + color: #888; + p { + margin: 0; + color: #333; + line-height: 24px; + padding-left: 10px; + } + + &:hover { + background: $hover; + } + } + } + } + + /** + * Code file + */ + &.code { + padding: 0; + } + } +} + diff --git a/app/assets/stylesheets/framework/filters.scss b/app/assets/stylesheets/framework/filters.scss new file mode 100644 index 00000000000..8e6922c9231 --- /dev/null +++ b/app/assets/stylesheets/framework/filters.scss @@ -0,0 +1,30 @@ +.filter-item { + margin-right: 15px; +} + +@media (min-width: 800px) { + .issues-filters, + .issues_bulk_update { + select, .select2-container { + width: 120px !important; + display: inline-block; + } + } +} + +@media (min-width: 1200px) { + .issues-filters, + .issues_bulk_update { + select, .select2-container { + width: 150px !important; + display: inline-block; + } + } +} + +.issues-filters, +.issues_bulk_update { + .select2-container .select2-choice { + color: #444 !important; + } +} diff --git a/app/assets/stylesheets/framework/flash.scss b/app/assets/stylesheets/framework/flash.scss new file mode 100644 index 00000000000..82eb50ad4be --- /dev/null +++ b/app/assets/stylesheets/framework/flash.scss @@ -0,0 +1,17 @@ +.flash-container { + cursor: pointer; + margin: 0; + font-size: 14px; + width: 100%; + z-index: 100; + + .flash-notice { + @extend .alert; + @extend .alert-info; + } + + .flash-alert { + @extend .alert; + @extend .alert-danger; + } +} diff --git a/app/assets/stylesheets/framework/fonts.scss b/app/assets/stylesheets/framework/fonts.scss new file mode 100644 index 00000000000..e214567eca1 --- /dev/null +++ b/app/assets/stylesheets/framework/fonts.scss @@ -0,0 +1,25 @@ +/* latin-ext */ +@font-face { + font-family: 'Source Sans Pro'; + font-style: normal; + font-weight: 300; + src: local('Source Sans Pro Light'), local('SourceSansPro-Light'), font-url('SourceSansPro-Light.ttf'); +} +@font-face { + font-family: 'Source Sans Pro'; + font-style: normal; + font-weight: 400; + src: local('Source Sans Pro'), local('SourceSansPro-Regular'), font-url('SourceSansPro-Regular.ttf'); +} +@font-face { + font-family: 'Source Sans Pro'; + font-style: normal; + font-weight: 600; + src: local('Source Sans Pro Semibold'), local('SourceSansPro-Semibold'), font-url('SourceSansPro-Semibold.ttf'); +} +@font-face { + font-family: 'Source Sans Pro'; + font-style: normal; + font-weight: 700; + src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), font-url('SourceSansPro-Bold.ttf'); +} diff --git a/app/assets/stylesheets/framework/forms.scss b/app/assets/stylesheets/framework/forms.scss new file mode 100644 index 00000000000..0edfe24f195 --- /dev/null +++ b/app/assets/stylesheets/framework/forms.scss @@ -0,0 +1,94 @@ +textarea { + resize: vertical; +} + +input[type='search'].search-text-input { + background-image: image-url("icon-search.png"); + background-repeat: no-repeat; + background-position: 10px; + padding-left: 25px; +} + +input[type='text'].danger { + background: #F2DEDE!important; + border-color: #D66; + text-shadow: 0 1px 1px #fff +} + +.datetime-controls { + select { + width: 100px; + } +} + +.form-actions { + padding: 17px 20px 18px; + margin-top: 18px; + margin-bottom: 18px; + background-color: $background-color; + border-top: 1px solid $border-color; +} + +label { + &.control-label { + @extend .col-sm-2; + } + + &.inline-label { + margin: 0; + } +} + +.inline-input-group { + width: 250px; +} + +.custom-form-control { + width: 150px; +} + +@media (min-width: $screen-sm-min) { + .custom-form-control { + width: 150px; + } +} + +/* Medium devices (desktops, 992px and up) */ +@media (min-width: $screen-md-min) { + .custom-form-control { + width: 170px; + } +} + +/* Large devices (large desktops, 1200px and up) */ +@media (min-width: $screen-lg-min) { + .custom-form-control { + width: 200px; + } +} + +.fieldset-form fieldset { + margin-bottom: 20px; +} + +.form-control { + @include box-shadow(none); +} + +.wiki-content { + margin-top: 35px; +} + +.form-group .control-label { + font-weight: normal; +} + +.form-control::-webkit-input-placeholder { + color: #7f8fa4; +} + +.input-group { + .input-group-addon { + background-color: #f7f8fa; + } +} diff --git a/app/assets/stylesheets/framework/gfm.scss b/app/assets/stylesheets/framework/gfm.scss new file mode 100644 index 00000000000..bd9200ace23 --- /dev/null +++ b/app/assets/stylesheets/framework/gfm.scss @@ -0,0 +1,25 @@ +/** + * Styles that apply to all GFM related forms. + */ +.issue-form, .merge-request-form, .wiki-form { + .description { + height: 16em; + border-top-left-radius: 0; + } +} + +.wiki-form { + .description { + height: 26em; + } +} + +.milestone-form { + .description { + height: 14em; + } +} + +.gfm-commit, .gfm-commit_range { + font-family: $monospace_font; +} diff --git a/app/assets/stylesheets/framework/gitlab-theme.scss b/app/assets/stylesheets/framework/gitlab-theme.scss new file mode 100644 index 00000000000..8d9a0aae568 --- /dev/null +++ b/app/assets/stylesheets/framework/gitlab-theme.scss @@ -0,0 +1,120 @@ +/** + * Styles the GitLab application with a specific color theme + * + * $color-light - + * $color - + * $color-darker - + * $color-dark - + */ +@mixin gitlab-theme($color-light, $color, $color-darker, $color-dark) { + .page-with-sidebar { + .header-logo { + background-color: $color; + border-color: $color; + + a { + color: $color-light; + + h3 { + color: $color-light; + } + } + + &:hover { + background-color: $color-darker; + a { + color: #FFF; + } + } + } + + .collapse-nav a { + color: #FFF; + background: $color; + } + + .sidebar-wrapper { + background: $color-darker; + + .sidebar-user { + background: $color-darker; + color: $color-light; + + &:hover { + background-color: $color-dark; + color: #FFF; + text-decoration: none; + } + } + } + + .nav-sidebar li { + a { + color: $color-light; + + &:hover, &:focus, &:active { + background: $color-dark; + } + + i { + color: $color-light; + } + + .count { + color: $color-light; + background: $color-dark; + } + } + + &.separate-item { + border-top: 1px solid $color; + } + + &.active a { + color: #FFF; + background: $color-dark; + + &.no-highlight { + border: none; + } + + i { + color: #FFF + } + } + } + } +} + +$theme-blue: #2980B9; +$theme-charcoal: #333c47; +$theme-graphite: #888888; +$theme-gray: #373737; +$theme-green: #019875; +$theme-violet: #554488; + +body { + &.ui_blue { + @include gitlab-theme(#BECDE9, $theme-blue, #1970A9, #096099); + } + + &.ui_charcoal { + @include gitlab-theme(#c5d0de, $theme-charcoal, #2b333d, #24272D); + } + + &.ui_graphite { + @include gitlab-theme(#CCCCCC, $theme-graphite, #777777, #666666); + } + + &.ui_gray { + @include gitlab-theme(#979797, $theme-gray, #272727, #222222); + } + + &.ui_green { + @include gitlab-theme(#AADDCC, $theme-green, #018865, #017855); + } + + &.ui_violet { + @include gitlab-theme(#9988CC, $theme-violet, #443366, #332255); + } +} diff --git a/app/assets/stylesheets/framework/gl_bootstrap.scss b/app/assets/stylesheets/framework/gl_bootstrap.scss new file mode 100644 index 00000000000..eb8d23d6453 --- /dev/null +++ b/app/assets/stylesheets/framework/gl_bootstrap.scss @@ -0,0 +1,273 @@ +/* + * Twitter bootstrap with GitLab customizations/additions + * + */ + +// Core variables and mixins +@import "bootstrap/variables"; +@import "bootstrap/mixins"; + +// Reset +@import "bootstrap/normalize"; +@import "bootstrap/print"; + +// Core CSS +@import "bootstrap/scaffolding"; +@import "bootstrap/type"; +@import "bootstrap/code"; +@import "bootstrap/grid"; +@import "bootstrap/tables"; +@import "bootstrap/forms"; +@import "bootstrap/buttons"; + +// Components +@import "bootstrap/component-animations"; +@import "bootstrap/dropdowns"; +@import "bootstrap/button-groups"; +@import "bootstrap/input-groups"; +@import "bootstrap/navs"; +@import "bootstrap/navbar"; +@import "bootstrap/breadcrumbs"; +@import "bootstrap/pagination"; +@import "bootstrap/pager"; +@import "bootstrap/labels"; +@import "bootstrap/badges"; +@import "bootstrap/jumbotron"; +@import "bootstrap/thumbnails"; +@import "bootstrap/alerts"; +@import "bootstrap/progress-bars"; +@import "bootstrap/list-group"; +@import "bootstrap/wells"; +@import "bootstrap/close"; +@import "bootstrap/panels"; + +// Components w/ JavaScript +@import "bootstrap/modals"; +@import "bootstrap/tooltip"; +@import "bootstrap/popovers"; +@import "bootstrap/carousel"; + +// Utility classes +.clearfix { + @include clearfix(); +} +.center-block { + @include center-block(); +} +.pull-right { + float: right !important; +} +.pull-left { + float: left !important; +} +.hide { + display: none; +} +.show { + display: block !important; +} +.invisible { + visibility: hidden; +} +.text-hide { + @include text-hide(); +} +.hidden { + display: none !important; + visibility: hidden !important; +} +.affix { + position: fixed; +} + +@import "bootstrap/responsive-utilities"; + +// Labels +.label { + padding: 2px 4px; + font-size: 13px; + font-style: normal; + font-weight: normal; + display: inline-block; + + &.label-gray { + background-color: #f8fafc; + color: $gl-gray; + text-shadow: none; + } + + &.label-inverse { + background-color: #333333; + } +} + +// Nav tabs +.nav.nav-tabs { + margin-bottom: 15px; + + li { + > a { + margin-right: 5px; + line-height: 20px; + border-color: #EEE; + color: #888; + border-bottom: 1px solid #ddd; + .badge { + background-color: #eee; + color: #888; + text-shadow: 0 1px 1px #fff; + } + i.fa { + line-height: 14px; + } + } + &.active { + > a { + border-color: #CCC; + border-bottom: 1px solid #fff; + color: #333; + font-weight: bold; + } + } + } +} + +.nav-tabs > li > a, +.nav-pills > li > a { + color: #666; +} + +.nav-pills > .active > a > span > .badge { + background-color: #fff; + color: $gl-primary; +} + + +/** + * fix to keep tooltips position in top navigation bar + * + */ +.navbar .nav > li { + position: relative; + white-space: nowrap; +} + +/** + * Add some extra stuff to panels + * + */ + +.container-blank .panel .panel-heading { + font-size: 17px; + line-height: 38px; +} + +.panel { + box-shadow: none; + + .panel-heading { + .panel-head-actions { + position: relative; + top: -5px; + float: right; + } + } + + .panel-body { + form { + margin: 0; + } + + .form-actions { + margin: -15px; + margin-top: 18px; + } + } + + .panel-footer { + .pagination { + margin: 0; + } + + .btn { + min-width: 124px; + } + } + + &.panel-small { + .panel-heading { + padding: 6px 15px; + font-size: 13px; + font-weight: normal; + a { + color: #777; + } + } + } +} + +.panel-succes .panel-heading, +.panel-info .panel-heading, +.panel-danger .panel-heading, +.panel-warning .panel-heading, +.panel-primary .panel-heading, +.alert { + a:not(.btn) { + @extend .alert-link; + color: #fff; + text-decoration: underline; + } +} + +.alert-help { + background-color: $background-color; + border: 1px solid $border-color; + color: $gl-gray; +} + +// Typography ================================================================= + +.text-primary, +.text-primary:hover { + color: $brand-primary; +} + +.text-success, +.text-success:hover { + color: $brand-success; +} + +.text-danger, +.text-danger:hover { + color: $brand-danger; +} + +.text-warning, +.text-warning:hover { + color: $brand-warning; +} + +.text-info, +.text-info:hover { + color: $brand-info; +} + +// Tables ===================================================================== + +table.table { + .dropdown-menu a { + text-decoration: none; + } + + .success, + .warning, + .danger, + .info { + color: #fff; + + a:not(.btn) { + text-decoration: underline; + color: #fff; + } + } +} diff --git a/app/assets/stylesheets/framework/gl_variables.scss b/app/assets/stylesheets/framework/gl_variables.scss new file mode 100644 index 00000000000..18632da4f2a --- /dev/null +++ b/app/assets/stylesheets/framework/gl_variables.scss @@ -0,0 +1,158 @@ +// Override Bootstrap variables here (defaults from bootstrap-sass v3.3.3): +// For all variables see https://github.com/twbs/bootstrap-sass/blob/master/templates/project/_bootstrap-variables.sass +// +// Variables +// -------------------------------------------------- + + +//== Colors +// +//## Gray and brand colors for use across Bootstrap. + +// $gray-base: #000 +// $gray-darker: lighten($gray-base, 13.5%) // #222 +// $gray-dark: lighten($gray-base, 20%) // #333 +// $gray: lighten($gray-base, 33.5%) // #555 +// $gray-light: lighten($gray-base, 46.7%) // #777 +// $gray-lighter: lighten($gray-base, 93.5%) // #eee + +$brand-primary: $gl-primary; +$brand-success: $gl-success; +$brand-info: $gl-info; +$brand-warning: $gl-warning; +$brand-danger: $gl-danger; + +$border-radius-base: 2px !default; +$border-radius-large: 2px !default; +$border-radius-small: 2px !default; + + +//== Scaffolding +// +$text-color: $gl-text-color; +$link-color: $gl-link-color; + + +//== Typography +// +//## Font, line-height, and color for body text, headings, and more. + +$font-family-sans-serif: $regular_font; +$font-family-monospace: $monospace_font; +$font-size-base: $gl-font-size; + + +//== Components +// +//## Define common padding and border radius sizes and more. Values based on 14px text and 1.428 line-height (~20px to start). + +$padding-base-vertical: 9px; +$padding-base-horizontal: $gl-padding; +$component-active-color: #fff; +$component-active-bg: $brand-info; + +//== Forms +// +//## + +$input-color: $text-color; +$input-border: #e7e9ed; +$input-border-focus: #7F8FA4; +$legend-color: $text-color; + + +//== Pagination +// +//## + +$pagination-color: $gl-gray; +$pagination-bg: $background-color; +$pagination-border: transparent; + +$pagination-hover-color: #fff; +$pagination-hover-bg: $brand-info; +$pagination-hover-border: transparent; + +$pagination-active-color: #fff; +$pagination-active-bg: $brand-info; +$pagination-active-border: transparent; + +$pagination-disabled-color: #fff; +$pagination-disabled-bg: lighten($brand-info, 15%); +$pagination-disabled-border: transparent; + + +//== Form states and alerts +// +//## Define colors for form feedback states and, by default, alerts. + +$state-success-text: #fff; +$state-success-bg: $brand-success; +$state-success-border: $brand-success; + +$state-info-text: #fff; +$state-info-bg: $brand-info; +$state-info-border: $brand-info; + +$state-warning-text: #fff; +$state-warning-bg: $brand-warning; +$state-warning-border: $brand-warning; + +$state-danger-text: #fff; +$state-danger-bg: $brand-danger; +$state-danger-border: $brand-danger; + + +//== Alerts +// +//## Define alert colors, border radius, and padding. + +$alert-border-radius: 0; + + +//== Panels +// +//## + +$panel-border-radius: 2px; +$panel-default-text: $text-color; +$panel-default-border: $border-color; +$panel-default-heading-bg: $background-color; +$panel-footer-bg: $background-color; +$panel-inner-border: $border-color; + +//== Wells +// +//## + +$well-bg: #F9F9F9; +$well-border: #EEE; + +//== Code +// +//## + +$code-color: #c7254e; +$code-bg: #f9f2f4; + +$kbd-color: #fff; +$kbd-bg: #333; + +//== Buttons +// +//## +$btn-default-color: $gl-text-color; +$btn-default-bg: #fff; +$btn-default-border: #e7e9ed; + +//== Nav +// +//## +$nav-link-padding: 13px $gl-padding; + +//== Code +// +//## +$pre-bg: #f8fafc !default; +$pre-color: $gl-gray !default; +$pre-border-color: #e7e9ed; diff --git a/app/assets/stylesheets/framework/header.scss b/app/assets/stylesheets/framework/header.scss new file mode 100644 index 00000000000..91e6975e269 --- /dev/null +++ b/app/assets/stylesheets/framework/header.scss @@ -0,0 +1,169 @@ +/* + * Application Header + * + */ +header { + transition-duration: .3s; + + &.navbar-empty { + background: #FFF; + border-bottom: 1px solid #EEE; + + .center-logo { + margin: 8px 0; + text-align: center; + + img { + height: 32px; + } + } + } + + &.navbar-gitlab { + padding: 0 20px; + z-index: 100; + margin-bottom: 0; + min-height: $header-height; + background-color: #fff; + border: none; + + .container-fluid { + width: 100% !important; + filter: none; + padding: 0; + + .nav > li > a { + color: #7f8fa4; + font-size: 18px; + padding: 0; + margin: ($header-height - 28) / 2 0; + margin-left: 10px; + height: 28px; + width: 28px; + line-height: 28px; + text-align: center; + + &:hover, &:focus, &:active { + background-color: #FFF; + } + } + + .navbar-toggle { + color: #666; + margin: 6px 0; + border-radius: 0; + position: absolute; + right: 2px; + + &:hover { + background-color: #EEE; + } + &.active { + color: #7f8fa4; + } + } + } + } + + .header-content { + height: $header-height; + + .title { + margin: 0; + overflow: hidden; + font-size: 19px; + line-height: $header-height; + font-weight: normal; + color: #4c4e54; + text-overflow: ellipsis; + vertical-align: top; + white-space: nowrap; + + a { + color: #4c4e54; + &:hover { + text-decoration: underline; + } + } + } + + .navbar-collapse { + float: right; + border-top: none; + } + } + + .search { + margin-right: 10px; + margin-left: 10px; + margin-top: ($header-height - 36) / 2; + + form { + margin: 0; + padding: 0; + } + + .search-input { + width: 220px; + background-image: image-url("icon-search.png"); + background-repeat: no-repeat; + background-position: 195px; + @include input-big; + + &:focus { + @include box-shadow(none); + outline: none; + border-color: #DDD; + background-color: #FFF; + } + } + } +} + +@mixin collapsed-header { + margin-left: $sidebar_collapsed_width; +} + +@media (max-width: $screen-md-max) { + .header-collapsed, .header-expanded { + @include collapsed-header; + } +} + +@media(min-width: $screen-md-max) { + .header-collapsed { + @include collapsed-header; + } + + .header-expanded { + margin-left: $sidebar_width; + } +} + +@media (max-width: $screen-xs-max) { + header .container-fluid { + font-size: 18px; + + .navbar-nav { + margin: 0px; + float: none !important; + + .visible-xs, .visable-sm { + display: table-cell !important; + } + } + + .navbar-collapse { + padding-left: 5px; + + li { + display: table-cell; + width: 1%; + + a { + margin-left: 8px !important; + } + } + } + } +} diff --git a/app/assets/stylesheets/framework/highlight.scss b/app/assets/stylesheets/framework/highlight.scss new file mode 100644 index 00000000000..2e13ee842e0 --- /dev/null +++ b/app/assets/stylesheets/framework/highlight.scss @@ -0,0 +1,70 @@ +.file-content.code { + border: none; + box-shadow: none; + margin: 0px; + padding: 0px; + table-layout: fixed; + + pre { + padding: 10px; + border: none; + border-radius: 0; + font-family: $monospace_font; + font-size: $code_font_size !important; + line-height: $code_line_height !important; + margin: 0; + overflow: auto; + overflow-y: hidden; + white-space: pre; + word-wrap: normal; + + code { + font-family: $monospace_font; + white-space: pre; + word-wrap: normal; + padding: 0; + + .line { + display: inline; + } + } + } + + .line-numbers { + padding: 10px; + text-align: right; + float: left; + + a { + font-family: $monospace_font; + display: block; + font-size: $code_font_size !important; + line-height: $code_line_height !important; + white-space: nowrap; + + i { + visibility: hidden; + @extend .pull-left; + } + + &:hover i { + visibility: visible; + } + } + } +} + +.note-text .code { + border: none; + box-shadow: none; + background: $background-color; + padding: 1em; + overflow-x: auto; + + code { + font-family: $monospace_font; + white-space: pre; + word-wrap: normal; + padding: 0; + } +} diff --git a/app/assets/stylesheets/framework/issue_box.scss b/app/assets/stylesheets/framework/issue_box.scss new file mode 100644 index 00000000000..93377e45e70 --- /dev/null +++ b/app/assets/stylesheets/framework/issue_box.scss @@ -0,0 +1,35 @@ +/** + * Issue box for showing Open/Closed state: + * Used for Issue#show page, MergeRequest#show page etc + * + */ + +.issue-box { + @include border-radius(2px); + + display: inline-block; + padding: 10px $gl-padding; + font-weight: normal; + margin-right: 10px; + font-size: $gl-font-size; + + &.issue-box-closed { + background-color: $gl-danger; + color: #FFF; + } + + &.issue-box-merged { + background-color: $gl-primary; + color: #FFF; + } + + &.issue-box-open { + background-color: #019875; + color: #FFF; + } + + &.issue-box-expired { + background: #cea61b; + color: #FFF; + } +} diff --git a/app/assets/stylesheets/framework/jquery.scss b/app/assets/stylesheets/framework/jquery.scss new file mode 100644 index 00000000000..871b808bad4 --- /dev/null +++ b/app/assets/stylesheets/framework/jquery.scss @@ -0,0 +1,55 @@ +.ui-widget { + font-family: $regular_font; + font-size: $font-size-base; + + &.ui-datepicker-inline { + border: 1px solid #DDD; + padding: 10px; + width: 270px; + + .ui-datepicker-header { + background: #FFF; + border-color: #DDD; + } + + .ui-datepicker-calendar td a { + padding: 5px; + text-align: center; + } + } + + &.ui-autocomplete { + border-color: #DDD; + padding: 0; + margin-top: 2px; + z-index: 1001; + + .ui-menu-item a { + padding: 4px 10px; + } + } + + .ui-state-default { + border: 1px solid #FFF; + background: #FFF; + color: #777; + } + + .ui-state-highlight { + border: 1px solid #EEE; + background: #EEE; + } + + .ui-state-active { + border: 1px solid $gl-primary; + background: $gl-primary; + color: #FFF; + } + + .ui-state-hover, + .ui-state-focus { + border: 1px solid $hover; + background: $hover; + color: #333; + } +} diff --git a/app/assets/stylesheets/framework/layout.scss b/app/assets/stylesheets/framework/layout.scss new file mode 100644 index 00000000000..c7b3b60e769 --- /dev/null +++ b/app/assets/stylesheets/framework/layout.scss @@ -0,0 +1,27 @@ +html { + overflow-y: scroll; + + &.touch .tooltip { display: none !important; } + + body { + padding-top: $header-height; + text-rendering: geometricPrecision; + } +} + +.container { + padding-top: 0; + z-index: 5; +} + +.container .content { + margin: 0 0; +} + +.navless-container { + margin-top: 30px; +} + +.container-limited { + max-width: $fixed-layout-width; +} diff --git a/app/assets/stylesheets/framework/lists.scss b/app/assets/stylesheets/framework/lists.scss new file mode 100644 index 00000000000..3bfed8de772 --- /dev/null +++ b/app/assets/stylesheets/framework/lists.scss @@ -0,0 +1,125 @@ +/** + * Well styled list + * + */ +.well-list { + margin: 0; + padding: 0; + list-style: none; + + li { + padding: 10px 15px; + min-height: 20px; + border-bottom: 1px solid #eee; + border-bottom: 1px solid rgba(0, 0, 0, 0.05); + + &:after { + content: " "; + display: table; + clear: both; + } + + &.disabled { + color: #888; + } + + &.unstyled { + &:hover { + background: none; + } + } + + &.warning-row { + background-color: #fcf8e3; + border-color: #faebcc; + color: #8a6d3b; + } + + &.smoke { background-color: $background-color; } + + &:hover { + background: $hover; + } + + &:last-child { + border-bottom: none; + + &.bottom { + background: $background-color; + } + } + + .list-item-name { + float: left; + position: relative; + top: 3px; + } + + p { + padding-top: 1px; + margin: 0; + color: $gray-dark; + img { + position: relative; + top: 3px; + } + } + + .well-title { + font-size: $list-font-size; + line-height: 18px; + } + } +} + +ol, ul { + &.styled { + li { + padding: 2px; + } + } +} + +/** light list with border-bottom between li **/ +ul.bordered-list { + @include basic-list; + + &.top-list { + li:first-child { + padding-top: 0; + + h4, h5 { + margin-top: 0; + } + } + } +} + +li.task-list-item { + list-style-type: none; +} + +ul.content-list { + @include basic-list; + + margin: 0; + padding: 0; + + > li { + padding: $gl-padding; + border-color: #f1f2f4; + margin-left: -$gl-padding; + margin-right: -$gl-padding; + color: $gl-gray; + + .avatar { + margin-right: 15px; + } + + .controls { + padding-top: 10px; + float: right; + } + } +} + diff --git a/app/assets/stylesheets/framework/markdown_area.scss b/app/assets/stylesheets/framework/markdown_area.scss new file mode 100644 index 00000000000..ed0333d2336 --- /dev/null +++ b/app/assets/stylesheets/framework/markdown_area.scss @@ -0,0 +1,115 @@ +.div-dropzone-wrapper { + .div-dropzone { + position: relative; + padding: 0; + border: 0; + margin-bottom: 5px; + + .div-dropzone-focus { + border-color: #66afe9 !important; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6) !important; + outline: 0 !important; + } + + .div-dropzone-hover { + position: absolute; + top: 50%; + left: 50%; + margin-top: -0.5em; + margin-left: -0.6em; + opacity: 0; + font-size: 50px; + transition: opacity 200ms ease-in-out; + pointer-events: none; + } + + .div-dropzone-spinner { + position: absolute; + top: 100%; + left: 100%; + margin-top: -1.1em; + margin-left: -1.1em; + opacity: 0; + font-size: 30px; + transition: opacity 200ms ease-in-out; + } + + .div-dropzone-icon { + display: block; + text-align: center; + font-size: inherit; + } + + .div-dropzone-progress { + position: absolute; + top: 7px; + left: -40px; + width: 35px; + font-size: 13px; + text-align: right; + } + + .dz-preview { + display: none; + } + } +} + +.div-dropzone-alert { + margin-top: 5px; + margin-bottom: 0; + transition: opacity 200ms ease-in-out; +} + +.md-area { + position: relative; +} + +.md-header { + ul { + float: left; + margin-bottom: 1px; + } +} + +.referenced-users { + padding: 10px 0; + color: #999; + margin-left: 10px; + margin-top: 1px; + margin-right: 130px; +} + +.md-preview-holder { + background: #FFF; + border: 1px solid #ddd; + min-height: 169px; + padding: 5px; + box-shadow: none; +} + +.new_note, +.edit_note, +.issuable-description, +.milestone-description, +.wiki-content, +.merge-request-form { + .nav-tabs { + margin-bottom: 0; + border: none; + + li a, + li.active a { + border: 1px solid #DDD; + } + } +} + +.markdown-area { + background: #FFF; + border: 1px solid #ddd; + min-height: 140px; + padding: 5px; + box-shadow: none; + width: 100%; +} diff --git a/app/assets/stylesheets/framework/mixins.scss b/app/assets/stylesheets/framework/mixins.scss new file mode 100644 index 00000000000..c74a6d39824 --- /dev/null +++ b/app/assets/stylesheets/framework/mixins.scss @@ -0,0 +1,301 @@ +/** + * Generic mixins + */ + @mixin box-shadow($shadow) { + -webkit-box-shadow: $shadow; + -moz-box-shadow: $shadow; + -ms-box-shadow: $shadow; + -o-box-shadow: $shadow; + box-shadow: $shadow; +} + +@mixin border-radius($radius) { + -webkit-border-radius: $radius; + -moz-border-radius: $radius; + -ms-border-radius: $radius; + -o-border-radius: $radius; + border-radius: $radius; +} + +@mixin border-radius-left($radius) { + @include border-radius($radius 0 0 $radius) +} + +@mixin border-radius-right($radius) { + @include border-radius(0 0 $radius $radius) +} + +@mixin linear-gradient($from, $to) { + background-image: -webkit-gradient(linear, 0 0, 0 100%, from($from), to($to)); + background-image: -webkit-linear-gradient($from, $to); + background-image: -moz-linear-gradient($from, $to); + background-image: -ms-linear-gradient($from, $to); + background-image: -o-linear-gradient($from, $to); +} + +@mixin transition($transition) { + -webkit-transition: $transition; + -moz-transition: $transition; + -ms-transition: $transition; + -o-transition: $transition; + transition: $transition; +} + +/** + * Prefilled mixins + * Mixins with fixed values + */ + +@mixin shade { + @include box-shadow(0 0 3px #ddd); +} + +@mixin solid-shade { + @include box-shadow(0 0 0 3px #f1f1f1); +} + +@mixin md-typography { + color: $md-text-color; + + a { + color: $md-link-color; + } + + img { + max-width: 100%; + } + + *:first-child { + margin-top: 0; + } + + code { + font-family: $monospace_font; + white-space: pre; + word-wrap: normal; + padding: 1px 2px; + } + + kbd { + display: inline-block; + padding: 3px 5px; + font-size: 11px; + line-height: 10px; + color: #555; + vertical-align: middle; + background-color: #FCFCFC; + border-width: 1px; + border-style: solid; + border-color: #CCC #CCC #BBB; + border-image: none; + border-radius: 3px; + box-shadow: 0px -1px 0px #BBB inset; + } + + h1 { + font-size: 1.3em; + font-weight: 600; + margin: 24px 0 12px 0; + padding: 0 0 10px 0; + border-bottom: 1px solid #e7e9ed; + color: #313236; + } + + h2 { + font-size: 1.2em; + font-weight: 600; + margin: 24px 0 12px 0; + color: #313236; + } + + h3 { + margin: 24px 0 12px 0; + font-size: 1.25em; + } + + h4 { + margin: 24px 0 12px 0; + font-size: 1.1em; + } + + h5 { + margin: 24px 0 12px 0; + font-size: 1em; + } + + h6 { + margin: 24px 0 12px 0; + font-size: 0.90em; + } + + blockquote { + padding: 8px 21px; + margin: 12px 0 12px; + border-left: 3px solid #e7e9ed; + } + + blockquote p { + color: #7f8fa4 !important; + font-size: 15px; + line-height: 1.5; + } + + p { + color:#5c5d5e; + margin:6px 0 0 0; + } + + table { + @extend .table; + @extend .table-bordered; + margin: 12px 0 12px 0; + color: #5c5d5e; + th { + background: #f8fafc; + } + } + + pre { + margin: 12px 0 12px 0 !important; + background-color: #f8fafc !important; + font-size: 13px !important; + color: #5b6169 !important; + line-height: 1.6em !important; + @include border-radius(2px); + } + + p > code { + font-weight: inherit; + } + + + ul { + color: #5c5d5e; + } + + li { + line-height: 1.6em; + } + + a[href*="/uploads/"], a[href*="storage.googleapis.com/google-code-attachments/"] { + &:before { + margin-right: 4px; + + font: normal normal normal 14px/1 FontAwesome; + font-size: inherit; + text-rendering: auto; + -webkit-font-smoothing: antialiased; + content: "\f0c6"; + } + + &:hover:before { + text-decoration: none; + } + } +} + + +@mixin str-truncated($max_width: 82%) { + display: inline-block; + overflow: hidden; + text-overflow: ellipsis; + vertical-align: top; + white-space: nowrap; + max-width: $max_width; +} + +/* + * Base mixin for lists in GitLab + */ +@mixin basic-list { + margin: 5px 0px; + padding: 0px; + list-style: none; + + > li { + padding: 10px 0; + border-bottom: 1px solid #EEE; + overflow: hidden; + display: block; + margin: 0px; + + &:last-child { + border-bottom: none; + } + + &.active { + background: #f9f9f9; + a { + font-weight: 600; + } + } + + &.hide { + display: none; + } + + &.light { + a { + color: $gl-gray; + } + } + } +} + +@mixin input-big { + height: 36px; + padding: 5px 10px; + font-size: 16px; + line-height: 24px; + color: #7f8fa4; + background-color: #fff; + border-color: #e7e9ed; +} + +@mixin btn-big { + height: 36px; + padding: 5px 10px; + font-size: 16px; + line-height: 24px; +} + +@mixin nav-menu { + padding: 0; + margin: 0; + list-style: none; + margin-top: 5px; + height: 56px; + + li { + display: inline-block; + + a { + padding: 14px; + font-size: 17px; + line-height: 28px; + color: #7f8fa4; + border-bottom: 2px solid transparent; + + &:hover, &:active, &:focus { + text-decoration: none; + } + } + + &.active a { + color: #4c4e54; + border-bottom: 2px solid #1cacfc; + } + + .badge { + font-weight: normal; + background-color: #fff; + background-color: #eee; + color: #78a; + } + } +} + +.fa-align { + top: 20px; + position: relative; +} diff --git a/app/assets/stylesheets/framework/mobile.scss b/app/assets/stylesheets/framework/mobile.scss new file mode 100644 index 00000000000..36ae126f865 --- /dev/null +++ b/app/assets/stylesheets/framework/mobile.scss @@ -0,0 +1,139 @@ +/** Common mobile (screen XS, SM) styles **/ +@media (max-width: $screen-xs-max) { + .container .content { + margin-top: 20px; + } + + .container-fluid { + padding-left: 5px; + padding-right: 5px; + } + + .nav.nav-tabs > li > a { + padding: 10px; + font-size: 12px; + margin-right: 3px; + + .badge { + display: none; + } + } + + .referenced-users { + margin-right: 0; + } + + .issues-filters, + .dash-projects-filters, + .check-all-holder { + display: none; + } + + .rss-btn { + display: none !important; + } + + .project-home-links { + display: none; + } + + .project-avatar { + display: none; + } + + .project-home-panel { + padding-left: 0 !important; + + .project-avatar { + display: block; + } + + .project-home-desc { + font-size: 21px; + } + + .project-repo-buttons, + .git-clone-holder { + display: none; + } + } + + .project-stats { + display: none; + } + + .container .title { + padding-left: 15px !important; + } + + .issue-info, .merge-request-info { + display: none; + } + + .issue-details { + .creator, + .page-title .btn-close { + display: none; + } + } + + %ul.notes .note-role, .note-actions { + display: none; + } + + .center-top-menu { + height: 45px; + + li a { + font-size: 14px; + padding: 19px 10px; + } + } + + .projects-search-form { + margin: 0 -5px !important; + + .btn { + display: none; + } + } +} + +@media (max-width: $screen-sm-max) { + .issues-filters { + .milestone-filter, .labels-filter { + display: none; + } + } + + .page-title { + .note_created_ago, .new-issue-link { + display: none; + } + } + + .issue_edited_ago, .note_edited_ago { + display: none; + } + + aside { + display: none; + } + + .show-aside { + display: block !important; + } +} + +.show-aside { + display: none; + position: fixed; + right: 0px; + top: 30%; + padding: 5px 15px; + background: #EEE; + font-size: 20px; + color: #777; + z-index: 100; + @include box-shadow(0 1px 2px #DDD); +} diff --git a/app/assets/stylesheets/framework/pagination.scss b/app/assets/stylesheets/framework/pagination.scss new file mode 100644 index 00000000000..6677f94dafd --- /dev/null +++ b/app/assets/stylesheets/framework/pagination.scss @@ -0,0 +1,34 @@ +.gl-pagination { + border-top: 1px solid $border-color; + background-color: $background-color; + margin: -$gl-padding; + margin-top: 0; + + .pagination { + padding: 0; + margin: 0; + display: block; + + li.first, + li.last, + li.next, + li.prev { + > a { + color: $link-color; + + &:hover { + color: #fff; + } + } + } + + li > a, + li > span { + border: none; + margin: 0; + @include border-radius(0 !important); + padding: 13px 19px; + border-right: 1px solid $border-color; + } + } +} diff --git a/app/assets/stylesheets/framework/selects.scss b/app/assets/stylesheets/framework/selects.scss new file mode 100644 index 00000000000..cba621635b6 --- /dev/null +++ b/app/assets/stylesheets/framework/selects.scss @@ -0,0 +1,146 @@ +/** Select2 selectbox style override **/ +.select2-container, .select2-container.select2-drop-above { + .select2-choice { + background: #FFF; + border-color: #DDD; + height: 42px; + padding: 8px $gl-padding; + font-size: $gl-font-size; + line-height: 1.42857143; + + @include border-radius(2px); + + .select2-arrow { + background: #FFF; + border-left: none; + padding-top: 5px; + } + } +} + +.select2-container .select2-choice, .select2-container.select2-drop-above .select2-choice{ + color: #7f8fa4; + border: 1px solid #e7e9ed; +} + +.select2-drop { + @include box-shadow(rgba(76, 86, 103, 0.247059) 0px 0px 1px 0px, rgba(31, 37, 50, 0.317647) 0px 2px 18px 0px); + @include border-radius (0px); + + padding: 16px; + border: none !important; +} + +.select2-results .select2-result-label { + padding: 16px; +} + +.select2-drop{ + color: #7f8fa4; +} + +.select2-highlighted { + background: #3084bb !important; +} + +.select2-results li.select2-result-with-children > .select2-result-label { + font-weight: 600; + color: #313236; +} + + +.select2-container-multi .select2-choices { + @include border-radius(2px); + border-color: #CCC; +} + +.select2-container-multi .select2-choices .select2-search-field input { + padding: 8px 14px; + font-size: 13px; + line-height: 18px; + height: auto; +} + +.select2-drop-active { + border: 1px solid #BBB !important; + margin-top: 4px; + font-size: 13px; + + &.select2-drop-above { + margin-bottom: 8px; + } + + .select2-search input { + background: #fafafa; + border-color: #DDD; + } + + .select2-results { + max-height: 350px; + .select2-highlighted { + background: $gl-primary; + } + } +} + +.select2-container { + width: 100% !important; +} + +/** Branch/tag selector **/ +.project-refs-form .select2-container { + width: 160px !important; +} + +.ajax-users-dropdown, .ajax-project-users-dropdown { + .select2-search { + padding-top: 2px; + } +} + +.ajax-users-select { + width: 400px; + + &.input-large { + width: 210px; + } + + &.input-clamp { + max-width: 100%; + } +} + +.group-result { + .group-image { + float: left; + } + .group-name { + font-weight: bold; + } + .group-path { + color: #999; + } +} + +.user-result { + .user-image { + float: left; + } + .user-name { + } +} + +.namespace-result { + .namespace-kind { + color: #AAA; + font-weight: normal; + } + .namespace-path { + margin-left: 10px; + font-weight: bolder; + } +} + +.ajax-users-dropdown { + min-width: 250px !important; +} diff --git a/app/assets/stylesheets/framework/sidebar.scss b/app/assets/stylesheets/framework/sidebar.scss new file mode 100644 index 00000000000..c5ea3aca7ca --- /dev/null +++ b/app/assets/stylesheets/framework/sidebar.scss @@ -0,0 +1,267 @@ +.page-with-sidebar { + .sidebar-wrapper { + position: fixed; + top: 0; + bottom: 0; + overflow-y: auto; + overflow-x: hidden; + left: 0; + height: 100%; + transition-duration: .3s; + } +} + +.sidebar-wrapper { + z-index: 99; + background: $background-color; + transition-duration: .3s; +} + +.content-wrapper { + min-height: 100vh; + width: 100%; + padding: 20px; + background: #EAEBEC; + + .container-fluid { + background: #FFF; + padding: $gl-padding; + min-height: 90vh; + + &.container-blank { + background: none; + padding: 0; + border: none; + } + } +} + +.nav-sidebar { + margin-top: 14 + $header-height; + margin-bottom: 100px; + transition-duration: .3s; + list-style: none; + overflow: hidden; + + &.navbar-collapse { + padding: 0px !important; + } + + li { + width: $sidebar_width; + + &.separate-item { + padding-top: 10px; + margin-top: 10px; + } + + a { + padding: 7px 15px; + font-size: $gl-font-size; + line-height: 24px; + color: $gray; + display: block; + text-decoration: none; + padding-left: 22px; + font-weight: normal; + + &:hover { + text-decoration: none; + } + + &:active, &:focus { + text-decoration: none; + } + + i { + width: 16px; + color: $gray-light; + margin-right: 13px; + } + + .count { + float: right; + background: #eee; + padding: 0px 8px; + @include border-radius(6px); + } + } + } +} + +.sidebar-subnav { + margin-left: 0px; + padding-left: 0px; + + li { + list-style: none; + } +} + +@mixin expanded-sidebar { + padding-left: $sidebar_width; + transition-duration: .3s; + + .sidebar-wrapper { + width: $sidebar_width; + + .nav-sidebar { + width: $sidebar_width; + } + + .nav-sidebar li a{ + width: 230px; + + &.back-link { + i { + visibility: hidden; + } + } + } + } +} + +@mixin folded-sidebar { + padding-left: 60px; + transition-duration: .3s; + + .sidebar-wrapper { + width: $sidebar_collapsed_width; + + .header-logo { + width: $sidebar_collapsed_width; + + a { + padding-left: 12px; + + .gitlab-text-container { + display: none; + } + } + } + + .nav-sidebar { + width: $sidebar_collapsed_width; + + li a { + span { + display: none; + } + } + } + + .collapse-nav a { + width: $sidebar_collapsed_width; + } + + .sidebar-user { + padding-left: 12px; + width: $sidebar_collapsed_width; + + .username { + display: none; + } + } + } +} + +.collapse-nav a { + width: $sidebar_width; + position: fixed; + bottom: 0; + left: 0; + font-size: 13px; + background: transparent; + height: 40px; + text-align: center; + line-height: 40px; + transition-duration: .3s; +} + +.collapse-nav a:hover { + text-decoration: none; + background: #f2f6f7; +} + +@media (max-width: $screen-md-max) { + .page-sidebar-collapsed { + @include folded-sidebar; + } + + .page-sidebar-expanded { + @include folded-sidebar; + } + + .collapse-nav { + display: none; + } +} + +@media(min-width: $screen-md-max) { + .page-sidebar-collapsed { + @include folded-sidebar; + } + + .page-sidebar-expanded { + @include expanded-sidebar; + } +} + +.sidebar-user { + padding: 9px 22px; + position: fixed; + bottom: 40px; + width: $sidebar_width; + overflow: hidden; + transition-duration: .3s; + + .username { + margin-left: 10px; + width: $sidebar_width - 2 * 10px; + font-size: 16px; + line-height: 34px; + } +} + +.sidebar-wrapper { + .header-logo { + border-bottom: 1px solid transparent; + float: left; + height: $header-height; + width: $sidebar_width; + overflow: hidden; + transition-duration: .3s; + + a { + float: left; + height: $header-height; + width: 100%; + padding: 10px 22px; + overflow: hidden; + + img { + width: 36px; + height: 36px; + float: left; + } + + .gitlab-text-container { + width: 230px; + + h3 { + width: 158px; + float: left; + margin: 0; + margin-left: 14px; + font-size: 19px; + line-height: 41px; + font-weight: normal; + } + } + } + + &:hover { + background-color: #EEE; + } + } +} diff --git a/app/assets/stylesheets/framework/tables.scss b/app/assets/stylesheets/framework/tables.scss new file mode 100644 index 00000000000..a66e45577de --- /dev/null +++ b/app/assets/stylesheets/framework/tables.scss @@ -0,0 +1,20 @@ +table { + &.table { + tr { + td, th { + padding: 8px 10px; + line-height: 20px; + vertical-align: middle; + } + th { + font-weight: normal; + font-size: 15px; + border-bottom: 1px solid $border-color !important; + } + td { + border-color: #F1F1F1 !important; + border-bottom: 1px solid; + } + } + } +} diff --git a/app/assets/stylesheets/framework/timeline.scss b/app/assets/stylesheets/framework/timeline.scss new file mode 100644 index 00000000000..bf21d7fce76 --- /dev/null +++ b/app/assets/stylesheets/framework/timeline.scss @@ -0,0 +1,70 @@ +.timeline { + @include basic-list; + + margin: 0; + padding: 0; + + .timeline-entry { + padding: $gl-padding; + border-color: #f1f2f4; + margin-left: -$gl-padding; + margin-right: -$gl-padding; + color: $gl-gray; + border-bottom: 1px solid #ECEEF1; + border-right: 1px solid #ECEEF1; + + &:last-child { + border-bottom: none; + } + + .avatar { + margin-right: 15px; + } + + .controls { + padding-top: 10px; + float: right; + } + } + + .note-text { + p:last-child { + margin-bottom: 0; + } + } + + .system-note { + .note-text { + color: $gl-gray !important; + } + } + + .diff-file { + border: 1px solid $border-color; + border-bottom: none; + margin-left: 0; + margin-right: 0; + } +} + +@media (max-width: $screen-xs-max) { + .timeline { + &:before { + background: none; + } + .timeline-entry .timeline-entry-inner { + .timeline-icon { + display: none; + } + + .timeline-content { + margin-left: 0; + } + } + } +} + +.discussion .timeline-entry { + margin: 0; + border-right: none; +} diff --git a/app/assets/stylesheets/framework/typography.scss b/app/assets/stylesheets/framework/typography.scss new file mode 100644 index 00000000000..6a3cb49baae --- /dev/null +++ b/app/assets/stylesheets/framework/typography.scss @@ -0,0 +1,130 @@ +/** + * Headers + * + */ +body { + text-rendering:optimizeLegibility; + -webkit-text-shadow: rgba(255,255,255,0.01) 0 0 1px; +} + +.page-title { + margin-top: 0px; + line-height: 1.3; + font-size: 1.25em; + font-weight: 600; +} + +.page-title-empty { + margin-top: 0px; + line-height: 1.3; + font-size: 1.25em; + font-weight: 600; + margin: 12px 7px 12px 7px; +} + +h1, h2, h3, h4, h5, h6 { + color: $gl-header-color; + font-weight: 500; +} + +/** CODE **/ +pre { + font-family: $monospace_font; + + &.dark { + background: #333; + color: $background-color; + } + + &.plain-readme { + background: none; + border: none; + padding: 0; + margin: 0; + font-size: 14px; + } +} + +.monospace { + font-family: $monospace_font; +} + +code { + &.key-fingerprint { + background: $body-bg; + color: $text-color; + } +} + +a > code { + color: $link-color; +} + +/** + * Wiki typography + * + */ +.wiki { + @include md-typography; + + word-wrap: break-word; + padding: 7px; + + /* Link to current header. */ + h1, h2, h3, h4, h5, h6 { + position: relative; + + a.anchor { + // Setting `display: none` would prevent the anchor being scrolled to, so + // instead we set the height to 0 and it gets updated on hover. + height: 0; + } + + &:hover > a.anchor { + $size: 16px; + position: absolute; + right: 100%; + top: 50%; + margin-top: -$size/2; + margin-right: 0px; + padding-right: 20px; + display: inline-block; + width: $size; + height: $size; + background-image: image-url("icon-link.png"); + background-size: contain; + background-repeat: no-repeat; + } + } + + ul,ol { + padding: 0; + margin: 6px 0 6px 18px !important; + } + ol { + color: #5c5d5e; + } +} + +.md-area { + @include md-typography; +} + +.md { + @include md-typography; +} + +/** + * Textareas intended for GFM + * + */ +textarea.js-gfm-input { + font-family: $monospace_font; +} + +.md-preview { +} + +.strikethrough { + text-decoration: line-through; +} \ No newline at end of file diff --git a/app/assets/stylesheets/framework/variables.scss b/app/assets/stylesheets/framework/variables.scss new file mode 100644 index 00000000000..eb9a2966389 --- /dev/null +++ b/app/assets/stylesheets/framework/variables.scss @@ -0,0 +1,98 @@ +$hover: #FFFAF1; +$gl-text-color: #54565B; +$gl-text-green: #4A2; +$gl-text-red: #D12F19; +$gl-text-orange: #D90; +$gl-header-color: #4c4e54; +$gl-link-color: #333c48; +$md-text-color: #444; +$md-link-color: #3084bb; +$nprogress-color: #c0392b; +$gl-font-size: 15px; +$list-font-size: 15px; +$sidebar_collapsed_width: 62px; +$sidebar_width: 230px; +$avatar_radius: 50%; +$code_font_size: 13px; +$code_line_height: 1.5; +$border-color: #dce0e6; +$background-color: #F7F8FA; +$header-height: 58px; +$fixed-layout-width: 1200px; +$gl-gray: #7f8fa4; +$gl-padding: 16px; +$gl-avatar-size: 46px; + +/* + * Color schema + */ + +$white-light: #FFFFFF; +$white-normal: #DCE0E5; +$white-dark: #E4E7ED; + +$gray-light: #F0F2F5; +$gray-normal: #DCE0E5; +$gray-dark: #E4E7ED; + +$green-light: #31AF64; +$green-normal: #2FAA60; +$green-dark: #2CA05B; + +$blue-light: #2EA8E5; +$blue-normal: #2D9FD8; +$blue-dark: #2897CE; + +$orange-light: #FC6443; +$orange-normal: #E75E40; +$orange-dark: #CE5237; + +$red-light: #F43263; +$red-normal: #E52C5A; +$red-dark: #D22852; + +$border-white-light: #E3E7EC; +$border-white-normal: #D6DAE2; +$border-white-dark: #C6CACF; + +$border-gray-light: #DCE0E5; +$border-gray-normal: #D6DAE2; +$border-gray-dark: #C6CACF; + +$border-green-light: #2FAA60; +$border-green-normal: #2CA05B; +$border-green-dark: #279654; + +$border-blue-light: #2D9FD8; +$border-blue-normal: #2897CE; +$border-blue-dark: #258DC1; + +$border-orange-light: #ED5C3D; +$border-orange-normal: #CE5237; +$border-orange-dark: #C14E35; + +$border-red-light: #E52C5A; +$border-red-normal: #D22852; +$border-red-dark: #CA264F; + + +/* + * State colors: + */ +$gl-primary: $blue-normal; +$gl-success: $green-normal; +$gl-info: $blue-normal; +$gl-warning: $orange-normal; +$gl-danger: $red-normal; + +/* + * Commit Diff Colors + */ +$added: #63c363; +$deleted: #f77; + +/* + * Fonts + */ +$monospace_font: 'Menlo', 'Liberation Mono', 'Consolas', 'DejaVu Sans Mono', 'Ubuntu Mono', 'Courier New', 'andale mono', 'lucida console', monospace; +$regular_font: 'Source Sans Pro', "Helvetica Neue", Helvetica, Arial, sans-serif; diff --git a/app/assets/stylesheets/framework/zen.scss b/app/assets/stylesheets/framework/zen.scss new file mode 100644 index 00000000000..32e2c020e06 --- /dev/null +++ b/app/assets/stylesheets/framework/zen.scss @@ -0,0 +1,86 @@ +.zennable { + .zen-toggle-comment { + display: none; + } + + .zen-enter-link { + color: $gl-gray; + position: absolute; + top: 0px; + right: 4px; + line-height: 40px; + } + + .zen-leave-link { + display: none; + color: $gl-text-color; + position: absolute; + top: 10px; + right: 10px; + padding: 5px; + font-size: 36px; + + &:hover { + color: #111; + } + } + + // Hide the Enter link when we're in Zen mode + input:checked ~ .zen-backdrop .zen-enter-link { + display: none; + } + + // Show the Leave link when we're in Zen mode + input:checked ~ .zen-backdrop .zen-leave-link { + display: block; + position: absolute; + top: 0; + } + + input:checked ~ .zen-backdrop { + background-color: white; + position: fixed; + top: 0; + bottom: 0; + left: 0; + right: 0; + z-index: 1031; + + textarea { + border: none; + box-shadow: none; + border-radius: 0; + color: #000; + font-size: 20px; + line-height: 26px; + padding: 30px; + display: block; + outline: none; + resize: none; + height: 100vh; + max-width: 900px; + margin: 0 auto; + } + } + + // Make the color of the placeholder text in the Zenned-out textarea darker, + // so it becomes visible + + input:checked ~ .zen-backdrop textarea::-webkit-input-placeholder { + color: #A8A8A8; + } + + input:checked ~ .zen-backdrop textarea:-moz-placeholder { + color: #A8A8A8; + opacity: 1; + } + + input:checked ~ .zen-backdrop textarea::-moz-placeholder { + color: #A8A8A8; + opacity: 1; + } + + input:checked ~ .zen-backdrop textarea:-ms-input-placeholder { + color: #A8A8A8; + } +} diff --git a/app/assets/stylesheets/generic/avatar.scss b/app/assets/stylesheets/generic/avatar.scss deleted file mode 100644 index 36e582d4854..00000000000 --- a/app/assets/stylesheets/generic/avatar.scss +++ /dev/null @@ -1,49 +0,0 @@ -.avatar { - float: left; - margin-right: 12px; - width: 40px; - height: 40px; - padding: 0; - @include border-radius($avatar_radius); - - &.avatar-inline { - float: none; - margin-left: 4px; - margin-bottom: 2px; - - &.s16 { margin-right: 4px; } - &.s24 { margin-right: 4px; } - } - - &.group-avatar, &.project-avatar, &.avatar-tile { - @include border-radius(0px); - } - - &.s16 { width: 16px; height: 16px; margin-right: 6px; } - &.s24 { width: 24px; height: 24px; margin-right: 8px; } - &.s26 { width: 26px; height: 26px; margin-right: 8px; } - &.s32 { width: 32px; height: 32px; margin-right: 10px; } - &.s36 { width: 36px; height: 36px; margin-right: 10px; } - &.s46 { width: 46px; height: 46px; margin-right: 15px; } - &.s48 { width: 48px; height: 48px; margin-right: 10px; } - &.s60 { width: 60px; height: 60px; margin-right: 12px; } - &.s90 { width: 90px; height: 90px; margin-right: 15px; } - &.s110 { width: 110px; height: 110px; margin-right: 15px; } - &.s140 { width: 140px; height: 140px; margin-right: 20px; } - &.s160 { width: 160px; height: 160px; margin-right: 20px; } -} - -.identicon { - text-align: center; - vertical-align: top; - - &.s16 { font-size: 12px; line-height: 1.33; } - &.s24 { font-size: 14px; line-height: 1.8; } - &.s26 { font-size: 20px; line-height: 1.33; } - &.s32 { font-size: 22px; line-height: 32px; } - &.s60 { font-size: 32px; line-height: 60px; } - &.s90 { font-size: 36px; line-height: 90px; } - &.s110 { font-size: 40px; line-height: 112px; font-weight: 300; } - &.s140 { font-size: 72px; line-height: 140px; } - &.s160 { font-size: 96px; line-height: 160px; } -} diff --git a/app/assets/stylesheets/generic/blocks.scss b/app/assets/stylesheets/generic/blocks.scss deleted file mode 100644 index 6ce34b5c3e8..00000000000 --- a/app/assets/stylesheets/generic/blocks.scss +++ /dev/null @@ -1,62 +0,0 @@ -.light-well { - background-color: #f8fafc; - padding: 15px; -} - -.centered-light-block { - text-align: center; - color: $gl-gray; - margin: 20px; -} - -.nothing-here-block { - text-align: center; - padding: 20px; - color: $gl-gray; - font-weight: normal; - font-size: 16px; - line-height: 36px; -} - -.gray-content-block { - margin: -$gl-padding; - background-color: $background-color; - padding: $gl-padding; - margin-bottom: 0px; - border-top: 1px solid $border-color; - border-bottom: 1px solid $border-color; - color: $gl-gray; - - &.top-block { - border-top: none; - } - - &.middle-block { - margin-top: 0; - margin-bottom: 0; - } - - &.clear-block { - margin-bottom: $gl-padding - 1px; - padding-bottom: $gl-padding; - } - - &.second-block { - margin-top: -1px; - margin-bottom: 0; - } - - &.footer-block { - margin-top: 0; - border-bottom: none; - margin-bottom: -$gl-padding; - } - - .title { - color: $gl-text-color; - } - - .oneline { - line-height: 42px; - } -} diff --git a/app/assets/stylesheets/generic/buttons.scss b/app/assets/stylesheets/generic/buttons.scss deleted file mode 100644 index 11acbe3adfa..00000000000 --- a/app/assets/stylesheets/generic/buttons.scss +++ /dev/null @@ -1,163 +0,0 @@ -@mixin btn-default { - @include border-radius(2px); - border-width: 1px; - border-style: solid; - text-transform: uppercase; - font-size: 13px; - font-weight: 600; - line-height: 18px; - padding: 11px 16px; - letter-spacing: .4px; - - &:focus, - &:active { - outline: none; - @include box-shadow(inset 0 0 4px rgba(0, 0, 0, 0.12)); - } -} - -@mixin btn-middle { - @include btn-default; - @include border-radius(2px); - padding: 11px 24px; -} - -@mixin btn-color($light, $border-light, $normal, $border-normal, $dark, $border-dark, $color) { - background-color: $light; - border-color: $border-light; - color: $color; - - &:hover, - &:focus { - background-color: $normal; - border-color: $border-normal; - color: $color; - } - - &:active { - @include box-shadow (inset 0 0 4px rgba(0, 0, 0, 0.12)); - - background-color: $dark; - border-color: $border-dark; - color: $color; - } -} - -@mixin btn-green { - @include btn-color($green-light, $border-green-light, $green-normal, $border-green-normal, $green-dark, $border-green-dark, #FFFFFF); -} - -@mixin btn-blue { - @include btn-color($blue-light, $border-blue-light, $blue-normal, $border-blue-normal, $blue-dark, $border-blue-dark, #FFFFFF); -} - -@mixin btn-orange { - @include btn-color($orange-light, $border-orange-light, $orange-normal, $border-orange-normal, $orange-dark, $border-orange-dark, #FFFFFF); -} - -@mixin btn-red { - @include btn-color($red-light, $border-red-light, $red-normal, $border-red-normal, $red-dark, $border-red-dark, #FFFFFF); -} - -@mixin btn-gray { - @include btn-color($gray-light, $border-gray-light, $gray-normal, $border-gray-normal, $gray-dark, $border-gray-dark, #313236); -} - -@mixin btn-white { - @include btn-color($white-light, $border-white-light, $white-normal, $border-white-normal, $white-dark, $border-white-dark, #313236); -} - -.btn { - @include btn-default; - @include btn-white; - - &.btn-success, - &.btn-new, - &.btn-create, - &.btn-save, - &.btn-green { - @include btn-green; - } - - &.btn-gray { - @include btn-gray; - } - - &.btn-primary, - &.btn-info { - @include btn-blue; - } - - &.btn-warning { - @include btn-orange; - } - - &.btn-danger, - &.btn-remove, - &.btn-red { - @include btn-red; - } - - &.btn-cancel { - float: right; - } - - &.btn-close { - color: $gl-danger; - border-color: $gl-danger; - &:hover { - color: #B94A48; - } - } - - &.btn-reopen { - color: $gl-success; - border-color: $gl-success; - &:hover { - color: #468847; - } - } - - &.btn-grouped { - margin-right: 7px; - float: left; - &:last-child { - margin-right: 0px; - } - } -} - -.btn-block { - width: 100%; - margin: 0; - margin-bottom: 15px; - &.btn { - padding: 6px 0; - } -} - -.btn-group { - &.btn-grouped { - margin-right: 7px; - float: left; - &:last-child { - margin-right: 0px; - } - } -} - -.btn-group-next { - .btn { - padding: 9px 0px; - font-size: 15px; - color: #7f8fa4; - border-color: #e7e9ed; - width: 140px; - - &.active { - border-color: $gl-info; - background: $gl-info; - color: #fff; - } - } -} diff --git a/app/assets/stylesheets/generic/calendar.scss b/app/assets/stylesheets/generic/calendar.scss deleted file mode 100644 index a36fefe22c5..00000000000 --- a/app/assets/stylesheets/generic/calendar.scss +++ /dev/null @@ -1,90 +0,0 @@ -.user-calendar-activities { - .calendar_onclick_hr { - padding: 0; - margin: 10px 0; - } - - .str-truncated { - max-width: 70%; - } - - .text-expander { - background: #eee; - color: #555; - padding: 0 5px; - cursor: pointer; - margin-left: 4px; - &:hover { - background-color: #ddd; - } - } -} -/** -* This overwrites the default values of the cal-heatmap gem -*/ -.calendar { - .qi { - background-color: #999; - fill: #fff; - } - - .q1 { - background-color: #dae289; - fill: #ededed; - } - - .q2 { - background-color: #cedb9c; - fill: #ACD5F2; - } - - .q3 { - background-color: #b5cf6b; - fill: #7FA8D1; - } - - .q4 { - background-color: #637939; - fill: #49729B; - } - - .q5 { - background-color: #3b6427; - fill: #254E77; - } - - .domain-background { - fill: none; - shape-rendering: crispedges; - } - - .ch-tooltip { - position: absolute; - display: none; - margin-top: 22px; - margin-left: 1px; - font-size: 13px; - padding: 3px; - font-weight: 550; - background-color: #222; - span { - position: absolute; - width: 200px; - text-align: center; - visibility: hidden; - border-radius: 10px; - &:after { - content: ''; - position: absolute; - top: 100%; - left: 50%; - margin-left: -8px; - width: 0; - height: 0; - border-top: 8px solid #000000; - border-right: 8px solid transparent; - border-left: 8px solid transparent; - } - } - } -} diff --git a/app/assets/stylesheets/generic/callout.scss b/app/assets/stylesheets/generic/callout.scss deleted file mode 100644 index f1699d21c9b..00000000000 --- a/app/assets/stylesheets/generic/callout.scss +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Callouts from Bootstrap3 docs - * - * Not quite alerts, but custom and helpful notes for folks reading the docs. - * Requires a base and modifier class. - */ - -/* Common styles for all types */ -.bs-callout { - margin: 20px 0; - padding: 20px; - border-left: 3px solid #eee; - color: #666; - background: #f9f9f9; -} -.bs-callout h4 { - margin-top: 0; - margin-bottom: 5px; -} -.bs-callout p:last-child { - margin-bottom: 0; -} - -/* Variations */ -.bs-callout-danger { - background-color: #fdf7f7; - border-color: #eed3d7; - color: #b94a48; -} -.bs-callout-warning { - background-color: #faf8f0; - border-color: #faebcc; - color: #8a6d3b; -} -.bs-callout-info { - background-color: #f4f8fa; - border-color: #bce8f1; - color: #34789a; -} -.bs-callout-success { - background-color: #dff0d8; - border-color: #5cA64d; - color: #3c763d; -} - diff --git a/app/assets/stylesheets/generic/common.scss b/app/assets/stylesheets/generic/common.scss deleted file mode 100644 index 03919f15f1f..00000000000 --- a/app/assets/stylesheets/generic/common.scss +++ /dev/null @@ -1,404 +0,0 @@ -/** COLORS **/ -.cgray { color: $gl-gray; } -.clgray { color: #BBB } -.cred { color: $gl-text-red; } -.cgreen { color: $gl-text-green; } -.cdark { color: #444 } - -/** COMMON CLASSES **/ -.prepend-top-10 { margin-top:10px } -.prepend-top-default { margin-top: $gl-padding; } -.prepend-top-20 { margin-top:20px } -.prepend-left-10 { margin-left:10px } -.prepend-left-20 { margin-left:20px } -.append-right-10 { margin-right:10px } -.append-right-20 { margin-right:20px } -.append-bottom-10 { margin-bottom:10px } -.append-bottom-15 { margin-bottom:15px } -.append-bottom-20 { margin-bottom:20px } -.inline { display: inline-block } -.center { text-align: center } - -.underlined-link { text-decoration: underline; } -.hint { font-style: italic; color: #999; } -.light { color: $gl-gray; } - -.slead { - color: $gl-gray; - font-size: 15px; - margin-bottom: 12px; - font-weight: normal; - line-height: 24px; -} - -.tab-content { - overflow: visible; -} - -pre { - &.clean { - background: none; - border: none; - margin: 0; - padding: 0; - } - - &.well-pre { - border: 1px solid #EEE; - background: #f9f9f9; - border-radius: 0; - color: #555; - } -} - -.dropdown-menu > li > a { - text-shadow: none; -} - -.dropdown-menu-align-right { - left: auto; - right: 0px; -} - -.dropdown-menu > li > a:hover, -.dropdown-menu > li > a:focus { - background: $gl-primary; - color: #FFF -} - -.str-truncated { - @include str-truncated; -} - -/** FLASH message **/ -.author_link { - color: $gl-link-color; -} - -.back-link { - font-size: 14px; -} - -table a code { - position: relative; - top: -2px; - margin-right: 3px; -} - -.loading { - margin: 20px auto; - height: 40px; - color: #555; - font-size: 32px; - text-align: center; -} - -span.update-author { - display: block; - color: #999; - font-weight: normal; - font-style: italic; - strong { - font-weight: bold; - font-style: normal; - } -} - -.user-mention { - color: #2FA0BB; - font-weight: bold; -} - -.field_with_errors { - display: inline; -} - -.line_holder { - &:hover { - td { - background: #FFFFCF !important; - } - } -} - -p.time { - color: #999; - font-size: 90%; - margin: 30px 3px 3px 2px; -} - -.highlight { - text-shadow: none; -} - -.thin_area{ - height: 150px; -} - -// Fixes alignment on notes. -.new_note { - label { - text-align: left; - } -} - -// Fix issue with notes & lists creating a bunch of bottom borders. -li.note { - img { max-width:100% } - .note-title { - li { - border-bottom:none !important; - } - } -} - -.markdown { - img { - max-width: 100%; - } -} - -.wiki_content code, .readme code{ - background-color: inherit; -} - -.project_member_show { - td:first-child { - color: #aaa; - } -} - -.rss-icon { - img { - width: 24px; - vertical-align: top; - } - - strong { - line-height: 24px; - } -} - -.show-suppressed-diff, -.show-all-commits { - cursor: pointer; -} - -.git_error_tips { - @extend .col-md-6; - text-align: left; - margin-top: 40px; - pre { - background: white; - border: none; - font-size: 12px; - } -} - -.error-message { - padding: 10px; - background: #C67; - margin: 0; - color: #FFF; - - a { - color: #fff; - text-decoration: underline; - } -} - -.browser-alert { - padding: 10px; - text-align: center; - background: #C67; - color: #fff; - font-weight: bold; - a { - color: #fff; - text-decoration: underline; - } -} - -.warning_message { - border-left: 4px solid #ed9; - color: #b90; - padding: 10px; - margin-bottom: 10px; - background: #ffffe6; - padding-left: 20px; - - &.centered { - text-align: center; - } -} - -.gitlab-promo { - a { - color: #aaa; - margin-right: 30px; - } -} - -.milestone { - &.milestone-closed { - background: #f9f9f9; - } - .progress { - margin-bottom: 0; - margin-top: 4px; - } -} - -.control-group { - .controls { - span { - &.descr { - position: relative; - top: 2px; - left: 5px; - color: #666; - } - } - } -} - -img.emoji { - height: 20px; - vertical-align: middle; - width: 20px; -} - -.chart { - overflow: hidden; - height: 220px; -} - -.description-block { - @extend .light-well; - @extend .light; - margin-bottom: 10px; -} - -table { - td.permission-x { - background: #D9EDF7 !important; - text-align: center; - } -} - -.dashboard-intro-icon { - float: left; - text-align: center; - font-size: 32px; - color: #AAA; - width: 60px; -} - -.dashboard-intro-text { - display: inline-block; - margin-left: -60px; - padding-left: 60px; - width: 100%; -} - -.btn-sign-in { - margin-top: 8px; - text-shadow: none; -} - -.side-filters { - fieldset { - margin-bottom: 15px; - } -} - -.wiki .highlight, .note-body .highlight { - margin: 12px 0 12px 0; -} - -.wiki .code { - overflow-x: auto; -} - -.footer-links { - margin-bottom: 20px; - a { - margin-right: 15px; - } -} - -.search_box { - @extend .well; - text-align: center; -} - -.task-status { - margin-left: 10px; -} - -#nprogress .spinner { - top: 15px !important; - right: 10px !important; -} - -.header-with-avatar { - h3 { - margin: 0; - font-weight: bold; - } - - .username { - font-size: 18px; - color: #666; - margin-top: 8px; - } - - .description { - font-size: $gl-font-size; - color: #666; - margin-top: 8px; - } -} - -.profiler-results { - top: 73px !important; - - .profiler-button, - .profiler-controls { - border-color: #EEE !important; - } -} - -.center-top-menu { - @include nav-menu; - text-align: center; - margin-top: 5px; - margin-bottom: $gl-padding; - height: 56px; - margin-top: -$gl-padding; - padding-top: $gl-padding; - - &.no-bottom { - margin-bottom: 0; - } - - &.no-top { - margin-top: 0; - } -} - -.dropzone .dz-preview .dz-progress { - border-color: $border-color !important; -} - -.dropzone .dz-preview .dz-progress .dz-upload { - background: $gl-success !important; -} - -.space-right { - margin-right: 10px; -} - -.in-line { - display: inline-block; -} diff --git a/app/assets/stylesheets/generic/files.scss b/app/assets/stylesheets/generic/files.scss deleted file mode 100644 index 9dd77747884..00000000000 --- a/app/assets/stylesheets/generic/files.scss +++ /dev/null @@ -1,171 +0,0 @@ -/** - * File content holder - * - */ -.file-holder { - margin-left: -$gl-padding; - margin-right: -$gl-padding; - border: none; - border-top: 1px solid #E7E9EE; - border-bottom: 1px solid #E7E9EE; - margin-bottom: 1em; - - table { - @extend .table; - } - - .file-title { - position: relative; - background: $background-color; - border-bottom: 1px solid $border-color; - text-shadow: 0 1px 1px #fff; - margin: 0; - text-align: left; - padding: 10px 15px; - - .file-actions { - float: right; - position: absolute; - top: 5px; - right: 15px; - - .btn { - padding: 0px 10px; - font-size: 13px; - line-height: 28px; - } - } - - .left-options { - margin-top: -3px; - } - } - .file-content { - background: #fff; - - &.image_file { - background: #eee; - text-align: center; - img { - padding: 100px; - max-width: 50%; - } - } - - &.wiki { - padding: $gl-padding; - - .highlight { - margin-bottom: 9px; - - > pre { - margin: 0; - } - } - } - - &.blob_file { - - } - - &.blob-no-preview { - background: #eee; - text-shadow: 0 1px 2px #FFF; - padding: 100px 0; - } - - /** - * Blame file - */ - &.blame { - table { - border: none; - box-shadow: none; - margin: 0; - } - tr { - border-bottom: 1px solid #eee; - } - td { - &:first-child { - border-left: none; - } - &:last-child { - border-right: none; - } - background: #fff; - padding: 10px $gl-padding; - } - .lines { - pre { - padding: 0; - margin: 0; - background: none; - border: none; - } - } - img.avatar { - border: 0 none; - float: none; - margin: 0; - padding: 0; - } - td.blame-commit { - background: #f9f9f9; - min-width: 350px; - - .commit-author-link { - color: #888; - } - } - td.blame-numbers { - pre { - color: #AAA; - white-space: pre; - } - background: #f1f1f1; - border-left: 1px solid #DDD; - } - td.lines { - code { - font-family: $monospace_font; - } - } - } - - &.logs { - background: #eee; - max-height: 700px; - overflow-y: auto; - - ol { - margin-left: 40px; - padding: 10px 0; - border-left: 1px solid $border-color; - margin-bottom: 0; - background: white; - li { - color: #888; - p { - margin: 0; - color: #333; - line-height: 24px; - padding-left: 10px; - } - - &:hover { - background: $hover; - } - } - } - } - - /** - * Code file - */ - &.code { - padding: 0; - } - } -} - diff --git a/app/assets/stylesheets/generic/filters.scss b/app/assets/stylesheets/generic/filters.scss deleted file mode 100644 index 8e6922c9231..00000000000 --- a/app/assets/stylesheets/generic/filters.scss +++ /dev/null @@ -1,30 +0,0 @@ -.filter-item { - margin-right: 15px; -} - -@media (min-width: 800px) { - .issues-filters, - .issues_bulk_update { - select, .select2-container { - width: 120px !important; - display: inline-block; - } - } -} - -@media (min-width: 1200px) { - .issues-filters, - .issues_bulk_update { - select, .select2-container { - width: 150px !important; - display: inline-block; - } - } -} - -.issues-filters, -.issues_bulk_update { - .select2-container .select2-choice { - color: #444 !important; - } -} diff --git a/app/assets/stylesheets/generic/flash.scss b/app/assets/stylesheets/generic/flash.scss deleted file mode 100644 index 82eb50ad4be..00000000000 --- a/app/assets/stylesheets/generic/flash.scss +++ /dev/null @@ -1,17 +0,0 @@ -.flash-container { - cursor: pointer; - margin: 0; - font-size: 14px; - width: 100%; - z-index: 100; - - .flash-notice { - @extend .alert; - @extend .alert-info; - } - - .flash-alert { - @extend .alert; - @extend .alert-danger; - } -} diff --git a/app/assets/stylesheets/generic/forms.scss b/app/assets/stylesheets/generic/forms.scss deleted file mode 100644 index 0edfe24f195..00000000000 --- a/app/assets/stylesheets/generic/forms.scss +++ /dev/null @@ -1,94 +0,0 @@ -textarea { - resize: vertical; -} - -input[type='search'].search-text-input { - background-image: image-url("icon-search.png"); - background-repeat: no-repeat; - background-position: 10px; - padding-left: 25px; -} - -input[type='text'].danger { - background: #F2DEDE!important; - border-color: #D66; - text-shadow: 0 1px 1px #fff -} - -.datetime-controls { - select { - width: 100px; - } -} - -.form-actions { - padding: 17px 20px 18px; - margin-top: 18px; - margin-bottom: 18px; - background-color: $background-color; - border-top: 1px solid $border-color; -} - -label { - &.control-label { - @extend .col-sm-2; - } - - &.inline-label { - margin: 0; - } -} - -.inline-input-group { - width: 250px; -} - -.custom-form-control { - width: 150px; -} - -@media (min-width: $screen-sm-min) { - .custom-form-control { - width: 150px; - } -} - -/* Medium devices (desktops, 992px and up) */ -@media (min-width: $screen-md-min) { - .custom-form-control { - width: 170px; - } -} - -/* Large devices (large desktops, 1200px and up) */ -@media (min-width: $screen-lg-min) { - .custom-form-control { - width: 200px; - } -} - -.fieldset-form fieldset { - margin-bottom: 20px; -} - -.form-control { - @include box-shadow(none); -} - -.wiki-content { - margin-top: 35px; -} - -.form-group .control-label { - font-weight: normal; -} - -.form-control::-webkit-input-placeholder { - color: #7f8fa4; -} - -.input-group { - .input-group-addon { - background-color: #f7f8fa; - } -} diff --git a/app/assets/stylesheets/generic/gfm.scss b/app/assets/stylesheets/generic/gfm.scss deleted file mode 100644 index bd9200ace23..00000000000 --- a/app/assets/stylesheets/generic/gfm.scss +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Styles that apply to all GFM related forms. - */ -.issue-form, .merge-request-form, .wiki-form { - .description { - height: 16em; - border-top-left-radius: 0; - } -} - -.wiki-form { - .description { - height: 26em; - } -} - -.milestone-form { - .description { - height: 14em; - } -} - -.gfm-commit, .gfm-commit_range { - font-family: $monospace_font; -} diff --git a/app/assets/stylesheets/generic/header.scss b/app/assets/stylesheets/generic/header.scss deleted file mode 100644 index 91e6975e269..00000000000 --- a/app/assets/stylesheets/generic/header.scss +++ /dev/null @@ -1,169 +0,0 @@ -/* - * Application Header - * - */ -header { - transition-duration: .3s; - - &.navbar-empty { - background: #FFF; - border-bottom: 1px solid #EEE; - - .center-logo { - margin: 8px 0; - text-align: center; - - img { - height: 32px; - } - } - } - - &.navbar-gitlab { - padding: 0 20px; - z-index: 100; - margin-bottom: 0; - min-height: $header-height; - background-color: #fff; - border: none; - - .container-fluid { - width: 100% !important; - filter: none; - padding: 0; - - .nav > li > a { - color: #7f8fa4; - font-size: 18px; - padding: 0; - margin: ($header-height - 28) / 2 0; - margin-left: 10px; - height: 28px; - width: 28px; - line-height: 28px; - text-align: center; - - &:hover, &:focus, &:active { - background-color: #FFF; - } - } - - .navbar-toggle { - color: #666; - margin: 6px 0; - border-radius: 0; - position: absolute; - right: 2px; - - &:hover { - background-color: #EEE; - } - &.active { - color: #7f8fa4; - } - } - } - } - - .header-content { - height: $header-height; - - .title { - margin: 0; - overflow: hidden; - font-size: 19px; - line-height: $header-height; - font-weight: normal; - color: #4c4e54; - text-overflow: ellipsis; - vertical-align: top; - white-space: nowrap; - - a { - color: #4c4e54; - &:hover { - text-decoration: underline; - } - } - } - - .navbar-collapse { - float: right; - border-top: none; - } - } - - .search { - margin-right: 10px; - margin-left: 10px; - margin-top: ($header-height - 36) / 2; - - form { - margin: 0; - padding: 0; - } - - .search-input { - width: 220px; - background-image: image-url("icon-search.png"); - background-repeat: no-repeat; - background-position: 195px; - @include input-big; - - &:focus { - @include box-shadow(none); - outline: none; - border-color: #DDD; - background-color: #FFF; - } - } - } -} - -@mixin collapsed-header { - margin-left: $sidebar_collapsed_width; -} - -@media (max-width: $screen-md-max) { - .header-collapsed, .header-expanded { - @include collapsed-header; - } -} - -@media(min-width: $screen-md-max) { - .header-collapsed { - @include collapsed-header; - } - - .header-expanded { - margin-left: $sidebar_width; - } -} - -@media (max-width: $screen-xs-max) { - header .container-fluid { - font-size: 18px; - - .navbar-nav { - margin: 0px; - float: none !important; - - .visible-xs, .visable-sm { - display: table-cell !important; - } - } - - .navbar-collapse { - padding-left: 5px; - - li { - display: table-cell; - width: 1%; - - a { - margin-left: 8px !important; - } - } - } - } -} diff --git a/app/assets/stylesheets/generic/highlight.scss b/app/assets/stylesheets/generic/highlight.scss deleted file mode 100644 index 2e13ee842e0..00000000000 --- a/app/assets/stylesheets/generic/highlight.scss +++ /dev/null @@ -1,70 +0,0 @@ -.file-content.code { - border: none; - box-shadow: none; - margin: 0px; - padding: 0px; - table-layout: fixed; - - pre { - padding: 10px; - border: none; - border-radius: 0; - font-family: $monospace_font; - font-size: $code_font_size !important; - line-height: $code_line_height !important; - margin: 0; - overflow: auto; - overflow-y: hidden; - white-space: pre; - word-wrap: normal; - - code { - font-family: $monospace_font; - white-space: pre; - word-wrap: normal; - padding: 0; - - .line { - display: inline; - } - } - } - - .line-numbers { - padding: 10px; - text-align: right; - float: left; - - a { - font-family: $monospace_font; - display: block; - font-size: $code_font_size !important; - line-height: $code_line_height !important; - white-space: nowrap; - - i { - visibility: hidden; - @extend .pull-left; - } - - &:hover i { - visibility: visible; - } - } - } -} - -.note-text .code { - border: none; - box-shadow: none; - background: $background-color; - padding: 1em; - overflow-x: auto; - - code { - font-family: $monospace_font; - white-space: pre; - word-wrap: normal; - padding: 0; - } -} diff --git a/app/assets/stylesheets/generic/issue_box.scss b/app/assets/stylesheets/generic/issue_box.scss deleted file mode 100644 index 93377e45e70..00000000000 --- a/app/assets/stylesheets/generic/issue_box.scss +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Issue box for showing Open/Closed state: - * Used for Issue#show page, MergeRequest#show page etc - * - */ - -.issue-box { - @include border-radius(2px); - - display: inline-block; - padding: 10px $gl-padding; - font-weight: normal; - margin-right: 10px; - font-size: $gl-font-size; - - &.issue-box-closed { - background-color: $gl-danger; - color: #FFF; - } - - &.issue-box-merged { - background-color: $gl-primary; - color: #FFF; - } - - &.issue-box-open { - background-color: #019875; - color: #FFF; - } - - &.issue-box-expired { - background: #cea61b; - color: #FFF; - } -} diff --git a/app/assets/stylesheets/generic/jquery.scss b/app/assets/stylesheets/generic/jquery.scss deleted file mode 100644 index 871b808bad4..00000000000 --- a/app/assets/stylesheets/generic/jquery.scss +++ /dev/null @@ -1,55 +0,0 @@ -.ui-widget { - font-family: $regular_font; - font-size: $font-size-base; - - &.ui-datepicker-inline { - border: 1px solid #DDD; - padding: 10px; - width: 270px; - - .ui-datepicker-header { - background: #FFF; - border-color: #DDD; - } - - .ui-datepicker-calendar td a { - padding: 5px; - text-align: center; - } - } - - &.ui-autocomplete { - border-color: #DDD; - padding: 0; - margin-top: 2px; - z-index: 1001; - - .ui-menu-item a { - padding: 4px 10px; - } - } - - .ui-state-default { - border: 1px solid #FFF; - background: #FFF; - color: #777; - } - - .ui-state-highlight { - border: 1px solid #EEE; - background: #EEE; - } - - .ui-state-active { - border: 1px solid $gl-primary; - background: $gl-primary; - color: #FFF; - } - - .ui-state-hover, - .ui-state-focus { - border: 1px solid $hover; - background: $hover; - color: #333; - } -} diff --git a/app/assets/stylesheets/generic/lists.scss b/app/assets/stylesheets/generic/lists.scss deleted file mode 100644 index 3bfed8de772..00000000000 --- a/app/assets/stylesheets/generic/lists.scss +++ /dev/null @@ -1,125 +0,0 @@ -/** - * Well styled list - * - */ -.well-list { - margin: 0; - padding: 0; - list-style: none; - - li { - padding: 10px 15px; - min-height: 20px; - border-bottom: 1px solid #eee; - border-bottom: 1px solid rgba(0, 0, 0, 0.05); - - &:after { - content: " "; - display: table; - clear: both; - } - - &.disabled { - color: #888; - } - - &.unstyled { - &:hover { - background: none; - } - } - - &.warning-row { - background-color: #fcf8e3; - border-color: #faebcc; - color: #8a6d3b; - } - - &.smoke { background-color: $background-color; } - - &:hover { - background: $hover; - } - - &:last-child { - border-bottom: none; - - &.bottom { - background: $background-color; - } - } - - .list-item-name { - float: left; - position: relative; - top: 3px; - } - - p { - padding-top: 1px; - margin: 0; - color: $gray-dark; - img { - position: relative; - top: 3px; - } - } - - .well-title { - font-size: $list-font-size; - line-height: 18px; - } - } -} - -ol, ul { - &.styled { - li { - padding: 2px; - } - } -} - -/** light list with border-bottom between li **/ -ul.bordered-list { - @include basic-list; - - &.top-list { - li:first-child { - padding-top: 0; - - h4, h5 { - margin-top: 0; - } - } - } -} - -li.task-list-item { - list-style-type: none; -} - -ul.content-list { - @include basic-list; - - margin: 0; - padding: 0; - - > li { - padding: $gl-padding; - border-color: #f1f2f4; - margin-left: -$gl-padding; - margin-right: -$gl-padding; - color: $gl-gray; - - .avatar { - margin-right: 15px; - } - - .controls { - padding-top: 10px; - float: right; - } - } -} - diff --git a/app/assets/stylesheets/generic/markdown_area.scss b/app/assets/stylesheets/generic/markdown_area.scss deleted file mode 100644 index ed0333d2336..00000000000 --- a/app/assets/stylesheets/generic/markdown_area.scss +++ /dev/null @@ -1,115 +0,0 @@ -.div-dropzone-wrapper { - .div-dropzone { - position: relative; - padding: 0; - border: 0; - margin-bottom: 5px; - - .div-dropzone-focus { - border-color: #66afe9 !important; - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6) !important; - outline: 0 !important; - } - - .div-dropzone-hover { - position: absolute; - top: 50%; - left: 50%; - margin-top: -0.5em; - margin-left: -0.6em; - opacity: 0; - font-size: 50px; - transition: opacity 200ms ease-in-out; - pointer-events: none; - } - - .div-dropzone-spinner { - position: absolute; - top: 100%; - left: 100%; - margin-top: -1.1em; - margin-left: -1.1em; - opacity: 0; - font-size: 30px; - transition: opacity 200ms ease-in-out; - } - - .div-dropzone-icon { - display: block; - text-align: center; - font-size: inherit; - } - - .div-dropzone-progress { - position: absolute; - top: 7px; - left: -40px; - width: 35px; - font-size: 13px; - text-align: right; - } - - .dz-preview { - display: none; - } - } -} - -.div-dropzone-alert { - margin-top: 5px; - margin-bottom: 0; - transition: opacity 200ms ease-in-out; -} - -.md-area { - position: relative; -} - -.md-header { - ul { - float: left; - margin-bottom: 1px; - } -} - -.referenced-users { - padding: 10px 0; - color: #999; - margin-left: 10px; - margin-top: 1px; - margin-right: 130px; -} - -.md-preview-holder { - background: #FFF; - border: 1px solid #ddd; - min-height: 169px; - padding: 5px; - box-shadow: none; -} - -.new_note, -.edit_note, -.issuable-description, -.milestone-description, -.wiki-content, -.merge-request-form { - .nav-tabs { - margin-bottom: 0; - border: none; - - li a, - li.active a { - border: 1px solid #DDD; - } - } -} - -.markdown-area { - background: #FFF; - border: 1px solid #ddd; - min-height: 140px; - padding: 5px; - box-shadow: none; - width: 100%; -} diff --git a/app/assets/stylesheets/generic/mobile.scss b/app/assets/stylesheets/generic/mobile.scss deleted file mode 100644 index 36ae126f865..00000000000 --- a/app/assets/stylesheets/generic/mobile.scss +++ /dev/null @@ -1,139 +0,0 @@ -/** Common mobile (screen XS, SM) styles **/ -@media (max-width: $screen-xs-max) { - .container .content { - margin-top: 20px; - } - - .container-fluid { - padding-left: 5px; - padding-right: 5px; - } - - .nav.nav-tabs > li > a { - padding: 10px; - font-size: 12px; - margin-right: 3px; - - .badge { - display: none; - } - } - - .referenced-users { - margin-right: 0; - } - - .issues-filters, - .dash-projects-filters, - .check-all-holder { - display: none; - } - - .rss-btn { - display: none !important; - } - - .project-home-links { - display: none; - } - - .project-avatar { - display: none; - } - - .project-home-panel { - padding-left: 0 !important; - - .project-avatar { - display: block; - } - - .project-home-desc { - font-size: 21px; - } - - .project-repo-buttons, - .git-clone-holder { - display: none; - } - } - - .project-stats { - display: none; - } - - .container .title { - padding-left: 15px !important; - } - - .issue-info, .merge-request-info { - display: none; - } - - .issue-details { - .creator, - .page-title .btn-close { - display: none; - } - } - - %ul.notes .note-role, .note-actions { - display: none; - } - - .center-top-menu { - height: 45px; - - li a { - font-size: 14px; - padding: 19px 10px; - } - } - - .projects-search-form { - margin: 0 -5px !important; - - .btn { - display: none; - } - } -} - -@media (max-width: $screen-sm-max) { - .issues-filters { - .milestone-filter, .labels-filter { - display: none; - } - } - - .page-title { - .note_created_ago, .new-issue-link { - display: none; - } - } - - .issue_edited_ago, .note_edited_ago { - display: none; - } - - aside { - display: none; - } - - .show-aside { - display: block !important; - } -} - -.show-aside { - display: none; - position: fixed; - right: 0px; - top: 30%; - padding: 5px 15px; - background: #EEE; - font-size: 20px; - color: #777; - z-index: 100; - @include box-shadow(0 1px 2px #DDD); -} diff --git a/app/assets/stylesheets/generic/pagination.scss b/app/assets/stylesheets/generic/pagination.scss deleted file mode 100644 index 6677f94dafd..00000000000 --- a/app/assets/stylesheets/generic/pagination.scss +++ /dev/null @@ -1,34 +0,0 @@ -.gl-pagination { - border-top: 1px solid $border-color; - background-color: $background-color; - margin: -$gl-padding; - margin-top: 0; - - .pagination { - padding: 0; - margin: 0; - display: block; - - li.first, - li.last, - li.next, - li.prev { - > a { - color: $link-color; - - &:hover { - color: #fff; - } - } - } - - li > a, - li > span { - border: none; - margin: 0; - @include border-radius(0 !important); - padding: 13px 19px; - border-right: 1px solid $border-color; - } - } -} diff --git a/app/assets/stylesheets/generic/selects.scss b/app/assets/stylesheets/generic/selects.scss deleted file mode 100644 index cba621635b6..00000000000 --- a/app/assets/stylesheets/generic/selects.scss +++ /dev/null @@ -1,146 +0,0 @@ -/** Select2 selectbox style override **/ -.select2-container, .select2-container.select2-drop-above { - .select2-choice { - background: #FFF; - border-color: #DDD; - height: 42px; - padding: 8px $gl-padding; - font-size: $gl-font-size; - line-height: 1.42857143; - - @include border-radius(2px); - - .select2-arrow { - background: #FFF; - border-left: none; - padding-top: 5px; - } - } -} - -.select2-container .select2-choice, .select2-container.select2-drop-above .select2-choice{ - color: #7f8fa4; - border: 1px solid #e7e9ed; -} - -.select2-drop { - @include box-shadow(rgba(76, 86, 103, 0.247059) 0px 0px 1px 0px, rgba(31, 37, 50, 0.317647) 0px 2px 18px 0px); - @include border-radius (0px); - - padding: 16px; - border: none !important; -} - -.select2-results .select2-result-label { - padding: 16px; -} - -.select2-drop{ - color: #7f8fa4; -} - -.select2-highlighted { - background: #3084bb !important; -} - -.select2-results li.select2-result-with-children > .select2-result-label { - font-weight: 600; - color: #313236; -} - - -.select2-container-multi .select2-choices { - @include border-radius(2px); - border-color: #CCC; -} - -.select2-container-multi .select2-choices .select2-search-field input { - padding: 8px 14px; - font-size: 13px; - line-height: 18px; - height: auto; -} - -.select2-drop-active { - border: 1px solid #BBB !important; - margin-top: 4px; - font-size: 13px; - - &.select2-drop-above { - margin-bottom: 8px; - } - - .select2-search input { - background: #fafafa; - border-color: #DDD; - } - - .select2-results { - max-height: 350px; - .select2-highlighted { - background: $gl-primary; - } - } -} - -.select2-container { - width: 100% !important; -} - -/** Branch/tag selector **/ -.project-refs-form .select2-container { - width: 160px !important; -} - -.ajax-users-dropdown, .ajax-project-users-dropdown { - .select2-search { - padding-top: 2px; - } -} - -.ajax-users-select { - width: 400px; - - &.input-large { - width: 210px; - } - - &.input-clamp { - max-width: 100%; - } -} - -.group-result { - .group-image { - float: left; - } - .group-name { - font-weight: bold; - } - .group-path { - color: #999; - } -} - -.user-result { - .user-image { - float: left; - } - .user-name { - } -} - -.namespace-result { - .namespace-kind { - color: #AAA; - font-weight: normal; - } - .namespace-path { - margin-left: 10px; - font-weight: bolder; - } -} - -.ajax-users-dropdown { - min-width: 250px !important; -} diff --git a/app/assets/stylesheets/generic/sidebar.scss b/app/assets/stylesheets/generic/sidebar.scss deleted file mode 100644 index c5ea3aca7ca..00000000000 --- a/app/assets/stylesheets/generic/sidebar.scss +++ /dev/null @@ -1,267 +0,0 @@ -.page-with-sidebar { - .sidebar-wrapper { - position: fixed; - top: 0; - bottom: 0; - overflow-y: auto; - overflow-x: hidden; - left: 0; - height: 100%; - transition-duration: .3s; - } -} - -.sidebar-wrapper { - z-index: 99; - background: $background-color; - transition-duration: .3s; -} - -.content-wrapper { - min-height: 100vh; - width: 100%; - padding: 20px; - background: #EAEBEC; - - .container-fluid { - background: #FFF; - padding: $gl-padding; - min-height: 90vh; - - &.container-blank { - background: none; - padding: 0; - border: none; - } - } -} - -.nav-sidebar { - margin-top: 14 + $header-height; - margin-bottom: 100px; - transition-duration: .3s; - list-style: none; - overflow: hidden; - - &.navbar-collapse { - padding: 0px !important; - } - - li { - width: $sidebar_width; - - &.separate-item { - padding-top: 10px; - margin-top: 10px; - } - - a { - padding: 7px 15px; - font-size: $gl-font-size; - line-height: 24px; - color: $gray; - display: block; - text-decoration: none; - padding-left: 22px; - font-weight: normal; - - &:hover { - text-decoration: none; - } - - &:active, &:focus { - text-decoration: none; - } - - i { - width: 16px; - color: $gray-light; - margin-right: 13px; - } - - .count { - float: right; - background: #eee; - padding: 0px 8px; - @include border-radius(6px); - } - } - } -} - -.sidebar-subnav { - margin-left: 0px; - padding-left: 0px; - - li { - list-style: none; - } -} - -@mixin expanded-sidebar { - padding-left: $sidebar_width; - transition-duration: .3s; - - .sidebar-wrapper { - width: $sidebar_width; - - .nav-sidebar { - width: $sidebar_width; - } - - .nav-sidebar li a{ - width: 230px; - - &.back-link { - i { - visibility: hidden; - } - } - } - } -} - -@mixin folded-sidebar { - padding-left: 60px; - transition-duration: .3s; - - .sidebar-wrapper { - width: $sidebar_collapsed_width; - - .header-logo { - width: $sidebar_collapsed_width; - - a { - padding-left: 12px; - - .gitlab-text-container { - display: none; - } - } - } - - .nav-sidebar { - width: $sidebar_collapsed_width; - - li a { - span { - display: none; - } - } - } - - .collapse-nav a { - width: $sidebar_collapsed_width; - } - - .sidebar-user { - padding-left: 12px; - width: $sidebar_collapsed_width; - - .username { - display: none; - } - } - } -} - -.collapse-nav a { - width: $sidebar_width; - position: fixed; - bottom: 0; - left: 0; - font-size: 13px; - background: transparent; - height: 40px; - text-align: center; - line-height: 40px; - transition-duration: .3s; -} - -.collapse-nav a:hover { - text-decoration: none; - background: #f2f6f7; -} - -@media (max-width: $screen-md-max) { - .page-sidebar-collapsed { - @include folded-sidebar; - } - - .page-sidebar-expanded { - @include folded-sidebar; - } - - .collapse-nav { - display: none; - } -} - -@media(min-width: $screen-md-max) { - .page-sidebar-collapsed { - @include folded-sidebar; - } - - .page-sidebar-expanded { - @include expanded-sidebar; - } -} - -.sidebar-user { - padding: 9px 22px; - position: fixed; - bottom: 40px; - width: $sidebar_width; - overflow: hidden; - transition-duration: .3s; - - .username { - margin-left: 10px; - width: $sidebar_width - 2 * 10px; - font-size: 16px; - line-height: 34px; - } -} - -.sidebar-wrapper { - .header-logo { - border-bottom: 1px solid transparent; - float: left; - height: $header-height; - width: $sidebar_width; - overflow: hidden; - transition-duration: .3s; - - a { - float: left; - height: $header-height; - width: 100%; - padding: 10px 22px; - overflow: hidden; - - img { - width: 36px; - height: 36px; - float: left; - } - - .gitlab-text-container { - width: 230px; - - h3 { - width: 158px; - float: left; - margin: 0; - margin-left: 14px; - font-size: 19px; - line-height: 41px; - font-weight: normal; - } - } - } - - &:hover { - background-color: #EEE; - } - } -} diff --git a/app/assets/stylesheets/generic/tables.scss b/app/assets/stylesheets/generic/tables.scss deleted file mode 100644 index a66e45577de..00000000000 --- a/app/assets/stylesheets/generic/tables.scss +++ /dev/null @@ -1,20 +0,0 @@ -table { - &.table { - tr { - td, th { - padding: 8px 10px; - line-height: 20px; - vertical-align: middle; - } - th { - font-weight: normal; - font-size: 15px; - border-bottom: 1px solid $border-color !important; - } - td { - border-color: #F1F1F1 !important; - border-bottom: 1px solid; - } - } - } -} diff --git a/app/assets/stylesheets/generic/timeline.scss b/app/assets/stylesheets/generic/timeline.scss deleted file mode 100644 index bf21d7fce76..00000000000 --- a/app/assets/stylesheets/generic/timeline.scss +++ /dev/null @@ -1,70 +0,0 @@ -.timeline { - @include basic-list; - - margin: 0; - padding: 0; - - .timeline-entry { - padding: $gl-padding; - border-color: #f1f2f4; - margin-left: -$gl-padding; - margin-right: -$gl-padding; - color: $gl-gray; - border-bottom: 1px solid #ECEEF1; - border-right: 1px solid #ECEEF1; - - &:last-child { - border-bottom: none; - } - - .avatar { - margin-right: 15px; - } - - .controls { - padding-top: 10px; - float: right; - } - } - - .note-text { - p:last-child { - margin-bottom: 0; - } - } - - .system-note { - .note-text { - color: $gl-gray !important; - } - } - - .diff-file { - border: 1px solid $border-color; - border-bottom: none; - margin-left: 0; - margin-right: 0; - } -} - -@media (max-width: $screen-xs-max) { - .timeline { - &:before { - background: none; - } - .timeline-entry .timeline-entry-inner { - .timeline-icon { - display: none; - } - - .timeline-content { - margin-left: 0; - } - } - } -} - -.discussion .timeline-entry { - margin: 0; - border-right: none; -} diff --git a/app/assets/stylesheets/generic/typography.scss b/app/assets/stylesheets/generic/typography.scss deleted file mode 100644 index 6a3cb49baae..00000000000 --- a/app/assets/stylesheets/generic/typography.scss +++ /dev/null @@ -1,130 +0,0 @@ -/** - * Headers - * - */ -body { - text-rendering:optimizeLegibility; - -webkit-text-shadow: rgba(255,255,255,0.01) 0 0 1px; -} - -.page-title { - margin-top: 0px; - line-height: 1.3; - font-size: 1.25em; - font-weight: 600; -} - -.page-title-empty { - margin-top: 0px; - line-height: 1.3; - font-size: 1.25em; - font-weight: 600; - margin: 12px 7px 12px 7px; -} - -h1, h2, h3, h4, h5, h6 { - color: $gl-header-color; - font-weight: 500; -} - -/** CODE **/ -pre { - font-family: $monospace_font; - - &.dark { - background: #333; - color: $background-color; - } - - &.plain-readme { - background: none; - border: none; - padding: 0; - margin: 0; - font-size: 14px; - } -} - -.monospace { - font-family: $monospace_font; -} - -code { - &.key-fingerprint { - background: $body-bg; - color: $text-color; - } -} - -a > code { - color: $link-color; -} - -/** - * Wiki typography - * - */ -.wiki { - @include md-typography; - - word-wrap: break-word; - padding: 7px; - - /* Link to current header. */ - h1, h2, h3, h4, h5, h6 { - position: relative; - - a.anchor { - // Setting `display: none` would prevent the anchor being scrolled to, so - // instead we set the height to 0 and it gets updated on hover. - height: 0; - } - - &:hover > a.anchor { - $size: 16px; - position: absolute; - right: 100%; - top: 50%; - margin-top: -$size/2; - margin-right: 0px; - padding-right: 20px; - display: inline-block; - width: $size; - height: $size; - background-image: image-url("icon-link.png"); - background-size: contain; - background-repeat: no-repeat; - } - } - - ul,ol { - padding: 0; - margin: 6px 0 6px 18px !important; - } - ol { - color: #5c5d5e; - } -} - -.md-area { - @include md-typography; -} - -.md { - @include md-typography; -} - -/** - * Textareas intended for GFM - * - */ -textarea.js-gfm-input { - font-family: $monospace_font; -} - -.md-preview { -} - -.strikethrough { - text-decoration: line-through; -} \ No newline at end of file diff --git a/app/assets/stylesheets/generic/zen.scss b/app/assets/stylesheets/generic/zen.scss deleted file mode 100644 index 32e2c020e06..00000000000 --- a/app/assets/stylesheets/generic/zen.scss +++ /dev/null @@ -1,86 +0,0 @@ -.zennable { - .zen-toggle-comment { - display: none; - } - - .zen-enter-link { - color: $gl-gray; - position: absolute; - top: 0px; - right: 4px; - line-height: 40px; - } - - .zen-leave-link { - display: none; - color: $gl-text-color; - position: absolute; - top: 10px; - right: 10px; - padding: 5px; - font-size: 36px; - - &:hover { - color: #111; - } - } - - // Hide the Enter link when we're in Zen mode - input:checked ~ .zen-backdrop .zen-enter-link { - display: none; - } - - // Show the Leave link when we're in Zen mode - input:checked ~ .zen-backdrop .zen-leave-link { - display: block; - position: absolute; - top: 0; - } - - input:checked ~ .zen-backdrop { - background-color: white; - position: fixed; - top: 0; - bottom: 0; - left: 0; - right: 0; - z-index: 1031; - - textarea { - border: none; - box-shadow: none; - border-radius: 0; - color: #000; - font-size: 20px; - line-height: 26px; - padding: 30px; - display: block; - outline: none; - resize: none; - height: 100vh; - max-width: 900px; - margin: 0 auto; - } - } - - // Make the color of the placeholder text in the Zenned-out textarea darker, - // so it becomes visible - - input:checked ~ .zen-backdrop textarea::-webkit-input-placeholder { - color: #A8A8A8; - } - - input:checked ~ .zen-backdrop textarea:-moz-placeholder { - color: #A8A8A8; - opacity: 1; - } - - input:checked ~ .zen-backdrop textarea::-moz-placeholder { - color: #A8A8A8; - opacity: 1; - } - - input:checked ~ .zen-backdrop textarea:-ms-input-placeholder { - color: #A8A8A8; - } -} diff --git a/app/assets/stylesheets/themes/gitlab-theme.scss b/app/assets/stylesheets/themes/gitlab-theme.scss deleted file mode 100644 index 8d9a0aae568..00000000000 --- a/app/assets/stylesheets/themes/gitlab-theme.scss +++ /dev/null @@ -1,120 +0,0 @@ -/** - * Styles the GitLab application with a specific color theme - * - * $color-light - - * $color - - * $color-darker - - * $color-dark - - */ -@mixin gitlab-theme($color-light, $color, $color-darker, $color-dark) { - .page-with-sidebar { - .header-logo { - background-color: $color; - border-color: $color; - - a { - color: $color-light; - - h3 { - color: $color-light; - } - } - - &:hover { - background-color: $color-darker; - a { - color: #FFF; - } - } - } - - .collapse-nav a { - color: #FFF; - background: $color; - } - - .sidebar-wrapper { - background: $color-darker; - - .sidebar-user { - background: $color-darker; - color: $color-light; - - &:hover { - background-color: $color-dark; - color: #FFF; - text-decoration: none; - } - } - } - - .nav-sidebar li { - a { - color: $color-light; - - &:hover, &:focus, &:active { - background: $color-dark; - } - - i { - color: $color-light; - } - - .count { - color: $color-light; - background: $color-dark; - } - } - - &.separate-item { - border-top: 1px solid $color; - } - - &.active a { - color: #FFF; - background: $color-dark; - - &.no-highlight { - border: none; - } - - i { - color: #FFF - } - } - } - } -} - -$theme-blue: #2980B9; -$theme-charcoal: #333c47; -$theme-graphite: #888888; -$theme-gray: #373737; -$theme-green: #019875; -$theme-violet: #554488; - -body { - &.ui_blue { - @include gitlab-theme(#BECDE9, $theme-blue, #1970A9, #096099); - } - - &.ui_charcoal { - @include gitlab-theme(#c5d0de, $theme-charcoal, #2b333d, #24272D); - } - - &.ui_graphite { - @include gitlab-theme(#CCCCCC, $theme-graphite, #777777, #666666); - } - - &.ui_gray { - @include gitlab-theme(#979797, $theme-gray, #272727, #222222); - } - - &.ui_green { - @include gitlab-theme(#AADDCC, $theme-green, #018865, #017855); - } - - &.ui_violet { - @include gitlab-theme(#9988CC, $theme-violet, #443366, #332255); - } -} -- cgit v1.2.1 From c42d35b7214348e5c31014b3d3d54e59f6030ddc Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 12 Oct 2015 15:08:33 +0200 Subject: Add css welcome notice Signed-off-by: Dmitriy Zaporozhets --- app/assets/stylesheets/application.scss | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'app') diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 233e01cc06b..65f775ca3f3 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -11,33 +11,41 @@ *= require cal-heatmap */ -/** +/* + * Welcome to GitLab css! + * If you need to add or modify UI component that is commont for many pages + * like table or typography then make changes in framework/ directory. + * If you need to add uniq style that should affect only one page - use pages/ + * directory. + */ + +/* * GitLab UI framework */ @import "framework"; -/** +/* * NProgress load bar css */ @import 'nprogress'; @import 'nprogress-bootstrap'; -/** +/* * Font icons */ @import "font-awesome"; -/** +/* * Page specific styles (issues, projects etc): */ @import "pages/**/*"; -/** +/* * Code highlight */ @import "highlight/**/*"; -/** +/* * Styles for JS behaviors. */ @import "behaviors.scss"; -- cgit v1.2.1 From 7a0cc665ff5ad3969f36082baa162a2169c34612 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Mon, 12 Oct 2015 15:34:08 +0200 Subject: Remove useless assignment --- app/models/concerns/participable.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/models/concerns/participable.rb b/app/models/concerns/participable.rb index 22182445978..ffc874357fd 100644 --- a/app/models/concerns/participable.rb +++ b/app/models/concerns/participable.rb @@ -38,7 +38,7 @@ module Participable # Be aware that this method makes a lot of sql queries. # Save result into variable if you are going to reuse it inside same request def participants(current_user = self.author) - participants = self.class.participant_attrs.flat_map do |attr| + self.class.participant_attrs.flat_map do |attr| meth = method(attr) value = -- cgit v1.2.1 From 69c04498ef0a49186a667fd44383b9b43690a91e Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Mon, 12 Oct 2015 15:45:46 +0200 Subject: Small bug fixes --- app/models/ci/build.rb | 16 +++++++++++---- app/models/commit_status.rb | 23 +++++++++++++++------- .../commit_statuses/_commit_status.html.haml | 16 +++++++-------- 3 files changed, 36 insertions(+), 19 deletions(-) (limited to 'app') diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index 41ce522b2ff..cb6a1015210 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -212,15 +212,23 @@ module Ci "#{dir_to_trace}/#{id}.log" end - def description - name - end - def target_url Gitlab::Application.routes.url_helpers. namespace_project_build_url(gl_project.namespace, gl_project, self) end + def cancel_url + if active? + cancel_namespace_project_build_path(gl_project.namespace, gl_project, self, return_to: request.original_url) + end + end + + def retry_url + if commands.present? + cancel_namespace_project_build_path(gl_project.namespace, gl_project, self, return_to: request.original_url) + end + end + private def yaml_variables diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb index a4896a76316..b6234c896e3 100644 --- a/app/models/commit_status.rb +++ b/app/models/commit_status.rb @@ -11,14 +11,14 @@ class CommitStatus < ActiveRecord::Base alias_attribute :author, :user - scope :running, ->() { where(status: 'running') } - scope :pending, ->() { where(status: 'pending') } - scope :success, ->() { where(status: 'success') } - scope :failed, ->() { where(status: 'failed') } - scope :running_or_pending, ->() { where(status:[:running, :pending]) } - scope :latest, ->() { where(id: unscope(:select).select('max(id)').group(:name, :ref)).order(stage_idx: :asc) } + scope :running, -> { where(status: 'running') } + scope :pending, -> { where(status: 'pending') } + scope :success, -> { where(status: 'success') } + scope :failed, -> { where(status: 'failed') } + scope :running_or_pending, -> { where(status:[:running, :pending]) } + scope :latest, -> { where(id: unscope(:select).select('max(id)').group(:name, :ref)).order(stage_idx: :asc) } scope :for_ref, ->(ref) { where(ref: [ref, nil]) } - scope :running_or_pending, ->() { where(status: [:running, :pending]) } + scope :running_or_pending, -> { where(status: [:running, :pending]) } state_machine :status, initial: :pending do event :run do @@ -55,6 +55,7 @@ class CommitStatus < ActiveRecord::Base delegate :sha, :short_sha, :gl_project, to: :commit, prefix: false + # TODO: this should be removed with all references def before_sha Gitlab::Git::BLANK_SHA end @@ -78,4 +79,12 @@ class CommitStatus < ActiveRecord::Base Time.now - started_at end end + + def cancel_url + nil + end + + def retry_url + nil + end end diff --git a/app/views/projects/commit_statuses/_commit_status.html.haml b/app/views/projects/commit_statuses/_commit_status.html.haml index f79929c70bf..14b814bb0d6 100644 --- a/app/views/projects/commit_statuses/_commit_status.html.haml +++ b/app/views/projects/commit_statuses/_commit_status.html.haml @@ -9,7 +9,7 @@ - else %strong Build ##{commit_status.id} - - if defined?(ref) + - if defined?(ref) && ref %td = commit_status.ref @@ -17,7 +17,7 @@ = commit_status.stage %td - = commit_status.description + = commit_status.name .pull-right - if commit_status.tags.any? - commit_status.tags.each do |tag| @@ -36,17 +36,17 @@ - if commit_status.finished_at %span #{time_ago_in_words commit_status.finished_at} ago - - if defined?(coverage) + - if defined?(coverage) && coverage %td.coverage - if commit_status.try(:coverage) #{commit_status.coverage}% %td - - if defined?(controls) && current_user && can?(current_user, :manage_builds, gl_project) + - if defined?(controls) && controls && current_user && can?(current_user, :manage_builds, gl_project) .pull-right - - if commit_status.active? - = link_to cancel_namespace_project_build_path(gl_project.namespace, gl_project, commit_status, return_to: request.original_url), title: 'Cancel commit_status' do + - if commit_status.cancel_url + = link_to commit_status.cancel_url, title: 'Cancel' do %i.fa.fa-remove.cred - - elsif commit_status.commands.present? - = link_to retry_namespace_project_build_path(gl_project.namespace, gl_project, commit_status, return_to: request.original_url), method: :post, title: 'Retry commit_status' do + - elsif commit_status.retry_url + = link_to commit_status.retry_url, method: :post, title: 'Retry' do %i.fa.fa-repeat -- cgit v1.2.1 From 789fe7b4899fb97c48ad363c5ecb1969d78d1536 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Mon, 12 Oct 2015 16:32:58 +0200 Subject: Update rendering --- app/models/ci/commit.rb | 66 +++++++++++---------- app/models/commit_status.rb | 5 +- app/views/projects/builds/show.html.haml | 6 +- app/views/projects/commit/ci.html.haml | 67 ++++++++-------------- .../commit_statuses/_commit_status.html.haml | 5 +- 5 files changed, 63 insertions(+), 86 deletions(-) (limited to 'app') diff --git a/app/models/ci/commit.rb b/app/models/ci/commit.rb index 623ff619c49..201b6f62b86 100644 --- a/app/models/ci/commit.rb +++ b/app/models/ci/commit.rb @@ -106,50 +106,47 @@ module Ci end def refs - statuses.pluck(:ref).compact.uniq + statuses.order(:ref).pluck(:ref).uniq end - def statuses_for_ref(ref = nil) - if ref - statuses.for_ref(ref) - else - statuses - end + def latest_statuses + @latest_statuses ||= statuses.latest.to_a end - def builds_without_retry(ref = nil) - if ref - builds.for_ref(ref).latest - else - builds.latest - end + def builds_without_retry + @builds_without_retry ||= builds.latest.to_a + end + + def builds_without_retry_for_ref(ref) + builds_without_retry.select { |build| build.ref == ref } end def retried @retried ||= (statuses.order(id: :desc) - statuses.latest) end - def status(ref = nil) + def status if yaml_errors.present? return 'failed' end - latest_statuses = statuses.latest.to_a - latest_statuses.reject! { |status| status.try(&:allow_failure?) } - latest_statuses.select! { |status| status.ref.nil? || status.ref == ref } if ref - - if latest_statuses.none? - return 'skipped' - elsif latest_statuses.all?(&:success?) - 'success' - elsif latest_statuses.all?(&:pending?) - 'pending' - elsif latest_statuses.any?(&:running?) || latest_statuses.any?(&:pending?) - 'running' - elsif latest_statuses.all?(&:canceled?) - 'canceled' - else - 'failed' + @status ||= begin + latest = latest_statuses + latest.reject! { |status| status.try(&:allow_failure?) } + + if latest.none? + 'skipped' + elsif latest.all?(&:success?) + 'success' + elsif latest.all?(&:pending?) + 'pending' + elsif latest.any?(&:running?) || latest.any?(&:pending?) + 'running' + elsif latest.all?(&:canceled?) + 'canceled' + else + 'failed' + end end end @@ -173,8 +170,9 @@ module Ci status == 'canceled' end - def duration(ref = nil) - statuses_for_ref(ref).latest.select(&:duration).sum(&:duration).to_i + def duration + duration_array = latest_statuses.map(&:duration).compact + duration_array.reduce(:+).to_i end def finished_at @@ -190,8 +188,8 @@ module Ci end end - def matrix?(ref) - builds_without_retry(ref).pluck(:id).size > 1 + def matrix_for_ref?(ref) + builds_without_retry_for_ref(ref).size > 1 end def config_processor diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb index b6234c896e3..b4d91b1b0c3 100644 --- a/app/models/commit_status.rb +++ b/app/models/commit_status.rb @@ -16,8 +16,9 @@ class CommitStatus < ActiveRecord::Base scope :success, -> { where(status: 'success') } scope :failed, -> { where(status: 'failed') } scope :running_or_pending, -> { where(status:[:running, :pending]) } - scope :latest, -> { where(id: unscope(:select).select('max(id)').group(:name, :ref)).order(stage_idx: :asc) } - scope :for_ref, ->(ref) { where(ref: [ref, nil]) } + scope :latest, -> { where(id: unscope(:select).select('max(id)').group(:name, :ref)) } + scope :ordered, -> { order(:ref, :stage_idx, :name) } + scope :for_ref, ->(ref) { where(ref: ref) } scope :running_or_pending, -> { where(status: [:running, :pending]) } state_machine :status, initial: :pending do diff --git a/app/views/projects/builds/show.html.haml b/app/views/projects/builds/show.html.haml index 66e668f3771..b561078e8c7 100644 --- a/app/views/projects/builds/show.html.haml +++ b/app/views/projects/builds/show.html.haml @@ -7,9 +7,9 @@ %code #{@build.ref} #up-build-trace - - if @commit.matrix?(@build.ref) + - if @commit.matrix_for_ref?(@build.ref) %ul.center-top-menu.build-top-menu - - @commit.builds_without_retry(@build.ref).each do |build| + - @commit.builds_without_retry_for_ref(@build.ref).each do |build| %li{class: ('active' if build == @build) } = link_to namespace_project_build_path(@project.namespace, @project, build) do = ci_icon_for_status(build.status) @@ -20,7 +20,7 @@ = build.id - - unless @commit.builds_without_retry(@build.ref).include?(@build) + - unless @commit.builds_without_retry_for_ref(@build.ref).include?(@build) %li.active %a Build ##{@build.id} diff --git a/app/views/projects/commit/ci.html.haml b/app/views/projects/commit/ci.html.haml index 7f106631cac..585f012fe04 100644 --- a/app/views/projects/commit/ci.html.haml +++ b/app/views/projects/commit/ci.html.haml @@ -20,49 +20,28 @@ .bs-callout.bs-callout-warning \.gitlab-ci.yml not found in this commit -- if @ci_commit.refs.blank? - .gray-content-block.second-block - Latest builds - - if @ci_commit.duration > 0 - %small.pull-right - %i.fa.fa-time - #{time_interval_in_words @ci_commit.duration} - - %table.table.builds - %thead - %tr - %th Status - %th Build ID - %th Stage - %th Name - %th Duration - %th Finished at - - if @ci_project && @ci_project.coverage_enabled? - %th Coverage - %th - = render partial: "projects/commit_statuses/commit_status", collection: @ci_commit.statuses.latest, coverage: @ci_project.try(:coverage_enabled?), controls: true - -- @ci_commit.refs.sort.each do |ref| - .gray-content-block.second-block - Builds for #{ref} - - if @ci_commit.duration(ref) > 0 - %small.pull-right - %i.fa.fa-time - #{time_interval_in_words @ci_commit.duration(ref)} - - %table.table.builds - %thead - %tr - %th Status - %th Build ID - %th Stage - %th Name - %th Duration - %th Finished at - - if @ci_project && @ci_project.coverage_enabled? - %th Coverage - %th - = render partial: "projects/commit_statuses/commit_status", collection: @ci_commit.statuses.for_ref(ref).latest, coverage: @ci_project.try(:coverage_enabled?), controls: true +.gray-content-block.second-block + Latest + - if @ci_commit.duration > 0 + %small.pull-right + %i.fa.fa-time + #{time_interval_in_words @ci_commit.duration} + +%table.table.builds + %thead + %tr + %th Status + %th Build ID + %th Ref + %th Stage + %th Name + %th Duration + %th Finished at + - if @ci_project && @ci_project.coverage_enabled? + %th Coverage + %th + - @ci_commit.refs.each do |ref| + = render partial: "projects/commit_statuses/commit_status", collection: @ci_commit.statuses.for_ref(ref).latest.ordered, coverage: @ci_project.try(:coverage_enabled?), controls: true - if @ci_commit.retried.any? .gray-content-block.second-block @@ -81,4 +60,4 @@ - if @ci_project && @ci_project.coverage_enabled? %th Coverage %th - = render partial: "projects/commit_statuses/commit_status", collection: @ci_commit.retried, coverage: @ci_project.try(:coverage_enabled?), ref: true + = render partial: "projects/commit_statuses/commit_status", collection: @ci_commit.retried, coverage: @ci_project.try(:coverage_enabled?) diff --git a/app/views/projects/commit_statuses/_commit_status.html.haml b/app/views/projects/commit_statuses/_commit_status.html.haml index 14b814bb0d6..e3a17faf0bd 100644 --- a/app/views/projects/commit_statuses/_commit_status.html.haml +++ b/app/views/projects/commit_statuses/_commit_status.html.haml @@ -9,9 +9,8 @@ - else %strong Build ##{commit_status.id} - - if defined?(ref) && ref - %td - = commit_status.ref + %td + = commit_status.ref %td = commit_status.stage -- cgit v1.2.1 From 2e9c1608e56a20b93608ddcd569c6a45d3a229eb Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Mon, 12 Oct 2015 16:35:58 +0200 Subject: Fix commit skipping --- app/services/ci/create_commit_service.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'app') diff --git a/app/services/ci/create_commit_service.rb b/app/services/ci/create_commit_service.rb index 0ae35387579..79b0291fabc 100644 --- a/app/services/ci/create_commit_service.rb +++ b/app/services/ci/create_commit_service.rb @@ -17,11 +17,11 @@ module Ci tag = origin_ref.start_with?('refs/tags/') commit = project.gl_project.ensure_ci_commit(sha) - return false if commit.skip_ci? - - commit.update_committed! - commit.create_builds(ref, tag, user) - + unless commit.skip_ci? + commit.update_committed! + commit.create_builds(ref, tag, user) + end + commit end end -- cgit v1.2.1 From 5cd504ed331dd23d17709285237945fb867978a8 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Mon, 12 Oct 2015 16:39:08 +0200 Subject: Rename builds_without_retry to latest_builds --- app/models/ci/commit.rb | 14 +++++++------- app/models/project_services/ci/hip_chat_service.rb | 2 +- app/models/project_services/ci/mail_service.rb | 2 +- app/models/project_services/ci/slack_message.rb | 2 +- app/models/project_services/ci/slack_service.rb | 2 +- app/services/ci/create_commit_service.rb | 2 +- app/views/projects/builds/show.html.haml | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) (limited to 'app') diff --git a/app/models/ci/commit.rb b/app/models/ci/commit.rb index 201b6f62b86..296890c5e7c 100644 --- a/app/models/ci/commit.rb +++ b/app/models/ci/commit.rb @@ -48,7 +48,7 @@ module Ci end def retry - builds_without_retry.each do |build| + latest_builds.each do |build| Ci::Build.retry(build) end end @@ -113,12 +113,12 @@ module Ci @latest_statuses ||= statuses.latest.to_a end - def builds_without_retry - @builds_without_retry ||= builds.latest.to_a + def latest_builds + @latest_builds ||= builds.latest.to_a end - def builds_without_retry_for_ref(ref) - builds_without_retry.select { |build| build.ref == ref } + def latest_builds_for_ref(ref) + latest_builds.select { |build| build.ref == ref } end def retried @@ -181,7 +181,7 @@ module Ci def coverage if project.coverage_enabled? - coverage_array = builds_without_retry.map(&:coverage).compact + coverage_array = latest_builds.map(&:coverage).compact if coverage_array.size >= 1 '%.2f' % (coverage_array.reduce(:+) / coverage_array.size) end @@ -189,7 +189,7 @@ module Ci end def matrix_for_ref?(ref) - builds_without_retry_for_ref(ref).size > 1 + latest_builds_for_ref(ref).size > 1 end def config_processor diff --git a/app/models/project_services/ci/hip_chat_service.rb b/app/models/project_services/ci/hip_chat_service.rb index 0e6e97394bc..f17993d9f3b 100644 --- a/app/models/project_services/ci/hip_chat_service.rb +++ b/app/models/project_services/ci/hip_chat_service.rb @@ -49,7 +49,7 @@ module Ci commit = build.commit return unless commit - return unless commit.builds_without_retry.include? build + return unless commit.latest_builds.include? build case commit.status.to_sym when :failed diff --git a/app/models/project_services/ci/mail_service.rb b/app/models/project_services/ci/mail_service.rb index 11a2743f969..fd193301001 100644 --- a/app/models/project_services/ci/mail_service.rb +++ b/app/models/project_services/ci/mail_service.rb @@ -48,7 +48,7 @@ module Ci # it doesn't make sense to send emails for retried builds commit = build.commit return unless commit - return unless commit.builds_without_retry.include?(build) + return unless commit.latest_builds.include?(build) case build.status.to_sym when :failed diff --git a/app/models/project_services/ci/slack_message.rb b/app/models/project_services/ci/slack_message.rb index 5ac8907ecd0..dc050a3fc59 100644 --- a/app/models/project_services/ci/slack_message.rb +++ b/app/models/project_services/ci/slack_message.rb @@ -23,7 +23,7 @@ module Ci def attachments fields = [] - commit.builds_without_retry.each do |build| + commit.latest_builds.each do |build| next if build.allow_failure? next unless build.failed? fields << { diff --git a/app/models/project_services/ci/slack_service.rb b/app/models/project_services/ci/slack_service.rb index 76db573dc17..ee8e4988826 100644 --- a/app/models/project_services/ci/slack_service.rb +++ b/app/models/project_services/ci/slack_service.rb @@ -48,7 +48,7 @@ module Ci commit = build.commit return unless commit - return unless commit.builds_without_retry.include?(build) + return unless commit.latest_builds.include?(build) case commit.status.to_sym when :failed diff --git a/app/services/ci/create_commit_service.rb b/app/services/ci/create_commit_service.rb index 79b0291fabc..479a2d6defc 100644 --- a/app/services/ci/create_commit_service.rb +++ b/app/services/ci/create_commit_service.rb @@ -21,7 +21,7 @@ module Ci commit.update_committed! commit.create_builds(ref, tag, user) end - + commit end end diff --git a/app/views/projects/builds/show.html.haml b/app/views/projects/builds/show.html.haml index b561078e8c7..9c3ae622b72 100644 --- a/app/views/projects/builds/show.html.haml +++ b/app/views/projects/builds/show.html.haml @@ -9,7 +9,7 @@ #up-build-trace - if @commit.matrix_for_ref?(@build.ref) %ul.center-top-menu.build-top-menu - - @commit.builds_without_retry_for_ref(@build.ref).each do |build| + - @commit.latest_builds_for_ref(@build.ref).each do |build| %li{class: ('active' if build == @build) } = link_to namespace_project_build_path(@project.namespace, @project, build) do = ci_icon_for_status(build.status) @@ -20,7 +20,7 @@ = build.id - - unless @commit.builds_without_retry_for_ref(@build.ref).include?(@build) + - unless @commit.latest_builds_for_ref(@build.ref).include?(@build) %li.active %a Build ##{@build.id} -- cgit v1.2.1 From 1af4fcfa123370ab6dcf38a424c54029d7734032 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 12 Oct 2015 19:00:21 +0000 Subject: Fix typos in application.scss --- app/assets/stylesheets/application.scss | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'app') diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 65f775ca3f3..7b060ce4853 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -13,9 +13,9 @@ /* * Welcome to GitLab css! - * If you need to add or modify UI component that is commont for many pages - * like table or typography then make changes in framework/ directory. - * If you need to add uniq style that should affect only one page - use pages/ + * If you need to add or modify UI component that is common for many pages + * like a table or typography then make changes in the framework/ directory. + * If you need to add unique style that should affect only one page - use pages/ * directory. */ @@ -48,4 +48,4 @@ /* * Styles for JS behaviors. */ -@import "behaviors.scss"; +@import "behaviors.scss"; \ No newline at end of file -- cgit v1.2.1 From daca1c6511c3a09d5f0c33a8c4d29487e668afc2 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Mon, 12 Oct 2015 21:35:52 +0200 Subject: Fix broken tests --- app/models/ci/commit.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/models/ci/commit.rb b/app/models/ci/commit.rb index 296890c5e7c..f6fc4645947 100644 --- a/app/models/ci/commit.rb +++ b/app/models/ci/commit.rb @@ -82,7 +82,7 @@ module Ci end def stage - running_or_pending = statuses.latest.running_or_pending + running_or_pending = statuses.latest.running_or_pending.ordered running_or_pending.first.try(:stage) end @@ -189,7 +189,7 @@ module Ci end def matrix_for_ref?(ref) - latest_builds_for_ref(ref).size > 1 + builds_without_retry_for_ref(ref).size > 1 end def config_processor -- cgit v1.2.1 From 766da5fa7bdded8a333a758d7b172533ade5a934 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Mon, 12 Oct 2015 22:34:59 +0200 Subject: Fix broken matrix_for_ref? Signed-off-by: Kamil Trzcinski --- app/models/ci/commit.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/models/ci/commit.rb b/app/models/ci/commit.rb index f6fc4645947..68864edfbbf 100644 --- a/app/models/ci/commit.rb +++ b/app/models/ci/commit.rb @@ -189,7 +189,7 @@ module Ci end def matrix_for_ref?(ref) - builds_without_retry_for_ref(ref).size > 1 + latest_builds_for_ref(ref).size > 1 end def config_processor -- cgit v1.2.1 From 4bf69b0bd9a27e675c98eee998f24c0122030731 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Mon, 12 Oct 2015 23:59:21 +0200 Subject: Fix feature tests --- app/views/projects/commit/ci.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/views/projects/commit/ci.html.haml b/app/views/projects/commit/ci.html.haml index 585f012fe04..4a1ef378a30 100644 --- a/app/views/projects/commit/ci.html.haml +++ b/app/views/projects/commit/ci.html.haml @@ -21,7 +21,7 @@ \.gitlab-ci.yml not found in this commit .gray-content-block.second-block - Latest + Latest builds - if @ci_commit.duration > 0 %small.pull-right %i.fa.fa-time -- cgit v1.2.1 From 42fb52adf4460682c35d70930bcb2379ccb26171 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A7=D0=B8=D0=BD=D0=B3=D0=B8=D0=B7=20=D0=90=D1=83=D0=B0?= =?UTF-8?q?=D0=BD=D0=B0=D1=81=D0=BE=D0=B2?= Date: Tue, 13 Oct 2015 04:41:51 +0600 Subject: Use css style --- app/views/dashboard/projects/_projects.html.haml | 3 ++- app/views/groups/_projects.html.haml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/views/dashboard/projects/_projects.html.haml b/app/views/dashboard/projects/_projects.html.haml index 30372e98430..e641b82f819 100644 --- a/app/views/dashboard/projects/_projects.html.haml +++ b/app/views/dashboard/projects/_projects.html.haml @@ -5,6 +5,7 @@ - if current_user.can_create_project? %span.input-group-btn = link_to new_project_path, class: 'btn btn-green' do - + New Project + %i.fa.fa-plus + New Project = render 'shared/projects/list', projects: @projects, ci: true diff --git a/app/views/groups/_projects.html.haml b/app/views/groups/_projects.html.haml index 9c73f7a0ef7..53c11a471b0 100644 --- a/app/views/groups/_projects.html.haml +++ b/app/views/groups/_projects.html.haml @@ -5,6 +5,7 @@ - if can? current_user, :create_projects, @group %span.input-group-btn = link_to new_project_path(namespace_id: @group.id), class: 'btn btn-green' do - + New Project + %i.fa.fa-plus + New Project = render 'shared/projects/list', projects: @projects, projects_limit: 20, stars: false -- cgit v1.2.1 From 7816488a8967d4c87e84a35027499c1a5cb5406e Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Mon, 12 Oct 2015 23:02:27 -0700 Subject: Add "New Page" button to Wiki Pages tab Closes #2998 --- app/views/projects/wikis/pages.html.haml | 1 + 1 file changed, 1 insertion(+) (limited to 'app') diff --git a/app/views/projects/wikis/pages.html.haml b/app/views/projects/wikis/pages.html.haml index 03e6a522b25..d179a1abec1 100644 --- a/app/views/projects/wikis/pages.html.haml +++ b/app/views/projects/wikis/pages.html.haml @@ -3,6 +3,7 @@ = render 'nav' .gray-content-block + = render 'main_links' %h3.page-title All Pages %ul.content-list -- cgit v1.2.1 From 0e34154d214c0e470b7783b5086a70b4fe4cb08f Mon Sep 17 00:00:00 2001 From: Valery Sizov Date: Fri, 9 Oct 2015 19:35:09 +0300 Subject: Project names are not fully shown if group name is too big, even on group page view --- app/views/groups/_projects.html.haml | 2 +- app/views/shared/projects/_list.html.haml | 3 ++- app/views/shared/projects/_project.html.haml | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) (limited to 'app') diff --git a/app/views/groups/_projects.html.haml b/app/views/groups/_projects.html.haml index 76da3276e47..133f3e2d5a8 100644 --- a/app/views/groups/_projects.html.haml +++ b/app/views/groups/_projects.html.haml @@ -7,4 +7,4 @@ = link_to new_project_path(namespace_id: @group.id), class: 'btn btn-green' do New project - = render 'shared/projects/list', projects: @projects, projects_limit: 20, stars: false + = render 'shared/projects/list', projects: @projects, projects_limit: 20, stars: false, skip_namespace: true diff --git a/app/views/shared/projects/_list.html.haml b/app/views/shared/projects/_list.html.haml index 16e1d8421de..357cfd6a370 100644 --- a/app/views/shared/projects/_list.html.haml +++ b/app/views/shared/projects/_list.html.haml @@ -2,11 +2,12 @@ - avatar = true unless local_assigns[:avatar] == false - stars = true unless local_assigns[:stars] == false - ci = false unless local_assigns[:ci] == true +- skip_namespace = false unless local_assigns[:skip_namespace] == true %ul.projects-list - projects.each_with_index do |project, i| - css_class = (i >= projects_limit) ? 'hide' : nil - = render "shared/projects/project", project: project, + = render "shared/projects/project", project: project, skip_namespace: skip_namespace, avatar: avatar, stars: stars, css_class: css_class, ci: ci - if projects.size > projects_limit diff --git a/app/views/shared/projects/_project.html.haml b/app/views/shared/projects/_project.html.haml index e67e5a8a638..aee839b44e7 100644 --- a/app/views/shared/projects/_project.html.haml +++ b/app/views/shared/projects/_project.html.haml @@ -1,6 +1,7 @@ - avatar = true unless local_assigns[:avatar] == false - stars = true unless local_assigns[:stars] == false - ci = false unless local_assigns[:ci] == true +- skip_namespace = false unless local_assigns[:skip_namespace] == true - css_class = '' unless local_assigns[:css_class] - css_class += " no-description" unless project.description.present? %li.project-row{ class: css_class } @@ -11,7 +12,7 @@ = project_icon(project, alt: '', class: 'avatar project-avatar s46') %span.project-full-name %span.namespace-name - - if project.namespace + - if project.namespace && !skip_namespace = project.namespace.human_name \/ %span.project-name.filter-title -- cgit v1.2.1 From e4a9447451bfccbea6943bb5546b03c81321eb77 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 13 Oct 2015 10:55:06 +0200 Subject: Rename bootstrap css file and refactor typography css Signed-off-by: Dmitriy Zaporozhets --- app/assets/stylesheets/framework.scss | 5 +- app/assets/stylesheets/framework/gl_bootstrap.scss | 273 --------------------- app/assets/stylesheets/framework/gl_variables.scss | 158 ------------ app/assets/stylesheets/framework/mixins.scss | 141 ----------- app/assets/stylesheets/framework/tables.scss | 16 ++ app/assets/stylesheets/framework/tw_bootstrap.scss | 253 +++++++++++++++++++ .../framework/tw_bootstrap_variables.scss | 158 ++++++++++++ app/assets/stylesheets/framework/typography.scss | 145 ++++++++++- 8 files changed, 573 insertions(+), 576 deletions(-) delete mode 100644 app/assets/stylesheets/framework/gl_bootstrap.scss delete mode 100644 app/assets/stylesheets/framework/gl_variables.scss create mode 100644 app/assets/stylesheets/framework/tw_bootstrap.scss create mode 100644 app/assets/stylesheets/framework/tw_bootstrap_variables.scss (limited to 'app') diff --git a/app/assets/stylesheets/framework.scss b/app/assets/stylesheets/framework.scss index c5e23c1c328..1ec9d2fd84f 100644 --- a/app/assets/stylesheets/framework.scss +++ b/app/assets/stylesheets/framework.scss @@ -2,8 +2,9 @@ @import "framework/variables"; @import "framework/mixins"; @import "framework/layout"; -@import 'framework/gl_variables'; -@import 'framework/gl_bootstrap'; +@import 'framework/tw_bootstrap_variables'; +@import 'framework/tw_bootstrap'; + @import "framework/avatar.scss"; @import "framework/blocks.scss"; @import "framework/buttons.scss"; diff --git a/app/assets/stylesheets/framework/gl_bootstrap.scss b/app/assets/stylesheets/framework/gl_bootstrap.scss deleted file mode 100644 index eb8d23d6453..00000000000 --- a/app/assets/stylesheets/framework/gl_bootstrap.scss +++ /dev/null @@ -1,273 +0,0 @@ -/* - * Twitter bootstrap with GitLab customizations/additions - * - */ - -// Core variables and mixins -@import "bootstrap/variables"; -@import "bootstrap/mixins"; - -// Reset -@import "bootstrap/normalize"; -@import "bootstrap/print"; - -// Core CSS -@import "bootstrap/scaffolding"; -@import "bootstrap/type"; -@import "bootstrap/code"; -@import "bootstrap/grid"; -@import "bootstrap/tables"; -@import "bootstrap/forms"; -@import "bootstrap/buttons"; - -// Components -@import "bootstrap/component-animations"; -@import "bootstrap/dropdowns"; -@import "bootstrap/button-groups"; -@import "bootstrap/input-groups"; -@import "bootstrap/navs"; -@import "bootstrap/navbar"; -@import "bootstrap/breadcrumbs"; -@import "bootstrap/pagination"; -@import "bootstrap/pager"; -@import "bootstrap/labels"; -@import "bootstrap/badges"; -@import "bootstrap/jumbotron"; -@import "bootstrap/thumbnails"; -@import "bootstrap/alerts"; -@import "bootstrap/progress-bars"; -@import "bootstrap/list-group"; -@import "bootstrap/wells"; -@import "bootstrap/close"; -@import "bootstrap/panels"; - -// Components w/ JavaScript -@import "bootstrap/modals"; -@import "bootstrap/tooltip"; -@import "bootstrap/popovers"; -@import "bootstrap/carousel"; - -// Utility classes -.clearfix { - @include clearfix(); -} -.center-block { - @include center-block(); -} -.pull-right { - float: right !important; -} -.pull-left { - float: left !important; -} -.hide { - display: none; -} -.show { - display: block !important; -} -.invisible { - visibility: hidden; -} -.text-hide { - @include text-hide(); -} -.hidden { - display: none !important; - visibility: hidden !important; -} -.affix { - position: fixed; -} - -@import "bootstrap/responsive-utilities"; - -// Labels -.label { - padding: 2px 4px; - font-size: 13px; - font-style: normal; - font-weight: normal; - display: inline-block; - - &.label-gray { - background-color: #f8fafc; - color: $gl-gray; - text-shadow: none; - } - - &.label-inverse { - background-color: #333333; - } -} - -// Nav tabs -.nav.nav-tabs { - margin-bottom: 15px; - - li { - > a { - margin-right: 5px; - line-height: 20px; - border-color: #EEE; - color: #888; - border-bottom: 1px solid #ddd; - .badge { - background-color: #eee; - color: #888; - text-shadow: 0 1px 1px #fff; - } - i.fa { - line-height: 14px; - } - } - &.active { - > a { - border-color: #CCC; - border-bottom: 1px solid #fff; - color: #333; - font-weight: bold; - } - } - } -} - -.nav-tabs > li > a, -.nav-pills > li > a { - color: #666; -} - -.nav-pills > .active > a > span > .badge { - background-color: #fff; - color: $gl-primary; -} - - -/** - * fix to keep tooltips position in top navigation bar - * - */ -.navbar .nav > li { - position: relative; - white-space: nowrap; -} - -/** - * Add some extra stuff to panels - * - */ - -.container-blank .panel .panel-heading { - font-size: 17px; - line-height: 38px; -} - -.panel { - box-shadow: none; - - .panel-heading { - .panel-head-actions { - position: relative; - top: -5px; - float: right; - } - } - - .panel-body { - form { - margin: 0; - } - - .form-actions { - margin: -15px; - margin-top: 18px; - } - } - - .panel-footer { - .pagination { - margin: 0; - } - - .btn { - min-width: 124px; - } - } - - &.panel-small { - .panel-heading { - padding: 6px 15px; - font-size: 13px; - font-weight: normal; - a { - color: #777; - } - } - } -} - -.panel-succes .panel-heading, -.panel-info .panel-heading, -.panel-danger .panel-heading, -.panel-warning .panel-heading, -.panel-primary .panel-heading, -.alert { - a:not(.btn) { - @extend .alert-link; - color: #fff; - text-decoration: underline; - } -} - -.alert-help { - background-color: $background-color; - border: 1px solid $border-color; - color: $gl-gray; -} - -// Typography ================================================================= - -.text-primary, -.text-primary:hover { - color: $brand-primary; -} - -.text-success, -.text-success:hover { - color: $brand-success; -} - -.text-danger, -.text-danger:hover { - color: $brand-danger; -} - -.text-warning, -.text-warning:hover { - color: $brand-warning; -} - -.text-info, -.text-info:hover { - color: $brand-info; -} - -// Tables ===================================================================== - -table.table { - .dropdown-menu a { - text-decoration: none; - } - - .success, - .warning, - .danger, - .info { - color: #fff; - - a:not(.btn) { - text-decoration: underline; - color: #fff; - } - } -} diff --git a/app/assets/stylesheets/framework/gl_variables.scss b/app/assets/stylesheets/framework/gl_variables.scss deleted file mode 100644 index 18632da4f2a..00000000000 --- a/app/assets/stylesheets/framework/gl_variables.scss +++ /dev/null @@ -1,158 +0,0 @@ -// Override Bootstrap variables here (defaults from bootstrap-sass v3.3.3): -// For all variables see https://github.com/twbs/bootstrap-sass/blob/master/templates/project/_bootstrap-variables.sass -// -// Variables -// -------------------------------------------------- - - -//== Colors -// -//## Gray and brand colors for use across Bootstrap. - -// $gray-base: #000 -// $gray-darker: lighten($gray-base, 13.5%) // #222 -// $gray-dark: lighten($gray-base, 20%) // #333 -// $gray: lighten($gray-base, 33.5%) // #555 -// $gray-light: lighten($gray-base, 46.7%) // #777 -// $gray-lighter: lighten($gray-base, 93.5%) // #eee - -$brand-primary: $gl-primary; -$brand-success: $gl-success; -$brand-info: $gl-info; -$brand-warning: $gl-warning; -$brand-danger: $gl-danger; - -$border-radius-base: 2px !default; -$border-radius-large: 2px !default; -$border-radius-small: 2px !default; - - -//== Scaffolding -// -$text-color: $gl-text-color; -$link-color: $gl-link-color; - - -//== Typography -// -//## Font, line-height, and color for body text, headings, and more. - -$font-family-sans-serif: $regular_font; -$font-family-monospace: $monospace_font; -$font-size-base: $gl-font-size; - - -//== Components -// -//## Define common padding and border radius sizes and more. Values based on 14px text and 1.428 line-height (~20px to start). - -$padding-base-vertical: 9px; -$padding-base-horizontal: $gl-padding; -$component-active-color: #fff; -$component-active-bg: $brand-info; - -//== Forms -// -//## - -$input-color: $text-color; -$input-border: #e7e9ed; -$input-border-focus: #7F8FA4; -$legend-color: $text-color; - - -//== Pagination -// -//## - -$pagination-color: $gl-gray; -$pagination-bg: $background-color; -$pagination-border: transparent; - -$pagination-hover-color: #fff; -$pagination-hover-bg: $brand-info; -$pagination-hover-border: transparent; - -$pagination-active-color: #fff; -$pagination-active-bg: $brand-info; -$pagination-active-border: transparent; - -$pagination-disabled-color: #fff; -$pagination-disabled-bg: lighten($brand-info, 15%); -$pagination-disabled-border: transparent; - - -//== Form states and alerts -// -//## Define colors for form feedback states and, by default, alerts. - -$state-success-text: #fff; -$state-success-bg: $brand-success; -$state-success-border: $brand-success; - -$state-info-text: #fff; -$state-info-bg: $brand-info; -$state-info-border: $brand-info; - -$state-warning-text: #fff; -$state-warning-bg: $brand-warning; -$state-warning-border: $brand-warning; - -$state-danger-text: #fff; -$state-danger-bg: $brand-danger; -$state-danger-border: $brand-danger; - - -//== Alerts -// -//## Define alert colors, border radius, and padding. - -$alert-border-radius: 0; - - -//== Panels -// -//## - -$panel-border-radius: 2px; -$panel-default-text: $text-color; -$panel-default-border: $border-color; -$panel-default-heading-bg: $background-color; -$panel-footer-bg: $background-color; -$panel-inner-border: $border-color; - -//== Wells -// -//## - -$well-bg: #F9F9F9; -$well-border: #EEE; - -//== Code -// -//## - -$code-color: #c7254e; -$code-bg: #f9f2f4; - -$kbd-color: #fff; -$kbd-bg: #333; - -//== Buttons -// -//## -$btn-default-color: $gl-text-color; -$btn-default-bg: #fff; -$btn-default-border: #e7e9ed; - -//== Nav -// -//## -$nav-link-padding: 13px $gl-padding; - -//== Code -// -//## -$pre-bg: #f8fafc !default; -$pre-color: $gl-gray !default; -$pre-border-color: #e7e9ed; diff --git a/app/assets/stylesheets/framework/mixins.scss b/app/assets/stylesheets/framework/mixins.scss index c74a6d39824..089e6958eeb 100644 --- a/app/assets/stylesheets/framework/mixins.scss +++ b/app/assets/stylesheets/framework/mixins.scss @@ -54,147 +54,6 @@ @include box-shadow(0 0 0 3px #f1f1f1); } -@mixin md-typography { - color: $md-text-color; - - a { - color: $md-link-color; - } - - img { - max-width: 100%; - } - - *:first-child { - margin-top: 0; - } - - code { - font-family: $monospace_font; - white-space: pre; - word-wrap: normal; - padding: 1px 2px; - } - - kbd { - display: inline-block; - padding: 3px 5px; - font-size: 11px; - line-height: 10px; - color: #555; - vertical-align: middle; - background-color: #FCFCFC; - border-width: 1px; - border-style: solid; - border-color: #CCC #CCC #BBB; - border-image: none; - border-radius: 3px; - box-shadow: 0px -1px 0px #BBB inset; - } - - h1 { - font-size: 1.3em; - font-weight: 600; - margin: 24px 0 12px 0; - padding: 0 0 10px 0; - border-bottom: 1px solid #e7e9ed; - color: #313236; - } - - h2 { - font-size: 1.2em; - font-weight: 600; - margin: 24px 0 12px 0; - color: #313236; - } - - h3 { - margin: 24px 0 12px 0; - font-size: 1.25em; - } - - h4 { - margin: 24px 0 12px 0; - font-size: 1.1em; - } - - h5 { - margin: 24px 0 12px 0; - font-size: 1em; - } - - h6 { - margin: 24px 0 12px 0; - font-size: 0.90em; - } - - blockquote { - padding: 8px 21px; - margin: 12px 0 12px; - border-left: 3px solid #e7e9ed; - } - - blockquote p { - color: #7f8fa4 !important; - font-size: 15px; - line-height: 1.5; - } - - p { - color:#5c5d5e; - margin:6px 0 0 0; - } - - table { - @extend .table; - @extend .table-bordered; - margin: 12px 0 12px 0; - color: #5c5d5e; - th { - background: #f8fafc; - } - } - - pre { - margin: 12px 0 12px 0 !important; - background-color: #f8fafc !important; - font-size: 13px !important; - color: #5b6169 !important; - line-height: 1.6em !important; - @include border-radius(2px); - } - - p > code { - font-weight: inherit; - } - - - ul { - color: #5c5d5e; - } - - li { - line-height: 1.6em; - } - - a[href*="/uploads/"], a[href*="storage.googleapis.com/google-code-attachments/"] { - &:before { - margin-right: 4px; - - font: normal normal normal 14px/1 FontAwesome; - font-size: inherit; - text-rendering: auto; - -webkit-font-smoothing: antialiased; - content: "\f0c6"; - } - - &:hover:before { - text-decoration: none; - } - } -} - - @mixin str-truncated($max_width: 82%) { display: inline-block; overflow: hidden; diff --git a/app/assets/stylesheets/framework/tables.scss b/app/assets/stylesheets/framework/tables.scss index a66e45577de..76163b3a05e 100644 --- a/app/assets/stylesheets/framework/tables.scss +++ b/app/assets/stylesheets/framework/tables.scss @@ -1,5 +1,21 @@ table { &.table { + .dropdown-menu a { + text-decoration: none; + } + + .success, + .warning, + .danger, + .info { + color: #fff; + + a:not(.btn) { + text-decoration: underline; + color: #fff; + } + } + tr { td, th { padding: 8px 10px; diff --git a/app/assets/stylesheets/framework/tw_bootstrap.scss b/app/assets/stylesheets/framework/tw_bootstrap.scss new file mode 100644 index 00000000000..722b44d2d10 --- /dev/null +++ b/app/assets/stylesheets/framework/tw_bootstrap.scss @@ -0,0 +1,253 @@ +/* + * Twitter bootstrap with GitLab customizations/additions + * + */ + +// Core variables and mixins +@import "bootstrap/variables"; +@import "bootstrap/mixins"; + +// Reset +@import "bootstrap/normalize"; +@import "bootstrap/print"; + +// Core CSS +@import "bootstrap/scaffolding"; +@import "bootstrap/type"; +@import "bootstrap/code"; +@import "bootstrap/grid"; +@import "bootstrap/tables"; +@import "bootstrap/forms"; +@import "bootstrap/buttons"; + +// Components +@import "bootstrap/component-animations"; +@import "bootstrap/dropdowns"; +@import "bootstrap/button-groups"; +@import "bootstrap/input-groups"; +@import "bootstrap/navs"; +@import "bootstrap/navbar"; +@import "bootstrap/breadcrumbs"; +@import "bootstrap/pagination"; +@import "bootstrap/pager"; +@import "bootstrap/labels"; +@import "bootstrap/badges"; +@import "bootstrap/jumbotron"; +@import "bootstrap/thumbnails"; +@import "bootstrap/alerts"; +@import "bootstrap/progress-bars"; +@import "bootstrap/list-group"; +@import "bootstrap/wells"; +@import "bootstrap/close"; +@import "bootstrap/panels"; + +// Components w/ JavaScript +@import "bootstrap/modals"; +@import "bootstrap/tooltip"; +@import "bootstrap/popovers"; +@import "bootstrap/carousel"; + +// Utility classes +.clearfix { + @include clearfix(); +} +.center-block { + @include center-block(); +} +.pull-right { + float: right !important; +} +.pull-left { + float: left !important; +} +.hide { + display: none; +} +.show { + display: block !important; +} +.invisible { + visibility: hidden; +} +.text-hide { + @include text-hide(); +} +.hidden { + display: none !important; + visibility: hidden !important; +} +.affix { + position: fixed; +} + +@import "bootstrap/responsive-utilities"; + +// Labels +.label { + padding: 2px 4px; + font-size: 13px; + font-style: normal; + font-weight: normal; + display: inline-block; + + &.label-gray { + background-color: #f8fafc; + color: $gl-gray; + text-shadow: none; + } + + &.label-inverse { + background-color: #333333; + } +} + +// Nav tabs +.nav.nav-tabs { + margin-bottom: 15px; + + li { + > a { + margin-right: 5px; + line-height: 20px; + border-color: #EEE; + color: #888; + border-bottom: 1px solid #ddd; + .badge { + background-color: #eee; + color: #888; + text-shadow: 0 1px 1px #fff; + } + i.fa { + line-height: 14px; + } + } + &.active { + > a { + border-color: #CCC; + border-bottom: 1px solid #fff; + color: #333; + font-weight: bold; + } + } + } +} + +.nav-tabs > li > a, +.nav-pills > li > a { + color: #666; +} + +.nav-pills > .active > a > span > .badge { + background-color: #fff; + color: $gl-primary; +} + + +/** + * fix to keep tooltips position in top navigation bar + * + */ +.navbar .nav > li { + position: relative; + white-space: nowrap; +} + +/** + * Add some extra stuff to panels + * + */ + +.container-blank .panel .panel-heading { + font-size: 17px; + line-height: 38px; +} + +.panel { + box-shadow: none; + + .panel-heading { + .panel-head-actions { + position: relative; + top: -5px; + float: right; + } + } + + .panel-body { + form { + margin: 0; + } + + .form-actions { + margin: -15px; + margin-top: 18px; + } + } + + .panel-footer { + .pagination { + margin: 0; + } + + .btn { + min-width: 124px; + } + } + + &.panel-small { + .panel-heading { + padding: 6px 15px; + font-size: 13px; + font-weight: normal; + a { + color: #777; + } + } + } +} + +.panel-succes .panel-heading, +.panel-info .panel-heading, +.panel-danger .panel-heading, +.panel-warning .panel-heading, +.panel-primary .panel-heading, +.alert { + a:not(.btn) { + @extend .alert-link; + color: #fff; + text-decoration: underline; + } +} + +.alert-help { + background-color: $background-color; + border: 1px solid $border-color; + color: $gl-gray; +} + +// Typography ================================================================= + +.text-primary, +.text-primary:hover { + color: $brand-primary; +} + +.text-success, +.text-success:hover { + color: $brand-success; +} + +.text-danger, +.text-danger:hover { + color: $brand-danger; +} + +.text-warning, +.text-warning:hover { + color: $brand-warning; +} + +.text-info, +.text-info:hover { + color: $brand-info; +} diff --git a/app/assets/stylesheets/framework/tw_bootstrap_variables.scss b/app/assets/stylesheets/framework/tw_bootstrap_variables.scss new file mode 100644 index 00000000000..18632da4f2a --- /dev/null +++ b/app/assets/stylesheets/framework/tw_bootstrap_variables.scss @@ -0,0 +1,158 @@ +// Override Bootstrap variables here (defaults from bootstrap-sass v3.3.3): +// For all variables see https://github.com/twbs/bootstrap-sass/blob/master/templates/project/_bootstrap-variables.sass +// +// Variables +// -------------------------------------------------- + + +//== Colors +// +//## Gray and brand colors for use across Bootstrap. + +// $gray-base: #000 +// $gray-darker: lighten($gray-base, 13.5%) // #222 +// $gray-dark: lighten($gray-base, 20%) // #333 +// $gray: lighten($gray-base, 33.5%) // #555 +// $gray-light: lighten($gray-base, 46.7%) // #777 +// $gray-lighter: lighten($gray-base, 93.5%) // #eee + +$brand-primary: $gl-primary; +$brand-success: $gl-success; +$brand-info: $gl-info; +$brand-warning: $gl-warning; +$brand-danger: $gl-danger; + +$border-radius-base: 2px !default; +$border-radius-large: 2px !default; +$border-radius-small: 2px !default; + + +//== Scaffolding +// +$text-color: $gl-text-color; +$link-color: $gl-link-color; + + +//== Typography +// +//## Font, line-height, and color for body text, headings, and more. + +$font-family-sans-serif: $regular_font; +$font-family-monospace: $monospace_font; +$font-size-base: $gl-font-size; + + +//== Components +// +//## Define common padding and border radius sizes and more. Values based on 14px text and 1.428 line-height (~20px to start). + +$padding-base-vertical: 9px; +$padding-base-horizontal: $gl-padding; +$component-active-color: #fff; +$component-active-bg: $brand-info; + +//== Forms +// +//## + +$input-color: $text-color; +$input-border: #e7e9ed; +$input-border-focus: #7F8FA4; +$legend-color: $text-color; + + +//== Pagination +// +//## + +$pagination-color: $gl-gray; +$pagination-bg: $background-color; +$pagination-border: transparent; + +$pagination-hover-color: #fff; +$pagination-hover-bg: $brand-info; +$pagination-hover-border: transparent; + +$pagination-active-color: #fff; +$pagination-active-bg: $brand-info; +$pagination-active-border: transparent; + +$pagination-disabled-color: #fff; +$pagination-disabled-bg: lighten($brand-info, 15%); +$pagination-disabled-border: transparent; + + +//== Form states and alerts +// +//## Define colors for form feedback states and, by default, alerts. + +$state-success-text: #fff; +$state-success-bg: $brand-success; +$state-success-border: $brand-success; + +$state-info-text: #fff; +$state-info-bg: $brand-info; +$state-info-border: $brand-info; + +$state-warning-text: #fff; +$state-warning-bg: $brand-warning; +$state-warning-border: $brand-warning; + +$state-danger-text: #fff; +$state-danger-bg: $brand-danger; +$state-danger-border: $brand-danger; + + +//== Alerts +// +//## Define alert colors, border radius, and padding. + +$alert-border-radius: 0; + + +//== Panels +// +//## + +$panel-border-radius: 2px; +$panel-default-text: $text-color; +$panel-default-border: $border-color; +$panel-default-heading-bg: $background-color; +$panel-footer-bg: $background-color; +$panel-inner-border: $border-color; + +//== Wells +// +//## + +$well-bg: #F9F9F9; +$well-border: #EEE; + +//== Code +// +//## + +$code-color: #c7254e; +$code-bg: #f9f2f4; + +$kbd-color: #fff; +$kbd-bg: #333; + +//== Buttons +// +//## +$btn-default-color: $gl-text-color; +$btn-default-bg: #fff; +$btn-default-border: #e7e9ed; + +//== Nav +// +//## +$nav-link-padding: 13px $gl-padding; + +//== Code +// +//## +$pre-bg: #f8fafc !default; +$pre-color: $gl-gray !default; +$pre-border-color: #e7e9ed; diff --git a/app/assets/stylesheets/framework/typography.scss b/app/assets/stylesheets/framework/typography.scss index 6a3cb49baae..bf36f96cc97 100644 --- a/app/assets/stylesheets/framework/typography.scss +++ b/app/assets/stylesheets/framework/typography.scss @@ -1,3 +1,144 @@ +@mixin md-typography { + color: $md-text-color; + + a { + color: $md-link-color; + } + + img { + max-width: 100%; + } + + *:first-child { + margin-top: 0; + } + + code { + font-family: $monospace_font; + white-space: pre; + word-wrap: normal; + padding: 1px 2px; + } + + kbd { + display: inline-block; + padding: 3px 5px; + font-size: 11px; + line-height: 10px; + color: #555; + vertical-align: middle; + background-color: #FCFCFC; + border-width: 1px; + border-style: solid; + border-color: #CCC #CCC #BBB; + border-image: none; + border-radius: 3px; + box-shadow: 0px -1px 0px #BBB inset; + } + + h1 { + font-size: 1.3em; + font-weight: 600; + margin: 24px 0 12px 0; + padding: 0 0 10px 0; + border-bottom: 1px solid #e7e9ed; + color: #313236; + } + + h2 { + font-size: 1.2em; + font-weight: 600; + margin: 24px 0 12px 0; + color: #313236; + } + + h3 { + margin: 24px 0 12px 0; + font-size: 1.25em; + } + + h4 { + margin: 24px 0 12px 0; + font-size: 1.1em; + } + + h5 { + margin: 24px 0 12px 0; + font-size: 1em; + } + + h6 { + margin: 24px 0 12px 0; + font-size: 0.90em; + } + + blockquote { + padding: 8px 21px; + margin: 12px 0 12px; + border-left: 3px solid #e7e9ed; + } + + blockquote p { + color: #7f8fa4 !important; + font-size: 15px; + line-height: 1.5; + } + + p { + color:#5c5d5e; + margin:6px 0 0 0; + } + + table { + @extend .table; + @extend .table-bordered; + margin: 12px 0 12px 0; + color: #5c5d5e; + th { + background: #f8fafc; + } + } + + pre { + margin: 12px 0 12px 0 !important; + background-color: #f8fafc !important; + font-size: 13px !important; + color: #5b6169 !important; + line-height: 1.6em !important; + @include border-radius(2px); + } + + p > code { + font-weight: inherit; + } + + + ul { + color: #5c5d5e; + } + + li { + line-height: 1.6em; + } + + a[href*="/uploads/"], a[href*="storage.googleapis.com/google-code-attachments/"] { + &:before { + margin-right: 4px; + + font: normal normal normal 14px/1 FontAwesome; + font-size: inherit; + text-rendering: auto; + -webkit-font-smoothing: antialiased; + content: "\f0c6"; + } + + &:hover:before { + text-decoration: none; + } + } +} + + /** * Headers * @@ -6,7 +147,7 @@ body { text-rendering:optimizeLegibility; -webkit-text-shadow: rgba(255,255,255,0.01) 0 0 1px; } - + .page-title { margin-top: 0px; line-height: 1.3; @@ -127,4 +268,4 @@ textarea.js-gfm-input { .strikethrough { text-decoration: line-through; -} \ No newline at end of file +} -- cgit v1.2.1 From 029edcc391d492c30f0598e70dba3433189806c7 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 13 Oct 2015 11:02:44 +0200 Subject: Fix padding for controls in list Signed-off-by: Dmitriy Zaporozhets --- app/assets/stylesheets/framework/lists.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/assets/stylesheets/framework/lists.scss b/app/assets/stylesheets/framework/lists.scss index 3bfed8de772..fdfbb886926 100644 --- a/app/assets/stylesheets/framework/lists.scss +++ b/app/assets/stylesheets/framework/lists.scss @@ -117,7 +117,7 @@ ul.content-list { } .controls { - padding-top: 10px; + padding-top: 5px; float: right; } } -- cgit v1.2.1 From f1e3894973abd96a318b5f3f56bfce110c620c39 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 13 Oct 2015 11:23:10 +0200 Subject: Remove unused twbs components Signed-off-by: Dmitriy Zaporozhets --- app/assets/stylesheets/framework/tw_bootstrap.scss | 2 -- app/assets/stylesheets/pages/note_form.scss | 1 - 2 files changed, 3 deletions(-) (limited to 'app') diff --git a/app/assets/stylesheets/framework/tw_bootstrap.scss b/app/assets/stylesheets/framework/tw_bootstrap.scss index 722b44d2d10..99d028d1228 100644 --- a/app/assets/stylesheets/framework/tw_bootstrap.scss +++ b/app/assets/stylesheets/framework/tw_bootstrap.scss @@ -32,8 +32,6 @@ @import "bootstrap/pager"; @import "bootstrap/labels"; @import "bootstrap/badges"; -@import "bootstrap/jumbotron"; -@import "bootstrap/thumbnails"; @import "bootstrap/alerts"; @import "bootstrap/progress-bars"; @import "bootstrap/list-group"; diff --git a/app/assets/stylesheets/pages/note_form.scss b/app/assets/stylesheets/pages/note_form.scss index dcd1aed7196..4392f08942b 100644 --- a/app/assets/stylesheets/pages/note_form.scss +++ b/app/assets/stylesheets/pages/note_form.scss @@ -65,7 +65,6 @@ .note-image-attach { @extend .col-md-4; - @extend .thumbnail; margin-left: 45px; float: none; } -- cgit v1.2.1 From ab604c73ef986d03d5c5c04075663d87ef390479 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 13 Oct 2015 11:33:46 +0200 Subject: Temporary return sm and xs button sizes Signed-off-by: Dmitriy Zaporozhets --- app/assets/stylesheets/framework/buttons.scss | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/assets/stylesheets/framework/buttons.scss b/app/assets/stylesheets/framework/buttons.scss index 11acbe3adfa..e5f0c0ad9ef 100644 --- a/app/assets/stylesheets/framework/buttons.scss +++ b/app/assets/stylesheets/framework/buttons.scss @@ -6,7 +6,7 @@ font-size: 13px; font-weight: 600; line-height: 18px; - padding: 11px 16px; + padding: 11px $gl-padding; letter-spacing: .4px; &:focus, @@ -71,6 +71,14 @@ @include btn-default; @include btn-white; + &.btn-sm { + padding: 5px 10px; + } + + &.btn-xs { + padding: 1px 5px; + } + &.btn-success, &.btn-new, &.btn-create, -- cgit v1.2.1 From e7cc554cc181cbb850f89af26e64a9ab56116f28 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Tue, 13 Oct 2015 11:50:37 +0200 Subject: Fix retry and cancel URLs --- app/models/ci/build.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index cb6a1015210..f8c731a7bf7 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -219,13 +219,15 @@ module Ci def cancel_url if active? - cancel_namespace_project_build_path(gl_project.namespace, gl_project, self, return_to: request.original_url) + Gitlab::Application.routes.url_helpers. + cancel_namespace_project_build_path(gl_project.namespace, gl_project, self, return_to: request.original_url) end end def retry_url if commands.present? - cancel_namespace_project_build_path(gl_project.namespace, gl_project, self, return_to: request.original_url) + Gitlab::Application.routes.url_helpers. + cancel_namespace_project_build_path(gl_project.namespace, gl_project, self, return_to: request.original_url) end end -- cgit v1.2.1 From 4ad61519f9f9cdc82b1ee6bd1ed92905692c7e7f Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 13 Oct 2015 13:02:27 +0200 Subject: Fix control buttons in lists Signed-off-by: Dmitriy Zaporozhets --- app/assets/stylesheets/framework/lists.scss | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/assets/stylesheets/framework/lists.scss b/app/assets/stylesheets/framework/lists.scss index fdfbb886926..c5764c36597 100644 --- a/app/assets/stylesheets/framework/lists.scss +++ b/app/assets/stylesheets/framework/lists.scss @@ -117,8 +117,12 @@ ul.content-list { } .controls { - padding-top: 5px; + padding-top: 4px; float: right; + + .btn { + padding: 10px 14px; + } } } } -- cgit v1.2.1 From 219451241a92ff9e81dcb77914e6d659ea2f7376 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 13 Oct 2015 13:03:27 +0200 Subject: Fix UI issue on project page with no ssh key message Signed-off-by: Dmitriy Zaporozhets --- app/views/layouts/_page.html.haml | 3 ++- app/views/projects/show.html.haml | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'app') diff --git a/app/views/layouts/_page.html.haml b/app/views/layouts/_page.html.haml index 2468687b56d..1a883e20e89 100644 --- a/app/views/layouts/_page.html.haml +++ b/app/views/layouts/_page.html.haml @@ -6,7 +6,7 @@ = brand_header_logo .gitlab-text-container %h3 GitLab - + - if defined?(sidebar) && sidebar = render "layouts/nav/#{sidebar}" - elsif current_user @@ -23,6 +23,7 @@ = current_user.username .content-wrapper = render "layouts/flash" + = yield :flash_message %div{ class: container_class } .content .clearfix diff --git a/app/views/projects/show.html.haml b/app/views/projects/show.html.haml index efa119edd5a..e95d987d74c 100644 --- a/app/views/projects/show.html.haml +++ b/app/views/projects/show.html.haml @@ -2,9 +2,10 @@ - if current_user = auto_discovery_link_tag(:atom, namespace_project_path(@project.namespace, @project, format: :atom, private_token: current_user.private_token), title: "#{@project.name} activity") -- if current_user && can?(current_user, :download_code, @project) - = render 'shared/no_ssh' - = render 'shared/no_password' += content_for :flash_message do + - if current_user && can?(current_user, :download_code, @project) + = render 'shared/no_ssh' + = render 'shared/no_password' - if prefer_readme? = render 'projects/last_push' -- cgit v1.2.1 From e75655950d27eff75dba0aadd2f853f84034bb3a Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 13 Oct 2015 13:37:15 +0200 Subject: Several fixes for UI on mobile Signed-off-by: Dmitriy Zaporozhets --- app/assets/stylesheets/framework/mobile.scss | 14 +++++++++++--- app/assets/stylesheets/pages/projects.scss | 1 + 2 files changed, 12 insertions(+), 3 deletions(-) (limited to 'app') diff --git a/app/assets/stylesheets/framework/mobile.scss b/app/assets/stylesheets/framework/mobile.scss index 36ae126f865..cea47fba192 100644 --- a/app/assets/stylesheets/framework/mobile.scss +++ b/app/assets/stylesheets/framework/mobile.scss @@ -23,7 +23,7 @@ margin-right: 0; } - .issues-filters, + .issues-details-filters, .dash-projects-filters, .check-all-holder { display: none; @@ -83,6 +83,7 @@ .center-top-menu { height: 45px; + margin-bottom: 30px; li a { font-size: 14px; @@ -90,9 +91,11 @@ } } - .projects-search-form { - margin: 0 -5px !important; + .activity-filter-block { + display: none; + } + .projects-search-form { .btn { display: none; } @@ -100,6 +103,11 @@ } @media (max-width: $screen-sm-max) { + .page-with-sidebar .content-wrapper { + padding: 0; + padding-top: 1px; + } + .issues-filters { .milestone-filter, .labels-filter { display: none; diff --git a/app/assets/stylesheets/pages/projects.scss b/app/assets/stylesheets/pages/projects.scss index 0031ab5151b..9d42c0f28e7 100644 --- a/app/assets/stylesheets/pages/projects.scss +++ b/app/assets/stylesheets/pages/projects.scss @@ -63,6 +63,7 @@ } p { + padding: 0 $gl-padding; color: #5c5d5e; } } -- cgit v1.2.1 From 2f68fb9cc3622eb90c955b6936e91ea766f262b6 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 13 Oct 2015 14:38:38 +0200 Subject: Small css cleanup Signed-off-by: Dmitriy Zaporozhets --- app/assets/stylesheets/framework/common.scss | 4 ---- app/assets/stylesheets/pages/projects.scss | 5 ----- app/views/dashboard/_activities.html.haml | 7 +++---- app/views/groups/show.html.haml | 8 +++----- app/views/projects/_activity.html.haml | 7 +++---- app/views/projects/buttons/_notifications.html.haml | 2 +- app/views/projects/new.html.haml | 4 ++-- 7 files changed, 12 insertions(+), 25 deletions(-) (limited to 'app') diff --git a/app/assets/stylesheets/framework/common.scss b/app/assets/stylesheets/framework/common.scss index 03919f15f1f..e1a1793be9c 100644 --- a/app/assets/stylesheets/framework/common.scss +++ b/app/assets/stylesheets/framework/common.scss @@ -398,7 +398,3 @@ table { .space-right { margin-right: 10px; } - -.in-line { - display: inline-block; -} diff --git a/app/assets/stylesheets/pages/projects.scss b/app/assets/stylesheets/pages/projects.scss index 9d42c0f28e7..f7a22849003 100644 --- a/app/assets/stylesheets/pages/projects.scss +++ b/app/assets/stylesheets/pages/projects.scss @@ -511,8 +511,3 @@ pre.light-well { margin-top: -1px; } } - -.inline-form { - display: inline-block; -} - diff --git a/app/views/dashboard/_activities.html.haml b/app/views/dashboard/_activities.html.haml index 19d919f9b6a..f98fd9f06ba 100644 --- a/app/views/dashboard/_activities.html.haml +++ b/app/views/dashboard/_activities.html.haml @@ -3,10 +3,9 @@ .gray-content-block - if current_user - %ul.nav.nav-pills.event_filter.pull-right - %li.pull-right - = link_to dashboard_projects_path(:atom, { private_token: current_user.private_token }), class: 'rss-btn' do - %i.fa.fa-rss + .pull-right + = link_to dashboard_projects_path(:atom, { private_token: current_user.private_token }), class: 'btn rss-btn' do + %i.fa.fa-rss = render 'shared/event_filter' .content_list diff --git a/app/views/groups/show.html.haml b/app/views/groups/show.html.haml index a9ba9d2ba10..dc8e81323a6 100644 --- a/app/views/groups/show.html.haml +++ b/app/views/groups/show.html.haml @@ -25,11 +25,9 @@ .hidden-xs - if current_user = render "events/event_last_push", event: @last_push - - %ul.nav.nav-pills.event_filter.pull-right - %li - = link_to group_path(@group, { format: :atom, private_token: current_user.private_token }), title: "Feed", class: 'rss-btn' do - %i.fa.fa-rss + .pull-right + = link_to group_path(@group, { format: :atom, private_token: current_user.private_token }), title: "Feed", class: 'btn rss-btn' do + %i.fa.fa-rss = render 'shared/event_filter' %hr diff --git a/app/views/projects/_activity.html.haml b/app/views/projects/_activity.html.haml index 1261f6254d7..c2683bc6219 100644 --- a/app/views/projects/_activity.html.haml +++ b/app/views/projects/_activity.html.haml @@ -1,10 +1,9 @@ = render 'projects/last_push' .gray-content-block.activity-filter-block - if current_user - %ul.nav.nav-pills.event_filter.pull-right - %li - = link_to namespace_project_path(@project.namespace, @project, format: :atom, private_token: current_user.private_token), title: "Feed", class: 'rss-btn' do - %i.fa.fa-rss + .pull-right + = link_to namespace_project_path(@project.namespace, @project, format: :atom, private_token: current_user.private_token), title: "Feed", class: 'btn rss-btn' do + %i.fa.fa-rss = render 'shared/event_filter' .content_list{:"data-href" => activity_project_path(@project)} diff --git a/app/views/projects/buttons/_notifications.html.haml b/app/views/projects/buttons/_notifications.html.haml index 4b69a6d7a6f..3bc2daeec4e 100644 --- a/app/views/projects/buttons/_notifications.html.haml +++ b/app/views/projects/buttons/_notifications.html.haml @@ -1,6 +1,6 @@ - return unless @membership -= form_tag profile_notifications_path, method: :put, remote: true, class: 'inline-form', id: 'notification-form' do += form_tag profile_notifications_path, method: :put, remote: true, class: 'inline', id: 'notification-form' do = hidden_field_tag :notification_type, 'project' = hidden_field_tag :notification_id, @membership.id = hidden_field_tag :notification_level diff --git a/app/views/projects/new.html.haml b/app/views/projects/new.html.haml index 1b093c8f514..daab2326bc7 100644 --- a/app/views/projects/new.html.haml +++ b/app/views/projects/new.html.haml @@ -111,10 +111,10 @@ - if current_user.can_create_group? .pull-right - .light.in-line + .light.inline .space-right Need a group for several dependent projects? - = link_to new_group_path, class: "btn btn-xs" do + = link_to new_group_path, class: "btn" do Create a group .save-project-loader.hide -- cgit v1.2.1 From a0a488ed13e2a07e0dd42e8795c50ea762917f20 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 13 Oct 2015 16:41:48 +0200 Subject: Apply new design to files page Signed-off-by: Dmitriy Zaporozhets --- app/assets/javascripts/line_highlighter.js.coffee | 6 +- app/assets/stylesheets/framework/tables.scss | 2 +- .../framework/tw_bootstrap_variables.scss | 2 + app/assets/stylesheets/framework/variables.scss | 1 + app/assets/stylesheets/pages/tree.scss | 34 +++---- app/views/projects/blob/_blob.html.haml | 2 +- .../repositories/_download_archive.html.haml | 4 +- app/views/projects/tree/_readme.html.haml | 13 +-- app/views/projects/tree/_tree.html.haml | 106 +++++++++++---------- 9 files changed, 84 insertions(+), 86 deletions(-) (limited to 'app') diff --git a/app/assets/javascripts/line_highlighter.js.coffee b/app/assets/javascripts/line_highlighter.js.coffee index e604e6025c2..2254a3f91ae 100644 --- a/app/assets/javascripts/line_highlighter.js.coffee +++ b/app/assets/javascripts/line_highlighter.js.coffee @@ -6,7 +6,7 @@ # # ### Example Markup # -#
+#
#
#
# 1 @@ -53,7 +53,7 @@ class @LineHighlighter $.scrollTo("#L#{range[0]}", offset: -150) bindEvents: -> - $('#tree-content-holder').on 'mousedown', 'a[data-line-number]', @clickHandler + $('#blob-content-holder').on 'mousedown', 'a[data-line-number]', @clickHandler # While it may seem odd to bind to the mousedown event and then throw away # the click event, there is a method to our madness. @@ -62,7 +62,7 @@ class @LineHighlighter # active state even when the event is cancelled, resulting in an ugly border # around the link and/or a persisted underline text decoration. - $('#tree-content-holder').on 'click', 'a[data-line-number]', (event) -> + $('#blob-content-holder').on 'click', 'a[data-line-number]', (event) -> event.preventDefault() clickHandler: (event) => diff --git a/app/assets/stylesheets/framework/tables.scss b/app/assets/stylesheets/framework/tables.scss index 76163b3a05e..789b34020c1 100644 --- a/app/assets/stylesheets/framework/tables.scss +++ b/app/assets/stylesheets/framework/tables.scss @@ -28,7 +28,7 @@ table { border-bottom: 1px solid $border-color !important; } td { - border-color: #F1F1F1 !important; + border-color: $table-border-color !important; border-bottom: 1px solid; } } diff --git a/app/assets/stylesheets/framework/tw_bootstrap_variables.scss b/app/assets/stylesheets/framework/tw_bootstrap_variables.scss index 18632da4f2a..63868a34e2a 100644 --- a/app/assets/stylesheets/framework/tw_bootstrap_variables.scss +++ b/app/assets/stylesheets/framework/tw_bootstrap_variables.scss @@ -156,3 +156,5 @@ $nav-link-padding: 13px $gl-padding; $pre-bg: #f8fafc !default; $pre-color: $gl-gray !default; $pre-border-color: #e7e9ed; + +$table-bg-accent: $background-color; diff --git a/app/assets/stylesheets/framework/variables.scss b/app/assets/stylesheets/framework/variables.scss index eb9a2966389..91954683c3e 100644 --- a/app/assets/stylesheets/framework/variables.scss +++ b/app/assets/stylesheets/framework/variables.scss @@ -16,6 +16,7 @@ $avatar_radius: 50%; $code_font_size: 13px; $code_line_height: 1.5; $border-color: #dce0e6; +$table-border-color: #eef0f2; $background-color: #F7F8FA; $header-height: 58px; $fixed-layout-width: 1200px; diff --git a/app/assets/stylesheets/pages/tree.scss b/app/assets/stylesheets/pages/tree.scss index 271cc547e2b..dadd86e88cc 100644 --- a/app/assets/stylesheets/pages/tree.scss +++ b/app/assets/stylesheets/pages/tree.scss @@ -1,7 +1,7 @@ .tree-holder { - .tree-content-holder { - float: left; - width: 100%; + .tree-table-holder { + margin-left: -$gl-padding; + margin-right: -$gl-padding; } .tree_progress { @@ -13,10 +13,15 @@ } .tree-table { - @extend .table; - @include border-radius(0); + margin-bottom: 0; tr { + > td, > th { + padding: 10px $gl-padding; + line-height: 32px; + border-color: $table-border-color !important; + } + &:hover { td { background: $hover; @@ -27,9 +32,9 @@ } &.selected { td { - background: $background-color; - border-top: 1px solid #EEE; - border-bottom: 1px solid #EEE; + background: $gray-dark; + border-top: 1px solid $border-gray-dark; + border-bottom: 1px solid $border-gray-dark; } } } @@ -85,19 +90,6 @@ margin-right: 15px; } -.readme-holder { - margin: 0 auto; - - .readme-file-title { - font-size: 14px; - font-weight: bold; - margin-bottom: 20px; - color: #777; - border-bottom: 1px solid #DDD; - padding: 10px 0; - } -} - .blob-commit-info { list-style: none; margin: 0; diff --git a/app/views/projects/blob/_blob.html.haml b/app/views/projects/blob/_blob.html.haml index b4c7d8b9b71..a1ae1397584 100644 --- a/app/views/projects/blob/_blob.html.haml +++ b/app/views/projects/blob/_blob.html.haml @@ -19,7 +19,7 @@ - blob_commit = @repository.last_commit_for_path(@commit.id, blob.path) = render blob_commit, project: @project -%div#tree-content-holder.tree-content-holder +%div#blob-content-holder.blob-content-holder %article.file-holder .file-title = blob_icon blob.mode, blob.name diff --git a/app/views/projects/repositories/_download_archive.html.haml b/app/views/projects/repositories/_download_archive.html.haml index b9486a9b492..07c24950ee2 100644 --- a/app/views/projects/repositories/_download_archive.html.haml +++ b/app/views/projects/repositories/_download_archive.html.haml @@ -3,10 +3,10 @@ - split_button = split_button || false - if split_button == true %span.btn-group{class: btn_class} - = link_to archive_namespace_project_repository_path(@project.namespace, @project, ref: ref, format: 'zip'), class: 'btn col-xs-10', rel: 'nofollow' do + = link_to archive_namespace_project_repository_path(@project.namespace, @project, ref: ref, format: 'zip'), class: 'btn btn-success col-xs-10', rel: 'nofollow' do %i.fa.fa-download %span Download zip - %a.col-xs-2.btn.dropdown-toggle{ 'data-toggle' => 'dropdown' } + %a.col-xs-2.btn.btn-success.dropdown-toggle{ 'data-toggle' => 'dropdown' } %span.caret %span.sr-only Select Archive Format diff --git a/app/views/projects/tree/_readme.html.haml b/app/views/projects/tree/_readme.html.haml index f082d711865..7e9af19c8ba 100644 --- a/app/views/projects/tree/_readme.html.haml +++ b/app/views/projects/tree/_readme.html.haml @@ -1,7 +1,8 @@ -%article.readme-holder#README - = link_to '#README' do - %h4.readme-file-title - %i.fa.fa-file - = readme.name - .wiki +%article.file-holder.readme-holder#README + .file-title + = link_to '#README' do + %strong + %i.fa.fa-file + = readme.name + .file-content.wiki = render_readme(readme) diff --git a/app/views/projects/tree/_tree.html.haml b/app/views/projects/tree/_tree.html.haml index 457f8a4a585..7ff48e32e60 100644 --- a/app/views/projects/tree/_tree.html.haml +++ b/app/views/projects/tree/_tree.html.haml @@ -1,59 +1,61 @@ -%ul.breadcrumb.repo-breadcrumb - %li - = link_to namespace_project_tree_path(@project.namespace, @project, @ref) do - = @project.path - - tree_breadcrumbs(tree, 6) do |title, path| +.gray-content-block + %ul.breadcrumb.repo-breadcrumb %li - - if path - = link_to truncate(title, length: 40), namespace_project_tree_path(@project.namespace, @project, path) - - else - = link_to title, '#' - - if allowed_tree_edit? - %li - %span.dropdown - %a.dropdown-toggle.btn.btn-xs.add-to-tree{href: '#', "data-toggle" => "dropdown"} - = icon('plus') - %ul.dropdown-menu - %li - = link_to namespace_project_new_blob_path(@project.namespace, @project, @id), title: 'Create file', id: 'new-file-link' do - = icon('pencil fw') - Create file - %li - = link_to '#modal-upload-blob', { 'data-target' => '#modal-upload-blob', 'data-toggle' => 'modal'} do - = icon('file fw') - Upload file - %li.divider - %li - = link_to '#modal-create-new-dir', { 'data-target' => '#modal-create-new-dir', 'data-toggle' => 'modal'} do - = icon('folder fw') - New directory + = link_to namespace_project_tree_path(@project.namespace, @project, @ref) do + = @project.path + - tree_breadcrumbs(tree, 6) do |title, path| + %li + - if path + = link_to truncate(title, length: 40), namespace_project_tree_path(@project.namespace, @project, path) + - else + = link_to title, '#' + - if allowed_tree_edit? + %li + %span.dropdown + %a.dropdown-toggle.btn.add-to-tree{href: '#', "data-toggle" => "dropdown"} + = icon('plus') + %ul.dropdown-menu + %li + = link_to namespace_project_new_blob_path(@project.namespace, @project, @id), title: 'Create file', id: 'new-file-link' do + = icon('pencil fw') + Create file + %li + = link_to '#modal-upload-blob', { 'data-target' => '#modal-upload-blob', 'data-toggle' => 'modal'} do + = icon('file fw') + Upload file + %li.divider + %li + = link_to '#modal-create-new-dir', { 'data-target' => '#modal-create-new-dir', 'data-toggle' => 'modal'} do + = icon('folder fw') + New directory -%div#tree-content-holder.tree-content-holder.prepend-top-20 - %table#tree-slider{class: "table_#{@hex_path} tree-table" } - %thead - %tr - %th Name - %th Last Update - %th.hidden-xs - .pull-left Last Commit - .last-commit.hidden-sm.pull-left -   - %i.fa.fa-angle-right -   - %small.light - = link_to @commit.short_id, namespace_project_commit_path(@project.namespace, @project, @commit) - – - = truncate(@commit.title, length: 50) - = link_to 'History', namespace_project_commits_path(@project.namespace, @project, @id), class: 'pull-right' +%div#tree-content-holder.tree-content-holder + .tree-table-holder + %table.table#tree-slider{class: "table_#{@hex_path} tree-table table-striped" } + %thead + %tr + %th Name + %th Last Update + %th.hidden-xs + .pull-left Last Commit + .last-commit.hidden-sm.pull-left +   + %i.fa.fa-angle-right +   + %small.light + = link_to @commit.short_id, namespace_project_commit_path(@project.namespace, @project, @commit) + – + = truncate(@commit.title, length: 50) + = link_to 'History', namespace_project_commits_path(@project.namespace, @project, @id), class: 'pull-right' - - if @path.present? - %tr.tree-item - %td.tree-item-file-name - = link_to "..", namespace_project_tree_path(@project.namespace, @project, up_dir_path), class: 'prepend-left-10' - %td - %td.hidden-xs + - if @path.present? + %tr.tree-item + %td.tree-item-file-name + = link_to "..", namespace_project_tree_path(@project.namespace, @project, up_dir_path), class: 'prepend-left-10' + %td + %td.hidden-xs - = render_tree(tree) + = render_tree(tree) - if tree.readme = render "projects/tree/readme", readme: tree.readme -- cgit v1.2.1 From 135ec3242d803fc46087b59d10016e55207f6743 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Tue, 13 Oct 2015 18:27:25 +0200 Subject: Reduce font size of commit references to not stand out as much --- app/assets/stylesheets/generic/gfm.scss | 1 + 1 file changed, 1 insertion(+) (limited to 'app') diff --git a/app/assets/stylesheets/generic/gfm.scss b/app/assets/stylesheets/generic/gfm.scss index bd9200ace23..5ae0520fd7b 100644 --- a/app/assets/stylesheets/generic/gfm.scss +++ b/app/assets/stylesheets/generic/gfm.scss @@ -22,4 +22,5 @@ .gfm-commit, .gfm-commit_range { font-family: $monospace_font; + font-size: 90%; } -- cgit v1.2.1 From 8346dde0520ed625446ecc5d5a35b53e0b60dbb0 Mon Sep 17 00:00:00 2001 From: Valery Sizov Date: Fri, 9 Oct 2015 20:07:29 +0300 Subject: Only render 404 page from /public --- app/controllers/application_controller.rb | 6 +----- app/controllers/import/bitbucket_controller.rb | 2 +- app/controllers/import/fogbugz_controller.rb | 2 +- app/controllers/import/github_controller.rb | 2 +- app/controllers/import/gitlab_controller.rb | 2 +- app/controllers/import/gitorious_controller.rb | 2 +- app/controllers/import/google_code_controller.rb | 2 +- app/controllers/projects/avatars_controller.rb | 2 +- app/controllers/projects/blob_controller.rb | 6 +++--- app/controllers/projects/raw_controller.rb | 2 +- app/controllers/projects/tree_controller.rb | 6 +++--- app/controllers/projects/uploads_controller.rb | 2 +- app/controllers/uploads_controller.rb | 6 +++--- 13 files changed, 19 insertions(+), 23 deletions(-) (limited to 'app') diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 527c9da0faa..2b2ea3dff16 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -30,7 +30,7 @@ class ApplicationController < ActionController::Base rescue_from ActiveRecord::RecordNotFound do |exception| log_exception(exception) - render "errors/not_found", layout: "errors", status: 404 + render_404 end protected @@ -149,10 +149,6 @@ class ApplicationController < ActionController::Base render "errors/access_denied", layout: "errors", status: 404 end - def not_found! - render "errors/not_found", layout: "errors", status: 404 - end - def git_not_found! render "errors/git_not_found", layout: "errors", status: 404 end diff --git a/app/controllers/import/bitbucket_controller.rb b/app/controllers/import/bitbucket_controller.rb index f84f85a7df8..25e58724860 100644 --- a/app/controllers/import/bitbucket_controller.rb +++ b/app/controllers/import/bitbucket_controller.rb @@ -62,7 +62,7 @@ class Import::BitbucketController < Import::BaseController end def verify_bitbucket_import_enabled - not_found! unless bitbucket_import_enabled? + render_404 unless bitbucket_import_enabled? end def bitbucket_auth diff --git a/app/controllers/import/fogbugz_controller.rb b/app/controllers/import/fogbugz_controller.rb index 849646cd665..18300390851 100644 --- a/app/controllers/import/fogbugz_controller.rb +++ b/app/controllers/import/fogbugz_controller.rb @@ -99,6 +99,6 @@ class Import::FogbugzController < Import::BaseController end def verify_fogbugz_import_enabled - not_found! unless fogbugz_import_enabled? + render_404 unless fogbugz_import_enabled? end end diff --git a/app/controllers/import/github_controller.rb b/app/controllers/import/github_controller.rb index f21fbd9ecca..aae77d384c6 100644 --- a/app/controllers/import/github_controller.rb +++ b/app/controllers/import/github_controller.rb @@ -47,7 +47,7 @@ class Import::GithubController < Import::BaseController end def verify_github_import_enabled - not_found! unless github_import_enabled? + render_404 unless github_import_enabled? end def github_auth diff --git a/app/controllers/import/gitlab_controller.rb b/app/controllers/import/gitlab_controller.rb index 27af19f5f61..23a396e8084 100644 --- a/app/controllers/import/gitlab_controller.rb +++ b/app/controllers/import/gitlab_controller.rb @@ -44,7 +44,7 @@ class Import::GitlabController < Import::BaseController end def verify_gitlab_import_enabled - not_found! unless gitlab_import_enabled? + render_404 unless gitlab_import_enabled? end def gitlab_auth diff --git a/app/controllers/import/gitorious_controller.rb b/app/controllers/import/gitorious_controller.rb index f24cdb3709a..eecbe380c9e 100644 --- a/app/controllers/import/gitorious_controller.rb +++ b/app/controllers/import/gitorious_controller.rb @@ -42,7 +42,7 @@ class Import::GitoriousController < Import::BaseController end def verify_gitorious_import_enabled - not_found! unless gitorious_import_enabled? + render_404 unless gitorious_import_enabled? end end diff --git a/app/controllers/import/google_code_controller.rb b/app/controllers/import/google_code_controller.rb index 82fadeb7e83..41472a6fe6c 100644 --- a/app/controllers/import/google_code_controller.rb +++ b/app/controllers/import/google_code_controller.rb @@ -106,7 +106,7 @@ class Import::GoogleCodeController < Import::BaseController end def verify_google_code_import_enabled - not_found! unless google_code_import_enabled? + render_404 unless google_code_import_enabled? end def user_map diff --git a/app/controllers/projects/avatars_controller.rb b/app/controllers/projects/avatars_controller.rb index 9c3763d5934..548f1b9ebfe 100644 --- a/app/controllers/projects/avatars_controller.rb +++ b/app/controllers/projects/avatars_controller.rb @@ -12,7 +12,7 @@ class Projects::AvatarsController < Projects::ApplicationController filename: @blob.name ) else - not_found! + render_404 end end diff --git a/app/controllers/projects/blob_controller.rb b/app/controllers/projects/blob_controller.rb index ae9b1384463..8cc2f21d887 100644 --- a/app/controllers/projects/blob_controller.rb +++ b/app/controllers/projects/blob_controller.rb @@ -113,14 +113,14 @@ class Projects::BlobController < Projects::ApplicationController end end - return not_found! + return render_404 end end def commit @commit = @repository.commit(@ref) - return not_found! unless @commit + return render_404 unless @commit end def assign_blob_vars @@ -128,7 +128,7 @@ class Projects::BlobController < Projects::ApplicationController @ref, @path = extract_ref(@id) rescue InvalidPathError - not_found! + render_404 end def after_edit_path diff --git a/app/controllers/projects/raw_controller.rb b/app/controllers/projects/raw_controller.rb index 5f6fbce795e..d5ee6ac8663 100644 --- a/app/controllers/projects/raw_controller.rb +++ b/app/controllers/projects/raw_controller.rb @@ -20,7 +20,7 @@ class Projects::RawController < Projects::ApplicationController disposition: 'inline' ) else - not_found! + render_404 end end diff --git a/app/controllers/projects/tree_controller.rb b/app/controllers/projects/tree_controller.rb index 7eaff1d61ee..bdcb1a3e297 100644 --- a/app/controllers/projects/tree_controller.rb +++ b/app/controllers/projects/tree_controller.rb @@ -10,7 +10,7 @@ class Projects::TreeController < Projects::ApplicationController before_action :authorize_push_code!, only: [:create_dir] def show - return not_found! unless @repository.commit(@ref) + return render_404 unless @repository.commit(@ref) if tree.entries.empty? if @repository.blob_at(@commit.id, @path) @@ -19,7 +19,7 @@ class Projects::TreeController < Projects::ApplicationController File.join(@ref, @path)) ) and return elsif @path.present? - return not_found! + return render_404 end end @@ -31,7 +31,7 @@ class Projects::TreeController < Projects::ApplicationController end def create_dir - return not_found! unless @commit_params.values.all? + return render_404 unless @commit_params.values.all? begin result = Files::CreateDirService.new(@project, current_user, @commit_params).execute diff --git a/app/controllers/projects/uploads_controller.rb b/app/controllers/projects/uploads_controller.rb index 71ecc20dd95..e1fe7ea2114 100644 --- a/app/controllers/projects/uploads_controller.rb +++ b/app/controllers/projects/uploads_controller.rb @@ -20,7 +20,7 @@ class Projects::UploadsController < Projects::ApplicationController end def show - return not_found! if uploader.nil? || !uploader.file.exists? + return render_404 if uploader.nil? || !uploader.file.exists? disposition = uploader.image? ? 'inline' : 'attachment' send_file uploader.file.path, disposition: disposition diff --git a/app/controllers/uploads_controller.rb b/app/controllers/uploads_controller.rb index 28536e359e5..868b05929d7 100644 --- a/app/controllers/uploads_controller.rb +++ b/app/controllers/uploads_controller.rb @@ -10,7 +10,7 @@ class UploadsController < ApplicationController end unless uploader.file && uploader.file.exists? - return not_found! + return render_404 end disposition = uploader.image? ? 'inline' : 'attachment' @@ -21,7 +21,7 @@ class UploadsController < ApplicationController def find_model unless upload_model && upload_mount - return not_found! + return render_404 end @model = upload_model.find(params[:id]) @@ -44,7 +44,7 @@ class UploadsController < ApplicationController return if authorized if current_user - not_found! + render_404 else authenticate_user! end -- cgit v1.2.1 From 276b3a7bc202bd9b51c8f5401f4c525227f3a4d8 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Wed, 14 Oct 2015 09:27:30 +0200 Subject: Make Mentionable#cross_reference_exists? private. --- app/models/concerns/mentionable.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'app') diff --git a/app/models/concerns/mentionable.rb b/app/models/concerns/mentionable.rb index 5f53ea25630..b34def66d2e 100644 --- a/app/models/concerns/mentionable.rb +++ b/app/models/concerns/mentionable.rb @@ -41,12 +41,6 @@ module Mentionable self end - # Determine whether or not a cross-reference Note has already been created between this Mentionable and - # the specified target. - def cross_reference_exists?(target) - SystemNoteService.cross_reference_exists?(target, local_reference) - end - def all_references(current_user = self.author, text = self.mentionable_text) ext = Gitlab::ReferenceExtractor.new(self.project, current_user) ext.analyze(text) @@ -111,4 +105,10 @@ module Mentionable # Only include changed fields that are mentionable source.select { |key, val| mentionable.include?(key) } end + + # Determine whether or not a cross-reference Note has already been created between this Mentionable and + # the specified target. + def cross_reference_exists?(target) + SystemNoteService.cross_reference_exists?(target, local_reference) + end end -- cgit v1.2.1 From 33c9d6e45c0800fd5a312af2c286826764fd7589 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Tue, 13 Oct 2015 16:51:13 +0200 Subject: Fix retry and cancel for build --- app/models/ci/build.rb | 4 ++-- app/views/projects/commit/ci.html.haml | 22 +++++++++++++--------- .../commit_statuses/_commit_status.html.haml | 6 +++--- 3 files changed, 18 insertions(+), 14 deletions(-) (limited to 'app') diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index f8c731a7bf7..cfafbf6786e 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -220,14 +220,14 @@ module Ci def cancel_url if active? Gitlab::Application.routes.url_helpers. - cancel_namespace_project_build_path(gl_project.namespace, gl_project, self, return_to: request.original_url) + cancel_namespace_project_build_path(gl_project.namespace, gl_project, self) end end def retry_url if commands.present? Gitlab::Application.routes.url_helpers. - cancel_namespace_project_build_path(gl_project.namespace, gl_project, self, return_to: request.original_url) + retry_namespace_project_build_path(gl_project.namespace, gl_project, self) end end diff --git a/app/views/projects/commit/ci.html.haml b/app/views/projects/commit/ci.html.haml index 4a1ef378a30..ca71a91af15 100644 --- a/app/views/projects/commit/ci.html.haml +++ b/app/views/projects/commit/ci.html.haml @@ -3,11 +3,6 @@ = render "commit_box" = render "ci_menu" -- if @ci_project && current_user && can?(current_user, :manage_builds, @project) - .pull-right - - if @ci_commit.builds.running_or_pending.any? - = link_to "Cancel", cancel_builds_namespace_project_commit_path(@project.namespace, @project, @commit.sha), class: 'btn btn-sm btn-danger' - - if @ci_commit.yaml_errors.present? .bs-callout.bs-callout-danger @@ -22,11 +17,18 @@ .gray-content-block.second-block Latest builds - - if @ci_commit.duration > 0 - %small.pull-right + + .pull-right + - if @ci_commit.duration > 0 %i.fa.fa-time #{time_interval_in_words @ci_commit.duration} +   + + - if @ci_project && current_user && can?(current_user, :manage_builds, @project) + - if @ci_commit.builds.running_or_pending.any? + = link_to "Cancel all", cancel_builds_namespace_project_commit_path(@project.namespace, @project, @commit.sha), class: 'btn btn-xs btn-danger' + %table.table.builds %thead %tr @@ -41,7 +43,8 @@ %th Coverage %th - @ci_commit.refs.each do |ref| - = render partial: "projects/commit_statuses/commit_status", collection: @ci_commit.statuses.for_ref(ref).latest.ordered, coverage: @ci_project.try(:coverage_enabled?), controls: true + = render partial: "projects/commit_statuses/commit_status", collection: @ci_commit.statuses.for_ref(ref).latest.ordered, + locals: { coverage: @ci_project.try(:coverage_enabled?), allow_retry: true } - if @ci_commit.retried.any? .gray-content-block.second-block @@ -60,4 +63,5 @@ - if @ci_project && @ci_project.coverage_enabled? %th Coverage %th - = render partial: "projects/commit_statuses/commit_status", collection: @ci_commit.retried, coverage: @ci_project.try(:coverage_enabled?) + = render partial: "projects/commit_statuses/commit_status", collection: @ci_commit.retried, + locals: { coverage: @ci_project.try(:coverage_enabled?) } diff --git a/app/views/projects/commit_statuses/_commit_status.html.haml b/app/views/projects/commit_statuses/_commit_status.html.haml index e3a17faf0bd..7314f8e79d3 100644 --- a/app/views/projects/commit_statuses/_commit_status.html.haml +++ b/app/views/projects/commit_statuses/_commit_status.html.haml @@ -41,11 +41,11 @@ #{commit_status.coverage}% %td - - if defined?(controls) && controls && current_user && can?(current_user, :manage_builds, gl_project) - .pull-right + .pull-right + - if current_user && can?(current_user, :manage_builds, commit_status.gl_project) - if commit_status.cancel_url = link_to commit_status.cancel_url, title: 'Cancel' do %i.fa.fa-remove.cred - - elsif commit_status.retry_url + - elsif defined?(allow_retry) && allow_retry && commit_status.retry_url = link_to commit_status.retry_url, method: :post, title: 'Retry' do %i.fa.fa-repeat -- cgit v1.2.1 From 7b5ab3ded5e6f5d88f04802d5a71a9ae94d20f92 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Mon, 12 Oct 2015 17:06:53 +0200 Subject: Added CI_BUILD_TAG, _STAGE, _NAME and _TRIGGERED to CI builds --- app/models/ci/build.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index cfafbf6786e..481440e869f 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -119,7 +119,7 @@ module Ci end def variables - yaml_variables + project_variables + trigger_variables + predefined_variables + yaml_variables + project_variables + trigger_variables end def project @@ -258,5 +258,14 @@ module Ci [] end end + + def predefined_variables + variables = [] + variables << { key: :CI_BUILD_TAG, value: ref, public: true } if tag + variables << { key: :CI_BUILD_NAME, value: name, public: true } + variables << { key: :CI_BUILD_STAGE, value: stage, public: true } + variables << { key: :CI_BUILD_TRIGGERED, value: 'true', public: true } if trigger_request + variables + end end end -- cgit v1.2.1 From 58074195198e715045dc5280aed9515297fe7ad3 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Tue, 13 Oct 2015 17:00:55 +0200 Subject: Use tag? instead of tag to indicate that this is boolean --- app/models/ci/build.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index 481440e869f..23aed6d9952 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -261,7 +261,7 @@ module Ci def predefined_variables variables = [] - variables << { key: :CI_BUILD_TAG, value: ref, public: true } if tag + variables << { key: :CI_BUILD_TAG, value: ref, public: true } if tag? variables << { key: :CI_BUILD_NAME, value: name, public: true } variables << { key: :CI_BUILD_STAGE, value: stage, public: true } variables << { key: :CI_BUILD_TRIGGERED, value: 'true', public: true } if trigger_request -- cgit v1.2.1 From 7af4f5215e28927830cbc74d383cdfeb9e4ef587 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Mon, 12 Oct 2015 21:12:31 +0200 Subject: Show warning if build doesn't have runners with specified tags or runners didn't connect recently Slightly refactor runner status detection: moving it to Runner class Signed-off-by: Kamil Trzcinski --- app/controllers/ci/admin/runners_controller.rb | 4 ++-- app/controllers/projects/runners_controller.rb | 2 +- app/helpers/runners_helper.rb | 26 +++++++++------------- app/models/ci/build.rb | 12 ++++++++++ app/models/ci/project.rb | 6 ++--- app/models/ci/runner.rb | 17 ++++++++++++++ app/models/commit_status.rb | 4 ++++ app/services/ci/register_build_service.rb | 2 +- app/views/projects/builds/show.html.haml | 21 +++++++++++++++++ .../commit_statuses/_commit_status.html.haml | 4 ++++ 10 files changed, 76 insertions(+), 22 deletions(-) (limited to 'app') diff --git a/app/controllers/ci/admin/runners_controller.rb b/app/controllers/ci/admin/runners_controller.rb index 9a68add9083..110954a612d 100644 --- a/app/controllers/ci/admin/runners_controller.rb +++ b/app/controllers/ci/admin/runners_controller.rb @@ -6,7 +6,7 @@ module Ci @runners = Ci::Runner.order('id DESC') @runners = @runners.search(params[:search]) if params[:search].present? @runners = @runners.page(params[:page]).per(30) - @active_runners_cnt = Ci::Runner.where("contacted_at > ?", 1.minutes.ago).count + @active_runners_cnt = Ci::Runner.online.count end def show @@ -66,7 +66,7 @@ module Ci end def runner_params - params.require(:runner).permit(:token, :description, :tag_list, :contacted_at, :active) + params.require(:runner).permit(:token, :description, :tag_list, :active) end end end diff --git a/app/controllers/projects/runners_controller.rb b/app/controllers/projects/runners_controller.rb index 6cb6e3ef6d4..deb07a21416 100644 --- a/app/controllers/projects/runners_controller.rb +++ b/app/controllers/projects/runners_controller.rb @@ -60,6 +60,6 @@ class Projects::RunnersController < Projects::ApplicationController end def runner_params - params.require(:runner).permit(:description, :tag_list, :contacted_at, :active) + params.require(:runner).permit(:description, :tag_list, :active) end end diff --git a/app/helpers/runners_helper.rb b/app/helpers/runners_helper.rb index 5d7d06c8490..f79fef03ae8 100644 --- a/app/helpers/runners_helper.rb +++ b/app/helpers/runners_helper.rb @@ -1,20 +1,16 @@ module RunnersHelper def runner_status_icon(runner) - unless runner.contacted_at - return content_tag :i, nil, - class: "fa fa-warning-sign", - title: "New runner. Has not connected yet" - end - - status = - if runner.active? - runner.contacted_at > 3.hour.ago ? :online : :offline - else - :paused - end + status = runner.status + case status + when :not_connected + content_tag :i, nil, + class: "fa fa-warning-sign", + title: "New runner. Has not connected yet" - content_tag :i, nil, - class: "fa fa-circle runner-status-#{status}", - title: "Runner is #{status}, last contact was #{time_ago_in_words(runner.contacted_at)} ago" + when :online, :offline, :paused + content_tag :i, nil, + class: "fa fa-circle runner-status-#{status}", + title: "Runner is #{status}, last contact was #{time_ago_in_words(runner.contacted_at)} ago" + end end end diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index cfafbf6786e..2c7cad46b00 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -231,6 +231,18 @@ module Ci end end + def can_be_served?(runner) + (tag_list - runner.tag_list).empty? + end + + def any_runners_online? + project.any_runners? { |runner| runner.active? && runner.online? && can_be_served?(runner) } + end + + def show_warning? + pending? && !any_runners_online? + end + private def yaml_variables diff --git a/app/models/ci/project.rb b/app/models/ci/project.rb index 88ba933a434..ef28353a30c 100644 --- a/app/models/ci/project.rb +++ b/app/models/ci/project.rb @@ -115,12 +115,12 @@ module Ci web_url end - def any_runners? - if runners.active.any? + def any_runners?(&block) + if runners.active.any?(&block) return true end - shared_runners_enabled && Ci::Runner.shared.active.any? + shared_runners_enabled && Ci::Runner.shared.active.any?(&block) end def set_default_values diff --git a/app/models/ci/runner.rb b/app/models/ci/runner.rb index 6838ccfaaab..02a3e9db1fa 100644 --- a/app/models/ci/runner.rb +++ b/app/models/ci/runner.rb @@ -20,6 +20,8 @@ module Ci class Runner < ActiveRecord::Base extend Ci::Model + + LAST_CONTACT_TIME = 5.minutes.ago has_many :builds, class_name: 'Ci::Build' has_many :runner_projects, dependent: :destroy, class_name: 'Ci::RunnerProject' @@ -33,6 +35,7 @@ module Ci scope :shared, ->() { where(is_shared: true) } scope :active, ->() { where(active: true) } scope :paused, ->() { where(active: false) } + scope :online, ->() { where('contacted_at > ?', LAST_CONTACT_TIME) } acts_as_taggable @@ -65,6 +68,20 @@ module Ci is_shared end + def online? + contacted_at && contacted_at > LAST_CONTACT_TIME + end + + def status + if contacted_at.nil? + :not_connected + elsif active? + online? ? :online : :offline + else + :paused + end + end + def belongs_to_one_project? runner_projects.count == 1 end diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb index b4d91b1b0c3..92905c618eb 100644 --- a/app/models/commit_status.rb +++ b/app/models/commit_status.rb @@ -88,4 +88,8 @@ class CommitStatus < ActiveRecord::Base def retry_url nil end + + def show_warning? + false + end end diff --git a/app/services/ci/register_build_service.rb b/app/services/ci/register_build_service.rb index 71b61bbe389..7beb098659c 100644 --- a/app/services/ci/register_build_service.rb +++ b/app/services/ci/register_build_service.rb @@ -17,7 +17,7 @@ module Ci builds = builds.order('created_at ASC') build = builds.find do |build| - (build.tag_list - current_runner.tag_list).empty? + build.can_be_served?(current_runner) end diff --git a/app/views/projects/builds/show.html.haml b/app/views/projects/builds/show.html.haml index 9c3ae622b72..70a93eb5976 100644 --- a/app/views/projects/builds/show.html.haml +++ b/app/views/projects/builds/show.html.haml @@ -39,6 +39,27 @@ .pull-right = @build.updated_at.stamp('19:00 Aug 27') + - if @build.show_warning? + - unless @build.any_runners_online? + .bs-callout.bs-callout-warning + %p + - if no_runners_for_project?(@build.project) + This build is stuck, because the project doesn't have runners assigned. + - elsif @build.tags.any? + This build is stuck. + %br + This build is stuck, because you don't have any active runners online with these tags assigned to the project: + - @build.tags.each do |tag| + %span.label.label-primary + = tag + - else + This build is stuck, because you don't have any active runners online that can run this build. + + %br + Go to + = link_to namespace_project_runners_path(@build.gl_project.namespace, @build.gl_project) do + Runners page + .row.prepend-top-default .col-md-9 .clearfix diff --git a/app/views/projects/commit_statuses/_commit_status.html.haml b/app/views/projects/commit_statuses/_commit_status.html.haml index 7314f8e79d3..99fdde45402 100644 --- a/app/views/projects/commit_statuses/_commit_status.html.haml +++ b/app/views/projects/commit_statuses/_commit_status.html.haml @@ -2,6 +2,10 @@ %td.status = ci_status_with_icon(commit_status.status) + - if commit_status.show_warning? + .pull-right + %i.fa.fa-warning-sign.text-warning + %td.commit_status-link - if commit_status.target_url = link_to commit_status.target_url do -- cgit v1.2.1 From d9e2232f6393a1627847c9f6c2be3c4f987d0797 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Wed, 14 Oct 2015 13:51:29 +0200 Subject: Fix warning sign --- app/helpers/runners_helper.rb | 2 +- app/views/projects/builds/show.html.haml | 2 +- app/views/projects/commit_statuses/_commit_status.html.haml | 7 +++---- 3 files changed, 5 insertions(+), 6 deletions(-) (limited to 'app') diff --git a/app/helpers/runners_helper.rb b/app/helpers/runners_helper.rb index f79fef03ae8..5afebab88e1 100644 --- a/app/helpers/runners_helper.rb +++ b/app/helpers/runners_helper.rb @@ -4,7 +4,7 @@ module RunnersHelper case status when :not_connected content_tag :i, nil, - class: "fa fa-warning-sign", + class: "fa fa-warning", title: "New runner. Has not connected yet" when :online, :offline, :paused diff --git a/app/views/projects/builds/show.html.haml b/app/views/projects/builds/show.html.haml index 70a93eb5976..91c1b16c9f6 100644 --- a/app/views/projects/builds/show.html.haml +++ b/app/views/projects/builds/show.html.haml @@ -25,7 +25,7 @@ %a Build ##{@build.id} · - %i.fa.fa-warning-sign + %i.fa.fa-warning This build was retried. .gray-content-block.second-block diff --git a/app/views/projects/commit_statuses/_commit_status.html.haml b/app/views/projects/commit_statuses/_commit_status.html.haml index 99fdde45402..637154f56aa 100644 --- a/app/views/projects/commit_statuses/_commit_status.html.haml +++ b/app/views/projects/commit_statuses/_commit_status.html.haml @@ -2,10 +2,6 @@ %td.status = ci_status_with_icon(commit_status.status) - - if commit_status.show_warning? - .pull-right - %i.fa.fa-warning-sign.text-warning - %td.commit_status-link - if commit_status.target_url = link_to commit_status.target_url do @@ -13,6 +9,9 @@ - else %strong Build ##{commit_status.id} + - if commit_status.show_warning? + %i.fa.fa-warning.text-warning + %td = commit_status.ref -- cgit v1.2.1 From 8f584d5f2c8dc036214a7fc71ce864fe23b4cb9e Mon Sep 17 00:00:00 2001 From: Valery Sizov Date: Tue, 6 Oct 2015 17:09:03 +0300 Subject: Fix: Images cannot show when projects' path was changed --- app/models/namespace.rb | 2 ++ app/models/project.rb | 2 ++ app/services/projects/transfer_service.rb | 4 ++++ app/uploaders/file_uploader.rb | 2 +- 4 files changed, 9 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/models/namespace.rb b/app/models/namespace.rb index bc8525df5a5..5782e649f8b 100644 --- a/app/models/namespace.rb +++ b/app/models/namespace.rb @@ -118,6 +118,8 @@ class Namespace < ActiveRecord::Base gitlab_shell.add_namespace(path_was) if gitlab_shell.mv_namespace(path_was, path) + Gitlab::UploadsTransfer.new.rename_namespace(path_was, path) + # If repositories moved successfully we need to # send update instructions to users. # However we cannot allow rollback since we moved namespace dir diff --git a/app/models/project.rb b/app/models/project.rb index 021920008ad..cd30467fae3 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -656,6 +656,8 @@ class Project < ActiveRecord::Base # db changes in order to prevent out of sync between db and fs raise Exception.new('repository cannot be renamed') end + + Gitlab::UploadsTransfer.new.rename_project(path_was, path, namespace.path) end def hook_attrs diff --git a/app/services/projects/transfer_service.rb b/app/services/projects/transfer_service.rb index c327c244f0d..64ea6dd42eb 100644 --- a/app/services/projects/transfer_service.rb +++ b/app/services/projects/transfer_service.rb @@ -27,6 +27,7 @@ module Projects def transfer(project, new_namespace) Project.transaction do old_path = project.path_with_namespace + old_namespace = project.namespace new_path = File.join(new_namespace.try(:path) || '', project.path) if Project.where(path: project.path, namespace_id: new_namespace.try(:id)).present? @@ -51,6 +52,9 @@ module Projects # clear project cached events project.reset_events_cache + # Move uploads + Gitlab::UploadsTransfer.new.move_project(project.path, old_namespace.path, new_namespace.path) + true end end diff --git a/app/uploaders/file_uploader.rb b/app/uploaders/file_uploader.rb index f9673abbfe8..e8211585834 100644 --- a/app/uploaders/file_uploader.rb +++ b/app/uploaders/file_uploader.rb @@ -26,7 +26,7 @@ class FileUploader < CarrierWave::Uploader::Base end def secure_url - File.join(Gitlab.config.gitlab.url, @project.path_with_namespace, "uploads", @secret, file.filename) + File.join("/uploads", @secret, file.filename) end def file_storage? -- cgit v1.2.1