Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-10-01 13:33:51 +0300
committerDouwe Maan <douwe@gitlab.com>2015-10-01 13:33:51 +0300
commit7c7b664c01a87817ce3f35fb6bdab2498cff4f5d (patch)
tree19f001c79fb1ac98625b477152372b8b1ec49783 /app
parent333463ddf280180d1878186160eb5a5e9c5c6e3e (diff)
parent1ca119930fc5f6125ca4d5db4e1a658d5df9dfcd (diff)
Merge branch 'master' into flevour/gitlab-ce-project-path-insensitive-lookup
Diffstat (limited to 'app')
-rwxr-xr-xapp/assets/fonts/SourceSansPro-Bold.ttfbin148932 -> 291424 bytes
-rwxr-xr-xapp/assets/fonts/SourceSansPro-Light.ttfbin150244 -> 293220 bytes
-rwxr-xr-xapp/assets/fonts/SourceSansPro-Regular.ttfbin149972 -> 293956 bytes
-rwxr-xr-xapp/assets/fonts/SourceSansPro-Semibold.ttfbin149636 -> 292404 bytes
-rw-r--r--app/assets/javascripts/ci/pager.js.coffee42
-rw-r--r--app/assets/javascripts/issuable_context.js.coffee9
-rw-r--r--app/assets/javascripts/project.js.coffee16
-rw-r--r--app/assets/stylesheets/base/gl_variables.scss12
-rw-r--r--app/assets/stylesheets/base/mixins.scss74
-rw-r--r--app/assets/stylesheets/base/variables.scss4
-rw-r--r--app/assets/stylesheets/ci/projects.scss34
-rw-r--r--app/assets/stylesheets/ci/status.scss37
-rw-r--r--app/assets/stylesheets/generic/avatar.scss2
-rw-r--r--app/assets/stylesheets/generic/blocks.scss7
-rw-r--r--app/assets/stylesheets/generic/buttons.scss138
-rw-r--r--app/assets/stylesheets/generic/callout.scss45
-rw-r--r--app/assets/stylesheets/generic/common.scss4
-rw-r--r--app/assets/stylesheets/generic/header.scss1
-rw-r--r--app/assets/stylesheets/generic/pagination.scss34
-rw-r--r--app/assets/stylesheets/generic/sidebar.scss3
-rw-r--r--app/assets/stylesheets/generic/typography.scss36
-rw-r--r--app/assets/stylesheets/highlight/white.scss7
-rw-r--r--app/assets/stylesheets/pages/groups.scss6
-rw-r--r--app/assets/stylesheets/pages/note_form.scss2
-rw-r--r--app/assets/stylesheets/pages/projects.scss252
-rw-r--r--app/controllers/admin/users_controller.rb8
-rw-r--r--app/controllers/ci/application_controller.rb2
-rw-r--r--app/controllers/ci/charts_controller.rb24
-rw-r--r--app/controllers/ci/projects_controller.rb91
-rw-r--r--app/controllers/ci/runner_projects_controller.rb8
-rw-r--r--app/controllers/ci/runners_controller.rb73
-rw-r--r--app/controllers/ci/triggers_controller.rb43
-rw-r--r--app/controllers/ci/variables_controller.rb33
-rw-r--r--app/controllers/help_controller.rb5
-rw-r--r--app/controllers/profiles/two_factor_auths_controller.rb2
-rw-r--r--app/controllers/projects/application_controller.rb10
-rw-r--r--app/controllers/projects/ci_settings_controller.rb36
-rw-r--r--app/controllers/projects/commit_controller.rb2
-rw-r--r--app/controllers/projects/compare_controller.rb10
-rw-r--r--app/controllers/projects/graphs_controller.rb11
-rw-r--r--app/controllers/projects/merge_requests_controller.rb10
-rw-r--r--app/controllers/projects/runners_controller.rb65
-rw-r--r--app/controllers/projects/triggers_controller.rb35
-rw-r--r--app/controllers/projects/variables_controller.rb25
-rw-r--r--app/controllers/projects_controller.rb4
-rw-r--r--app/controllers/root_controller.rb4
-rw-r--r--app/controllers/sessions_controller.rb2
-rw-r--r--app/helpers/auth_helper.rb2
-rw-r--r--app/helpers/builds_helper.rb17
-rw-r--r--app/helpers/ci/application_helper.rb32
-rw-r--r--app/helpers/ci/builds_helper.rb41
-rw-r--r--app/helpers/ci/commits_helper.rb15
-rw-r--r--app/helpers/ci/gitlab_helper.rb4
-rw-r--r--app/helpers/ci/icons_helper.rb11
-rw-r--r--app/helpers/ci/routes_helper.rb29
-rw-r--r--app/helpers/ci/runners_helper.rb22
-rw-r--r--app/helpers/ci/triggers_helper.rb7
-rw-r--r--app/helpers/ci/user_helper.rb15
-rw-r--r--app/helpers/ci_status_helper.rb44
-rw-r--r--app/helpers/commits_helper.rb2
-rw-r--r--app/helpers/gitlab_markdown_helper.rb6
-rw-r--r--app/helpers/gitlab_routing_helper.rb8
-rw-r--r--app/helpers/graph_helper.rb5
-rw-r--r--app/helpers/notifications_helper.rb45
-rw-r--r--app/helpers/preferences_helper.rb4
-rw-r--r--app/helpers/projects_helper.rb4
-rw-r--r--app/helpers/runners_helper.rb20
-rw-r--r--app/helpers/time_helper.rb27
-rw-r--r--app/helpers/triggers_helper.rb5
-rw-r--r--app/helpers/version_check_helper.rb2
-rw-r--r--app/mailers/ci/notify.rb1
-rw-r--r--app/mailers/emails/notes.rb6
-rw-r--r--app/mailers/notify.rb4
-rw-r--r--app/models/ci/build.rb6
-rw-r--r--app/models/ci/commit.rb31
-rw-r--r--app/models/ci/project.rb55
-rw-r--r--app/models/ci/runner.rb4
-rw-r--r--app/models/merge_request.rb14
-rw-r--r--app/models/merge_request_diff.rb4
-rw-r--r--app/models/notification.rb21
-rw-r--r--app/models/project.rb31
-rw-r--r--app/models/project_services/buildkite_service.rb8
-rw-r--r--app/models/project_services/ci/hip_chat_message.rb8
-rw-r--r--app/models/project_services/ci/slack_message.rb10
-rw-r--r--app/models/project_services/drone_ci_service.rb16
-rw-r--r--app/models/project_services/gitlab_ci_service.rb92
-rw-r--r--app/models/sent_notification.rb20
-rw-r--r--app/models/user.rb2
-rw-r--r--app/services/ci/create_project_service.rb9
-rw-r--r--app/services/ci/register_build_service.rb6
-rw-r--r--app/services/compare_service.rb5
-rw-r--r--app/services/git_push_service.rb12
-rw-r--r--app/services/milestones/destroy_service.rb5
-rw-r--r--app/services/projects/fork_service.rb2
-rw-r--r--app/views/admin/application_settings/_form.html.haml2
-rw-r--r--app/views/admin/dashboard/index.html.haml2
-rw-r--r--app/views/admin/labels/index.html.haml4
-rw-r--r--app/views/admin/users/_head.html.haml2
-rw-r--r--app/views/admin/users/index.html.haml2
-rw-r--r--app/views/ci/admin/builds/_build.html.haml4
-rw-r--r--app/views/ci/admin/projects/_project.html.haml7
-rw-r--r--app/views/ci/admin/runners/show.html.haml4
-rw-r--r--app/views/ci/builds/_build.html.haml4
-rw-r--r--app/views/ci/builds/show.html.haml69
-rw-r--r--app/views/ci/charts/_overall.haml21
-rw-r--r--app/views/ci/charts/show.html.haml4
-rw-r--r--app/views/ci/commits/_commit.html.haml4
-rw-r--r--app/views/ci/commits/show.html.haml55
-rw-r--r--app/views/ci/projects/_project.html.haml36
-rw-r--r--app/views/ci/projects/_public.html.haml16
-rw-r--r--app/views/ci/projects/_search.html.haml11
-rw-r--r--app/views/ci/projects/disabled.html.haml2
-rw-r--r--app/views/ci/projects/index.html.haml30
-rw-r--r--app/views/ci/projects/show.html.haml2
-rw-r--r--app/views/ci/shared/_guide.html.haml2
-rw-r--r--app/views/dashboard/projects/_projects.html.haml4
-rw-r--r--app/views/groups/_projects.html.haml2
-rw-r--r--app/views/help/index.html.haml36
-rw-r--r--app/views/kaminari/gitlab/_first_page.html.haml2
-rw-r--r--app/views/kaminari/gitlab/_last_page.html.haml2
-rw-r--r--app/views/kaminari/gitlab/_paginator.html.haml11
-rw-r--r--app/views/layouts/ci/_nav_admin.html.haml10
-rw-r--r--app/views/layouts/ci/_nav_project.html.haml65
-rw-r--r--app/views/layouts/ci/_page.html.haml5
-rw-r--r--app/views/layouts/nav/_dashboard.html.haml7
-rw-r--r--app/views/layouts/nav/_project_settings.html.haml21
-rw-r--r--app/views/profiles/notifications/show.html.haml2
-rw-r--r--app/views/projects/_home_panel.html.haml33
-rw-r--r--app/views/projects/_readme.html.haml2
-rw-r--r--app/views/projects/buttons/_dropdown.html.haml2
-rw-r--r--app/views/projects/buttons/_fork.html.haml1
-rw-r--r--app/views/projects/buttons/_notifications.html.haml14
-rw-r--r--app/views/projects/buttons/_star.html.haml5
-rw-r--r--app/views/projects/ci_settings/_form.html.haml (renamed from app/views/ci/projects/_form.html.haml)21
-rw-r--r--app/views/projects/ci_settings/edit.html.haml (renamed from app/views/ci/projects/edit.html.haml)8
-rw-r--r--app/views/projects/commit/_commit_box.html.haml7
-rw-r--r--app/views/projects/commits/_commit.html.haml10
-rw-r--r--app/views/projects/empty.html.haml74
-rw-r--r--app/views/projects/graphs/_head.html.haml4
-rw-r--r--app/views/projects/graphs/ci.html.haml7
-rw-r--r--app/views/projects/graphs/ci/_build_times.haml (renamed from app/views/ci/charts/_build_times.haml)0
-rw-r--r--app/views/projects/graphs/ci/_builds.haml (renamed from app/views/ci/charts/_builds.haml)0
-rw-r--r--app/views/projects/graphs/ci/_overall.haml22
-rw-r--r--app/views/projects/graphs/commits.html.haml76
-rw-r--r--app/views/projects/merge_requests/widget/_heading.html.haml3
-rw-r--r--app/views/projects/merge_requests/widget/_merged.html.haml2
-rw-r--r--app/views/projects/milestones/_form.html.haml2
-rw-r--r--app/views/projects/network/show.json.erb2
-rw-r--r--app/views/projects/notes/_edit_form.html.haml2
-rw-r--r--app/views/projects/notes/_form.html.haml2
-rw-r--r--app/views/projects/runners/_runner.html.haml (renamed from app/views/ci/runners/_runner.html.haml)13
-rw-r--r--app/views/projects/runners/_shared_runners.html.haml (renamed from app/views/ci/runners/_shared_runners.html.haml)8
-rw-r--r--app/views/projects/runners/_specific_runners.html.haml (renamed from app/views/ci/runners/_specific_runners.html.haml)6
-rw-r--r--app/views/projects/runners/edit.html.haml (renamed from app/views/ci/runners/edit.html.haml)2
-rw-r--r--app/views/projects/runners/index.html.haml (renamed from app/views/ci/runners/index.html.haml)0
-rw-r--r--app/views/projects/runners/show.html.haml (renamed from app/views/ci/runners/show.html.haml)0
-rw-r--r--app/views/projects/show.html.haml2
-rw-r--r--app/views/projects/triggers/_trigger.html.haml (renamed from app/views/ci/triggers/_trigger.html.haml)2
-rw-r--r--app/views/projects/triggers/index.html.haml (renamed from app/views/ci/triggers/index.html.haml)10
-rw-r--r--app/views/projects/variables/show.html.haml (renamed from app/views/ci/variables/show.html.haml)10
-rw-r--r--app/views/projects/wikis/_form.html.haml2
-rw-r--r--app/views/shared/_clone_panel.html.haml2
-rw-r--r--app/views/shared/issuable/_form.html.haml2
-rw-r--r--app/views/shared/projects/_list.html.haml3
-rw-r--r--app/views/shared/projects/_project.html.haml13
-rw-r--r--app/workers/email_receiver_worker.rb2
-rw-r--r--app/workers/fork_registration_worker.rb12
167 files changed, 1612 insertions, 1233 deletions
diff --git a/app/assets/fonts/SourceSansPro-Bold.ttf b/app/assets/fonts/SourceSansPro-Bold.ttf
index 50d81bdad58..5d65c93242f 100755
--- a/app/assets/fonts/SourceSansPro-Bold.ttf
+++ b/app/assets/fonts/SourceSansPro-Bold.ttf
Binary files differ
diff --git a/app/assets/fonts/SourceSansPro-Light.ttf b/app/assets/fonts/SourceSansPro-Light.ttf
index 5f64679f6b9..83a0a336661 100755
--- a/app/assets/fonts/SourceSansPro-Light.ttf
+++ b/app/assets/fonts/SourceSansPro-Light.ttf
Binary files differ
diff --git a/app/assets/fonts/SourceSansPro-Regular.ttf b/app/assets/fonts/SourceSansPro-Regular.ttf
index 91e9ea5757f..44486cdc670 100755
--- a/app/assets/fonts/SourceSansPro-Regular.ttf
+++ b/app/assets/fonts/SourceSansPro-Regular.ttf
Binary files differ
diff --git a/app/assets/fonts/SourceSansPro-Semibold.ttf b/app/assets/fonts/SourceSansPro-Semibold.ttf
index 5020594826b..86b00c067e0 100755
--- a/app/assets/fonts/SourceSansPro-Semibold.ttf
+++ b/app/assets/fonts/SourceSansPro-Semibold.ttf
Binary files differ
diff --git a/app/assets/javascripts/ci/pager.js.coffee b/app/assets/javascripts/ci/pager.js.coffee
deleted file mode 100644
index 226fbd654ab..00000000000
--- a/app/assets/javascripts/ci/pager.js.coffee
+++ /dev/null
@@ -1,42 +0,0 @@
-@CiPager =
- init: (@url, @limit = 0, preload, @disable = false) ->
- if preload
- @offset = 0
- @getItems()
- else
- @offset = @limit
- @initLoadMore()
-
- getItems: ->
- $(".loading").show()
- $.ajax
- type: "GET"
- url: @url
- data: "limit=" + @limit + "&offset=" + @offset
- complete: =>
- $(".loading").hide()
- success: (data) =>
- CiPager.append(data.count, data.html)
- dataType: "json"
-
- append: (count, html) ->
- if count > 1
- $(".content-list").append html
- if count == @limit
- @offset += count
- else
- @disable = true
-
- initLoadMore: ->
- $(document).unbind('scroll')
- $(document).endlessScroll
- bottomPixels: 400
- fireDelay: 1000
- fireOnce: true
- ceaseFire: ->
- CiPager.disable
-
- callback: (i) =>
- unless $(".loading").is(':visible')
- $(".loading").show()
- CiPager.getItems()
diff --git a/app/assets/javascripts/issuable_context.js.coffee b/app/assets/javascripts/issuable_context.js.coffee
index 176d9cabefa..c4d3e619f5e 100644
--- a/app/assets/javascripts/issuable_context.js.coffee
+++ b/app/assets/javascripts/issuable_context.js.coffee
@@ -11,12 +11,13 @@ class @IssuableContext
$(this).submit()
$('.issuable-details').waitForImages ->
+ $('.issuable-affix').on 'affix.bs.affix', ->
+ $(@).width($(@).outerWidth())
+ .on 'affixed-top.bs.affix affixed-bottom.bs.affix', ->
+ $(@).width('')
+
$('.issuable-affix').affix offset:
top: ->
@top = ($('.issuable-affix').offset().top - 70)
bottom: ->
@bottom = $('.footer').outerHeight(true)
- $('.issuable-affix').on 'affix.bs.affix', ->
- $(@).width($(@).outerWidth())
- .on 'affixed-top.bs.affix affixed-bottom.bs.affix', ->
- $(@).width('')
diff --git a/app/assets/javascripts/project.js.coffee b/app/assets/javascripts/project.js.coffee
index 39a433dfc91..0ea8fffce07 100644
--- a/app/assets/javascripts/project.js.coffee
+++ b/app/assets/javascripts/project.js.coffee
@@ -24,3 +24,19 @@ class @Project
$.cookie('hide_no_password_message', 'false', { path: path })
$(@).parents('.no-password-message').remove()
e.preventDefault()
+
+ $('.update-notification').on 'click', (e) ->
+ e.preventDefault()
+ notification_level = $(@).data 'notification-level'
+ $('#notification_level').val(notification_level)
+ $('#notification-form').submit()
+ label = null
+ switch notification_level
+ when 0 then label = ' Disabled '
+ when 1 then label = ' Participating '
+ when 2 then label = ' Watching '
+ when 3 then label = ' Global '
+ when 4 then label = ' On Mention '
+ $('#notifications-button').empty().append("<i class='fa fa-bell'></i>" + label + "<i class='fa fa-angle-down'></i>")
+ $(@).parents('ul').find('li.active').removeClass 'active'
+ $(@).parent().addClass 'active' \ No newline at end of file
diff --git a/app/assets/stylesheets/base/gl_variables.scss b/app/assets/stylesheets/base/gl_variables.scss
index bfef5f78f83..7378d404008 100644
--- a/app/assets/stylesheets/base/gl_variables.scss
+++ b/app/assets/stylesheets/base/gl_variables.scss
@@ -65,20 +65,20 @@ $legend-color: $text-color;
//
//##
-$pagination-color: #fff;
-$pagination-bg: $brand-success;
+$pagination-color: $gl-gray;
+$pagination-bg: $background-color;
$pagination-border: transparent;
$pagination-hover-color: #fff;
-$pagination-hover-bg: darken($brand-success, 15%);
+$pagination-hover-bg: $brand-info;
$pagination-hover-border: transparent;
$pagination-active-color: #fff;
-$pagination-active-bg: darken($brand-success, 15%);
+$pagination-active-bg: $brand-info;
$pagination-active-border: transparent;
-$pagination-disabled-color: #b4bcc2;
-$pagination-disabled-bg: lighten($brand-success, 15%);
+$pagination-disabled-color: #fff;
+$pagination-disabled-bg: lighten($brand-info, 15%);
$pagination-disabled-border: transparent;
diff --git a/app/assets/stylesheets/base/mixins.scss b/app/assets/stylesheets/base/mixins.scss
index a2f6c3e21f4..c74a6d39824 100644
--- a/app/assets/stylesheets/base/mixins.scss
+++ b/app/assets/stylesheets/base/mixins.scss
@@ -93,46 +93,88 @@
}
h1 {
- margin-top: 45px;
- font-size: 2.5em;
+ 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 {
- margin-top: 40px;
- font-size: 2em;
+ font-size: 1.2em;
+ font-weight: 600;
+ margin: 24px 0 12px 0;
+ color: #313236;
}
h3 {
- margin-top: 35px;
- font-size: 1.5em;
+ margin: 24px 0 12px 0;
+ font-size: 1.25em;
}
h4 {
- margin-top: 30px;
- font-size: 1.2em;
+ 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 {
- color: #888;
+ 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: #EEE;
+ 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-size: inherit;
font-weight: inherit;
}
+
+ ul {
+ color: #5c5d5e;
+ }
+
li {
- line-height: 1.5;
+ line-height: 1.6em;
}
a[href*="/uploads/"], a[href*="storage.googleapis.com/google-code-attachments/"] {
@@ -152,6 +194,7 @@
}
}
+
@mixin str-truncated($max_width: 82%) {
display: inline-block;
overflow: hidden;
@@ -183,7 +226,7 @@
&.active {
background: #f9f9f9;
a {
- font-weight: bold;
+ font-weight: 600;
}
}
@@ -251,3 +294,8 @@
}
}
}
+
+.fa-align {
+ top: 20px;
+ position: relative;
+}
diff --git a/app/assets/stylesheets/base/variables.scss b/app/assets/stylesheets/base/variables.scss
index 2fc7bf1720a..f6bdea9a897 100644
--- a/app/assets/stylesheets/base/variables.scss
+++ b/app/assets/stylesheets/base/variables.scss
@@ -12,8 +12,8 @@ $sidebar_width: 230px;
$avatar_radius: 50%;
$code_font_size: 13px;
$code_line_height: 1.5;
-$border-color: #E7E9ED;
-$background-color: #F8FAFC;
+$border-color: #dce0e6;
+$background-color: #F7F8FA;
$header-height: 58px;
$fixed-layout-width: 1200px;
$gl-gray: #7f8fa4;
diff --git a/app/assets/stylesheets/ci/projects.scss b/app/assets/stylesheets/ci/projects.scss
index e5d69360c2c..8c5273abcda 100644
--- a/app/assets/stylesheets/ci/projects.scss
+++ b/app/assets/stylesheets/ci/projects.scss
@@ -13,31 +13,6 @@
.builds,
.projects-table {
- .alert-success {
- background-color: #6fc995;
- border-color: #5bba83;
- }
-
- .alert-danger {
- background-color: #eb897f;
- border-color: #d4776e;
- }
-
- .alert-info {
- background-color: #3498db;
- border-color: #2e8ece;
- }
-
- .alert-warning {
- background-color: #EB974E;
- border-color: #E87E04;
- }
-
- .alert-disabled {
- background: $background-color;
- border-color: $border-color;
- }
-
.light {
border-color: $border-color;
}
@@ -47,8 +22,8 @@
}
td {
+ color: $gl-gray;
vertical-align: middle !important;
- border-color: inherit !important;
a {
font-weight: normal;
@@ -58,23 +33,16 @@
}
.commit-info {
- font-size: 14px;
-
.attr-name {
- font-weight: 300;
- color: #666;
margin-right: 5px;
}
pre.commit-message {
- font-size: 14px;
background: none;
padding: 0;
margin: 0;
border: none;
margin: 20px 0;
- border-bottom: 1px solid #EEE;
- padding-bottom: 20px;
border-radius: 0;
}
}
diff --git a/app/assets/stylesheets/ci/status.scss b/app/assets/stylesheets/ci/status.scss
new file mode 100644
index 00000000000..a7d3b2197f1
--- /dev/null
+++ b/app/assets/stylesheets/ci/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/generic/avatar.scss b/app/assets/stylesheets/generic/avatar.scss
index 221cb6a04a5..36e582d4854 100644
--- a/app/assets/stylesheets/generic/avatar.scss
+++ b/app/assets/stylesheets/generic/avatar.scss
@@ -28,6 +28,7 @@
&.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; }
}
@@ -42,6 +43,7 @@
&.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
index ce024272a30..6ce34b5c3e8 100644
--- a/app/assets/stylesheets/generic/blocks.scss
+++ b/app/assets/stylesheets/generic/blocks.scss
@@ -20,11 +20,11 @@
.gray-content-block {
margin: -$gl-padding;
- background-color: #f8fafc;
+ background-color: $background-color;
padding: $gl-padding;
margin-bottom: 0px;
- border-top: 1px solid #e7e9ed;
- border-bottom: 1px solid #e7e9ed;
+ border-top: 1px solid $border-color;
+ border-bottom: 1px solid $border-color;
color: $gl-gray;
&.top-block {
@@ -48,6 +48,7 @@
&.footer-block {
margin-top: 0;
+ border-bottom: none;
margin-bottom: -$gl-padding;
}
diff --git a/app/assets/stylesheets/generic/buttons.scss b/app/assets/stylesheets/generic/buttons.scss
index 46ef595ddf0..cf76f538e01 100644
--- a/app/assets/stylesheets/generic/buttons.scss
+++ b/app/assets/stylesheets/generic/buttons.scss
@@ -1,3 +1,6 @@
+body {
+ text-rendering: geometricPrecision;
+}
.btn {
@extend .btn-default;
@@ -88,3 +91,138 @@
}
}
}
+
+@mixin btn-info {
+ @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;
+
+ &: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-middle {
+ @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-green {
+ 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*/
+
+@mixin bnt-project {
+ 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-remove {
+ 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;
+ }
+
+} \ No newline at end of file
diff --git a/app/assets/stylesheets/generic/callout.scss b/app/assets/stylesheets/generic/callout.scss
new file mode 100644
index 00000000000..f1699d21c9b
--- /dev/null
+++ b/app/assets/stylesheets/generic/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/generic/common.scss b/app/assets/stylesheets/generic/common.scss
index 48fad7701ef..96fb791c242 100644
--- a/app/assets/stylesheets/generic/common.scss
+++ b/app/assets/stylesheets/generic/common.scss
@@ -302,7 +302,7 @@ table {
}
.btn-sign-in {
- margin-top: 15px;
+ margin-top: 8px;
text-shadow: none;
}
@@ -313,7 +313,7 @@ table {
}
.wiki .highlight, .note-body .highlight {
- margin-bottom: 9px;
+ margin: 12px 0 12px 0;
}
.wiki .code {
diff --git a/app/assets/stylesheets/generic/header.scss b/app/assets/stylesheets/generic/header.scss
index b758a526fbb..543ce41ab52 100644
--- a/app/assets/stylesheets/generic/header.scss
+++ b/app/assets/stylesheets/generic/header.scss
@@ -26,7 +26,6 @@ header {
min-height: $header-height;
background-color: #fff;
border: none;
- border-bottom: 1px solid #EEE;
.container-fluid {
width: 100% !important;
diff --git a/app/assets/stylesheets/generic/pagination.scss b/app/assets/stylesheets/generic/pagination.scss
new file mode 100644
index 00000000000..6677f94dafd
--- /dev/null
+++ b/app/assets/stylesheets/generic/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/generic/sidebar.scss b/app/assets/stylesheets/generic/sidebar.scss
index 3d055f0e66f..c5ea3aca7ca 100644
--- a/app/assets/stylesheets/generic/sidebar.scss
+++ b/app/assets/stylesheets/generic/sidebar.scss
@@ -21,12 +21,11 @@
min-height: 100vh;
width: 100%;
padding: 20px;
- background: #f1f4f8;
+ background: #EAEBEC;
.container-fluid {
background: #FFF;
padding: $gl-padding;
- border: 1px solid #e7e9ed;
min-height: 90vh;
&.container-blank {
diff --git a/app/assets/stylesheets/generic/typography.scss b/app/assets/stylesheets/generic/typography.scss
index 73034c84f9a..6a3cb49baae 100644
--- a/app/assets/stylesheets/generic/typography.scss
+++ b/app/assets/stylesheets/generic/typography.scss
@@ -2,11 +2,24 @@
* 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.5;
- font-weight: normal;
- margin-bottom: 5px;
+ 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 {
@@ -55,6 +68,7 @@ a > code {
@include md-typography;
word-wrap: break-word;
+ padding: 7px;
/* Link to current header. */
h1, h2, h3, h4, h5, h6 {
@@ -83,12 +97,19 @@ a > code {
}
}
- ul {
+ ul,ol {
padding: 0;
- margin: 0 0 9px 25px !important;
+ margin: 6px 0 6px 18px !important;
+ }
+ ol {
+ color: #5c5d5e;
}
}
+.md-area {
+ @include md-typography;
+}
+
.md {
@include md-typography;
}
@@ -101,6 +122,9 @@ 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/highlight/white.scss b/app/assets/stylesheets/highlight/white.scss
index 5de589109bd..20a144ef952 100644
--- a/app/assets/stylesheets/highlight/white.scss
+++ b/app/assets/stylesheets/highlight/white.scss
@@ -1,9 +1,10 @@
/* https://github.com/aahan/pygments-github-style */
pre.code.highlight.white,
.code.white {
-
- background-color: #fff;
- color: #333;
+ background-color: #f8fafc;
+ font-size: 13px;
+ color: #5b6169;
+ line-height: 1.6em;
.line-numbers,
.line-numbers a {
diff --git a/app/assets/stylesheets/pages/groups.scss b/app/assets/stylesheets/pages/groups.scss
index 2b1b747139a..07a38a19fad 100644
--- a/app/assets/stylesheets/pages/groups.scss
+++ b/app/assets/stylesheets/pages/groups.scss
@@ -10,3 +10,9 @@
.milestone-row {
@include str-truncated(90%);
}
+
+.dashboard .side .panel .panel-heading .input-group {
+ .form-control {
+ height: 42px;
+ }
+} \ No newline at end of file
diff --git a/app/assets/stylesheets/pages/note_form.scss b/app/assets/stylesheets/pages/note_form.scss
index b311d26d675..fdc2c3332df 100644
--- a/app/assets/stylesheets/pages/note_form.scss
+++ b/app/assets/stylesheets/pages/note_form.scss
@@ -109,7 +109,7 @@
.note-edit-form {
display: none;
- font-size: 13px;
+ font-size: 15px;
.form-actions {
padding-left: 20px;
diff --git a/app/assets/stylesheets/pages/projects.scss b/app/assets/stylesheets/pages/projects.scss
index 53004fca350..31051785676 100644
--- a/app/assets/stylesheets/pages/projects.scss
+++ b/app/assets/stylesheets/pages/projects.scss
@@ -1,3 +1,14 @@
+.alert_holder {
+ margin: -16px;
+
+ .alert-link {
+ font-weight: normal;
+ }
+}
+.no-ssh-key-message {
+ background-color: #f28d35;
+ margin-bottom: 16px;
+}
.new_project,
.edit_project {
fieldset.features {
@@ -19,44 +30,47 @@
background: #f7f8fa;
margin: -$gl-padding;
padding: $gl-padding;
- padding-top: 40px;
-
+ padding: 44px 0 17px 0;
+
.project-identicon-holder {
- margin-bottom: 15px;
-
+ margin-bottom: 16px;
+
.avatar, .identicon {
margin: 0 auto;
float: none;
}
-
+
.identicon {
@include border-radius(50%);
}
}
-
+
.project-home-dropdown {
margin: 11px 3px 0;
}
.project-home-desc {
h1 {
+ color: #313236;
margin: 0;
- margin-bottom: 10px;
+ margin-bottom: 6px;
font-size: 23px;
font-weight: normal;
}
p {
- color: #7f8fa4;
+ color: #5c5d5e;
}
}
.git-clone-holder {
- max-width: 600px;
- margin: 20px auto;
+ max-width: 498px;
.form-control {
background: #FFF;
+ font-size: 14px;
+ height: 42px;
+ margin-left: -1px;
}
}
@@ -66,30 +80,37 @@
color: inherit;
}
}
-
+ .input-group {
+ display: inline-table;
+ position: relative;
+ top: 17px;
+ margin-bottom: 44px;
+ }
+
.project-repo-buttons {
- margin-top: $gl-padding;
- margin-bottom: 25px;
-
+ margin-top: 12px;
+ margin-bottom: 0px;
+
.btn {
- @extend .btn-info;
-
- text-transform: uppercase;
- font-size: 15px;
- line-height: 20px;
- padding: 8px 14px;
- border-radius: 3px;
- margin-left: 10px;
-
+ @include bnt-project;
+ @include btn-info;
+
.count {
- padding-left: 7px;
display: inline-block;
- margin-left: 7px;
}
}
}
}
+.split-one {
+ display: inline-table;
+ margin-right: 12px;
+
+ a {
+ margin: -1px !important;
+ }
+}
+
.git-clone-holder {
.project-home-dropdown + & {
margin-right: 45px;
@@ -99,23 +120,132 @@
cursor: auto;
@extend .monospace;
background: #FAFAFA;
- width: 100%;
+ width: 101%;
}
.input-group-addon {
- background: #FAFAFA;
+ background: #f7f8fa;
&.git-protocols {
padding: 0;
border: none;
-
+
.input-group-btn:last-child > .btn {
@include border-radius-right(0);
+
+ border-left: 1px solid #c6cacf;
+ margin-left: -2px !important;
}
}
}
}
+.projects-search-form {
+
+ .input-group .form-control {
+ height: 42px;
+ }
+}
+
+.input-group-btn {
+ .btn {
+ @include bnt-project;
+ @include btn-middle;
+
+ &:hover {
+ outline: none;
+ }
+
+ &:focus {
+ outline: none;
+ }
+
+ &:active {
+ outline: none;
+ }
+ }
+
+ .active {
+ @include box-shadow(inset 0 0 4px rgba(0, 0, 0, 0.12));
+
+ border: 1px solid #c6cacf !important;
+ background-color: #e4e7ed !important;
+ }
+
+ .btn-green {
+ @include btn-green
+ }
+
+}
+
+.split-repo-buttons {
+ display: inline-table;
+ margin: 0 12px 0 12px;
+
+ .btn{
+ @include bnt-project;
+ @include btn-info;
+ }
+
+ .dropdown-toggle {
+ margin: -5px;
+ }
+}
+
+#notification-form {
+ margin-left: 5px;
+}
+
+.dropdown-new {
+ margin-left: -5px;
+}
+
+.open > .dropdown-new.btn {
+ @include box-shadow(inset 0 0 4px rgba(0, 0, 0, 0.12));
+
+ border: 1px solid #c6cacf !important;
+ background-color: #e4e7ed !important;
+ text-transform: uppercase;
+ color: #313236 !important;
+ font-size: 13px;
+ font-weight: 600;
+}
+
+.dropdown-menu {
+ @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);
+
+ border: none;
+ padding: 16px 0;
+ font-size: 14px;
+ font-weight: 100;
+
+ li a {
+ color: #5f697a;
+ line-height: 30px;
+
+ &:hover {
+ background-color: #3084bb !important;
+ }
+ }
+
+ .fa-fw {
+ margin-right: 8px;
+ }
+}
+
+.fa-bell {
+ margin-right: 6px;
+}
+
+.fa-angle-down {
+ margin-left: 6px;
+}
+
+.project-home-panel .project-home-dropdown {
+ margin: 13px 0px 0;
+}
+
.project-visibility-level-holder {
.radio {
margin-bottom: 10px;
@@ -232,15 +362,28 @@ table.table.protected-branches-list tr.no-border {
.project-stats {
text-align: center;
- margin-top: 0;
+ margin-top: 15px;
margin-bottom: 0;
- padding-top: 5px;
- padding-bottom: 0;
+ padding-top: 10px;
+ padding-bottom: 4px;
ul.nav-pills {
display:inline-block;
}
+
+ .nav-pills li {
+ display:inline;
+ }
+ .nav > li > a {
+ @include btn-info;
+ @include bnt-project;
+
+ background-color: transparent;
+ border: 1px solid #f7f8fa;
+ margin-left: 12px;
+ }
+
li {
display:inline;
}
@@ -251,11 +394,11 @@ table.table.protected-branches-list tr.no-border {
}
li.missing a {
- color: #bbb;
- border: 1px dashed #ccc;
+ color: #5a6069;
+ border: 1px dashed #dce0e5;
&:hover {
- background-color: #FAFAFA;
+ background-color: #f0f2f5;
}
}
}
@@ -273,9 +416,37 @@ pre.light-well {
border-bottom: 1px solid #e7e9ed;
}
+.git-empty {
+ margin: 0 7px 0 7px;
+
+ h5 {
+ color: #5c5d5e;
+ }
+
+ .light-well {
+ @include border-radius (2px);
+
+ color: #5b6169;
+ font-size: 13px;
+ line-height: 1.6em;
+ }
+}
+
+.prepend-top-20 {
+ margin-top: 20px;
+
+ .btn-remove {
+ @include btn-middle;
+ @include btn-remove;
+
+ float: left !important;
+ }
+}
+
/*
* Projects list rendered on dashboard and user page
*/
+
.projects-list {
@include basic-list;
@@ -297,9 +468,15 @@ pre.light-well {
color: #4c4e54;
}
- .pull-right.light {
+ .project-controls {
+ float: right;
+ color: $gl-gray;
line-height: 45px;
color: #7f8fa4;
+
+ a:hover {
+ text-decoration: none;
+ }
}
.project-description {
@@ -329,3 +506,8 @@ pre.light-well {
margin-top: -1px;
}
}
+
+.inline-form {
+ display: inline-block;
+}
+
diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb
index 6092c79c254..00f41a10dd1 100644
--- a/app/controllers/admin/users_controller.rb
+++ b/app/controllers/admin/users_controller.rb
@@ -56,13 +56,19 @@ class Admin::UsersController < Admin::ApplicationController
end
def confirm
- if user.confirm!
+ if user.confirm
redirect_to :back, notice: "Successfully confirmed"
else
redirect_to :back, alert: "Error occurred. User was not confirmed"
end
end
+ def login_as
+ sign_in(user)
+ flash[:alert] = "Logged in as #{user.username}"
+ redirect_to root_path
+ end
+
def disable_two_factor
user.disable_two_factor!
redirect_to admin_user_path(user),
diff --git a/app/controllers/ci/application_controller.rb b/app/controllers/ci/application_controller.rb
index 8d8ff75ff72..d8227e632e4 100644
--- a/app/controllers/ci/application_controller.rb
+++ b/app/controllers/ci/application_controller.rb
@@ -38,7 +38,7 @@ module Ci
end
def authorize_manage_builds!
- unless can?(current_user, :admin_project, gl_project)
+ unless can?(current_user, :manage_builds, gl_project)
return page_404
end
end
diff --git a/app/controllers/ci/charts_controller.rb b/app/controllers/ci/charts_controller.rb
deleted file mode 100644
index aa875e70987..00000000000
--- a/app/controllers/ci/charts_controller.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-module Ci
- class ChartsController < Ci::ApplicationController
- before_action :authenticate_user!
- before_action :project
- before_action :authorize_access_project!
- before_action :authorize_manage_project!
-
- layout 'ci/project'
-
- def show
- @charts = {}
- @charts[:week] = Ci::Charts::WeekChart.new(@project)
- @charts[:month] = Ci::Charts::MonthChart.new(@project)
- @charts[:year] = Ci::Charts::YearChart.new(@project)
- @charts[:build_times] = Ci::Charts::BuildTime.new(@project)
- end
-
- protected
-
- def project
- @project = Ci::Project.find(params[:project_id])
- end
- end
-end
diff --git a/app/controllers/ci/projects_controller.rb b/app/controllers/ci/projects_controller.rb
index b1f1c087b9e..e8788955eba 100644
--- a/app/controllers/ci/projects_controller.rb
+++ b/app/controllers/ci/projects_controller.rb
@@ -1,12 +1,10 @@
module Ci
class ProjectsController < Ci::ApplicationController
- PROJECTS_BATCH = 100
-
- before_action :authenticate_user!, except: [:build, :badge, :index, :show]
+ before_action :authenticate_user!, except: [:build, :badge, :show]
before_action :authenticate_public_page!, only: :show
- before_action :project, only: [:build, :integration, :show, :badge, :edit, :update, :destroy, :toggle_shared_runners, :dumped_yaml]
- before_action :authorize_access_project!, except: [:build, :badge, :index, :show, :new, :create, :disabled]
- before_action :authorize_manage_project!, only: [:edit, :integration, :update, :destroy, :toggle_shared_runners, :dumped_yaml]
+ before_action :project, only: [:build, :show, :badge, :toggle_shared_runners, :dumped_yaml]
+ before_action :authorize_access_project!, except: [:build, :badge, :show, :new, :disabled]
+ before_action :authorize_manage_project!, only: [:toggle_shared_runners, :dumped_yaml]
before_action :authenticate_token!, only: [:build]
before_action :no_cache, only: [:badge]
skip_before_action :check_enable_flag!, only: [:disabled]
@@ -17,26 +15,6 @@ module Ci
def disabled
end
- def index
- @limit, @offset = (params[:limit] || PROJECTS_BATCH).to_i, (params[:offset] || 0).to_i
- @page = @offset == 0 ? 1 : (@offset / @limit + 1)
-
- if current_user
- @projects = ProjectListBuilder.new.execute(current_user, params[:search])
-
- @projects = @projects.page(@page).per(@limit)
-
- @total_count = @projects.size
- end
-
- respond_to do |format|
- format.json do
- pager_json("ci/projects/index", @total_count)
- end
- format.html
- end
- end
-
def show
@ref = params[:ref]
@@ -45,57 +23,6 @@ module Ci
@commits = @commits.page(params[:page]).per(20)
end
- def integration
- end
-
- def create
- project_data = OpenStruct.new(JSON.parse(params["project"]))
-
- unless can?(current_user, :admin_project, ::Project.find(project_data.id))
- return redirect_to ci_root_path, alert: 'You have to have at least master role to enable CI for this project'
- end
-
- @project = Ci::CreateProjectService.new.execute(current_user, project_data, ci_project_url(":project_id"))
-
- if @project.persisted?
- redirect_to ci_project_path(@project, show_guide: true), notice: 'Project was successfully created.'
- else
- redirect_to :back, alert: 'Cannot save project'
- end
- end
-
- def edit
- end
-
- def update
- if project.update_attributes(project_params)
- Ci::EventService.new.change_project_settings(current_user, project)
-
- redirect_to :back, notice: 'Project was successfully updated.'
- else
- render action: "edit"
- end
- end
-
- def destroy
- project.gl_project.gitlab_ci_service.update_attributes(active: false)
- project.destroy
-
- Ci::EventService.new.remove_project(current_user, project)
-
- redirect_to ci_projects_url
- end
-
- def build
- @commit = Ci::CreateCommitService.new.execute(@project, params.dup)
-
- if @commit && @commit.valid?
- head 201
- else
- head 400
- end
- end
-
# Project status badge
# Image with build status for sha or ref
def badge
@@ -106,7 +33,8 @@ module Ci
def toggle_shared_runners
project.toggle!(:shared_runners_enabled)
- redirect_to :back
+
+ redirect_to namespace_project_runners_path(project.gl_project.namespace, project.gl_project)
end
def dumped_yaml
@@ -124,12 +52,5 @@ module Ci
response.headers["Pragma"] = "no-cache"
response.headers["Expires"] = "Fri, 01 Jan 1990 00:00:00 GMT"
end
-
- def project_params
- params.require(:project).permit(:path, :timeout, :timeout_in_minutes, :default_ref, :always_build,
- :polling_interval, :public, :ssh_url_to_repo, :allow_git_fetch, :email_recipients,
- :email_add_pusher, :email_only_broken_builds, :coverage_regex, :shared_runners_enabled, :token,
- { variables_attributes: [:id, :key, :value, :_destroy] })
- end
end
end
diff --git a/app/controllers/ci/runner_projects_controller.rb b/app/controllers/ci/runner_projects_controller.rb
index a8bdd5bb362..97f01d40af5 100644
--- a/app/controllers/ci/runner_projects_controller.rb
+++ b/app/controllers/ci/runner_projects_controller.rb
@@ -11,10 +11,12 @@ module Ci
return head(403) unless current_user.ci_authorized_runners.include?(@runner)
+ path = runners_path(@project.gl_project)
+
if @runner.assign_to(project, current_user)
- redirect_to ci_project_runners_path(project)
+ redirect_to path
else
- redirect_to ci_project_runners_path(project), alert: 'Failed adding runner to project'
+ redirect_to path, alert: 'Failed adding runner to project'
end
end
@@ -22,7 +24,7 @@ module Ci
runner_project = project.runner_projects.find(params[:id])
runner_project.destroy
- redirect_to ci_project_runners_path(project)
+ redirect_to runners_path(@project.gl_project)
end
private
diff --git a/app/controllers/ci/runners_controller.rb b/app/controllers/ci/runners_controller.rb
deleted file mode 100644
index a672370302b..00000000000
--- a/app/controllers/ci/runners_controller.rb
+++ /dev/null
@@ -1,73 +0,0 @@
-module Ci
- class RunnersController < Ci::ApplicationController
- before_action :authenticate_user!
- before_action :project
- before_action :set_runner, only: [:edit, :update, :destroy, :pause, :resume, :show]
- before_action :authorize_access_project!
- before_action :authorize_manage_project!
-
- layout 'ci/project'
-
- def index
- @runners = @project.runners.order('id DESC')
- @specific_runners =
- Ci::Runner.specific.includes(:runner_projects).
- where(Ci::RunnerProject.table_name => { project_id: current_user.authorized_projects } ).
- where.not(id: @runners).order("#{Ci::Runner.table_name}.id DESC").page(params[:page]).per(20)
- @shared_runners = Ci::Runner.shared.active
- @shared_runners_count = @shared_runners.count(:all)
- end
-
- def edit
- end
-
- def update
- if @runner.update_attributes(runner_params)
- redirect_to edit_ci_project_runner_path(@project, @runner), notice: 'Runner was successfully updated.'
- else
- redirect_to edit_ci_project_runner_path(@project, @runner), alert: 'Runner was not updated.'
- end
- end
-
- def destroy
- if @runner.only_for?(@project)
- @runner.destroy
- end
-
- redirect_to ci_project_runners_path(@project)
- end
-
- def resume
- if @runner.update_attributes(active: true)
- redirect_to ci_project_runners_path(@project, @runner), notice: 'Runner was successfully updated.'
- else
- redirect_to ci_project_runners_path(@project, @runner), alert: 'Runner was not updated.'
- end
- end
-
- def pause
- if @runner.update_attributes(active: false)
- redirect_to ci_project_runners_path(@project, @runner), notice: 'Runner was successfully updated.'
- else
- redirect_to ci_project_runners_path(@project, @runner), alert: 'Runner was not updated.'
- end
- end
-
- def show
- end
-
- protected
-
- def project
- @project = Ci::Project.find(params[:project_id])
- end
-
- def set_runner
- @runner ||= @project.runners.find(params[:id])
- end
-
- def runner_params
- params.require(:runner).permit(:description, :tag_list, :contacted_at, :active)
- end
- end
-end
diff --git a/app/controllers/ci/triggers_controller.rb b/app/controllers/ci/triggers_controller.rb
deleted file mode 100644
index a39cc5d3a56..00000000000
--- a/app/controllers/ci/triggers_controller.rb
+++ /dev/null
@@ -1,43 +0,0 @@
-module Ci
- class TriggersController < Ci::ApplicationController
- before_action :authenticate_user!
- before_action :project
- before_action :authorize_access_project!
- before_action :authorize_manage_project!
-
- layout 'ci/project'
-
- def index
- @triggers = @project.triggers
- @trigger = Ci::Trigger.new
- end
-
- def create
- @trigger = @project.triggers.new
- @trigger.save
-
- if @trigger.valid?
- redirect_to ci_project_triggers_path(@project)
- else
- @triggers = @project.triggers.select(&:persisted?)
- render :index
- end
- end
-
- def destroy
- trigger.destroy
-
- redirect_to ci_project_triggers_path(@project)
- end
-
- private
-
- def trigger
- @trigger ||= @project.triggers.find(params[:id])
- end
-
- def project
- @project = Ci::Project.find(params[:project_id])
- end
- end
-end
diff --git a/app/controllers/ci/variables_controller.rb b/app/controllers/ci/variables_controller.rb
deleted file mode 100644
index 9c6c775fde8..00000000000
--- a/app/controllers/ci/variables_controller.rb
+++ /dev/null
@@ -1,33 +0,0 @@
-module Ci
- class VariablesController < Ci::ApplicationController
- before_action :authenticate_user!
- before_action :project
- before_action :authorize_access_project!
- before_action :authorize_manage_project!
-
- layout 'ci/project'
-
- def show
- end
-
- def update
- if project.update_attributes(project_params)
- Ci::EventService.new.change_project_settings(current_user, project)
-
- redirect_to ci_project_variables_path(project), notice: 'Variables were successfully updated.'
- else
- render action: 'show'
- end
- end
-
- private
-
- def project
- @project ||= Ci::Project.find(params[:project_id])
- end
-
- def project_params
- params.require(:project).permit({ variables_attributes: [:id, :key, :value, :_destroy] })
- end
- end
-end
diff --git a/app/controllers/help_controller.rb b/app/controllers/help_controller.rb
index ad00948da51..55050615473 100644
--- a/app/controllers/help_controller.rb
+++ b/app/controllers/help_controller.rb
@@ -4,6 +4,11 @@ class HelpController < ApplicationController
layout 'help'
def index
+ @help_index = File.read(Rails.root.join('doc', 'README.md'))
+
+ # Prefix Markdown links with `help/` unless they already have been
+ # See http://rubular.com/r/nwwhzH6Z8X
+ @help_index.gsub!(/(\]\()(?!help\/)([^\)\(]+)(\))/, '\1help/\2\3')
end
def show
diff --git a/app/controllers/profiles/two_factor_auths_controller.rb b/app/controllers/profiles/two_factor_auths_controller.rb
index f9af0871cf1..e6b99be37fb 100644
--- a/app/controllers/profiles/two_factor_auths_controller.rb
+++ b/app/controllers/profiles/two_factor_auths_controller.rb
@@ -9,7 +9,7 @@ class Profiles::TwoFactorAuthsController < Profiles::ApplicationController
end
def create
- if current_user.valid_otp?(params[:pin_code])
+ if current_user.validate_and_consume_otp!(params[:pin_code])
current_user.two_factor_enabled = true
@codes = current_user.generate_otp_backup_codes!
current_user.save!
diff --git a/app/controllers/projects/application_controller.rb b/app/controllers/projects/application_controller.rb
index ee88d49b400..519d6d6127e 100644
--- a/app/controllers/projects/application_controller.rb
+++ b/app/controllers/projects/application_controller.rb
@@ -25,4 +25,14 @@ class Projects::ApplicationController < ApplicationController
)
end
end
+
+ private
+
+ def ci_enabled
+ return render_404 unless @project.gitlab_ci?
+ end
+
+ def ci_project
+ @ci_project ||= @project.ensure_gitlab_ci_project
+ end
end
diff --git a/app/controllers/projects/ci_settings_controller.rb b/app/controllers/projects/ci_settings_controller.rb
new file mode 100644
index 00000000000..a263242a850
--- /dev/null
+++ b/app/controllers/projects/ci_settings_controller.rb
@@ -0,0 +1,36 @@
+class Projects::CiSettingsController < Projects::ApplicationController
+ before_action :ci_project
+ before_action :authorize_admin_project!
+
+ layout "project_settings"
+
+ def edit
+ end
+
+ def update
+ if ci_project.update_attributes(project_params)
+ Ci::EventService.new.change_project_settings(current_user, ci_project)
+
+ redirect_to edit_namespace_project_ci_settings_path(project.namespace, project), notice: 'Project was successfully updated.'
+ else
+ render action: "edit"
+ end
+ end
+
+ def destroy
+ ci_project.destroy
+ Ci::EventService.new.remove_project(current_user, ci_project)
+ project.gitlab_ci_service.update_attributes(active: false)
+
+ redirect_to project_path(project), notice: "CI was disabled for this project"
+ end
+
+ protected
+
+ def project_params
+ params.require(:project).permit(:path, :timeout, :timeout_in_minutes, :default_ref, :always_build,
+ :polling_interval, :public, :ssh_url_to_repo, :allow_git_fetch, :email_recipients,
+ :email_add_pusher, :email_only_broken_builds, :coverage_regex, :shared_runners_enabled, :token,
+ { variables_attributes: [:id, :key, :value, :_destroy] })
+ end
+end
diff --git a/app/controllers/projects/commit_controller.rb b/app/controllers/projects/commit_controller.rb
index 78d42d695b6..2fae5057138 100644
--- a/app/controllers/projects/commit_controller.rb
+++ b/app/controllers/projects/commit_controller.rb
@@ -22,6 +22,8 @@ class Projects::CommitController < Projects::ApplicationController
commit_id: @commit.id
}
+ @ci_commit = project.ci_commit(commit.sha)
+
respond_to do |format|
format.html
format.diff { render text: @commit.to_diff }
diff --git a/app/controllers/projects/compare_controller.rb b/app/controllers/projects/compare_controller.rb
index d9b3adae95b..d15004f93a6 100644
--- a/app/controllers/projects/compare_controller.rb
+++ b/app/controllers/projects/compare_controller.rb
@@ -16,10 +16,12 @@ class Projects::CompareController < Projects::ApplicationController
compare_result = CompareService.new.
execute(@project, head_ref, @project, base_ref)
- @commits = compare_result.commits
- @diffs = compare_result.diffs
- @commit = @commits.last
- @line_notes = []
+ if compare_result
+ @commits = compare_result.commits
+ @diffs = compare_result.diffs
+ @commit = @commits.last
+ @line_notes = []
+ end
end
def create
diff --git a/app/controllers/projects/graphs_controller.rb b/app/controllers/projects/graphs_controller.rb
index 0b6f7f5c91e..418b92040bc 100644
--- a/app/controllers/projects/graphs_controller.rb
+++ b/app/controllers/projects/graphs_controller.rb
@@ -5,6 +5,7 @@ class Projects::GraphsController < Projects::ApplicationController
before_action :require_non_empty_project
before_action :assign_ref_vars
before_action :authorize_download_code!
+ before_action :ci_enabled, only: :ci
def show
respond_to do |format|
@@ -23,6 +24,16 @@ class Projects::GraphsController < Projects::ApplicationController
@commits_per_month = @commits_graph.commits_per_month
end
+ def ci
+ ci_project = @project.gitlab_ci_project
+
+ @charts = {}
+ @charts[:week] = Ci::Charts::WeekChart.new(ci_project)
+ @charts[:month] = Ci::Charts::MonthChart.new(ci_project)
+ @charts[:year] = Ci::Charts::YearChart.new(ci_project)
+ @charts[:build_times] = Ci::Charts::BuildTime.new(ci_project)
+ end
+
private
def fetch_graph
diff --git a/app/controllers/projects/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb
index f3054881daf..7574842cd43 100644
--- a/app/controllers/projects/merge_requests_controller.rb
+++ b/app/controllers/projects/merge_requests_controller.rb
@@ -7,6 +7,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController
before_action :closes_issues, only: [:edit, :update, :show, :diffs, :commits]
before_action :validates_merge_request, only: [:show, :diffs, :commits]
before_action :define_show_vars, only: [:show, :diffs, :commits]
+ before_action :ensure_ref_fetched, only: [:show, :commits, :diffs]
# Allow read any merge_request
before_action :authorize_read_merge_request!
@@ -257,8 +258,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController
@commits = @merge_request.commits
@merge_request_diff = @merge_request.merge_request_diff
- @source_branch = @merge_request.source_project.repository.find_branch(@merge_request.source_branch).try(:name)
-
+
if @merge_request.locked_long_ago?
@merge_request.unlock_mr
@merge_request.close
@@ -277,4 +277,10 @@ class Projects::MergeRequestsController < Projects::ApplicationController
:state_event, :description, :task_num, label_ids: []
)
end
+
+ # Make sure merge requests created before 8.0
+ # have head file in refs/merge-requests/
+ def ensure_ref_fetched
+ @merge_request.ensure_ref_fetched
+ end
end
diff --git a/app/controllers/projects/runners_controller.rb b/app/controllers/projects/runners_controller.rb
new file mode 100644
index 00000000000..6cb6e3ef6d4
--- /dev/null
+++ b/app/controllers/projects/runners_controller.rb
@@ -0,0 +1,65 @@
+class Projects::RunnersController < Projects::ApplicationController
+ before_action :ci_project
+ before_action :set_runner, only: [:edit, :update, :destroy, :pause, :resume, :show]
+ before_action :authorize_admin_project!
+
+ layout 'project_settings'
+
+ def index
+ @runners = @ci_project.runners.order('id DESC')
+ @specific_runners =
+ Ci::Runner.specific.includes(:runner_projects).
+ where(Ci::RunnerProject.table_name => { project_id: current_user.authorized_projects } ).
+ where.not(id: @runners).order("#{Ci::Runner.table_name}.id DESC").page(params[:page]).per(20)
+ @shared_runners = Ci::Runner.shared.active
+ @shared_runners_count = @shared_runners.count(:all)
+ end
+
+ def edit
+ end
+
+ def update
+ if @runner.update_attributes(runner_params)
+ redirect_to runner_path(@runner), notice: 'Runner was successfully updated.'
+ else
+ redirect_to runner_path(@runner), alert: 'Runner was not updated.'
+ end
+ end
+
+ def destroy
+ if @runner.only_for?(@ci_project)
+ @runner.destroy
+ end
+
+ redirect_to runners_path(@project)
+ end
+
+ def resume
+ if @runner.update_attributes(active: true)
+ redirect_to runner_path(@runner), notice: 'Runner was successfully updated.'
+ else
+ redirect_to runner_path(@runner), alert: 'Runner was not updated.'
+ end
+ end
+
+ def pause
+ if @runner.update_attributes(active: false)
+ redirect_to runner_path(@runner), notice: 'Runner was successfully updated.'
+ else
+ redirect_to runner_path(@runner), alert: 'Runner was not updated.'
+ end
+ end
+
+ def show
+ end
+
+ protected
+
+ def set_runner
+ @runner ||= @ci_project.runners.find(params[:id])
+ end
+
+ def runner_params
+ params.require(:runner).permit(:description, :tag_list, :contacted_at, :active)
+ end
+end
diff --git a/app/controllers/projects/triggers_controller.rb b/app/controllers/projects/triggers_controller.rb
new file mode 100644
index 00000000000..782ebd01b05
--- /dev/null
+++ b/app/controllers/projects/triggers_controller.rb
@@ -0,0 +1,35 @@
+class Projects::TriggersController < Projects::ApplicationController
+ before_action :ci_project
+ before_action :authorize_admin_project!
+
+ layout 'project_settings'
+
+ def index
+ @triggers = @ci_project.triggers
+ @trigger = Ci::Trigger.new
+ end
+
+ def create
+ @trigger = @ci_project.triggers.new
+ @trigger.save
+
+ if @trigger.valid?
+ redirect_to namespace_project_triggers_path(@project.namespace, @project)
+ else
+ @triggers = @ci_project.triggers.select(&:persisted?)
+ render :index
+ end
+ end
+
+ def destroy
+ trigger.destroy
+
+ redirect_to namespace_project_triggers_path(@project.namespace, @project)
+ end
+
+ private
+
+ def trigger
+ @trigger ||= @ci_project.triggers.find(params[:id])
+ end
+end
diff --git a/app/controllers/projects/variables_controller.rb b/app/controllers/projects/variables_controller.rb
new file mode 100644
index 00000000000..d6561a45a70
--- /dev/null
+++ b/app/controllers/projects/variables_controller.rb
@@ -0,0 +1,25 @@
+class Projects::VariablesController < Projects::ApplicationController
+ before_action :ci_project
+ before_action :authorize_admin_project!
+
+ layout 'project_settings'
+
+ def show
+ end
+
+ def update
+ if ci_project.update_attributes(project_params)
+ Ci::EventService.new.change_project_settings(current_user, ci_project)
+
+ redirect_to namespace_project_variables_path(project.namespace, project), notice: 'Variables were successfully updated.'
+ else
+ render action: 'show'
+ end
+ end
+
+ private
+
+ def project_params
+ params.require(:project).permit({ variables_attributes: [:id, :key, :value, :_destroy] })
+ end
+end
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index f4d1a828aab..213c2a7173b 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -86,6 +86,10 @@ class ProjectsController < ApplicationController
if @project.empty_repo?
render 'projects/empty'
else
+ if current_user
+ @membership = @project.project_member_by_id(current_user.id)
+ end
+
render :show
end
else
diff --git a/app/controllers/root_controller.rb b/app/controllers/root_controller.rb
index 54171ff67c5..ad04c646e1b 100644
--- a/app/controllers/root_controller.rb
+++ b/app/controllers/root_controller.rb
@@ -22,6 +22,10 @@ class RootController < Dashboard::ProjectsController
when 'stars'
flash.keep
redirect_to starred_dashboard_projects_path
+ when 'project_activity'
+ redirect_to activity_dashboard_path
+ when 'starred_project_activity'
+ redirect_to activity_dashboard_path(filter: 'starred')
else
return
end
diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb
index cfa565cd03e..1b60d3e27d0 100644
--- a/app/controllers/sessions_controller.rb
+++ b/app/controllers/sessions_controller.rb
@@ -99,7 +99,7 @@ class SessionsController < Devise::SessionsController
end
def valid_otp_attempt?(user)
- user.valid_otp?(user_params[:otp_attempt]) ||
+ user.validate_and_consume_otp!(user_params[:otp_attempt]) ||
user.invalidate_otp_backup_code!(user_params[:otp_attempt])
end
diff --git a/app/helpers/auth_helper.rb b/app/helpers/auth_helper.rb
index ce7e9b1db87..cd99a232403 100644
--- a/app/helpers/auth_helper.rb
+++ b/app/helpers/auth_helper.rb
@@ -1,6 +1,6 @@
module AuthHelper
PROVIDERS_WITH_ICONS = %w(twitter github gitlab bitbucket google_oauth2).freeze
- FORM_BASED_PROVIDERS = [/\Aldap/, 'kerberos', 'crowd'].freeze
+ FORM_BASED_PROVIDERS = [/\Aldap/, 'crowd'].freeze
def ldap_enabled?
Gitlab.config.ldap.enabled
diff --git a/app/helpers/builds_helper.rb b/app/helpers/builds_helper.rb
new file mode 100644
index 00000000000..b6658e52d09
--- /dev/null
+++ b/app/helpers/builds_helper.rb
@@ -0,0 +1,17 @@
+module BuildsHelper
+ def build_ref_link build
+ gitlab_ref_link build.project, build.ref
+ end
+
+ def build_compare_link build
+ gitlab_compare_link build.project, build.commit.short_before_sha, build.short_sha
+ end
+
+ def build_commit_link build
+ gitlab_commit_link build.project, build.short_sha
+ end
+
+ def build_url(build)
+ ci_project_build_url(build.project, build)
+ end
+end
diff --git a/app/helpers/ci/application_helper.rb b/app/helpers/ci/application_helper.rb
deleted file mode 100644
index 7e880b00b3a..00000000000
--- a/app/helpers/ci/application_helper.rb
+++ /dev/null
@@ -1,32 +0,0 @@
-module Ci
- module ApplicationHelper
- def loader_html
- image_tag 'ci/loader.gif', alt: 'Loading'
- end
-
- def date_from_to(from, to)
- "#{from.to_s(:short)} - #{to.to_s(:short)}"
- end
-
- def duration_in_words(finished_at, started_at)
- if finished_at && started_at
- interval_in_seconds = finished_at.to_i - started_at.to_i
- elsif started_at
- interval_in_seconds = Time.now.to_i - started_at.to_i
- end
-
- time_interval_in_words(interval_in_seconds)
- end
-
- def time_interval_in_words(interval_in_seconds)
- minutes = interval_in_seconds / 60
- seconds = interval_in_seconds - minutes * 60
-
- if minutes >= 1
- "#{pluralize(minutes, "minute")} #{pluralize(seconds, "second")}"
- else
- "#{pluralize(seconds, "second")}"
- end
- end
- end
-end
diff --git a/app/helpers/ci/builds_helper.rb b/app/helpers/ci/builds_helper.rb
deleted file mode 100644
index cdabdad17d2..00000000000
--- a/app/helpers/ci/builds_helper.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-module Ci
- module BuildsHelper
- def build_ref_link build
- gitlab_ref_link build.project, build.ref
- end
-
- def build_compare_link build
- gitlab_compare_link build.project, build.commit.short_before_sha, build.short_sha
- end
-
- def build_commit_link build
- gitlab_commit_link build.project, build.short_sha
- end
-
- def build_url(build)
- ci_project_build_url(build.project, build)
- end
-
- def build_status_alert_class(build)
- if build.success?
- 'alert-success'
- elsif build.failed?
- 'alert-danger'
- elsif build.canceled?
- 'alert-disabled'
- else
- 'alert-warning'
- end
- end
-
- def build_icon_css_class(build)
- if build.success?
- 'fa-circle cgreen'
- elsif build.failed?
- 'fa-circle cred'
- else
- 'fa-circle light'
- end
- end
- end
-end
diff --git a/app/helpers/ci/commits_helper.rb b/app/helpers/ci/commits_helper.rb
index 74de30e006e..9069aed5b4d 100644
--- a/app/helpers/ci/commits_helper.rb
+++ b/app/helpers/ci/commits_helper.rb
@@ -1,20 +1,5 @@
module Ci
module CommitsHelper
- def commit_status_alert_class(commit)
- return 'alert-info' unless commit
-
- case commit.status
- when 'success'
- 'alert-success'
- when 'failed', 'canceled'
- 'alert-danger'
- when 'skipped'
- 'alert-disabled'
- else
- 'alert-warning'
- end
- end
-
def ci_commit_path(commit)
ci_project_ref_commits_path(commit.project, commit.ref, commit.sha)
end
diff --git a/app/helpers/ci/gitlab_helper.rb b/app/helpers/ci/gitlab_helper.rb
index 2b89a0ce93e..13e4d0fd9c3 100644
--- a/app/helpers/ci/gitlab_helper.rb
+++ b/app/helpers/ci/gitlab_helper.rb
@@ -27,9 +27,9 @@ module Ci
commits = project.commits
if commits.any? && commits.last.push_data[:ci_yaml_file]
- "#{@project.gitlab_url}/edit/master/.gitlab-ci.yml"
+ "#{project.gitlab_url}/edit/master/.gitlab-ci.yml"
else
- "#{@project.gitlab_url}/new/master"
+ "#{project.gitlab_url}/new/master"
end
end
end
diff --git a/app/helpers/ci/icons_helper.rb b/app/helpers/ci/icons_helper.rb
deleted file mode 100644
index be40f79e880..00000000000
--- a/app/helpers/ci/icons_helper.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-module Ci
- module IconsHelper
- def boolean_to_icon(value)
- if value.to_s == "true"
- content_tag :i, nil, class: 'fa fa-circle cgreen'
- else
- content_tag :i, nil, class: 'fa fa-power-off clgray'
- end
- end
- end
-end
diff --git a/app/helpers/ci/routes_helper.rb b/app/helpers/ci/routes_helper.rb
deleted file mode 100644
index 42cd54b064f..00000000000
--- a/app/helpers/ci/routes_helper.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-module Ci
- module RoutesHelper
- class Base
- include Gitlab::Application.routes.url_helpers
-
- def default_url_options
- {
- host: Settings.gitlab['host'],
- protocol: Settings.gitlab['https'] ? "https" : "http",
- port: Settings.gitlab['port']
- }
- end
- end
-
- def url_helpers
- @url_helpers ||= Base.new
- end
-
- def self.method_missing(method, *args, &block)
- @url_helpers ||= Base.new
-
- if @url_helpers.respond_to?(method)
- @url_helpers.send(method, *args, &block)
- else
- super method, *args, &block
- end
- end
- end
-end
diff --git a/app/helpers/ci/runners_helper.rb b/app/helpers/ci/runners_helper.rb
deleted file mode 100644
index 03c9914641e..00000000000
--- a/app/helpers/ci/runners_helper.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-module Ci
- 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
-
- 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/helpers/ci/triggers_helper.rb b/app/helpers/ci/triggers_helper.rb
deleted file mode 100644
index 0d2438928ce..00000000000
--- a/app/helpers/ci/triggers_helper.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-module Ci
- module TriggersHelper
- def ci_build_trigger_url(project_id, ref_name)
- "#{Settings.gitlab_ci.url}/ci/api/v1/projects/#{project_id}/refs/#{ref_name}/trigger"
- end
- end
-end
diff --git a/app/helpers/ci/user_helper.rb b/app/helpers/ci/user_helper.rb
deleted file mode 100644
index c332d6ed9cf..00000000000
--- a/app/helpers/ci/user_helper.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-module Ci
- module UserHelper
- def user_avatar_url(user = nil, size = nil, default = 'identicon')
- size = 40 if size.nil? || size <= 0
-
- if user.blank? || user.avatar_url.blank?
- 'ci/no_avatar.png'
- elsif /^(http(s?):\/\/(www|secure)\.gravatar\.com\/avatar\/(\w*))/ =~ user.avatar_url
- Regexp.last_match[0] + "?s=#{size}&d=#{default}"
- else
- user.avatar_url
- end
- end
- end
-end
diff --git a/app/helpers/ci_status_helper.rb b/app/helpers/ci_status_helper.rb
new file mode 100644
index 00000000000..3a88ed7107e
--- /dev/null
+++ b/app/helpers/ci_status_helper.rb
@@ -0,0 +1,44 @@
+module CiStatusHelper
+ def ci_status_path(ci_commit)
+ ci_project_ref_commits_path(ci_commit.project, ci_commit.ref, ci_commit)
+ end
+
+ def ci_status_icon(ci_commit)
+ ci_icon_for_status(ci_commit.status)
+ end
+
+ def ci_status_color(ci_commit)
+ case ci_commit.status
+ when 'success'
+ 'green'
+ when 'failed'
+ 'red'
+ when 'running', 'pending'
+ 'yellow'
+ else
+ 'gray'
+ end
+ end
+
+ def ci_status_with_icon(status)
+ content_tag :span, class: "ci-status ci-#{status}" do
+ ci_icon_for_status(status) + '&nbsp;'.html_safe + status
+ end
+ end
+
+ def ci_icon_for_status(status)
+ icon_name =
+ case status
+ when 'success'
+ 'check'
+ when 'failed'
+ 'close'
+ when 'running', 'pending'
+ 'clock-o'
+ else
+ 'circle'
+ end
+
+ icon(icon_name)
+ end
+end
diff --git a/app/helpers/commits_helper.rb b/app/helpers/commits_helper.rb
index d13d80be293..9df20c9fce5 100644
--- a/app/helpers/commits_helper.rb
+++ b/app/helpers/commits_helper.rb
@@ -135,7 +135,7 @@ module CommitsHelper
# size: size of the avatar image in px
def commit_person_link(commit, options = {})
user = commit.send(options[:source])
-
+
source_name = clean(commit.send "#{options[:source]}_name".to_sym)
source_email = clean(commit.send "#{options[:source]}_email".to_sym)
diff --git a/app/helpers/gitlab_markdown_helper.rb b/app/helpers/gitlab_markdown_helper.rb
index 1ebfd92f119..153a44870f6 100644
--- a/app/helpers/gitlab_markdown_helper.rb
+++ b/app/helpers/gitlab_markdown_helper.rb
@@ -45,7 +45,7 @@ module GitlabMarkdownHelper
end
def markdown(text, context = {})
- context.merge!(
+ context.reverse_merge!(
current_user: current_user,
path: @path,
project: @project,
@@ -59,7 +59,7 @@ module GitlabMarkdownHelper
# TODO (rspeicher): Remove all usages of this helper and just call `markdown`
# with a custom pipeline depending on the content being rendered
def gfm(text, options = {})
- options.merge!(
+ options.reverse_merge!(
current_user: current_user,
path: @path,
project: @project,
@@ -165,7 +165,7 @@ module GitlabMarkdownHelper
# and return true. Otherwise return false.
def truncate_if_block(node, truncated)
if node.element? && node.description.block? && !truncated
- node.content = "#{node.content}..." if node.next_sibling
+ node.inner_html = "#{node.inner_html}..." if node.next_sibling
true
else
truncated
diff --git a/app/helpers/gitlab_routing_helper.rb b/app/helpers/gitlab_routing_helper.rb
index e0816f4e714..4d9da6ff837 100644
--- a/app/helpers/gitlab_routing_helper.rb
+++ b/app/helpers/gitlab_routing_helper.rb
@@ -33,6 +33,14 @@ module GitlabRoutingHelper
edit_namespace_project_path(project.namespace, project, *args)
end
+ def runners_path(project, *args)
+ namespace_project_runners_path(project.namespace, project, *args)
+ end
+
+ def runner_path(runner, *args)
+ namespace_project_runner_path(@project.namespace, @project, runner, *args)
+ end
+
def issue_path(entity, *args)
namespace_project_issue_path(entity.project.namespace, entity.project, entity, *args)
end
diff --git a/app/helpers/graph_helper.rb b/app/helpers/graph_helper.rb
index e1dda20de85..1e372d5631d 100644
--- a/app/helpers/graph_helper.rb
+++ b/app/helpers/graph_helper.rb
@@ -1,7 +1,10 @@
module GraphHelper
def get_refs(repo, commit)
refs = ""
- refs << commit.ref_names(repo).join(' ')
+ # Commit::ref_names already strips the refs/XXX from important refs (e.g. refs/heads/XXX)
+ # so anything leftover is internally used by GitLab
+ commit_refs = commit.ref_names(repo).reject{ |name| name.starts_with?('refs/') }
+ refs << commit_refs.join(' ')
# append note count
refs << "[#{@graph.notes[commit.id]}]" if @graph.notes[commit.id] > 0
diff --git a/app/helpers/notifications_helper.rb b/app/helpers/notifications_helper.rb
index 2f8e64c375f..cf11f8e5320 100644
--- a/app/helpers/notifications_helper.rb
+++ b/app/helpers/notifications_helper.rb
@@ -12,4 +12,49 @@ module NotificationsHelper
icon('circle-o', class: 'ns-default')
end
end
+
+ def notification_list_item(notification_level, user_membership)
+ case notification_level
+ when Notification::N_DISABLED
+ content_tag(:li, class: active_level_for(user_membership, Notification::N_DISABLED)) do
+ link_to '#', class: 'update-notification', data: { notification_level: Notification::N_DISABLED } do
+ icon('microphone-slash fw', text: 'Disabled')
+ end
+ end
+ when Notification::N_PARTICIPATING
+ content_tag(:li, class: active_level_for(user_membership, Notification::N_PARTICIPATING)) do
+ link_to '#', class: 'update-notification', data: { notification_level: Notification::N_PARTICIPATING } do
+ icon('volume-up fw', text: 'Participate')
+ end
+ end
+ when Notification::N_WATCH
+ content_tag(:li, class: active_level_for(user_membership, Notification::N_WATCH)) do
+ link_to '#', class: 'update-notification', data: { notification_level: Notification::N_WATCH } do
+ icon('eye fw', text: 'Watch')
+ end
+ end
+ when Notification::N_MENTION
+ content_tag(:li, class: active_level_for(user_membership, Notification::N_MENTION)) do
+ link_to '#', class: 'update-notification', data: { notification_level: Notification::N_MENTION } do
+ icon('at fw', text: 'On mention')
+ end
+ end
+ when Notification::N_GLOBAL
+ content_tag(:li, class: active_level_for(user_membership, Notification::N_GLOBAL)) do
+ link_to '#', class: 'update-notification', data: { notification_level: Notification::N_GLOBAL } do
+ icon('globe fw', text: 'Global')
+ end
+ end
+ else
+ # do nothing
+ end
+ end
+
+ def notification_label(user_membership)
+ Notification.new(user_membership).to_s
+ end
+
+ def active_level_for(user_membership, level)
+ 'active' if user_membership.notification_level == level
+ end
end
diff --git a/app/helpers/preferences_helper.rb b/app/helpers/preferences_helper.rb
index 7f1b6a69926..1b1f4162df4 100644
--- a/app/helpers/preferences_helper.rb
+++ b/app/helpers/preferences_helper.rb
@@ -3,7 +3,9 @@ module PreferencesHelper
# Maps `dashboard` values to more user-friendly option text
DASHBOARD_CHOICES = {
projects: 'Your Projects (default)',
- stars: 'Starred Projects'
+ stars: 'Starred Projects',
+ project_activity: "Your Projects' Activity",
+ starred_project_activity: "Starred Projects' Activity"
}.with_indifferent_access.freeze
# Returns an Array usable by a select field for more user-friendly option text
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb
index a2b83c50c2e..7b4747ce3d7 100644
--- a/app/helpers/projects_helper.rb
+++ b/app/helpers/projects_helper.rb
@@ -156,8 +156,8 @@ module ProjectsHelper
end
end
- def repository_size(project = nil)
- "#{(project || @project).repository_size} MB"
+ def repository_size(project = @project)
+ "#{project.repository_size} MB"
rescue
# In order to prevent 500 error
# when application cannot allocate memory
diff --git a/app/helpers/runners_helper.rb b/app/helpers/runners_helper.rb
new file mode 100644
index 00000000000..5d7d06c8490
--- /dev/null
+++ b/app/helpers/runners_helper.rb
@@ -0,0 +1,20 @@
+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
+
+ 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
diff --git a/app/helpers/time_helper.rb b/app/helpers/time_helper.rb
new file mode 100644
index 00000000000..8142f733e76
--- /dev/null
+++ b/app/helpers/time_helper.rb
@@ -0,0 +1,27 @@
+module TimeHelper
+ def duration_in_words(finished_at, started_at)
+ if finished_at && started_at
+ interval_in_seconds = finished_at.to_i - started_at.to_i
+ elsif started_at
+ interval_in_seconds = Time.now.to_i - started_at.to_i
+ end
+
+ time_interval_in_words(interval_in_seconds)
+ end
+
+ def time_interval_in_words(interval_in_seconds)
+ minutes = interval_in_seconds / 60
+ seconds = interval_in_seconds - minutes * 60
+
+ if minutes >= 1
+ "#{pluralize(minutes, "minute")} #{pluralize(seconds, "second")}"
+ else
+ "#{pluralize(seconds, "second")}"
+ end
+ end
+
+
+ def date_from_to(from, to)
+ "#{from.to_s(:short)} - #{to.to_s(:short)}"
+ end
+end
diff --git a/app/helpers/triggers_helper.rb b/app/helpers/triggers_helper.rb
new file mode 100644
index 00000000000..2a3a7e80fca
--- /dev/null
+++ b/app/helpers/triggers_helper.rb
@@ -0,0 +1,5 @@
+module TriggersHelper
+ def ci_build_trigger_url(project_id, ref_name)
+ "#{Settings.gitlab_ci.url}/ci/api/v1/projects/#{project_id}/refs/#{ref_name}/trigger"
+ end
+end
diff --git a/app/helpers/version_check_helper.rb b/app/helpers/version_check_helper.rb
index f64d730b448..a674564c4ec 100644
--- a/app/helpers/version_check_helper.rb
+++ b/app/helpers/version_check_helper.rb
@@ -1,6 +1,6 @@
module VersionCheckHelper
def version_status_badge
- if Rails.env.production?
+ if Rails.env.production? && current_application_settings.version_check_enabled
image_tag VersionCheck.new.url
end
end
diff --git a/app/mailers/ci/notify.rb b/app/mailers/ci/notify.rb
index 4462da0d7d2..404842cf213 100644
--- a/app/mailers/ci/notify.rb
+++ b/app/mailers/ci/notify.rb
@@ -2,7 +2,6 @@ module Ci
class Notify < ActionMailer::Base
include Ci::Emails::Builds
- add_template_helper Ci::ApplicationHelper
add_template_helper Ci::GitlabHelper
default_url_options[:host] = Gitlab.config.gitlab.host
diff --git a/app/mailers/emails/notes.rb b/app/mailers/emails/notes.rb
index 63d4aca61af..87ba94a583d 100644
--- a/app/mailers/emails/notes.rb
+++ b/app/mailers/emails/notes.rb
@@ -12,7 +12,7 @@ module Emails
to: recipient(recipient_id),
subject: subject("#{@commit.title} (#{@commit.short_id})"))
- SentNotification.record(@commit, recipient_id, reply_key)
+ SentNotification.record_note(@note, recipient_id, reply_key)
end
def note_issue_email(recipient_id, note_id)
@@ -27,7 +27,7 @@ module Emails
to: recipient(recipient_id),
subject: subject("#{@issue.title} (##{@issue.iid})"))
- SentNotification.record(@issue, recipient_id, reply_key)
+ SentNotification.record_note(@note, recipient_id, reply_key)
end
def note_merge_request_email(recipient_id, note_id)
@@ -43,7 +43,7 @@ module Emails
to: recipient(recipient_id),
subject: subject("#{@merge_request.title} (##{@merge_request.iid})"))
- SentNotification.record(@merge_request, recipient_id, reply_key)
+ SentNotification.record_note(@note, recipient_id, reply_key)
end
end
end
diff --git a/app/mailers/notify.rb b/app/mailers/notify.rb
index f196ffd53f3..db2f9654e14 100644
--- a/app/mailers/notify.rb
+++ b/app/mailers/notify.rb
@@ -110,7 +110,7 @@ class Notify < BaseMailer
if reply_key
headers['X-GitLab-Reply-Key'] = reply_key
- address = Mail::Address.new(Gitlab::ReplyByEmail.reply_address(reply_key))
+ address = Mail::Address.new(Gitlab::IncomingEmail.reply_address(reply_key))
address.display_name = @project.name_with_namespace
headers['Reply-To'] = address
@@ -150,6 +150,6 @@ class Notify < BaseMailer
end
def reply_key
- @reply_key ||= Gitlab::ReplyByEmail.reply_key
+ @reply_key ||= SentNotification.reply_key
end
end
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb
index 8096d4fa5ae..cda4fdd4982 100644
--- a/app/models/ci/build.rb
+++ b/app/models/ci/build.rb
@@ -30,7 +30,6 @@ module Ci
LAZY_ATTRIBUTES = ['trace']
belongs_to :commit, class_name: 'Ci::Commit'
- belongs_to :project, class_name: 'Ci::Project'
belongs_to :runner, class_name: 'Ci::Runner'
belongs_to :trigger_request, class_name: 'Ci::TriggerRequest'
@@ -80,7 +79,6 @@ module Ci
new_build.commands = build.commands
new_build.tag_list = build.tag_list
new_build.commit_id = build.commit_id
- new_build.project_id = build.project_id
new_build.name = build.name
new_build.allow_failure = build.allow_failure
new_build.stage = build.stage
@@ -137,7 +135,7 @@ module Ci
state :canceled, value: 'canceled'
end
- delegate :sha, :short_sha, :before_sha, :ref,
+ delegate :sha, :short_sha, :before_sha, :ref, :project,
to: :commit, prefix: false
def trace_html
@@ -188,7 +186,7 @@ module Ci
end
def project_id
- commit.project_id
+ commit.project.id
end
def project_name
diff --git a/app/models/ci/commit.rb b/app/models/ci/commit.rb
index 23cd47dfe37..6d048779cde 100644
--- a/app/models/ci/commit.rb
+++ b/app/models/ci/commit.rb
@@ -18,8 +18,8 @@
module Ci
class Commit < ActiveRecord::Base
extend Ci::Model
-
- belongs_to :project, class_name: 'Ci::Project'
+
+ belongs_to :gl_project, class_name: '::Project', foreign_key: :gl_project_id
has_many :builds, dependent: :destroy, class_name: 'Ci::Build'
has_many :trigger_requests, dependent: :destroy, class_name: 'Ci::TriggerRequest'
@@ -36,6 +36,14 @@ module Ci
sha
end
+ def project
+ @project ||= gl_project.ensure_gitlab_ci_project
+ end
+
+ def project_id
+ project.id
+ end
+
def last_build
builds.order(:id).last
end
@@ -111,15 +119,14 @@ module Ci
builds_attrs = config_processor.builds_for_stage_and_ref(stage, ref, tag)
builds_attrs.map do |build_attrs|
builds.create!({
- project: project,
- name: build_attrs[:name],
- commands: build_attrs[:script],
- tag_list: build_attrs[:tags],
- options: build_attrs[:options],
- allow_failure: build_attrs[:allow_failure],
- stage: build_attrs[:stage],
- trigger_request: trigger_request,
- })
+ name: build_attrs[:name],
+ commands: build_attrs[:script],
+ tag_list: build_attrs[:tags],
+ options: build_attrs[:options],
+ allow_failure: build_attrs[:allow_failure],
+ stage: build_attrs[:stage],
+ trigger_request: trigger_request,
+ })
end
end
@@ -236,7 +243,7 @@ module Ci
end
def config_processor
- @config_processor ||= Ci::GitlabCiYamlProcessor.new(push_data[:ci_yaml_file] || project.generated_yaml_config)
+ @config_processor ||= Ci::GitlabCiYamlProcessor.new(push_data[:ci_yaml_file])
rescue Ci::GitlabCiYamlProcessor::ValidationError => e
save_yaml_error(e.message)
nil
diff --git a/app/models/ci/project.rb b/app/models/ci/project.rb
index ae901d4ccd0..77cce261fc8 100644
--- a/app/models/ci/project.rb
+++ b/app/models/ci/project.rb
@@ -33,8 +33,6 @@ module Ci
belongs_to :gl_project, class_name: '::Project', foreign_key: :gitlab_id
- has_many :commits, ->() { order('CASE WHEN ci_commits.committed_at IS NULL THEN 0 ELSE 1 END', :committed_at, :id) }, dependent: :destroy, class_name: 'Ci::Commit'
- has_many :builds, through: :commits, dependent: :destroy, class_name: 'Ci::Build'
has_many :runner_projects, dependent: :destroy, class_name: 'Ci::RunnerProject'
has_many :runners, through: :runner_projects, class_name: 'Ci::Runner'
has_many :web_hooks, dependent: :destroy, class_name: 'Ci::WebHook'
@@ -54,13 +52,13 @@ module Ci
# Validations
#
validates_presence_of :name, :timeout, :token, :default_ref,
- :path, :ssh_url_to_repo, :gitlab_id
+ :path, :ssh_url_to_repo, :gitlab_id
validates_uniqueness_of :gitlab_id
validates :polling_interval,
- presence: true,
- if: ->(project) { project.always_build.present? }
+ presence: true,
+ if: ->(project) { project.always_build.present? }
scope :public_only, ->() { where(public: true) }
@@ -78,12 +76,12 @@ module Ci
def parse(project)
params = {
- name: project.name_with_namespace,
- gitlab_id: project.id,
- path: project.path_with_namespace,
- default_ref: project.default_branch || 'master',
- ssh_url_to_repo: project.ssh_url_to_repo,
- email_add_pusher: current_application_settings.add_pusher,
+ name: project.name_with_namespace,
+ gitlab_id: project.id,
+ path: project.path_with_namespace,
+ default_ref: project.default_branch || 'master',
+ ssh_url_to_repo: project.ssh_url_to_repo,
+ email_add_pusher: current_application_settings.add_pusher,
email_only_broken_builds: current_application_settings.all_broken_builds,
}
@@ -92,21 +90,6 @@ module Ci
project
end
- # TODO: remove
- def from_gitlab(user, scope = :owned, options)
- opts = user.authenticate_options
- opts.merge! options
-
- raise 'Implement me of fix'
- #projects = Ci::Network.new.projects(opts.compact, scope)
-
- if projects
- projects.map { |pr| OpenStruct.new(pr) }
- else
- []
- end
- end
-
def already_added?(project)
where(gitlab_id: project.id).any?
end
@@ -114,12 +97,12 @@ module Ci
def unassigned(runner)
joins("LEFT JOIN #{Ci::RunnerProject.table_name} ON #{Ci::RunnerProject.table_name}.project_id = #{Ci::Project.table_name}.id " \
"AND #{Ci::RunnerProject.table_name}.runner_id = #{runner.id}").
- where('#{Ci::RunnerProject.table_name}.project_id' => nil)
+ where("#{Ci::RunnerProject.table_name}.project_id" => nil)
end
def ordered_by_last_commit_date
- last_commit_subquery = "(SELECT project_id, MAX(committed_at) committed_at FROM #{Ci::Commit.table_name} GROUP BY project_id)"
- joins("LEFT JOIN #{last_commit_subquery} AS last_commit ON #{Ci::Project.table_name}.id = last_commit.project_id").
+ last_commit_subquery = "(SELECT gl_project_id, MAX(committed_at) committed_at FROM #{Ci::Commit.table_name} GROUP BY gl_project_id)"
+ joins("LEFT JOIN #{last_commit_subquery} AS last_commit ON #{Ci::Project.table_name}.gitlab_id = last_commit.gl_project_id").
order("CASE WHEN last_commit.committed_at IS NULL THEN 1 ELSE 0 END, last_commit.committed_at DESC")
end
@@ -139,10 +122,14 @@ module Ci
def set_default_values
self.token = SecureRandom.hex(15) if self.token.blank?
+ self.default_ref ||= 'master'
+ self.name ||= gl_project.name_with_namespace
+ self.path ||= gl_project.path_with_namespace
+ self.ssh_url_to_repo ||= gl_project.ssh_url_to_repo
end
def tracked_refs
- @tracked_refs ||= default_ref.split(",").map{|ref| ref.strip}
+ @tracked_refs ||= default_ref.split(",").map { |ref| ref.strip }
end
def valid_token? token
@@ -221,5 +208,13 @@ module Ci
def setup_finished?
commits.any?
end
+
+ def commits
+ gl_project.ci_commits
+ end
+
+ def builds
+ gl_project.ci_builds
+ end
end
end
diff --git a/app/models/ci/runner.rb b/app/models/ci/runner.rb
index 1e9f78a3748..6838ccfaaab 100644
--- a/app/models/ci/runner.rb
+++ b/app/models/ci/runner.rb
@@ -41,6 +41,10 @@ module Ci
query: "%#{query.try(:downcase)}%")
end
+ def gl_projects_ids
+ projects.select(:gitlab_id)
+ end
+
def set_default_values
self.token = SecureRandom.hex(15) if self.token.blank?
end
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb
index 93faa133875..eb468c6cd53 100644
--- a/app/models/merge_request.rb
+++ b/app/models/merge_request.rb
@@ -433,10 +433,22 @@ class MergeRequest < ActiveRecord::Base
target_project.repository.fetch_ref(
source_project.repository.path_to_repo,
"refs/heads/#{source_branch}",
- "refs/merge-requests/#{iid}/head"
+ ref_path
)
end
+ def ref_path
+ "refs/merge-requests/#{iid}/head"
+ end
+
+ def ref_is_fetched?
+ File.exists?(File.join(project.repository.path_to_repo, ref_path))
+ end
+
+ def ensure_ref_fetched
+ fetch_ref unless ref_is_fetched?
+ end
+
def in_locked_state
begin
lock_mr
diff --git a/app/models/merge_request_diff.rb b/app/models/merge_request_diff.rb
index e317c8eac4d..f75f999b0d0 100644
--- a/app/models/merge_request_diff.rb
+++ b/app/models/merge_request_diff.rb
@@ -123,12 +123,12 @@ class MergeRequestDiff < ActiveRecord::Base
if new_diffs.any?
if new_diffs.size > Commit::DIFF_HARD_LIMIT_FILES
self.state = :overflow_diff_files_limit
- new_diffs = new_diffs.first[Commit::DIFF_HARD_LIMIT_LINES]
+ new_diffs = new_diffs.first(Commit::DIFF_HARD_LIMIT_LINES)
end
if new_diffs.sum { |diff| diff.diff.lines.count } > Commit::DIFF_HARD_LIMIT_LINES
self.state = :overflow_diff_lines_limit
- new_diffs = new_diffs.first[Commit::DIFF_HARD_LIMIT_LINES]
+ new_diffs = new_diffs.first(Commit::DIFF_HARD_LIMIT_LINES)
end
end
diff --git a/app/models/notification.rb b/app/models/notification.rb
index 1395274173d..171b8df45c2 100644
--- a/app/models/notification.rb
+++ b/app/models/notification.rb
@@ -12,7 +12,7 @@ class Notification
class << self
def notification_levels
- [N_DISABLED, N_PARTICIPATING, N_WATCH, N_MENTION]
+ [N_DISABLED, N_MENTION, N_PARTICIPATING, N_WATCH]
end
def options_with_labels
@@ -26,7 +26,7 @@ class Notification
end
def project_notification_levels
- [N_DISABLED, N_PARTICIPATING, N_WATCH, N_GLOBAL, N_MENTION]
+ [N_DISABLED, N_MENTION, N_PARTICIPATING, N_WATCH, N_GLOBAL]
end
end
@@ -57,4 +57,21 @@ class Notification
def level
target.notification_level
end
+
+ def to_s
+ case level
+ when N_DISABLED
+ 'Disabled'
+ when N_PARTICIPATING
+ 'Participating'
+ when N_WATCH
+ 'Watching'
+ when N_MENTION
+ 'On mention'
+ when N_GLOBAL
+ 'Global'
+ else
+ # do nothing
+ end
+ end
end
diff --git a/app/models/project.rb b/app/models/project.rb
index 3b233f2b890..4bcc16d8e9c 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -39,6 +39,7 @@ class Project < ActiveRecord::Base
include Gitlab::VisibilityLevel
include Referable
include Sortable
+ include AfterCommitQueue
extend Gitlab::ConfigHelper
extend Enumerize
@@ -117,6 +118,8 @@ class Project < ActiveRecord::Base
has_many :deploy_keys, through: :deploy_keys_projects
has_many :users_star_projects, dependent: :destroy
has_many :starrers, through: :users_star_projects, source: :user
+ has_many :ci_commits, ->() { order('CASE WHEN ci_commits.committed_at IS NULL THEN 0 ELSE 1 END', :committed_at, :id) }, dependent: :destroy, class_name: 'Ci::Commit', foreign_key: :gl_project_id
+ has_many :ci_builds, through: :ci_commits, source: :builds, dependent: :destroy, class_name: 'Ci::Build'
has_one :import_data, dependent: :destroy, class_name: "ProjectImportData"
has_one :gitlab_ci_project, dependent: :destroy, class_name: "Ci::Project", foreign_key: :gitlab_id
@@ -191,7 +194,7 @@ class Project < ActiveRecord::Base
state :finished
state :failed
- after_transition any => :started, do: :add_import_job
+ after_transition any => :started, do: :schedule_add_import_job
after_transition any => :finished, do: :clear_import_data
end
@@ -275,13 +278,17 @@ class Project < ActiveRecord::Base
id && persisted?
end
+ def schedule_add_import_job
+ run_after_commit(:add_import_job)
+ end
+
def add_import_job
if forked?
unless RepositoryForkWorker.perform_async(id, forked_from_project.path_with_namespace, self.namespace.path)
import_fail
end
else
- RepositoryImportWorker.perform_in(2.seconds, id)
+ RepositoryImportWorker.perform_async(id)
end
end
@@ -428,7 +435,7 @@ class Project < ActiveRecord::Base
end
def gitlab_ci?
- gitlab_ci_service && gitlab_ci_service.active
+ gitlab_ci_service && gitlab_ci_service.active && gitlab_ci_project.present?
end
def ci_services
@@ -735,4 +742,22 @@ class Project < ActiveRecord::Base
errors.add(:base, 'Failed create wiki')
false
end
+
+ def ci_commit(sha)
+ gitlab_ci_project.commits.find_by(sha: sha) if gitlab_ci?
+ end
+
+ def ensure_gitlab_ci_project
+ gitlab_ci_project || create_gitlab_ci_project
+ end
+
+ def enable_ci(user)
+ # Enable service
+ service = gitlab_ci_service || create_gitlab_ci_service
+ service.active = true
+ service.save
+
+ # Create Ci::Project
+ Ci::CreateProjectService.new.execute(user, self)
+ end
end
diff --git a/app/models/project_services/buildkite_service.rb b/app/models/project_services/buildkite_service.rb
index 9e5da6f45d2..40058b53df5 100644
--- a/app/models/project_services/buildkite_service.rb
+++ b/app/models/project_services/buildkite_service.rb
@@ -69,14 +69,6 @@ class BuildkiteService < CiService
"#{project_url}/builds?commit=#{sha}"
end
- def builds_path
- "#{project_url}/builds?branch=#{project.default_branch}"
- end
-
- def status_img_path
- "#{buildkite_endpoint('badge')}/#{status_token}.svg"
- end
-
def title
'Buildkite'
end
diff --git a/app/models/project_services/ci/hip_chat_message.rb b/app/models/project_services/ci/hip_chat_message.rb
index 58825fe066c..25c72033eac 100644
--- a/app/models/project_services/ci/hip_chat_message.rb
+++ b/app/models/project_services/ci/hip_chat_message.rb
@@ -1,5 +1,7 @@
module Ci
class HipChatMessage
+ include Gitlab::Application.routes.url_helpers
+
attr_reader :build
def initialize(build)
@@ -8,13 +10,13 @@ module Ci
def to_s
lines = Array.new
- lines.push("<a href=\"#{Ci::RoutesHelper.ci_project_url(project)}\">#{project.name}</a> - ")
+ lines.push("<a href=\"#{ci_project_url(project)}\">#{project.name}</a> - ")
if commit.matrix?
- lines.push("<a href=\"#{Ci::RoutesHelper.ci_project_ref_commits_url(project, commit.ref, commit.sha)}\">Commit ##{commit.id}</a></br>")
+ lines.push("<a href=\"#{ci_project_ref_commits_url(project, commit.ref, commit.sha)}\">Commit ##{commit.id}</a></br>")
else
first_build = commit.builds_without_retry.first
- lines.push("<a href=\"#{Ci::RoutesHelper.ci_project_build_url(project, first_build)}\">Build '#{first_build.name}' ##{first_build.id}</a></br>")
+ lines.push("<a href=\"#{ci_project_build_url(project, first_build)}\">Build '#{first_build.name}' ##{first_build.id}</a></br>")
end
lines.push("#{commit.short_sha} #{commit.git_author_name} - #{commit.git_commit_message}</br>")
diff --git a/app/models/project_services/ci/slack_message.rb b/app/models/project_services/ci/slack_message.rb
index 491ace50111..757b1961143 100644
--- a/app/models/project_services/ci/slack_message.rb
+++ b/app/models/project_services/ci/slack_message.rb
@@ -2,6 +2,8 @@ require 'slack-notifier'
module Ci
class SlackMessage
+ include Gitlab::Application.routes.url_helpers
+
def initialize(commit)
@commit = commit
end
@@ -27,7 +29,7 @@ module Ci
next unless build.failed?
fields << {
title: build.name,
- value: "Build <#{Ci::RoutesHelper.ci_project_build_url(project, build)}|\##{build.id}> failed in #{build.duration.to_i} second(s)."
+ value: "Build <#{ci_project_build_url(project, build)}|\##{build.id}> failed in #{build.duration.to_i} second(s)."
}
end
end
@@ -44,12 +46,12 @@ module Ci
attr_reader :commit
def attachment_message
- out = "<#{Ci::RoutesHelper.ci_project_url(project)}|#{project_name}>: "
+ out = "<#{ci_project_url(project)}|#{project_name}>: "
if commit.matrix?
- out << "Commit <#{Ci::RoutesHelper.ci_project_ref_commits_url(project, commit.ref, commit.sha)}|\##{commit.id}> "
+ out << "Commit <#{ci_project_ref_commits_url(project, commit.ref, commit.sha)}|\##{commit.id}> "
else
build = commit.builds_without_retry.first
- out << "Build <#{Ci::RoutesHelper.ci_project_build_path(project, build)}|\##{build.id}> "
+ out << "Build <#{ci_project_build_url(project, build)}|\##{build.id}> "
end
out << "(<#{commit_sha_link}|#{commit.short_sha}>) "
out << "of <#{commit_ref_link}|#{commit.ref}> "
diff --git a/app/models/project_services/drone_ci_service.rb b/app/models/project_services/drone_ci_service.rb
index 3e2b7faecdb..c73c4b058a1 100644
--- a/app/models/project_services/drone_ci_service.rb
+++ b/app/models/project_services/drone_ci_service.rb
@@ -26,7 +26,7 @@ class DroneCiService < CiService
format: { with: /\A#{URI.regexp(%w(http https))}\z/, message: "should be a valid url" }, if: :activated?
validates :token,
presence: true,
- format: { with: /\A([A-Za-z0-9]+)\z/ }, if: :activated?
+ if: :activated?
after_save :compose_service_hook, if: :activated?
@@ -135,20 +135,6 @@ class DroneCiService < CiService
commit_page(sha, ref)
end
- def builds_path
- url = [drone_url, "#{project.namespace.path}/#{project.path}"]
-
- URI.join(*url).to_s
- end
-
- def status_img_path
- url = [drone_url,
- "api/badges/#{project.namespace.path}/#{project.path}/status.svg",
- "?branch=#{URI::encode(project.default_branch)}"]
-
- URI.join(*url).to_s
- end
-
def title
'Drone CI'
end
diff --git a/app/models/project_services/gitlab_ci_service.rb b/app/models/project_services/gitlab_ci_service.rb
index acbbc9935b6..23ab206efba 100644
--- a/app/models/project_services/gitlab_ci_service.rb
+++ b/app/models/project_services/gitlab_ci_service.rb
@@ -19,22 +19,12 @@
#
class GitlabCiService < CiService
- API_PREFIX = "api/v1"
-
- prop_accessor :project_url, :token, :enable_ssl_verification
- validates :project_url,
- presence: true,
- format: { with: /\A#{URI.regexp(%w(http https))}\z/, message: "should be a valid url" }, if: :activated?
- validates :token,
- presence: true,
- format: { with: /\A([A-Za-z0-9]+)\z/ }, if: :activated?
+ include Gitlab::Application.routes.url_helpers
after_save :compose_service_hook, if: :activated?
def compose_service_hook
hook = service_hook || build_service_hook
- hook.url = [project_url, "/build", "?token=#{token}"].join("")
- hook.enable_ssl_verification = enable_ssl_verification
hook.save
end
@@ -55,71 +45,57 @@ class GitlabCiService < CiService
end
end
- service_hook.execute(data)
+ ci_project = Ci::Project.find_by(gitlab_id: project.id)
+ if ci_project
+ Ci::CreateCommitService.new.execute(ci_project, data)
+ end
end
- def commit_status_path(sha, ref)
- URI::encode(project_url + "/refs/#{ref}/commits/#{sha}/status.json?token=#{token}")
+ def token
+ if project.gitlab_ci_project.present?
+ project.gitlab_ci_project.token
+ end
end
- def get_ci_build(sha, ref)
- @ci_builds ||= {}
- @ci_builds[sha] ||= HTTParty.get(commit_status_path(sha, ref), verify: false)
+ def get_ci_commit(sha, ref)
+ Ci::Project.find(project.gitlab_ci_project).commits.find_by_sha_and_ref!(sha, ref)
end
def commit_status(sha, ref)
- response = get_ci_build(sha, ref)
-
- if response.code == 200 and response["status"]
- response["status"]
- else
- :error
- end
- rescue Errno::ECONNREFUSED
+ get_ci_commit(sha, ref).status
+ rescue ActiveRecord::RecordNotFound
:error
end
- def fork_registration(new_project, private_token)
- params = {
+ def fork_registration(new_project, current_user)
+ params = OpenStruct.new({
id: new_project.id,
name_with_namespace: new_project.name_with_namespace,
path_with_namespace: new_project.path_with_namespace,
web_url: new_project.web_url,
default_branch: new_project.default_branch,
ssh_url_to_repo: new_project.ssh_url_to_repo
- }
-
- HTTParty.post(
- fork_registration_path,
- body: {
- project_id: project.id,
- project_token: token,
- private_token: private_token,
- data: params },
- verify: false
+ })
+
+ ci_project = Ci::Project.find_by!(gitlab_id: project.id)
+
+ Ci::CreateProjectService.new.execute(
+ current_user,
+ params,
+ ci_project
)
end
def commit_coverage(sha, ref)
- response = get_ci_build(sha, ref)
-
- if response.code == 200 and response["coverage"]
- response["coverage"]
- end
- rescue Errno::ECONNREFUSED
- nil
+ get_ci_commit(sha, ref).coverage
+ rescue ActiveRecord::RecordNotFound
+ :error
end
def build_page(sha, ref)
- URI::encode(project_url + "/refs/#{ref}/commits/#{sha}")
- end
-
- def builds_path
- project_url + "?ref=" + project.default_branch
- end
-
- def status_img_path
- project_url + "/status.png?ref=" + project.default_branch
+ if project.gitlab_ci_project.present?
+ ci_project_ref_commits_url(project.gitlab_ci_project, ref, sha)
+ end
end
def title
@@ -135,11 +111,7 @@ class GitlabCiService < CiService
end
def fields
- [
- { type: 'text', name: 'token', placeholder: 'GitLab CI project specific token' },
- { type: 'text', name: 'project_url', placeholder: 'http://ci.gitlabhq.com/projects/3' },
- { type: 'checkbox', name: 'enable_ssl_verification', title: "Enable SSL verification" }
- ]
+ []
end
private
@@ -148,10 +120,6 @@ class GitlabCiService < CiService
repository.blob_at(sha, '.gitlab-ci.yml')
end
- def fork_registration_path
- project_url.sub(/projects\/\d*/, "#{API_PREFIX}/forks")
- end
-
def repository
project.repository
end
diff --git a/app/models/sent_notification.rb b/app/models/sent_notification.rb
index 33b113a2a27..3eed5c16e45 100644
--- a/app/models/sent_notification.rb
+++ b/app/models/sent_notification.rb
@@ -8,6 +8,7 @@
# noteable_type :string(255)
# recipient_id :integer
# commit_id :string(255)
+# line_code :string(255)
# reply_key :string(255) not null
#
@@ -21,13 +22,20 @@ class SentNotification < ActiveRecord::Base
validates :noteable_id, presence: true, unless: :for_commit?
validates :commit_id, presence: true, if: :for_commit?
+ validates :line_code, format: { with: /\A[a-z0-9]+_\d+_\d+\Z/ }, allow_blank: true
class << self
+ def reply_key
+ return nil unless Gitlab::IncomingEmail.enabled?
+
+ SecureRandom.hex(16)
+ end
+
def for(reply_key)
find_by(reply_key: reply_key)
end
- def record(noteable, recipient_id, reply_key)
+ def record(noteable, recipient_id, reply_key, params = {})
return unless reply_key
noteable_id = nil
@@ -38,7 +46,7 @@ class SentNotification < ActiveRecord::Base
noteable_id = noteable.id
end
- create(
+ params.reverse_merge!(
project: noteable.project,
noteable_type: noteable.class.name,
noteable_id: noteable_id,
@@ -46,6 +54,14 @@ class SentNotification < ActiveRecord::Base
recipient_id: recipient_id,
reply_key: reply_key
)
+
+ create(params)
+ end
+
+ def record_note(note, recipient_id, reply_key, params = {})
+ params[:line_code] = note.line_code
+
+ record(note.noteable, recipient_id, reply_key, params)
end
end
diff --git a/app/models/user.rb b/app/models/user.rb
index 25371f9138a..3879f3fd381 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -172,7 +172,7 @@ class User < ActiveRecord::Base
# User's Dashboard preference
# Note: When adding an option, it MUST go on the end of the array.
- enum dashboard: [:projects, :stars]
+ enum dashboard: [:projects, :stars, :project_activity, :starred_project_activity]
# User's Project preference
# Note: When adding an option, it MUST go on the end of the array.
diff --git a/app/services/ci/create_project_service.rb b/app/services/ci/create_project_service.rb
index 0419612d521..f42babd2388 100644
--- a/app/services/ci/create_project_service.rb
+++ b/app/services/ci/create_project_service.rb
@@ -2,20 +2,15 @@ module Ci
class CreateProjectService
include Gitlab::Application.routes.url_helpers
- def execute(current_user, params, project_route, forked_project = nil)
+ def execute(current_user, params, forked_project = nil)
@project = Ci::Project.parse(params)
Ci::Project.transaction do
@project.save!
- data = {
- token: @project.token,
- project_url: project_route.gsub(":project_id", @project.id.to_s),
- }
-
gl_project = ::Project.find(@project.gitlab_id)
gl_project.build_missing_services
- gl_project.gitlab_ci_service.update_attributes(data.merge(active: true))
+ gl_project.gitlab_ci_service.update_attributes(active: true)
end
if forked_project
diff --git a/app/services/ci/register_build_service.rb b/app/services/ci/register_build_service.rb
index 33f1c1e918d..71b61bbe389 100644
--- a/app/services/ci/register_build_service.rb
+++ b/app/services/ci/register_build_service.rb
@@ -8,10 +8,10 @@ module Ci
builds =
if current_runner.shared?
# don't run projects which have not enables shared runners
- builds.includes(:project).where(ci_projects: { shared_runners_enabled: true })
+ builds.joins(commit: { gl_project: :gitlab_ci_project }).where(ci_projects: { shared_runners_enabled: true })
else
# do run projects which are only assigned to this runner
- builds.where(project_id: current_runner.projects)
+ builds.joins(:commit).where(ci_commits: { gl_project_id: current_runner.gl_projects_ids })
end
builds = builds.order('created_at ASC')
@@ -19,7 +19,7 @@ module Ci
build = builds.find do |build|
(build.tag_list - current_runner.tag_list).empty?
end
-
+
if build
# In case when 2 runners try to assign the same build, second runner will be declined
diff --git a/app/services/compare_service.rb b/app/services/compare_service.rb
index 70f642baaaa..bfe6a3dc4be 100644
--- a/app/services/compare_service.rb
+++ b/app/services/compare_service.rb
@@ -4,7 +4,10 @@ require 'securerandom'
# and return Gitlab::CompareResult object that responds to commits and diffs
class CompareService
def execute(source_project, source_branch, target_project, target_branch)
- source_sha = source_project.commit(source_branch).sha
+ source_commit = source_project.commit(source_branch)
+ return unless source_commit
+
+ source_sha = source_commit.sha
# If compare with other project we need to fetch ref first
unless target_project == source_project
diff --git a/app/services/git_push_service.rb b/app/services/git_push_service.rb
index 0a73244774a..8193b6e192d 100644
--- a/app/services/git_push_service.rb
+++ b/app/services/git_push_service.rb
@@ -55,6 +55,12 @@ class GitPushService
@push_data = build_push_data(oldrev, newrev, ref)
+ # If CI was disabled but .gitlab-ci.yml file was pushed
+ # we enable CI automatically
+ if !project.gitlab_ci? && gitlab_ci_yaml?(newrev)
+ project.enable_ci(user)
+ end
+
EventCreateService.new.push(project, user, @push_data)
project.execute_hooks(@push_data.dup, :push_hooks)
project.execute_services(@push_data.dup, :push_hooks)
@@ -143,4 +149,10 @@ class GitPushService
def commit_user(commit)
commit.author || user
end
+
+ def gitlab_ci_yaml?(sha)
+ @project.repository.blob_at(sha, '.gitlab-ci.yml')
+ rescue Rugged::ReferenceError
+ nil
+ end
end
diff --git a/app/services/milestones/destroy_service.rb b/app/services/milestones/destroy_service.rb
index 7ce7d259d0b..2414966505b 100644
--- a/app/services/milestones/destroy_service.rb
+++ b/app/services/milestones/destroy_service.rb
@@ -4,10 +4,15 @@ module Milestones
Milestone.transaction do
update_params = { milestone: nil }
+
milestone.issues.each do |issue|
Issues::UpdateService.new(project, current_user, update_params).execute(issue)
end
+ milestone.merge_requests.each do |merge_request|
+ MergeRequests::UpdateService.new(project, current_user, update_params).execute(merge_request)
+ end
+
event_service.destroy_milestone(milestone, current_user)
Event.for_milestone_id(milestone.id).each do |event|
diff --git a/app/services/projects/fork_service.rb b/app/services/projects/fork_service.rb
index 50f208b11d1..2e995d6fd51 100644
--- a/app/services/projects/fork_service.rb
+++ b/app/services/projects/fork_service.rb
@@ -18,7 +18,7 @@ module Projects
if new_project.persisted?
if @project.gitlab_ci?
- ForkRegistrationWorker.perform_async(@project.id, new_project.id, @current_user.private_token)
+ @project.gitlab_ci_service.fork_registration(new_project, @current_user)
end
end
diff --git a/app/views/admin/application_settings/_form.html.haml b/app/views/admin/application_settings/_form.html.haml
index 1476e29524c..143cd10c543 100644
--- a/app/views/admin/application_settings/_form.html.haml
+++ b/app/views/admin/application_settings/_form.html.haml
@@ -131,7 +131,7 @@
.checkbox
= f.label :ci_enabled do
= f.check_box :ci_enabled
- Enable Continuous Integration
+ Disable to prevent CI usage until rake ci:migrate is run (8.0 only)
.form-actions
= f.submit 'Save', class: 'btn btn-primary'
diff --git a/app/views/admin/dashboard/index.html.haml b/app/views/admin/dashboard/index.html.haml
index 54191aadda6..8657d2c71fe 100644
--- a/app/views/admin/dashboard/index.html.haml
+++ b/app/views/admin/dashboard/index.html.haml
@@ -58,7 +58,7 @@
%p
Reply by email
%span.light.pull-right
- = boolean_to_icon Gitlab::ReplyByEmail.enabled?
+ = boolean_to_icon Gitlab::IncomingEmail.enabled?
.col-md-4
%h4
Components
diff --git a/app/views/admin/labels/index.html.haml b/app/views/admin/labels/index.html.haml
index 8b11c28c56e..d67454c03e7 100644
--- a/app/views/admin/labels/index.html.haml
+++ b/app/views/admin/labels/index.html.haml
@@ -12,5 +12,5 @@
= paginate @labels, theme: 'gitlab'
- else
.light-well
- .nothing-here-block There are no any labels yet
- \ No newline at end of file
+ .nothing-here-block There are no labels yet
+
diff --git a/app/views/admin/users/_head.html.haml b/app/views/admin/users/_head.html.haml
index 9d5e934c8ba..4245d0f1eda 100644
--- a/app/views/admin/users/_head.html.haml
+++ b/app/views/admin/users/_head.html.haml
@@ -6,6 +6,8 @@
%span.cred (Admin)
.pull-right
+ - unless @user == current_user
+ = link_to 'Log in as this user', login_as_admin_user_path(@user), method: :post, class: "btn btn-grouped btn-info"
= link_to edit_admin_user_path(@user), class: "btn btn-grouped" do
%i.fa.fa-pencil-square-o
Edit
diff --git a/app/views/admin/users/index.html.haml b/app/views/admin/users/index.html.haml
index 5e40d95d1c5..e3698ac1c46 100644
--- a/app/views/admin/users/index.html.haml
+++ b/app/views/admin/users/index.html.haml
@@ -97,5 +97,5 @@
- if user.access_locked?
= link_to 'Unlock', unlock_admin_user_path(user), method: :put, class: "btn btn-xs btn-success", data: { confirm: 'Are you sure?' }
- if user.can_be_removed?
- = link_to 'Destroy', [:admin, user], data: { confirm: "USER #{user.name} WILL BE REMOVED! All tickets linked to this user will also be removed! Maybe block the user instead? Are you sure?" }, method: :delete, class: "btn btn-xs btn-remove"
+ = link_to 'Destroy', [:admin, user], data: { confirm: "USER #{user.name} WILL BE REMOVED! All issues, merge requests and groups linked to this user will also be removed! Maybe block the user instead? Are you sure?" }, method: :delete, class: "btn btn-xs btn-remove"
= paginate @users, theme: "gitlab"
diff --git a/app/views/ci/admin/builds/_build.html.haml b/app/views/ci/admin/builds/_build.html.haml
index 47f8df8f98e..778d51d03be 100644
--- a/app/views/ci/admin/builds/_build.html.haml
+++ b/app/views/ci/admin/builds/_build.html.haml
@@ -1,11 +1,11 @@
- if build.commit && build.project
- %tr.build.alert{class: build_status_alert_class(build)}
+ %tr.build
%td.build-link
= link_to ci_project_build_url(build.project, build) do
%strong #{build.id}
%td.status
- = build.status
+ = ci_status_with_icon(build.status)
%td.commit-link
= commit_link(build.commit)
diff --git a/app/views/ci/admin/projects/_project.html.haml b/app/views/ci/admin/projects/_project.html.haml
index 505dd4b3fdc..a342d6e1cf0 100644
--- a/app/views/ci/admin/projects/_project.html.haml
+++ b/app/views/ci/admin/projects/_project.html.haml
@@ -1,5 +1,5 @@
-- last_commit = project.last_commit
-%tr.alert{class: commit_status_alert_class(last_commit) }
+- last_commit = project.commits.last
+%tr
%td
= project.id
%td
@@ -7,8 +7,9 @@
%strong= project.name
%td
- if last_commit
- #{last_commit.status} (#{commit_link(last_commit)})
+ = ci_status_with_icon(last_commit.status)
- if project.last_commit_date
+ &middot;
= time_ago_in_words project.last_commit_date
ago
- else
diff --git a/app/views/ci/admin/runners/show.html.haml b/app/views/ci/admin/runners/show.html.haml
index 24e0ad3b070..09905e0eb47 100644
--- a/app/views/ci/admin/runners/show.html.haml
+++ b/app/views/ci/admin/runners/show.html.haml
@@ -102,9 +102,9 @@
%th Finished at
- @builds.each do |build|
- %tr.build.alert{class: build_status_alert_class(build)}
+ %tr.build
%td.status
- = build.status
+ = ci_status_with_icon(build.status)
%td.status
= build.project.name
diff --git a/app/views/ci/builds/_build.html.haml b/app/views/ci/builds/_build.html.haml
index da306c9f020..515b862e992 100644
--- a/app/views/ci/builds/_build.html.haml
+++ b/app/views/ci/builds/_build.html.haml
@@ -1,6 +1,6 @@
-%tr.build.alert{class: build_status_alert_class(build)}
+%tr.build
%td.status
- = build.status
+ = ci_status_with_icon(build.status)
%td.build-link
= link_to ci_project_build_path(build.project, build) do
diff --git a/app/views/ci/builds/show.html.haml b/app/views/ci/builds/show.html.haml
index d1e955b5012..839dbf5c554 100644
--- a/app/views/ci/builds/show.html.haml
+++ b/app/views/ci/builds/show.html.haml
@@ -1,15 +1,16 @@
#up-build-trace
- if @commit.matrix?
- %ul.nav.nav-tabs.append-bottom-10
+ %ul.center-top-menu
- @commit.builds_without_retry_sorted.each do |build|
%li{class: ('active' if build == @build) }
= link_to ci_project_build_url(@project, build) do
- %i{class: build_icon_css_class(build)}
+ = ci_icon_for_status(build.status)
%span
- Build ##{build.id}
- if build.name
- &middot;
= build.name
+ - else
+ = build.id
+
- unless @commit.builds_without_retry.include?(@build)
%li.active
@@ -19,34 +20,33 @@
%i.fa.fa-warning-sign
This build was retried.
-.row
- .col-md-9
- .build-head.alert{class: build_status_alert_class(@build)}
- %h4
- - if @build.commit.tag?
- Build for tag
- %code #{@build.ref}
- - else
- Build for commit
- %code #{@build.short_sha}
- from
-
- = link_to ci_project_path(@build.project, ref: @build.ref) do
- %span.label.label-primary= "#{@build.ref}"
-
- - if @build.duration
- .pull-right
- %span
- %i.fa.fa-time
- #{duration_in_words(@build.finished_at, @build.started_at)}
+.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
- .clearfix
- = @build.status
- .pull-right
- = @build.updated_at.stamp('19:00 Aug 27')
+ = 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
@@ -150,13 +150,16 @@
%h4.title #{pluralize(@builds.count, "other build")} for #{@build.short_sha}:
%table.builds
- @builds.each_with_index do |build, i|
- %tr.build.alert{class: build_status_alert_class(build)}
+ %tr.build
%td
- = link_to ci_project_build_url(@project, build) do
- %span ##{build.id}
+ = ci_icon_for_status(build.status)
%td
- - if build.name
- = build.name
+ = link_to ci_project_build_url(@project, build) do
+ - if build.name
+ = build.name
+ - else
+ %span ##{build.id}
+
%td.status= build.status
diff --git a/app/views/ci/charts/_overall.haml b/app/views/ci/charts/_overall.haml
deleted file mode 100644
index f522f35a629..00000000000
--- a/app/views/ci/charts/_overall.haml
+++ /dev/null
@@ -1,21 +0,0 @@
-%fieldset
- %legend Overall
- %p
- Total:
- %strong= pluralize @project.builds.count(:all), 'build'
- %p
- Successful:
- %strong= pluralize @project.builds.success.count(:all), 'build'
- %p
- Failed:
- %strong= pluralize @project.builds.failed.count(:all), 'build'
-
- %p
- Success ratio:
- %strong
- #{success_ratio(@project.builds.success, @project.builds.failed)}%
-
- %p
- Commits covered:
- %strong
- = @project.commits.count(:all)
diff --git a/app/views/ci/charts/show.html.haml b/app/views/ci/charts/show.html.haml
deleted file mode 100644
index 0497f037721..00000000000
--- a/app/views/ci/charts/show.html.haml
+++ /dev/null
@@ -1,4 +0,0 @@
-#charts.ci-charts
- = render 'builds'
- = render 'build_times'
-= render 'overall'
diff --git a/app/views/ci/commits/_commit.html.haml b/app/views/ci/commits/_commit.html.haml
index c1b1988d147..1eacfca944f 100644
--- a/app/views/ci/commits/_commit.html.haml
+++ b/app/views/ci/commits/_commit.html.haml
@@ -1,6 +1,6 @@
-%tr.build.alert{class: commit_status_alert_class(commit)}
+%tr.build
%td.status
- = commit.status
+ = ci_status_with_icon(commit.status)
- if commit.running?
&middot;
= commit.stage
diff --git a/app/views/ci/commits/show.html.haml b/app/views/ci/commits/show.html.haml
index 1aeb557314a..8f38aa84676 100644
--- a/app/views/ci/commits/show.html.haml
+++ b/app/views/ci/commits/show.html.haml
@@ -1,29 +1,34 @@
.commit-info
- %pre.commit-message
- #{@commit.git_commit_message}
+ .append-bottom-20
+ = ci_status_with_icon(@commit.status)
- .row
- .col-sm-6
- - if @commit.compare?
- %p
- %span.attr-name Compare:
- #{gitlab_compare_link(@project, @commit.short_before_sha, @commit.short_sha)}
- - else
- %p
- %span.attr-name Commit:
- #{gitlab_commit_link(@project, @commit.sha)}
+ .gray-content-block.middle-block
+ %pre.commit-message
+ #{@commit.git_commit_message}
+
+ .gray-content-block.second-block
+ .row
+ .col-sm-6
+ - if @commit.compare?
+ %p
+ %span.attr-name Compare:
+ #{gitlab_compare_link(@project, @commit.short_before_sha, @commit.short_sha)}
+ - else
+ %p
+ %span.attr-name Commit:
+ #{gitlab_commit_link(@project, @commit.sha)}
- %p
- %span.attr-name Branch:
- #{gitlab_ref_link(@project, @commit.ref)}
- .col-sm-6
- %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)}
+ %span.attr-name Branch:
+ #{gitlab_ref_link(@project, @commit.ref)}
+ .col-sm-6
+ %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)
.pull-right
@@ -42,12 +47,6 @@
.bs-callout.bs-callout-warning
\.gitlab-ci.yml not found in this commit
-%h3 Status
-
-.build.alert{class: commit_status_alert_class(@commit)}
- .status
- = @commit.status.titleize
-
%h3
Builds
- if @commit.duration > 0
diff --git a/app/views/ci/projects/_project.html.haml b/app/views/ci/projects/_project.html.haml
deleted file mode 100644
index 869747b6eb1..00000000000
--- a/app/views/ci/projects/_project.html.haml
+++ /dev/null
@@ -1,36 +0,0 @@
-- if project.gitlab_ci_project
- - ci_project = project.gitlab_ci_project
- - last_commit = ci_project.last_commit
- %tr.alert{class: commit_status_alert_class(last_commit) }
- %td
- = link_to [:ci, ci_project] do
- = ci_project.name
- %td
- - if last_commit
- #{last_commit.status} (#{commit_link(last_commit)})
- - if ci_project.last_commit_date
- = time_ago_in_words ci_project.last_commit_date
- ago
- - else
- No builds yet
- %td
- - if ci_project.public
- %i.fa.fa-globe
- Public
- - else
- %i.fa.fa-lock
- Private
- %td
- = ci_project.commits.count
-- else
- %tr.light
- %td
- = project.name_with_namespace
- %td
- %small Not added to CI
- %td
- %td
- = form_tag ci_projects_path do
- = hidden_field_tag :project, project.to_json(methods: [:name_with_namespace, :path_with_namespace, :ssh_url_to_repo])
- = submit_tag 'Add project to CI', class: 'btn btn-default btn-sm'
- \ No newline at end of file
diff --git a/app/views/ci/projects/_public.html.haml b/app/views/ci/projects/_public.html.haml
deleted file mode 100644
index bcbd60b83f0..00000000000
--- a/app/views/ci/projects/_public.html.haml
+++ /dev/null
@@ -1,16 +0,0 @@
-= content_for :title do
- %h3.project-title
- Public projects
-
-- if @projects.present?
- .projects
- %table.table
- %tr
- %th Name
- %th Last commit
- %th Access
- %th Commits
- = render @projects
- = paginate @projects
-- else
- %h4 No public projects yet
diff --git a/app/views/ci/projects/_search.html.haml b/app/views/ci/projects/_search.html.haml
deleted file mode 100644
index 4ab43a403f7..00000000000
--- a/app/views/ci/projects/_search.html.haml
+++ /dev/null
@@ -1,11 +0,0 @@
-.search
- = form_tag "#", method: :get, class: 'ci-search-form' do |f|
- .input-group
- = search_field_tag "search", params[:search], placeholder: "Search", class: "search-input form-control"
- .input-group-addon
- %i.fa.fa-search
-
-:coffeescript
- $('.ci-search-form').submit ->
- CiPager.init "#{ci_projects_path}" + "?search=" + query, #{Ci::ProjectsController::PROJECTS_BATCH}, false
- false
diff --git a/app/views/ci/projects/disabled.html.haml b/app/views/ci/projects/disabled.html.haml
index 95276d894ed..83b0d8329e1 100644
--- a/app/views/ci/projects/disabled.html.haml
+++ b/app/views/ci/projects/disabled.html.haml
@@ -1 +1 @@
-Continuous Integration has been disabled. Please ask your administrator to enable it.
+Continuous Integration has been disabled for time of the migration.
diff --git a/app/views/ci/projects/index.html.haml b/app/views/ci/projects/index.html.haml
deleted file mode 100644
index 8de205d57aa..00000000000
--- a/app/views/ci/projects/index.html.haml
+++ /dev/null
@@ -1,30 +0,0 @@
-- if current_user
- - if @offset > 0
- = render @projects
- - else
- .gray-content-block.top-block
- = render "search"
- .projects
- .gray-content-block.clearfix.light.second-block
- .pull-left.fetch-status
- - if params[:search].present?
- by keyword: "#{params[:search]}",
- #{@total_count} projects
-
- .wide-table-holder
- %table.table.projects-table.content-list
- %thead
- %tr
- %th Project Name
- %th Last commit
- %th Access
- %th Commits
-
- = render @projects
- %p.text-center.hide.loading
- %i.fa.fa-refresh.fa-spin
- :coffeescript
- CiPager.init "#{ci_projects_path}", #{Ci::ProjectsController::PROJECTS_BATCH}, false
-
-- else
- = render 'public'
diff --git a/app/views/ci/projects/show.html.haml b/app/views/ci/projects/show.html.haml
index 6443378af99..73e60795ba6 100644
--- a/app/views/ci/projects/show.html.haml
+++ b/app/views/ci/projects/show.html.haml
@@ -3,7 +3,7 @@
- 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", ci_project_runners_path(@project)
+ = link_to "Runners page", runners_path(@project.gl_project)
%ul.nav.nav-tabs.append-bottom-20
%li{class: ref_tab_class}
diff --git a/app/views/ci/shared/_guide.html.haml b/app/views/ci/shared/_guide.html.haml
index 8a42f29b77c..db2d7f2f4b6 100644
--- a/app/views/ci/shared/_guide.html.haml
+++ b/app/views/ci/shared/_guide.html.haml
@@ -4,7 +4,7 @@
%ol
%li
Add at least one runner to the project.
- Go to #{link_to 'Runners page', ci_project_runners_path(@project), target: :blank} for instructions.
+ Go to #{link_to 'Runners page', runners_path(@project.gl_project), target: :blank} for instructions.
%li
Put the .gitlab-ci.yml in the root of your repository. Examples can be found in #{link_to "Configuring project (.gitlab-ci.yml)", "http://doc.gitlab.com/ci/yaml/README.html", target: :blank}.
You can also test your .gitlab-ci.yml in the #{link_to "Lint", ci_lint_path}
diff --git a/app/views/dashboard/projects/_projects.html.haml b/app/views/dashboard/projects/_projects.html.haml
index ef9b9ce756a..e09e032a7f1 100644
--- a/app/views/dashboard/projects/_projects.html.haml
+++ b/app/views/dashboard/projects/_projects.html.haml
@@ -4,7 +4,7 @@
= search_field_tag :filter_projects, nil, placeholder: 'Filter by name', class: 'projects-list-filter form-control'
- if current_user.can_create_project?
%span.input-group-btn
- = link_to new_project_path, class: 'btn btn-success' do
+ = link_to new_project_path, class: 'btn btn-green' do
New project
- = render 'shared/projects/list', projects: @projects
+ = 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 9ac56b1e5fe..2b27a88794d 100644
--- a/app/views/groups/_projects.html.haml
+++ b/app/views/groups/_projects.html.haml
@@ -4,7 +4,7 @@
= search_field_tag :filter_projects, nil, placeholder: 'Filter by name', class: 'projects-list-filter form-control'
- if can? current_user, :create_projects, @group
%span.input-group-btn
- = link_to new_project_path(namespace_id: @group.id), class: 'btn btn-success' do
+ = 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
diff --git a/app/views/help/index.html.haml b/app/views/help/index.html.haml
index f492aaf4c0a..57bc91ea5a9 100644
--- a/app/views/help/index.html.haml
+++ b/app/views/help/index.html.haml
@@ -1,14 +1,15 @@
%div
%h1
GitLab
- %span= Gitlab::VERSION
- %small= Gitlab::REVISION
- - if current_application_settings.version_check_enabled
+ Community Edition
+ - if user_signed_in?
+ %span= Gitlab::VERSION
+ %small= Gitlab::REVISION
= version_status_badge
%p.slead
GitLab is open source software to collaborate on code.
%br
- Manage git repositories with fine grained access controls that keep your code secure.
+ Manage git repositories with fine-grained access controls that keep your code secure.
%br
Perform code reviews and enhance collaboration with merge requests.
%br
@@ -27,29 +28,14 @@
.col-md-8
.documentation-index
= preserve do
- - readme_text = File.read(Rails.root.join("doc", "README.md"))
- - text = readme_text.dup
- - readme_text.scan(/\]\(([^(]+)\)/) { |match| text.gsub!(match.first, "help/#{match.first}") }
- = markdown text
-
+ = markdown(@help_index)
.col-md-4
.panel.panel-default
.panel-heading
Quick help
%ul.well-list
- %li
- See our website for
- = link_to 'getting help', promo_url + '/getting-help/'
- %li
- Use the
- = link_to 'search bar', '#', onclick: 'Shortcuts.focusSearch(event)'
- on the top of this page
- %li
- Use
- = link_to 'shortcuts', '#', onclick: 'Shortcuts.showHelp(event)'
- %li
- Get a support
- = link_to 'subscription', 'https://about.gitlab.com/pricing/'
- %li
- = link_to 'Compare', 'https://about.gitlab.com/features/#compare'
- GitLab editions
+ %li= link_to 'See our website for getting help', promo_url + '/getting-help/'
+ %li= link_to 'Use the search bar on the top of this page', '#', onclick: 'Shortcuts.focusSearch(event)'
+ %li= link_to 'Use shortcuts', '#', onclick: 'Shortcuts.showHelp(event)'
+ %li= link_to 'Get a support subscription', 'https://about.gitlab.com/pricing/'
+ %li= link_to 'Compare GitLab editions', 'https://about.gitlab.com/features/#compare'
diff --git a/app/views/kaminari/gitlab/_first_page.html.haml b/app/views/kaminari/gitlab/_first_page.html.haml
index 41c9c0b3af6..ada7306d98d 100644
--- a/app/views/kaminari/gitlab/_first_page.html.haml
+++ b/app/views/kaminari/gitlab/_first_page.html.haml
@@ -5,5 +5,5 @@
-# num_pages: total number of pages
-# per_page: number of items to fetch per page
-# remote: data-remote
-%span.first
+%li.first
= link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, remote: remote
diff --git a/app/views/kaminari/gitlab/_last_page.html.haml b/app/views/kaminari/gitlab/_last_page.html.haml
index b03a206224c..3431d029bcc 100644
--- a/app/views/kaminari/gitlab/_last_page.html.haml
+++ b/app/views/kaminari/gitlab/_last_page.html.haml
@@ -5,5 +5,5 @@
-# num_pages: total number of pages
-# per_page: number of items to fetch per page
-# remote: data-remote
-%span.last
+%li.last
= link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, {remote: remote}
diff --git a/app/views/kaminari/gitlab/_paginator.html.haml b/app/views/kaminari/gitlab/_paginator.html.haml
index 4f7996e4996..2f645186921 100644
--- a/app/views/kaminari/gitlab/_paginator.html.haml
+++ b/app/views/kaminari/gitlab/_paginator.html.haml
@@ -7,11 +7,16 @@
-# paginator: the paginator that renders the pagination tags inside
= paginator.render do
%div.gl-pagination
- %ul.pagination
- = prev_page_tag unless current_page.first?
+ %ul.pagination.clearfix
+ - unless current_page.first?
+ = first_page_tag unless num_pages < 5 # As kaminari will always show the first 5 pages
+ = prev_page_tag
- each_page do |page|
- if page.left_outer? || page.right_outer? || page.inside_window?
= page_tag page
- elsif !page.was_truncated?
= gap_tag
- = next_page_tag unless current_page.last?
+ - unless current_page.last?
+ = next_page_tag
+ = last_page_tag unless num_pages < 5
+
diff --git a/app/views/layouts/ci/_nav_admin.html.haml b/app/views/layouts/ci/_nav_admin.html.haml
index e9974c85733..af2545a22d8 100644
--- a/app/views/layouts/ci/_nav_admin.html.haml
+++ b/app/views/layouts/ci/_nav_admin.html.haml
@@ -8,26 +8,26 @@
%li.separate-item
= nav_link path: 'projects#index' do
= link_to ci_admin_projects_path do
- %i.fa.fa-list-alt
+ = icon('list-alt fw')
Projects
= nav_link path: 'events#index' do
= link_to ci_admin_events_path do
- %i.fa.fa-book
+ = icon('book fw')
Events
= nav_link path: ['runners#index', 'runners#show'] do
= link_to ci_admin_runners_path do
- %i.fa.fa-cog
+ = icon('cog fw')
Runners
%small.pull-right
= Ci::Runner.count(:all)
= nav_link path: 'builds#index' do
= link_to ci_admin_builds_path do
- %i.fa.fa-link
+ = icon('link fw')
Builds
%small.pull-right
= Ci::Build.count(:all)
= nav_link(controller: :application_settings, html_options: { class: 'separate-item'}) do
= link_to ci_admin_application_settings_path do
- %i.fa.fa-cogs
+ = icon('cogs fw')
%span
Settings
diff --git a/app/views/layouts/ci/_nav_project.html.haml b/app/views/layouts/ci/_nav_project.html.haml
index d747679c8cf..3a2741367c1 100644
--- a/app/views/layouts/ci/_nav_project.html.haml
+++ b/app/views/layouts/ci/_nav_project.html.haml
@@ -1,53 +1,28 @@
%ul.nav.nav-sidebar
= nav_link do
- = link_to ci_root_path, title: 'Back to CI projects', data: {placement: 'right'}, class: 'back-link' do
+ = link_to project_path(@project.gl_project), title: 'Back to project', data: {placement: 'right'}, class: 'back-link' do
= icon('caret-square-o-left fw')
- %span= 'Back to CI projects'
+ %span
+ Back to project
%li.separate-item
= nav_link path: ['projects#show', 'commits#show', 'builds#show'] do
= link_to ci_project_path(@project) do
- %i.fa.fa-list-alt
+ = icon('list-alt fw')
%span
Commits
- %small.pull-right= @project.commits.count
- = nav_link path: 'charts#show' do
- = link_to ci_project_charts_path(@project) do
- %i.fa.fa-bar-chart
- %span
- Charts
- = nav_link path: ['runners#index', 'runners#show', 'runners#edit'] do
- = link_to ci_project_runners_path(@project) do
- %i.fa.fa-cog
- %span
- Runners
- = nav_link path: 'variables#show' do
- = link_to ci_project_variables_path(@project) do
- %i.fa.fa-code
- %span
- Variables
- = nav_link path: 'web_hooks#index' do
- = link_to ci_project_web_hooks_path(@project) do
- %i.fa.fa-link
- %span
- Web Hooks
- = nav_link path: 'triggers#index' do
- = link_to ci_project_triggers_path(@project) do
- %i.fa.fa-retweet
- %span
- Triggers
- = nav_link path: ['services#index', 'services#edit'] do
- = link_to ci_project_services_path(@project) do
- %i.fa.fa-share
- %span
- Services
- = nav_link path: 'events#index' do
- = link_to ci_project_events_path(@project) do
- %i.fa.fa-book
- %span
- Events
- %li.separate-item
- = nav_link path: 'projects#edit' do
- = link_to edit_ci_project_path(@project) do
- %i.fa.fa-cogs
- %span
- Settings
+ %span.count= @project.commits.count
+ = nav_link path: 'web_hooks#index' do
+ = link_to ci_project_web_hooks_path(@project) do
+ = icon('link fw')
+ %span
+ Web Hooks
+ = 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')
+ %span
+ Events
diff --git a/app/views/layouts/ci/_page.html.haml b/app/views/layouts/ci/_page.html.haml
index c598f63c4c8..bb5ec727bff 100644
--- a/app/views/layouts/ci/_page.html.haml
+++ b/app/views/layouts/ci/_page.html.haml
@@ -2,10 +2,11 @@
= render "layouts/broadcast"
.sidebar-wrapper.nicescroll
.header-logo
- = link_to ci_root_path, class: 'home', title: 'Dashboard', id: 'js-shortcuts-home', data: {toggle: 'tooltip', placement: 'bottom'} do
+ = link_to root_path, class: 'home', title: 'Dashboard', id: 'js-shortcuts-home', data: {toggle: 'tooltip', placement: 'bottom'} do
= brand_header_logo
.gitlab-text-container
- %h3 GitLab CI
+ %h3 GitLab
+
- if defined?(sidebar) && sidebar
= render "layouts/ci/#{sidebar}"
- elsif current_user
diff --git a/app/views/layouts/nav/_dashboard.html.haml b/app/views/layouts/nav/_dashboard.html.haml
index b94165aac39..b1a1d531846 100644
--- a/app/views/layouts/nav/_dashboard.html.haml
+++ b/app/views/layouts/nav/_dashboard.html.haml
@@ -1,6 +1,6 @@
%ul.nav.nav-sidebar
= nav_link(path: ['root#index', 'projects#trending', 'projects#starred', 'dashboard/projects#index'], html_options: {class: 'home'}) do
- = link_to root_path, title: 'Projects', data: {placement: 'right'} do
+ = link_to dashboard_projects_path, title: 'Projects', data: {placement: 'right'} do
= icon('home fw')
%span
Projects
@@ -31,11 +31,6 @@
%span
Merge Requests
%span.count= current_user.assigned_merge_requests.opened.count
- = nav_link(path: ['ci/projects#index', 'ci/projects#disabled']) do
- = link_to ci_projects_path, title: 'Continuous Integration', data: {placement: 'right'} do
- = icon('building fw')
- %span
- Continuous Integration
= nav_link(controller: :snippets) do
= link_to dashboard_snippets_path, title: 'Your snippets', data: {placement: 'right'} do
= icon('clipboard fw')
diff --git a/app/views/layouts/nav/_project_settings.html.haml b/app/views/layouts/nav/_project_settings.html.haml
index 857fb199957..26cccb48f68 100644
--- a/app/views/layouts/nav/_project_settings.html.haml
+++ b/app/views/layouts/nav/_project_settings.html.haml
@@ -34,3 +34,24 @@
%span
Protected Branches
+ - if @project.gitlab_ci?
+ = nav_link(controller: :runners) do
+ = link_to namespace_project_runners_path(@project.namespace, @project), title: 'Runners', data: {placement: 'right'} do
+ = icon('cog fw')
+ %span
+ Runners
+ = nav_link(controller: :variables) do
+ = link_to namespace_project_variables_path(@project.namespace, @project) do
+ = icon('code fw')
+ %span
+ Variables
+ = nav_link path: 'triggers#index' do
+ = link_to namespace_project_triggers_path(@project.namespace, @project) do
+ = icon('retweet fw')
+ %span
+ Triggers
+ = nav_link path: 'ci_settings#edit' do
+ = link_to edit_namespace_project_ci_settings_path(@project.namespace, @project) do
+ = icon('building fw')
+ %span
+ CI Settings
diff --git a/app/views/profiles/notifications/show.html.haml b/app/views/profiles/notifications/show.html.haml
index ea4e5f3e182..8eebd96b674 100644
--- a/app/views/profiles/notifications/show.html.haml
+++ b/app/views/profiles/notifications/show.html.haml
@@ -33,7 +33,7 @@
= f.label :notification_level, value: Notification::N_MENTION do
= f.radio_button :notification_level, Notification::N_MENTION
.level-title
- Mention
+ On Mention
%p You will receive notifications only for comments in which you were @mentioned
.radio
diff --git a/app/views/projects/_home_panel.html.haml b/app/views/projects/_home_panel.html.haml
index b347846c932..8c0980369fd 100644
--- a/app/views/projects/_home_panel.html.haml
+++ b/app/views/projects/_home_panel.html.haml
@@ -16,20 +16,19 @@
.project-repo-buttons
- = render 'projects/buttons/star'
-
- - unless empty_repo
- = render 'projects/buttons/fork'
-
- - if can? current_user, :download_code, @project
- = link_to archive_namespace_project_repository_path(@project.namespace, @project, ref: @ref, format: 'zip'), class: 'btn', rel: 'nofollow' do
- = icon('download fw')
- Download
-
- = render 'projects/buttons/dropdown'
-
- - if @project.gitlab_ci?
- = link_to ci_project_path(@project.gitlab_ci_project), class: 'btn btn-default' do
- CI
-
- = render "shared/clone_panel"
+ .split-one
+ = render 'projects/buttons/star'
+
+ - unless empty_repo
+ = render 'projects/buttons/fork'
+
+ = render "shared/clone_panel"
+ .split-repo-buttons
+ - unless empty_repo
+ - if can? current_user, :download_code, @project
+ = link_to archive_namespace_project_repository_path(@project.namespace, @project, ref: @ref, format: 'zip'), class: 'btn', rel: 'nofollow' do
+ = icon('download fw')
+
+ = render 'projects/buttons/dropdown'
+ = render 'projects/buttons/notifications'
+
diff --git a/app/views/projects/_readme.html.haml b/app/views/projects/_readme.html.haml
index 5038edb95ed..5bc1999ec9d 100644
--- a/app/views/projects/_readme.html.haml
+++ b/app/views/projects/_readme.html.haml
@@ -5,7 +5,7 @@
&nbsp;
- if can?(current_user, :push_code, @project)
= link_to namespace_project_edit_blob_path(@project.namespace, @project, tree_join(@repository.root_ref, readme.name)), class: 'light' do
- %i.fa.fa-pencil
+ %i.fa-align.fa.fa-pencil
.wiki
= cache(readme_cache_key) do
= render_readme(readme)
diff --git a/app/views/projects/buttons/_dropdown.html.haml b/app/views/projects/buttons/_dropdown.html.haml
index bc7625e8989..4580c912692 100644
--- a/app/views/projects/buttons/_dropdown.html.haml
+++ b/app/views/projects/buttons/_dropdown.html.haml
@@ -1,6 +1,6 @@
- if current_user
%span.dropdown
- %a.dropdown-toggle.btn.btn-new{href: '#', "data-toggle" => "dropdown"}
+ %a.dropdown-new.btn.btn-new{href: '#', "data-toggle" => "dropdown"}
= icon('plus')
%ul.dropdown-menu.dropdown-menu-right.project-home-dropdown
- if can?(current_user, :create_issue, @project)
diff --git a/app/views/projects/buttons/_fork.html.haml b/app/views/projects/buttons/_fork.html.haml
index 854c154824d..8f2f631eb7d 100644
--- a/app/views/projects/buttons/_fork.html.haml
+++ b/app/views/projects/buttons/_fork.html.haml
@@ -8,6 +8,5 @@
- else
= link_to new_namespace_project_fork_path(@project.namespace, @project), title: "Fork project", class: 'btn' do
= icon('code-fork fw')
- Fork
%span.count
= @project.forks_count
diff --git a/app/views/projects/buttons/_notifications.html.haml b/app/views/projects/buttons/_notifications.html.haml
new file mode 100644
index 00000000000..4b69a6d7a6f
--- /dev/null
+++ b/app/views/projects/buttons/_notifications.html.haml
@@ -0,0 +1,14 @@
+- return unless @membership
+
+= form_tag profile_notifications_path, method: :put, remote: true, class: 'inline-form', id: 'notification-form' do
+ = hidden_field_tag :notification_type, 'project'
+ = hidden_field_tag :notification_id, @membership.id
+ = hidden_field_tag :notification_level
+ %span.dropdown
+ %a.dropdown-new.btn.btn-new#notifications-button{href: '#', "data-toggle" => "dropdown"}
+ = icon('bell')
+ = notification_label(@membership)
+ = icon('angle-down')
+ %ul.dropdown-menu.dropdown-menu-right.project-home-dropdown
+ - Notification.project_notification_levels.each do |level|
+ = notification_list_item(level, @membership)
diff --git a/app/views/projects/buttons/_star.html.haml b/app/views/projects/buttons/_star.html.haml
index 5d7df5ae099..3501dddefbe 100644
--- a/app/views/projects/buttons/_star.html.haml
+++ b/app/views/projects/buttons/_star.html.haml
@@ -1,10 +1,6 @@
- if current_user
= link_to toggle_star_namespace_project_path(@project.namespace, @project), class: 'btn star-btn toggle-star', method: :post, remote: true do
= icon('star fw')
- - if current_user.starred?(@project)
- Unstar
- - else
- Star
%span.count
= @project.star_count
@@ -17,6 +13,5 @@
- else
= link_to new_user_session_path, class: 'btn has_tooltip star-btn', title: 'You must sign in to star a project' do
= icon('star fw')
- Star
%span.count
= @project.star_count
diff --git a/app/views/ci/projects/_form.html.haml b/app/views/projects/ci_settings/_form.html.haml
index e782fd8a0f7..9f891f557a9 100644
--- a/app/views/ci/projects/_form.html.haml
+++ b/app/views/projects/ci_settings/_form.html.haml
@@ -1,17 +1,20 @@
+%h3.page-title
+ CI settings
+%hr
.bs-callout.help-callout
%p
If you want to test your .gitlab-ci.yml, you can use special tool - #{link_to "Lint", ci_lint_path}
%p
- Edit your
- #{link_to ".gitlab-ci.yml using web-editor", yaml_web_editor_link(@project)}
+ Edit your
+ #{link_to ".gitlab-ci.yml using web-editor", yaml_web_editor_link(@ci_project)}
-= nested_form_for [:ci, @project], html: { class: 'form-horizontal' } do |f|
- - if @project.errors.any?
+= 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
- %p.lead= "#{pluralize(@project.errors.count, "error")} prohibited this project from being saved:"
+ %p.lead= "#{pluralize(@ci_project.errors.count, "error")} prohibited this project from being saved:"
.alert.alert-error
%ul
- - @project.errors.full_messages.each do |msg|
+ - @ci_project.errors.full_messages.each do |msg|
%li= msg
%fieldset
@@ -93,8 +96,8 @@
= f.label :token, "CI token", class: 'control-label'
.col-sm-10
= f.text_field :token, class: 'form-control', placeholder: 'xEeFCaDAB89'
-
+
.form-actions
= f.submit 'Save changes', class: 'btn btn-save'
- - unless @project.new_record?
- = link_to 'Remove Project', ci_project_path(@project), method: :delete, data: { confirm: 'Project will be removed. Are you sure?' }, class: 'btn btn-danger pull-right'
+ - unless @ci_project.new_record?
+ = link_to 'Remove Project', ci_project_path(@ci_project), method: :delete, data: { confirm: 'Project will be removed. Are you sure?' }, class: 'btn btn-danger pull-right'
diff --git a/app/views/ci/projects/edit.html.haml b/app/views/projects/ci_settings/edit.html.haml
index 876ae5182d4..e9040fe4337 100644
--- a/app/views/ci/projects/edit.html.haml
+++ b/app/views/projects/ci_settings/edit.html.haml
@@ -1,6 +1,6 @@
-- if @project.generated_yaml_config
+- if @ci_project.generated_yaml_config
%p.alert.alert-danger
- CI Jobs are deprecated now, you can #{link_to "download", dumped_yaml_ci_project_path(@project)}
+ CI Jobs are deprecated now, you can #{link_to "download", dumped_yaml_ci_project_path(@ci_project)}
or
%a.preview-yml{:href => "#yaml-content", "data-toggle" => "modal"} preview
yaml file which is based on your old jobs.
@@ -8,7 +8,7 @@
= render 'form'
-- if @project.generated_yaml_config
+- if @ci_project.generated_yaml_config
#yaml-content.modal.fade{"aria-hidden" => "true", "aria-labelledby" => ".gitlab-ci.yml", :role => "dialog", :tabindex => "-1"}
.modal-dialog
.modal-content
@@ -16,6 +16,6 @@
%button.close{"aria-hidden" => "true", "data-dismiss" => "modal", :type => "button"} ×
%h4.modal-title Content of .gitlab-ci.yml
.modal-body
- = text_area_tag :yaml, @project.generated_yaml_config, size: "70x25", class: "form-control"
+ = text_area_tag :yaml, @ci_project.generated_yaml_config, size: "70x25", class: "form-control"
.modal-footer
%button.btn.btn-default{"data-dismiss" => "modal", :type => "button"} Close
diff --git a/app/views/projects/commit/_commit_box.html.haml b/app/views/projects/commit/_commit_box.html.haml
index 2ac79e87b4a..fbf0a9ec0c3 100644
--- a/app/views/projects/commit/_commit_box.html.haml
+++ b/app/views/projects/commit/_commit_box.html.haml
@@ -38,6 +38,13 @@
- @commit.parents.each do |parent|
= link_to parent.short_id, namespace_project_commit_path(@project.namespace, @project, parent)
+- if @ci_commit
+ .pull-right
+ = link_to ci_status_path(@ci_commit), class: "ci-status ci-#{@ci_commit.status}" do
+ = ci_status_icon(@ci_commit)
+ build:
+ = @ci_commit.status
+
.commit-info-row.branches
%i.fa.fa-spinner.fa-spin
diff --git a/app/views/projects/commits/_commit.html.haml b/app/views/projects/commits/_commit.html.haml
index 74f8d8b15cf..efad4cb1473 100644
--- a/app/views/projects/commits/_commit.html.haml
+++ b/app/views/projects/commits/_commit.html.haml
@@ -4,7 +4,11 @@
- notes = commit.notes
- note_count = notes.user.count
-= cache [project.id, commit.id, note_count] do
+- ci_commit = project.ci_commit(commit.sha)
+- cache_key = [project.id, commit.id, note_count]
+- cache_key.push(ci_commit.status) if ci_commit
+
+= cache(cache_key) do
%li.commit.js-toggle-container
.commit-row-title
%strong.str-truncated
@@ -13,6 +17,10 @@
%a.text-expander.js-toggle-button ...
.pull-right
+ - if ci_commit
+ = link_to ci_status_path(ci_commit), class: "c#{ci_status_color(ci_commit)}" do
+ = ci_status_icon(ci_commit)
+ &nbsp;
= link_to commit.short_id, namespace_project_commit_path(project.namespace, project, commit), class: "commit_short_id"
.notes_count
diff --git a/app/views/projects/empty.html.haml b/app/views/projects/empty.html.haml
index 185ebf23934..e06454fd148 100644
--- a/app/views/projects/empty.html.haml
+++ b/app/views/projects/empty.html.haml
@@ -1,7 +1,8 @@
-- if current_user && can?(current_user, :download_code, @project)
- = render 'shared/no_ssh'
- = render 'shared/no_password'
-
+.alert_holder
+ - if current_user && can?(current_user, :download_code, @project)
+ = render 'shared/no_ssh'
+ = render 'shared/no_password'
+
= render "home_panel"
.gray-content-block.center
@@ -15,38 +16,39 @@
file to this project.
.prepend-top-20
-%h3.page-title
- Command line instructions
-%div.git-empty
- %fieldset
- %h5 Git global setup
- %pre.light-well
- :preserve
- git config --global user.name "#{h git_user_name}"
- git config --global user.email "#{h git_user_email}"
+.empty_wrapper
+ %h3.page-title-empty
+ Command line instructions
+ %div.git-empty
+ %fieldset
+ %h5 Git global setup
+ %pre.light-well
+ :preserve
+ git config --global user.name "#{h git_user_name}"
+ git config --global user.email "#{h git_user_email}"
- %fieldset
- %h5 Create a new repository
- %pre.light-well
- :preserve
- git clone #{ content_tag(:span, default_url_to_repo, class: 'clone')}
- cd #{h @project.path}
- touch README.md
- git add README.md
- git commit -m "add README"
- git push -u origin master
+ %fieldset
+ %h5 Create a new repository
+ %pre.light-well
+ :preserve
+ git clone #{ content_tag(:span, default_url_to_repo, class: 'clone')}
+ cd #{h @project.path}
+ touch README.md
+ git add README.md
+ git commit -m "add README"
+ git push -u origin master
- %fieldset
- %h5 Existing folder or Git repository
- %pre.light-well
- :preserve
- cd existing_folder
- git init
- git remote add origin #{ content_tag(:span, default_url_to_repo, class: 'clone')}
- git add .
- git commit
- git push -u origin master
+ %fieldset
+ %h5 Existing folder or Git repository
+ %pre.light-well
+ :preserve
+ cd existing_folder
+ git init
+ git remote add origin #{ content_tag(:span, default_url_to_repo, class: 'clone')}
+ git add .
+ git commit
+ git push -u origin master
-- if can? current_user, :remove_project, @project
- .prepend-top-20
- = link_to 'Remove project', [@project.namespace.becomes(Namespace), @project], data: { confirm: remove_project_message(@project)}, method: :delete, class: "btn btn-remove pull-right"
+ - if can? current_user, :remove_project, @project
+ .prepend-top-20
+ = link_to 'Remove project', [@project.namespace.becomes(Namespace), @project], data: { confirm: remove_project_message(@project)}, method: :delete, class: "btn btn-remove pull-right"
diff --git a/app/views/projects/graphs/_head.html.haml b/app/views/projects/graphs/_head.html.haml
index 9383df13305..bbfaf422a82 100644
--- a/app/views/projects/graphs/_head.html.haml
+++ b/app/views/projects/graphs/_head.html.haml
@@ -3,3 +3,7 @@
= link_to 'Contributors', namespace_project_graph_path
= nav_link(action: :commits) do
= link_to 'Commits', commits_namespace_project_graph_path
+ - if @project.gitlab_ci?
+ = nav_link(action: :ci) do
+ = link_to ci_namespace_project_graph_path do
+ Continuous Integration
diff --git a/app/views/projects/graphs/ci.html.haml b/app/views/projects/graphs/ci.html.haml
new file mode 100644
index 00000000000..4f69cc64f7c
--- /dev/null
+++ b/app/views/projects/graphs/ci.html.haml
@@ -0,0 +1,7 @@
+- page_title "Continuous Integration", "Graphs"
+= render "header_title"
+= render 'head'
+#charts.ci-charts
+ = render 'projects/graphs/ci/builds'
+ = render 'projects/graphs/ci/build_times'
+= render 'projects/graphs/ci/overall'
diff --git a/app/views/ci/charts/_build_times.haml b/app/views/projects/graphs/ci/_build_times.haml
index c3c2f572414..c3c2f572414 100644
--- a/app/views/ci/charts/_build_times.haml
+++ b/app/views/projects/graphs/ci/_build_times.haml
diff --git a/app/views/ci/charts/_builds.haml b/app/views/projects/graphs/ci/_builds.haml
index 1b0039fb834..1b0039fb834 100644
--- a/app/views/ci/charts/_builds.haml
+++ b/app/views/projects/graphs/ci/_builds.haml
diff --git a/app/views/projects/graphs/ci/_overall.haml b/app/views/projects/graphs/ci/_overall.haml
new file mode 100644
index 00000000000..9550d719471
--- /dev/null
+++ b/app/views/projects/graphs/ci/_overall.haml
@@ -0,0 +1,22 @@
+- ci_project = @project.gitlab_ci_project
+%fieldset
+ %legend Overall
+ %p
+ Total:
+ %strong= pluralize ci_project.builds.count(:all), 'build'
+ %p
+ Successful:
+ %strong= pluralize ci_project.builds.success.count(:all), 'build'
+ %p
+ Failed:
+ %strong= pluralize ci_project.builds.failed.count(:all), 'build'
+
+ %p
+ Success ratio:
+ %strong
+ #{success_ratio(ci_project.builds.success, ci_project.builds.failed)}%
+
+ %p
+ Commits covered:
+ %strong
+ = ci_project.commits.count(:all)
diff --git a/app/views/projects/graphs/commits.html.haml b/app/views/projects/graphs/commits.html.haml
index bf0cac539b8..112be875b6b 100644
--- a/app/views/projects/graphs/commits.html.haml
+++ b/app/views/projects/graphs/commits.html.haml
@@ -32,61 +32,55 @@
%div
%p.slead
Commits per day of month
- %canvas#month-chart{width: 800, height: 400}
+ %canvas#month-chart
.row
.col-md-6
%div
%p.slead
Commits per day hour (UTC)
- %canvas#hour-chart{width: 800, height: 400}
+ %canvas#hour-chart
.col-md-6
%div
%p.slead
Commits per weekday
- %canvas#weekday-chart{width: 800, height: 400}
+ %canvas#weekday-chart
:coffeescript
- data = {
- labels : #{@commits_per_time.keys.to_json},
- datasets : [{
- fillColor : "rgba(220,220,220,0.5)",
- strokeColor : "rgba(220,220,220,1)",
- barStrokeWidth: 1,
- barValueSpacing: 1,
- barDatasetSpacing: 1,
- data : #{@commits_per_time.values.to_json}
- }]
- }
+ responsiveChart = (selector, data) ->
+ options = { "scaleOverlay": true, responsive: true, pointHitDetectionRadius: 2, maintainAspectRatio: false }
- ctx = $("#hour-chart").get(0).getContext("2d");
- new Chart(ctx).Bar(data,{"scaleOverlay": true, responsive: true, pointHitDetectionRadius: 2})
+ # get selector by context
+ ctx = selector.get(0).getContext("2d")
+ # pointing parent container to make chart.js inherit its width
+ container = $(selector).parent()
- data = {
- labels : #{@commits_per_week_days.keys.to_json},
- datasets : [{
- fillColor : "rgba(220,220,220,0.5)",
- strokeColor : "rgba(220,220,220,1)",
- barStrokeWidth: 1,
- barValueSpacing: 1,
- barDatasetSpacing: 1,
- data : #{@commits_per_week_days.values.to_json}
- }]
- }
+ generateChart = ->
+ selector.attr('width', $(container).width())
+ new Chart(ctx).Bar(data, options)
+
+ # enabling auto-resizing
+ $(window).resize( generateChart )
- ctx = $("#weekday-chart").get(0).getContext("2d");
- new Chart(ctx).Bar(data,{"scaleOverlay": true, responsive: true, pointHitDetectionRadius: 2})
+ generateChart()
- data = {
- labels : #{@commits_per_month.keys.to_json},
- datasets : [{
- fillColor : "rgba(220,220,220,0.5)",
- strokeColor : "rgba(220,220,220,1)",
- barStrokeWidth: 1,
- barValueSpacing: 1,
- barDatasetSpacing: 1,
- data : #{@commits_per_month.values.to_json}
- }]
+ chartData = (keys, values) ->
+ data = {
+ labels : keys,
+ datasets : [{
+ fillColor : "rgba(220,220,220,0.5)",
+ strokeColor : "rgba(220,220,220,1)",
+ barStrokeWidth: 1,
+ barValueSpacing: 1,
+ barDatasetSpacing: 1,
+ data : values
+ }]
}
- ctx = $("#month-chart").get(0).getContext("2d");
- new Chart(ctx).Bar(data, {"scaleOverlay": true, responsive: true, pointHitDetectionRadius: 2})
+ hourData = chartData(#{@commits_per_time.keys.to_json}, #{@commits_per_time.values.to_json})
+ responsiveChart($('#hour-chart'), hourData)
+
+ dayData = chartData(#{@commits_per_week_days.keys.to_json}, #{@commits_per_week_days.values.to_json})
+ responsiveChart($('#weekday-chart'), dayData)
+
+ monthData = chartData(#{@commits_per_month.keys.to_json}, #{@commits_per_month.values.to_json})
+ responsiveChart($('#month-chart'), monthData)
diff --git a/app/views/projects/merge_requests/widget/_heading.html.haml b/app/views/projects/merge_requests/widget/_heading.html.haml
index 4d4e2f68f61..10640f746f0 100644
--- a/app/views/projects/merge_requests/widget/_heading.html.haml
+++ b/app/views/projects/merge_requests/widget/_heading.html.haml
@@ -10,7 +10,8 @@
%span CI build #{status}
for #{@merge_request.last_commit_short_sha}.
%span.ci-coverage
- = link_to "View build details", ci_build_details_path(@merge_request), :"data-no-turbolink" => "data-no-turbolink"
+ - 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
= icon("spinner spin")
diff --git a/app/views/projects/merge_requests/widget/_merged.html.haml b/app/views/projects/merge_requests/widget/_merged.html.haml
index d22dfa085b8..f223f687def 100644
--- a/app/views/projects/merge_requests/widget/_merged.html.haml
+++ b/app/views/projects/merge_requests/widget/_merged.html.haml
@@ -20,7 +20,7 @@
The changes were merged into
%span.label-branch= @merge_request.target_branch
You can remove the source branch now.
- = link_to namespace_project_branch_path(@merge_request.source_project.namespace, @merge_request.source_project, @source_branch), remote: true, method: :delete, class: "btn btn-primary btn-sm remove_source_branch" do
+ = link_to namespace_project_branch_path(@merge_request.source_project.namespace, @merge_request.source_project, @merge_request.source_branch), remote: true, method: :delete, class: "btn btn-primary btn-sm remove_source_branch" do
%i.fa.fa-times
Remove Source Branch
diff --git a/app/views/projects/milestones/_form.html.haml b/app/views/projects/milestones/_form.html.haml
index b93462e5bdf..74e9668052d 100644
--- a/app/views/projects/milestones/_form.html.haml
+++ b/app/views/projects/milestones/_form.html.haml
@@ -21,7 +21,7 @@
.form-group.milestone-description
= f.label :description, "Description", class: "control-label"
.col-sm-10
- = render layout: 'projects/md_preview', locals: { preview_class: "wiki" } do
+ = render layout: 'projects/md_preview', locals: { preview_class: "md-preview" } do
= render 'projects/zen', f: f, attr: :description, classes: 'description form-control'
.hint
.pull-left Milestones are parsed with #{link_to "GitLab Flavored Markdown", help_page_path("markdown", "markdown"), target: '_blank'}.
diff --git a/app/views/projects/network/show.json.erb b/app/views/projects/network/show.json.erb
index dc82adcb2c6..122e84b41b2 100644
--- a/app/views/projects/network/show.json.erb
+++ b/app/views/projects/network/show.json.erb
@@ -9,7 +9,7 @@
author: {
name: c.author_name,
email: c.author_email,
- icon: avatar_icon(c.author_email, 20)
+ icon: image_path(avatar_icon(c.author_email, 20))
},
time: c.time,
space: c.spaces.first,
diff --git a/app/views/projects/notes/_edit_form.html.haml b/app/views/projects/notes/_edit_form.html.haml
index 8f7d2e84c70..a0e26f9827e 100644
--- a/app/views/projects/notes/_edit_form.html.haml
+++ b/app/views/projects/notes/_edit_form.html.haml
@@ -1,7 +1,7 @@
.note-edit-form
= 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: 'note-text' } do
+ = 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/notes/hints'
diff --git a/app/views/projects/notes/_form.html.haml b/app/views/projects/notes/_form.html.haml
index 3be8f44b282..d99445da59a 100644
--- a/app/views/projects/notes/_form.html.haml
+++ b/app/views/projects/notes/_form.html.haml
@@ -7,7 +7,7 @@
= f.hidden_field :noteable_id
= f.hidden_field :noteable_type
- = render layout: 'projects/md_preview', locals: { preview_class: "note-text", referenced_users: true } do
+ = 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/notes/hints'
.error-alert
diff --git a/app/views/ci/runners/_runner.html.haml b/app/views/projects/runners/_runner.html.haml
index ef8622e2807..e6b8a2e6fe7 100644
--- a/app/views/ci/runners/_runner.html.haml
+++ b/app/views/projects/runners/_runner.html.haml
@@ -3,9 +3,9 @@
= runner_status_icon(runner)
%span.monospace
- if @runners.include?(runner)
- = link_to runner.short_sha, ci_project_runner_path(@project, runner)
+ = link_to runner.short_sha, runner_path(runner)
%small
- =link_to edit_ci_project_runner_path(@project, runner) do
+ =link_to edit_namespace_project_runner_path(@project.namespace, @project, runner) do
%i.fa.fa-edit.btn
- else
= runner.short_sha
@@ -13,12 +13,12 @@
.pull-right
- if @runners.include?(runner)
- if runner.belongs_to_one_project?
- = link_to 'Remove runner', [:ci, @project, runner], data: { confirm: "Are you sure?" }, method: :delete, class: 'btn btn-danger btn-sm'
+ = link_to 'Remove runner', runner_path(runner), data: { confirm: "Are you sure?" }, method: :delete, class: 'btn btn-danger btn-sm'
- else
- - runner_project = @project.runner_projects.find_by(runner_id: runner)
- = link_to 'Disable for this project', [:ci, @project, runner_project], data: { confirm: "Are you sure?" }, method: :delete, class: 'btn btn-danger btn-sm'
+ - runner_project = @ci_project.runner_projects.find_by(runner_id: runner)
+ = link_to 'Disable for this project', [:ci, @ci_project, runner_project], data: { confirm: "Are you sure?" }, method: :delete, class: 'btn btn-danger btn-sm'
- elsif runner.specific?
- = form_for [:ci, @project, @project.runner_projects.new] do |f|
+ = form_for [:ci, @ci_project, @ci_project.runner_projects.new] do |f|
= f.hidden_field :runner_id, value: runner.id
= f.submit 'Enable for this project', class: 'btn btn-sm'
.pull-right
@@ -32,4 +32,3 @@
- runner.tag_list.each do |tag|
%span.label.label-primary
= tag
-
diff --git a/app/views/ci/runners/_shared_runners.html.haml b/app/views/projects/runners/_shared_runners.html.haml
index 944b3fd930d..316ea747b14 100644
--- a/app/views/ci/runners/_shared_runners.html.haml
+++ b/app/views/projects/runners/_shared_runners.html.haml
@@ -3,11 +3,11 @@
.bs-callout.bs-callout-warning
GitLab Runners do not offer secure isolation between projects that they do builds for. You are TRUSTING all GitLab users who can push code to project A, B or C to run shell scripts on the machine hosting runner X.
%hr
- - if @project.shared_runners_enabled
- = link_to toggle_shared_runners_ci_project_path(@project), class: 'btn btn-warning', method: :post do
+ - if @ci_project.shared_runners_enabled
+ = link_to toggle_shared_runners_ci_project_path(@ci_project), class: 'btn btn-warning', method: :post do
Disable shared runners
- else
- = link_to toggle_shared_runners_ci_project_path(@project), class: 'btn btn-success', method: :post do
+ = link_to toggle_shared_runners_ci_project_path(@ci_project), class: 'btn btn-success', method: :post do
Enable shared runners
&nbsp; for this project
@@ -17,7 +17,7 @@
- else
%h4.underlined-title Available shared runners - #{@shared_runners_count}
%ul.bordered-list.available-shared-runners
- = render @shared_runners.first(10)
+ = render partial: 'runner', collection: @shared_runners, as: :runner
- if @shared_runners_count > 10
.light
and #{@shared_runners_count - 10} more...
diff --git a/app/views/ci/runners/_specific_runners.html.haml b/app/views/projects/runners/_specific_runners.html.haml
index 0604e7a46c5..c13625c7e49 100644
--- a/app/views/ci/runners/_specific_runners.html.haml
+++ b/app/views/projects/runners/_specific_runners.html.haml
@@ -12,7 +12,7 @@
%code #{ci_root_url(only_path: false)}
%li
Use the following registration token during setup:
- %code #{@project.token}
+ %code #{@ci_project.token}
%li
Start runner!
@@ -20,10 +20,10 @@
- if @runners.any?
%h4.underlined-title Runners activated for this project
%ul.bordered-list.activated-specific-runners
- = render @runners
+ = render partial: 'runner', collection: @runners, as: :runner
- if @specific_runners.any?
%h4.underlined-title Available specific runners
%ul.bordered-list.available-specific-runners
- = render @specific_runners
+ = render partial: 'runner', collection: @specific_runners, as: :runner
= paginate @specific_runners
diff --git a/app/views/ci/runners/edit.html.haml b/app/views/projects/runners/edit.html.haml
index 81c8e58ae2b..66851d38316 100644
--- a/app/views/ci/runners/edit.html.haml
+++ b/app/views/projects/runners/edit.html.haml
@@ -1,6 +1,6 @@
%h4 Runner ##{@runner.id}
%hr
-= form_for [:ci, @project, @runner], html: { class: 'form-horizontal' } do |f|
+= form_for @runner, url: runner_path(@runner), html: { class: 'form-horizontal' } do |f|
.form-group
= label :active, "Active", class: 'control-label'
.col-sm-10
diff --git a/app/views/ci/runners/index.html.haml b/app/views/projects/runners/index.html.haml
index 529fb9c296d..529fb9c296d 100644
--- a/app/views/ci/runners/index.html.haml
+++ b/app/views/projects/runners/index.html.haml
diff --git a/app/views/ci/runners/show.html.haml b/app/views/projects/runners/show.html.haml
index ffec495f85a..ffec495f85a 100644
--- a/app/views/ci/runners/show.html.haml
+++ b/app/views/projects/runners/show.html.haml
diff --git a/app/views/projects/show.html.haml b/app/views/projects/show.html.haml
index aa5914e3ed9..6a5fc689803 100644
--- a/app/views/projects/show.html.haml
+++ b/app/views/projects/show.html.haml
@@ -24,7 +24,7 @@
= pluralize(number_with_delimiter(@repository.tag_names.count), 'tag')
%li
- = link_to namespace_project_path(@project.namespace, @project) do
+ = link_to project_files_path(@project) do
= repository_size
- if !prefer_readme? && @repository.readme
diff --git a/app/views/ci/triggers/_trigger.html.haml b/app/views/projects/triggers/_trigger.html.haml
index addfbfcb0d4..48b3b5c9920 100644
--- a/app/views/ci/triggers/_trigger.html.haml
+++ b/app/views/projects/triggers/_trigger.html.haml
@@ -11,4 +11,4 @@
%td
.pull-right
- = link_to 'Revoke', ci_project_trigger_path(@project, trigger), data: { confirm: 'Are you sure?'}, method: :delete, class: "btn btn-danger btn-sm btn-grouped"
+ = link_to 'Revoke', namespace_project_trigger_path(@project.namespace, @project, trigger), data: { confirm: 'Are you sure?'}, method: :delete, class: "btn btn-danger btn-sm btn-grouped"
diff --git a/app/views/ci/triggers/index.html.haml b/app/views/projects/triggers/index.html.haml
index 44374a1a4d5..17dcb78e256 100644
--- a/app/views/ci/triggers/index.html.haml
+++ b/app/views/projects/triggers/index.html.haml
@@ -12,11 +12,11 @@
%th Token
%th Last used
%th
- = render @triggers
+ = render partial: 'trigger', collection: @triggers, as: :trigger
- else
%h4 No triggers
-= form_for [:ci, @project, @trigger], html: { class: 'form-horizontal' } do |f|
+= form_for @trigger, url: url_for(controller: 'projects/triggers', action: 'create'), html: { class: 'form-horizontal' } do |f|
.clearfix
= f.submit "Add Trigger", class: 'btn btn-success pull-right'
@@ -34,7 +34,7 @@
:plain
curl -X POST \
-F token=TOKEN \
- #{ci_build_trigger_url(@project.id, 'REF_NAME')}
+ #{ci_build_trigger_url(@ci_project.id, 'REF_NAME')}
%h3
Use .gitlab-ci.yml
@@ -49,7 +49,7 @@
trigger:
type: deploy
script:
- - "curl -X POST -F token=TOKEN #{ci_build_trigger_url(@project.id, 'REF_NAME')}"
+ - "curl -X POST -F token=TOKEN #{ci_build_trigger_url(@ci_project.id, 'REF_NAME')}"
%h3
Pass build variables
@@ -64,4 +64,4 @@
curl -X POST \
-F token=TOKEN \
-F "variables[RUN_NIGHTLY_BUILD]=true" \
- #{ci_build_trigger_url(@project.id, 'REF_NAME')}
+ #{ci_build_trigger_url(@ci_project.id, 'REF_NAME')}
diff --git a/app/views/ci/variables/show.html.haml b/app/views/projects/variables/show.html.haml
index ebf68341e08..29416a94ff6 100644
--- a/app/views/ci/variables/show.html.haml
+++ b/app/views/projects/variables/show.html.haml
@@ -1,21 +1,21 @@
%h3.page-title
Secret Variables
-%p.light
+%p.light
These variables will be set to environment by the runner and will be hidden in the build log.
%br
- So you can use them for passwords, secret keys or whatever you want.
+ So you can use them for passwords, secret keys or whatever you want.
%hr
-= nested_form_for @project, url: url_for(controller: 'ci/variables', action: 'update'), html: { class: 'form-horizontal' } do |f|
+= nested_form_for @ci_project, url: url_for(controller: 'projects/variables', action: 'update'), html: { class: 'form-horizontal' } do |f|
- if @project.errors.any?
#error_explanation
- %p.lead= "#{pluralize(@project.errors.count, "error")} prohibited this project from being saved:"
+ %p.lead= "#{pluralize(@ci_project.errors.count, "error")} prohibited this project from being saved:"
.alert.alert-error
%ul
- - @project.errors.full_messages.each do |msg|
+ - @ci_project.errors.full_messages.each do |msg|
%li= msg
= f.fields_for :variables do |variable_form|
diff --git a/app/views/projects/wikis/_form.html.haml b/app/views/projects/wikis/_form.html.haml
index 904600499ae..05d754adbe5 100644
--- a/app/views/projects/wikis/_form.html.haml
+++ b/app/views/projects/wikis/_form.html.haml
@@ -21,7 +21,7 @@
.form-group.wiki-content
= f.label :content, class: 'control-label'
.col-sm-10
- = render layout: 'projects/md_preview', locals: { preview_class: "wiki" } do
+ = render layout: 'projects/md_preview', locals: { preview_class: "md-preview" } do
= render 'projects/zen', f: f, attr: :content, classes: 'description form-control'
.col-sm-12.hint
.pull-left Wiki content is parsed with #{link_to "GitLab Flavored Markdown", help_page_path("markdown", "markdown"), target: '_blank'}
diff --git a/app/views/shared/_clone_panel.html.haml b/app/views/shared/_clone_panel.html.haml
index 2cd422e772a..b23b2f0d5eb 100644
--- a/app/views/shared/_clone_panel.html.haml
+++ b/app/views/shared/_clone_panel.html.haml
@@ -24,4 +24,4 @@
.input-group-addon
.visibility-level-label.has_tooltip{'data-title' => "#{visibility_level_label(project.visibility_level)} project" }
= visibility_level_icon(project.visibility_level)
- = visibility_level_label(project.visibility_level).downcase
+
diff --git a/app/views/shared/issuable/_form.html.haml b/app/views/shared/issuable/_form.html.haml
index 1aa1e3c6c97..33ec726e93c 100644
--- a/app/views/shared/issuable/_form.html.haml
+++ b/app/views/shared/issuable/_form.html.haml
@@ -24,7 +24,7 @@
= f.label :description, 'Description', class: 'control-label'
.col-sm-10
- = render layout: 'projects/md_preview', locals: { preview_class: "wiki", referenced_users: true } do
+ = 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'
.col-sm-12.hint
diff --git a/app/views/shared/projects/_list.html.haml b/app/views/shared/projects/_list.html.haml
index 330b0626d63..16e1d8421de 100644
--- a/app/views/shared/projects/_list.html.haml
+++ b/app/views/shared/projects/_list.html.haml
@@ -1,12 +1,13 @@
- projects_limit = 20 unless local_assigns[:projects_limit]
- avatar = true unless local_assigns[:avatar] == false
- stars = true unless local_assigns[:stars] == false
+- ci = false unless local_assigns[:ci] == true
%ul.projects-list
- projects.each_with_index do |project, i|
- css_class = (i >= projects_limit) ? 'hide' : nil
= render "shared/projects/project", project: project,
- avatar: avatar, stars: stars, css_class: css_class
+ avatar: avatar, stars: stars, css_class: css_class, ci: ci
- if projects.size > projects_limit
%li.bottom.center
diff --git a/app/views/shared/projects/_project.html.haml b/app/views/shared/projects/_project.html.haml
index 5318c6011f4..e67e5a8a638 100644
--- a/app/views/shared/projects/_project.html.haml
+++ b/app/views/shared/projects/_project.html.haml
@@ -1,9 +1,10 @@
- avatar = true unless local_assigns[:avatar] == false
- stars = true unless local_assigns[:stars] == false
+- ci = false unless local_assigns[:ci] == true
- css_class = '' unless local_assigns[:css_class]
- css_class += " no-description" unless project.description.present?
%li.project-row{ class: css_class }
- = cache [project.namespace, project, controller.controller_name, controller.action_name, 'v2.1'] do
+ = cache [project.namespace, project, controller.controller_name, controller.action_name, 'v2.2'] do
= link_to project_path(project), class: dom_class(project) do
- if avatar
.dash-project-avatar
@@ -15,8 +16,16 @@
\/
%span.project-name.filter-title
= project.name
+
+ .project-controls
+ - if ci && !project.empty_repo? && project.commit
+ - if ci_commit = project.ci_commit(project.commit.sha)
+ = link_to ci_status_path(ci_commit), class: "c#{ci_status_color(ci_commit)}",
+ title: "Build status: #{ci_commit.status}", data: {toggle: 'tooltip', placement: 'left'} do
+ = ci_status_icon(ci_commit)
+ &nbsp;
- if stars
- %span.pull-right.light
+ %span
%i.fa.fa-star
= project.star_count
- if project.description.present?
diff --git a/app/workers/email_receiver_worker.rb b/app/workers/email_receiver_worker.rb
index 8cfb96ef376..5a921a73fe9 100644
--- a/app/workers/email_receiver_worker.rb
+++ b/app/workers/email_receiver_worker.rb
@@ -4,7 +4,7 @@ class EmailReceiverWorker
sidekiq_options queue: :incoming_email
def perform(raw)
- return unless Gitlab::ReplyByEmail.enabled?
+ return unless Gitlab::IncomingEmail.enabled?
begin
Gitlab::Email::Receiver.new(raw).execute
diff --git a/app/workers/fork_registration_worker.rb b/app/workers/fork_registration_worker.rb
deleted file mode 100644
index fffa8b3a659..00000000000
--- a/app/workers/fork_registration_worker.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-class ForkRegistrationWorker
- include Sidekiq::Worker
-
- sidekiq_options queue: :default
-
- def perform(from_project_id, to_project_id, private_token)
- from_project = Project.find(from_project_id)
- to_project = Project.find(to_project_id)
-
- from_project.gitlab_ci_service.fork_registration(to_project, private_token)
- end
-end