summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG23
-rw-r--r--Gemfile4
-rw-r--r--Gemfile.lock8
-rw-r--r--app/assets/javascripts/application.js.coffee12
-rw-r--r--app/assets/javascripts/dispatcher.js.coffee4
-rw-r--r--app/assets/javascripts/syntax_highlight.coffee9
-rw-r--r--app/assets/stylesheets/base/layout.scss5
-rw-r--r--app/assets/stylesheets/base/mixins.scss38
-rw-r--r--app/assets/stylesheets/base/variables.scss2
-rw-r--r--app/assets/stylesheets/generic/common.scss8
-rw-r--r--app/assets/stylesheets/generic/header.scss66
-rw-r--r--app/assets/stylesheets/generic/lists.scss20
-rw-r--r--app/assets/stylesheets/generic/sidebar.scss43
-rw-r--r--app/assets/stylesheets/highlight/dark.scss6
-rw-r--r--app/assets/stylesheets/highlight/monokai.scss6
-rw-r--r--app/assets/stylesheets/highlight/solarized_dark.scss5
-rw-r--r--app/assets/stylesheets/highlight/solarized_light.scss5
-rw-r--r--app/assets/stylesheets/highlight/white.scss5
-rw-r--r--app/assets/stylesheets/pages/issuable.scss6
-rw-r--r--app/assets/stylesheets/pages/projects.scss112
-rw-r--r--app/assets/stylesheets/pages/search.scss18
-rw-r--r--app/assets/stylesheets/pages/snippets.scss24
-rw-r--r--app/assets/stylesheets/pages/tree.scss1
-rw-r--r--app/assets/stylesheets/themes/gitlab-theme.scss26
-rw-r--r--app/controllers/admin/hooks_controller.rb2
-rw-r--r--app/controllers/application_controller.rb13
-rw-r--r--app/controllers/projects/hooks_controller.rb3
-rw-r--r--app/controllers/projects/services_controller.rb2
-rw-r--r--app/controllers/projects/snippets_controller.rb11
-rw-r--r--app/controllers/users_controller.rb4
-rw-r--r--app/finders/trending_projects_finder.rb18
-rw-r--r--app/helpers/gitlab_markdown_helper.rb2
-rw-r--r--app/helpers/page_layout_helper.rb8
-rw-r--r--app/helpers/preferences_helper.rb27
-rw-r--r--app/models/hooks/web_hook.rb5
-rw-r--r--app/models/project_services/buildkite_service.rb9
-rw-r--r--app/models/project_services/gitlab_ci_service.rb6
-rw-r--r--app/models/user.rb6
-rw-r--r--app/services/notification_service.rb11
-rw-r--r--app/views/admin/hooks/index.html.haml8
-rw-r--r--app/views/dashboard/_projects.html.haml5
-rw-r--r--app/views/dashboard/groups/index.html.haml31
-rw-r--r--app/views/dashboard/projects/starred.html.haml7
-rw-r--r--app/views/explore/groups/index.html.haml12
-rw-r--r--app/views/explore/projects/_projects.html.haml12
-rw-r--r--app/views/groups/_projects.html.haml2
-rw-r--r--app/views/groups/show.html.haml4
-rw-r--r--app/views/layouts/_page.html.haml7
-rw-r--r--app/views/layouts/header/_default.html.haml19
-rw-r--r--app/views/layouts/header/_public.html.haml7
-rw-r--r--app/views/layouts/nav/_project.html.haml2
-rw-r--r--app/views/profiles/notifications/show.html.haml2
-rw-r--r--app/views/profiles/preferences/show.html.haml8
-rw-r--r--app/views/profiles/show.html.haml5
-rw-r--r--app/views/projects/_home_panel.html.haml2
-rw-r--r--app/views/projects/blame/show.html.haml2
-rw-r--r--app/views/projects/buttons/_dropdown.html.haml2
-rw-r--r--app/views/projects/deploy_keys/index.html.haml1
-rw-r--r--app/views/projects/diffs/_diffs.html.haml3
-rw-r--r--app/views/projects/graphs/commits.html.haml21
-rw-r--r--app/views/projects/hooks/index.html.haml8
-rw-r--r--app/views/projects/merge_requests/_show.html.haml3
-rw-r--r--app/views/projects/snippets/_snippet.html.haml15
-rw-r--r--app/views/projects/snippets/index.html.haml3
-rw-r--r--app/views/search/_category.html.haml2
-rw-r--r--app/views/search/_filter.html.haml6
-rw-r--r--app/views/search/_form.html.haml12
-rw-r--r--app/views/search/_results.html.haml9
-rw-r--r--app/views/search/results/_blob.html.haml2
-rw-r--r--app/views/search/results/_project.html.haml6
-rw-r--r--app/views/search/results/_snippet_blob.html.haml2
-rw-r--r--app/views/search/results/_wiki_blob.html.haml2
-rw-r--r--app/views/search/show.html.haml2
-rw-r--r--app/views/shared/_file_highlight.html.haml2
-rw-r--r--app/views/shared/_project.html.haml20
-rw-r--r--app/views/shared/_projects_list.html.haml17
-rw-r--r--app/views/shared/groups/_group.html.haml24
-rw-r--r--app/views/shared/projects/_list.html.haml19
-rw-r--r--app/views/shared/projects/_project.html.haml23
-rw-r--r--app/views/shared/snippets/_snippet.html.haml (renamed from app/views/snippets/_snippet.html.haml)18
-rw-r--r--app/views/snippets/_snippets.html.haml2
-rw-r--r--app/views/users/_projects.html.haml4
-rw-r--r--app/views/users/show.html.haml4
-rw-r--r--app/workers/merge_worker.rb4
-rwxr-xr-xbin/daemon_with_pidfile33
-rwxr-xr-xbin/mail_room4
-rw-r--r--config/initializers/doorkeeper.rb3
-rw-r--r--db/migrate/20150817163600_deduplicate_user_identities.rb14
-rw-r--r--db/migrate/20150824002011_add_enable_ssl_verification.rb5
-rw-r--r--db/schema.rb15
-rw-r--r--doc/workflow/importing/README.md4
-rw-r--r--doc/workflow/importing/import_projects_from_github.md2
-rw-r--r--features/admin/hooks.feature9
-rw-r--r--features/project/hooks.feature5
-rw-r--r--features/steps/admin/hooks.rb15
-rw-r--r--features/steps/project/hooks.rb13
-rw-r--r--features/user.feature5
-rw-r--r--lib/gitlab/color_schemes.rb67
-rw-r--r--lib/gitlab/current_settings.rb2
-rw-r--r--lib/gitlab/ldap/user.rb11
-rw-r--r--lib/gitlab/themes.rb18
-rw-r--r--lib/redcarpet/render/gitlab_html.rb5
-rwxr-xr-xlib/support/init.d/gitlab2
-rw-r--r--spec/features/markdown_spec.rb8
-rw-r--r--spec/helpers/events_helper_spec.rb5
-rw-r--r--spec/helpers/preferences_helper_spec.rb92
-rw-r--r--spec/lib/gitlab/color_schemes_spec.rb45
-rw-r--r--spec/lib/gitlab/ldap/user_spec.rb22
-rw-r--r--spec/lib/gitlab/themes_spec.rb3
-rw-r--r--spec/services/notification_service_spec.rb11
-rw-r--r--spec/workers/merge_worker_spec.rb28
-rw-r--r--spec/workers/post_receive_spec.rb2
112 files changed, 849 insertions, 553 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 5222ab1e3e1..2ec3bd28b39 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,8 +1,11 @@
Please view this file on the master branch, on stable branches it's out of date.
v 8.0.0 (unreleased)
+ - Prevent anchors from being hidden by header (Stan Hu)
+ - Upgrade gitlab_git to 7.2.15 to fix `git blame` errors with ISO-encoded files (Stan Hu)
+ - Prevent too many redirects upon login when home page URL is set to external_url (Stan Hu)
+ - Improve dropdown positioning on the project home page (Hannes Rosenögger)
- Upgrade browser gem to 1.0.0 to avoid warning in IE11 compatibilty mode (Stan Hu)
- - Fix "Reload with full diff" URL button in compare branch view (Stan Hu)
- Remove user OAuth tokens from the database and request new tokens each session (Stan Hu)
- Only show recent push event if the branch still exists or a recent merge request has not been created (Stan Hu)
- Remove satellites
@@ -15,12 +18,23 @@ v 8.0.0 (unreleased)
- Create cross-reference for closing references on commits pushed to non-default branches (Maël Valais)
- Ability to search milestones
- Gracefully handle SMTP user input errors (e.g. incorrect email addresses) to prevent Sidekiq retries (Stan Hu)
- - Improve abuse reports management from admin area
- Move dashboard activity to separate page
-
-v 7.14.1 (unreleased)
+ - Improve performance of git blame
+ - Limit content width to 1200px for most of pages to improve readability on big screens
+ - Fix 500 error when submit project snippet without body
+ - Improve search page usability
+ - Bring more UI consistency in way how projects, snippets and groups lists are rendered
+ - Make all profiles public
+ - Fixed login failure when extern_uid changes (Joel Koglin)
+ - Don't notify users without access to the project when they are (accidentally) mentioned in a note.
+ - Retrieving oauth token with LDAP credentials
+
+v 7.14.1
+ - Improve abuse reports management from admin area
+ - Fix "Reload with full diff" URL button in compare branch view (Stan Hu)
- Only include base URL in OmniAuth full_host parameter (Stan Hu)
- Fix Error 500 in API when accessing a group that has an avatar (Stan Hu)
+ - Ability to enable SSL verification for Webhooks
v 7.14.0
- Fix bug where non-project members of the target project could set labels on new merge requests.
@@ -306,6 +320,7 @@ v 7.11.0
- Protect OmniAuth request phase against CSRF.
- Don't send notifications to mentioned users that don't have access to the project in question.
- Add search issues/MR by number
+ - Change plots to bar graphs in commit statistics screen
- Move snippets UI to fluid layout
- Improve UI for sidebar. Increase separation between navigation and content
- Improve new project command options (Ben Bodenmiller)
diff --git a/Gemfile b/Gemfile
index fa54a72f025..e1b9ede17ba 100644
--- a/Gemfile
+++ b/Gemfile
@@ -38,7 +38,7 @@ gem "browser", '~> 1.0.0'
# Extracting information from a git repository
# Provide access to Gitlab::Git library
-gem "gitlab_git", '~> 7.2.14'
+gem "gitlab_git", '~> 7.2.15'
# Ruby/Rack Git Smart-HTTP Server Handler
# GitLab fork with a lot of changes (improved thread-safety, better memory usage etc)
@@ -273,6 +273,6 @@ gem "newrelic_rpm"
gem 'octokit', '3.7.0'
-gem "mail_room", "~> 0.4.0"
+gem "mail_room", "~> 0.4.1"
gem 'email_reply_parser'
diff --git a/Gemfile.lock b/Gemfile.lock
index a7cfe6b7511..ff01ad10145 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -276,7 +276,7 @@ GEM
mime-types (~> 1.19)
gitlab_emoji (0.1.0)
gemojione (~> 2.0)
- gitlab_git (7.2.14)
+ gitlab_git (7.2.15)
activesupport (~> 4.0)
charlock_holmes (~> 0.6)
gitlab-linguist (~> 3.0)
@@ -372,7 +372,7 @@ GEM
systemu (~> 2.6.2)
mail (2.6.3)
mime-types (>= 1.16, < 3)
- mail_room (0.4.0)
+ mail_room (0.4.1)
method_source (0.8.2)
mime-types (1.25.1)
mimemagic (0.3.0)
@@ -790,7 +790,7 @@ DEPENDENCIES
gitlab-grack (~> 2.0.2)
gitlab-linguist (~> 3.0.1)
gitlab_emoji (~> 0.1)
- gitlab_git (~> 7.2.14)
+ gitlab_git (~> 7.2.15)
gitlab_meta (= 7.0)
gitlab_omniauth-ldap (= 1.2.1)
gollum-lib (~> 4.0.2)
@@ -808,7 +808,7 @@ DEPENDENCIES
jquery-ui-rails
kaminari (~> 0.15.1)
letter_opener
- mail_room (~> 0.4.0)
+ mail_room (~> 0.4.1)
minitest (~> 5.3.0)
mousetrap-rails
mysql2
diff --git a/app/assets/javascripts/application.js.coffee b/app/assets/javascripts/application.js.coffee
index c263912b7ea..8e987ac4e83 100644
--- a/app/assets/javascripts/application.js.coffee
+++ b/app/assets/javascripts/application.js.coffee
@@ -94,16 +94,18 @@ window.unbindEvents = ->
$(document).off('scroll')
window.shiftWindow = ->
- scrollBy 0, -50
+ scrollBy 0, -100
document.addEventListener("page:fetch", unbindEvents)
-# Scroll the window to avoid the topnav bar
-# https://github.com/twitter/bootstrap/issues/1768
-if location.hash
- setTimeout shiftWindow, 1
window.addEventListener "hashchange", shiftWindow
+window.onload = ->
+ # Scroll the window to avoid the topnav bar
+ # https://github.com/twitter/bootstrap/issues/1768
+ if location.hash
+ setTimeout shiftWindow, 100
+
$ ->
$(".nicescroll").niceScroll(cursoropacitymax: '0.4', cursorcolor: '#FFF', cursorborder: "1px solid #FFF")
diff --git a/app/assets/javascripts/dispatcher.js.coffee b/app/assets/javascripts/dispatcher.js.coffee
index 539041c2862..5bf0b302179 100644
--- a/app/assets/javascripts/dispatcher.js.coffee
+++ b/app/assets/javascripts/dispatcher.js.coffee
@@ -55,7 +55,6 @@ class Dispatcher
new Activities()
when 'dashboard:projects:starred'
new Activities()
- new ProjectsList()
when 'projects:commit:show'
new Commit()
new Diff()
@@ -70,7 +69,6 @@ class Dispatcher
when 'groups:show'
new Activities()
shortcut_handler = new ShortcutsNavigation()
- new ProjectsList()
when 'groups:group_members:index'
new GroupMembers()
new UsersSelect()
@@ -96,8 +94,6 @@ class Dispatcher
when 'users:show'
new User()
new Activities()
- when 'admin:users:show'
- new ProjectsList()
switch path.first()
when 'admin'
diff --git a/app/assets/javascripts/syntax_highlight.coffee b/app/assets/javascripts/syntax_highlight.coffee
new file mode 100644
index 00000000000..510f15d1b49
--- /dev/null
+++ b/app/assets/javascripts/syntax_highlight.coffee
@@ -0,0 +1,9 @@
+# Applies a syntax highlighting color scheme CSS class to any element with the
+# `js-syntax-highlight` class
+#
+# ### Example Markup
+#
+# <div class="js-syntax-highlight"></div>
+#
+$(document).on 'ready page:load', ->
+ $('.js-syntax-highlight').addClass(gon.user_color_scheme)
diff --git a/app/assets/stylesheets/base/layout.scss b/app/assets/stylesheets/base/layout.scss
index 690d89a5c16..734b95e26c0 100644
--- a/app/assets/stylesheets/base/layout.scss
+++ b/app/assets/stylesheets/base/layout.scss
@@ -20,3 +20,8 @@ html {
.navless-container {
margin-top: 30px;
}
+
+
+.container-limited {
+ max-width: $fixed-layout-width;
+}
diff --git a/app/assets/stylesheets/base/mixins.scss b/app/assets/stylesheets/base/mixins.scss
index 7beef1845ef..05f5bd79f91 100644
--- a/app/assets/stylesheets/base/mixins.scss
+++ b/app/assets/stylesheets/base/mixins.scss
@@ -157,3 +157,41 @@
white-space: nowrap;
max-width: $max_width;
}
+
+/*
+ * Base mixin for lists in GitLab
+ */
+@mixin basic-list {
+ margin: 5px 0px;
+ padding: 0px;
+ list-style: none;
+
+ li {
+ padding: 10px 0;
+ border-bottom: 1px solid #EEE;
+ overflow: hidden;
+ display: block;
+ margin: 0px;
+
+ &:last-child {
+ border:none
+ }
+
+ &.active {
+ background: #f9f9f9;
+ a {
+ font-weight: bold;
+ }
+ }
+
+ &.hide {
+ display: none;
+ }
+
+ &.light {
+ a {
+ color: #777;
+ }
+ }
+ }
+}
diff --git a/app/assets/stylesheets/base/variables.scss b/app/assets/stylesheets/base/variables.scss
index cb439a0e0bf..26d0a1e5363 100644
--- a/app/assets/stylesheets/base/variables.scss
+++ b/app/assets/stylesheets/base/variables.scss
@@ -13,7 +13,7 @@ $code_line_height: 1.5;
$border-color: #E5E5E5;
$background-color: #f5f5f5;
$header-height: 50px;
-$readable-width: 1100px;
+$fixed-layout-width: 1200px;
/*
diff --git a/app/assets/stylesheets/generic/common.scss b/app/assets/stylesheets/generic/common.scss
index bf5c7a8d75e..e5902597c4d 100644
--- a/app/assets/stylesheets/generic/common.scss
+++ b/app/assets/stylesheets/generic/common.scss
@@ -132,10 +132,6 @@ p.time {
text-shadow: none;
}
-.highlight_word {
- background: #fafe3d;
-}
-
.thin_area{
height: 150px;
}
@@ -375,9 +371,9 @@ table {
}
.center-top-menu {
- border-bottom: 1px solid #EEE;
list-style: none;
text-align: center;
+ margin-top: 5px;
padding-bottom: 15px;
margin-bottom: 15px;
@@ -385,7 +381,7 @@ table {
display: inline-block;
a {
- padding: 10px;
+ padding: 15px;
}
&.active a {
diff --git a/app/assets/stylesheets/generic/header.scss b/app/assets/stylesheets/generic/header.scss
index 31e2ad86691..6a29b32e196 100644
--- a/app/assets/stylesheets/generic/header.scss
+++ b/app/assets/stylesheets/generic/header.scss
@@ -20,16 +20,16 @@ header {
}
&.navbar-gitlab {
+ padding: 0 20px;
z-index: 100;
margin-bottom: 0;
min-height: $header-height;
border: none;
- width: 100%;
+ border-bottom: 1px solid #EEE;
- .container {
+ .container-fluid {
background: #FFF;
width: 100% !important;
- padding: 0;
filter: none;
.nav > li > a {
@@ -64,55 +64,11 @@ header {
}
}
- .header-logo {
- border-bottom: 1px solid transparent;
- float: left;
- height: $header-height;
- width: $sidebar_width;
- overflow: hidden;
- transition-duration: .3s;
-
- a {
- float: left;
- height: $header-height;
- width: 100%;
- padding: ($header-height - 36 ) / 2 8px;
- overflow: hidden;
-
- img {
- width: 36px;
- height: 36px;
- float: left;
- }
-
- .gitlab-text-container {
- width: 230px;
-
- h3 {
- width: 158px;
- float: left;
- margin: 0;
- margin-left: 14px;
- font-size: 18px;
- line-height: $header-height - 14;
- font-weight: normal;
- }
- }
- }
-
- &:hover {
- background-color: #EEE;
- }
- }
-
.header-content {
- border-bottom: 1px solid #EEE;
- padding-right: 35px;
height: $header-height;
.title {
margin: 0;
- padding: 0 15px 0 35px;
overflow: hidden;
font-size: 18px;
line-height: $header-height;
@@ -168,15 +124,7 @@ header {
}
@mixin collapsed-header {
- .header-logo {
- width: $sidebar_collapsed_width;
- }
-
- .header-content {
- .title {
- margin-left: 30px;
- }
- }
+ margin-left: $sidebar_collapsed_width;
}
@media (max-width: $screen-md-max) {
@@ -191,16 +139,14 @@ header {
}
.header-expanded {
+ margin-left: $sidebar_width;
}
}
@media (max-width: $screen-xs-max) {
- header .container {
+ header .container-fluid {
font-size: 18px;
- .title {
- }
-
.navbar-nav {
margin: 0px;
float: none !important;
diff --git a/app/assets/stylesheets/generic/lists.scss b/app/assets/stylesheets/generic/lists.scss
index c502d953c75..4b7ff84de2b 100644
--- a/app/assets/stylesheets/generic/lists.scss
+++ b/app/assets/stylesheets/generic/lists.scss
@@ -93,28 +93,12 @@ ol, ul {
/** light list with border-bottom between li **/
ul.bordered-list {
- margin: 5px 0px;
- padding: 0px;
- li {
- padding: 5px 0;
- border-bottom: 1px solid #EEE;
- overflow: hidden;
- display: block;
- margin: 0px;
- &:last-child { border:none }
- &.active {
- background: #f9f9f9;
- a { font-weight: bold; }
- }
-
- &.light {
- a { color: #777; }
- }
- }
+ @include basic-list;
&.top-list {
li:first-child {
padding-top: 0;
+
h4, h5 {
margin-top: 0;
}
diff --git a/app/assets/stylesheets/generic/sidebar.scss b/app/assets/stylesheets/generic/sidebar.scss
index b96664d30db..320bdb1c765 100644
--- a/app/assets/stylesheets/generic/sidebar.scss
+++ b/app/assets/stylesheets/generic/sidebar.scss
@@ -188,3 +188,46 @@
width: $sidebar_width - 2 * 10px;
}
}
+
+.sidebar-wrapper {
+ .header-logo {
+ border-bottom: 1px solid transparent;
+ float: left;
+ height: $header-height;
+ width: $sidebar_width;
+ overflow: hidden;
+ transition-duration: .3s;
+
+ a {
+ float: left;
+ height: $header-height;
+ width: 100%;
+ padding: ($header-height - 36 ) / 2 8px;
+ overflow: hidden;
+
+ img {
+ width: 36px;
+ height: 36px;
+ float: left;
+ }
+
+ .gitlab-text-container {
+ width: 230px;
+
+ h3 {
+ width: 158px;
+ float: left;
+ margin: 0;
+ margin-left: 14px;
+ font-size: 18px;
+ line-height: $header-height - 14;
+ font-weight: normal;
+ }
+ }
+ }
+
+ &:hover {
+ background-color: #EEE;
+ }
+ }
+}
diff --git a/app/assets/stylesheets/highlight/dark.scss b/app/assets/stylesheets/highlight/dark.scss
index c8cb18ec35f..8323a8598ec 100644
--- a/app/assets/stylesheets/highlight/dark.scss
+++ b/app/assets/stylesheets/highlight/dark.scss
@@ -21,6 +21,12 @@ pre.code.highlight.dark,
background-color: #557 !important;
}
+ // Search result highlight
+ span.highlight_word {
+ background: #ffe792;
+ color: #000000;
+ }
+
.hll { background-color: #373b41 }
.c { color: #969896 } /* Comment */
.err { color: #cc6666 } /* Error */
diff --git a/app/assets/stylesheets/highlight/monokai.scss b/app/assets/stylesheets/highlight/monokai.scss
index 001e8b31020..e8381674336 100644
--- a/app/assets/stylesheets/highlight/monokai.scss
+++ b/app/assets/stylesheets/highlight/monokai.scss
@@ -21,6 +21,12 @@ pre.code.monokai,
background-color: #49483e !important;
}
+ // Search result highlight
+ span.highlight_word {
+ background: #ffe792;
+ color: #000000;
+ }
+
.hll { background-color: #49483e }
.c { color: #75715e } /* Comment */
.err { color: #960050; background-color: #1e0010 } /* Error */
diff --git a/app/assets/stylesheets/highlight/solarized_dark.scss b/app/assets/stylesheets/highlight/solarized_dark.scss
index f5b827e7c02..bd41480aefb 100644
--- a/app/assets/stylesheets/highlight/solarized_dark.scss
+++ b/app/assets/stylesheets/highlight/solarized_dark.scss
@@ -21,6 +21,11 @@ pre.code.highlight.solarized-dark,
background-color: #174652 !important;
}
+ // Search result highlight
+ span.highlight_word {
+ background: #094554;
+ }
+
/* Solarized Dark
For use with Jekyll and Pygments
diff --git a/app/assets/stylesheets/highlight/solarized_light.scss b/app/assets/stylesheets/highlight/solarized_light.scss
index 6b44c00c305..4cc62863870 100644
--- a/app/assets/stylesheets/highlight/solarized_light.scss
+++ b/app/assets/stylesheets/highlight/solarized_light.scss
@@ -21,6 +21,11 @@ pre.code.highlight.solarized-light,
background-color: #ddd8c5 !important;
}
+ // Search result highlight
+ span.highlight_word {
+ background: #eee8d5;
+ }
+
/* Solarized Light
For use with Jekyll and Pygments
diff --git a/app/assets/stylesheets/highlight/white.scss b/app/assets/stylesheets/highlight/white.scss
index a52ffc971d1..e0edfb80b42 100644
--- a/app/assets/stylesheets/highlight/white.scss
+++ b/app/assets/stylesheets/highlight/white.scss
@@ -21,6 +21,11 @@ pre.code.highlight.white,
background-color: #f8eec7 !important;
}
+ // Search result highlight
+ span.highlight_word {
+ background: #fafe3d;
+ }
+
.hll { background-color: #f8f8f8 }
.c { color: #999988; font-style: italic; }
.err { color: #a61717; background-color: #e3d2d2; }
diff --git a/app/assets/stylesheets/pages/issuable.scss b/app/assets/stylesheets/pages/issuable.scss
index 3f617e72b02..586e7b5f8da 100644
--- a/app/assets/stylesheets/pages/issuable.scss
+++ b/app/assets/stylesheets/pages/issuable.scss
@@ -45,9 +45,3 @@
.btn { font-size: 13px; }
}
-
-.issuable-details {
- .description {
- max-width: $readable-width;
- }
-}
diff --git a/app/assets/stylesheets/pages/projects.scss b/app/assets/stylesheets/pages/projects.scss
index 1e138651d52..488dded549e 100644
--- a/app/assets/stylesheets/pages/projects.scss
+++ b/app/assets/stylesheets/pages/projects.scss
@@ -30,14 +30,21 @@
}
}
+ .project-home-dropdown {
+ margin: 11px 3px 0;
+ }
+
.project-home-desc {
h1 {
margin: 0;
margin-bottom: 10px;
font-size: 26px;
+ font-weight: bold;
}
p {
+ font-size: 18px;
+ color: #666;
display: inline;
}
}
@@ -155,78 +162,6 @@ ul.nav.nav-projects-tabs {
margin: 0px;
}
-.my-projects,
-.public-projects {
- li {
- .project-info {
- margin-bottom: 10px;
- overflow: hidden;
- }
-
- .access-icon {
- color: #AAA;
- margin-left: 10px;
- i {
- color: #AAA;
- }
- }
- }
-}
-
-.public-clone {
- background: #EEE;
- color: #777;
- padding: 6px 10px;
- margin: 1px;
- font-weight: normal;
-}
-
-.public-projects .repo-info {
- color: #777;
-
- a {
- color: #777;
- }
-}
-
-.project-side {
- .project-fork-icon {
- float: left;
- font-size: 26px;
- margin-right: 10px;
- line-height: 1.5;
- }
-
- .panel {
- @include border-radius(3px);
-
- .panel-heading, .panel-footer {
- font-weight: normal;
- background-color: transparent;
- color: #666;
- border-color: #EEE;
- }
-
- .actions {
- margin-top: 10px;
- }
-
- .nav-pills a {
- padding: 10px;
- font-weight: bold;
- color: $gl-link-color;
- }
-
- .nav {
- margin-bottom: 15px;
- }
- }
-
- .ci-status-image {
- max-height: 22px;
- }
-}
-
.transfer-project .select2-container {
min-width: 200px;
}
@@ -327,23 +262,32 @@ pre.light-well {
}
}
-.project-row {
- .project-full-name {
- font-weight: bold;
- font-size: 15px;
- }
+/*
+ * Projects list rendered on dashboard and user page
+ */
+.projects-list {
+ @include basic-list;
- .project-description {
- color: #888;
- font-size: 13px;
+ .project-row {
+ .project-full-name {
+ @include str-truncated;
+ font-weight: bold;
+ font-size: 15px;
+ }
- p {
- margin-bottom: 0;
+ .project-description {
color: #888;
+ font-size: 13px;
+
+ p {
+ @include str-truncated;
+ margin-bottom: 0;
+ color: #888;
+ }
}
}
}
-.my-projects .project-row {
- padding: 10px 0;
+.panel .projects-list li {
+ padding: 10px 15px;
}
diff --git a/app/assets/stylesheets/pages/search.scss b/app/assets/stylesheets/pages/search.scss
index bdaa17ac339..3aaa96da609 100644
--- a/app/assets/stylesheets/pages/search.scss
+++ b/app/assets/stylesheets/pages/search.scss
@@ -1,7 +1,19 @@
.search-results {
.search-result-row {
- border-bottom: 1px solid #EEE;
- padding-bottom: 10px;
- margin-bottom: 10px;
+ border-bottom: 1px solid #DDD;
+ padding-bottom: 15px;
+ margin-bottom: 15px;
}
}
+
+.search-holder {
+ max-width: 600px;
+ margin: 0 auto;
+ margin-bottom: 20px;
+
+ input {
+ border-color: #BBB;
+ font-weight: bold;
+ }
+}
+
diff --git a/app/assets/stylesheets/pages/snippets.scss b/app/assets/stylesheets/pages/snippets.scss
index d79591d9915..a3d7aba054d 100644
--- a/app/assets/stylesheets/pages/snippets.scss
+++ b/app/assets/stylesheets/pages/snippets.scss
@@ -6,3 +6,27 @@
.snippet-form-holder .file-holder .file-title {
padding: 2px;
}
+
+
+.snippet-row {
+ .snippet-title {
+ font-size: 15px;
+ font-weight: bold;
+ line-height: 20px;
+ margin-bottom: 2px;
+
+ .monospace {
+ font-weight: normal;
+ }
+ }
+
+ .snippet-info {
+ color: #888;
+ font-size: 13px;
+ line-height: 24px;
+
+ a {
+ color: #888;
+ }
+ }
+}
diff --git a/app/assets/stylesheets/pages/tree.scss b/app/assets/stylesheets/pages/tree.scss
index 5f1a3db4fb6..81e2aa7bb9c 100644
--- a/app/assets/stylesheets/pages/tree.scss
+++ b/app/assets/stylesheets/pages/tree.scss
@@ -117,7 +117,6 @@
.readme-holder {
margin: 0 auto;
- max-width: $readable-width;
.readme-file-title {
font-size: 14px;
diff --git a/app/assets/stylesheets/themes/gitlab-theme.scss b/app/assets/stylesheets/themes/gitlab-theme.scss
index 3589cb88d03..77b62c3153f 100644
--- a/app/assets/stylesheets/themes/gitlab-theme.scss
+++ b/app/assets/stylesheets/themes/gitlab-theme.scss
@@ -7,27 +7,23 @@
* $color-dark -
*/
@mixin gitlab-theme($color-light, $color, $color-darker, $color-dark) {
- header {
- &.navbar-gitlab {
- .header-logo {
- background-color: $color-darker;
- border-color: $color-darker;
+ .page-with-sidebar {
+ .header-logo {
+ background-color: $color-darker;
+ border-color: $color-darker;
- a {
- color: $color-light;
- }
+ a {
+ color: $color-light;
+ }
- &:hover {
- background-color: $color-dark;
- a {
- color: #FFF;
- }
+ &:hover {
+ background-color: $color-dark;
+ a {
+ color: #FFF;
}
}
}
- }
- .page-with-sidebar {
.collapse-nav a {
color: #FFF;
background: $color;
diff --git a/app/controllers/admin/hooks_controller.rb b/app/controllers/admin/hooks_controller.rb
index 690096bdbcf..d670386f8c6 100644
--- a/app/controllers/admin/hooks_controller.rb
+++ b/app/controllers/admin/hooks_controller.rb
@@ -39,6 +39,6 @@ class Admin::HooksController < Admin::ApplicationController
end
def hook_params
- params.require(:hook).permit(:url)
+ params.require(:hook).permit(:url, :enable_ssl_verification)
end
end
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 12d439b0b31..cb1cf13d34d 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -55,7 +55,9 @@ class ApplicationController < ActionController::Base
def authenticate_user!(*args)
# If user is not signed-in and tries to access root_path - redirect him to landing page
- if current_application_settings.home_page_url.present?
+ # Don't redirect to the default URL to prevent endless redirections
+ if current_application_settings.home_page_url.present? &&
+ current_application_settings.home_page_url.chomp('/') != Gitlab.config.gitlab['url'].chomp('/')
if current_user.nil? && root_path == request.path
redirect_to current_application_settings.home_page_url and return
end
@@ -190,11 +192,12 @@ class ApplicationController < ActionController::Base
end
def add_gon_variables
+ gon.api_version = API::API.version
+ gon.default_avatar_url = URI::join(Gitlab.config.gitlab.url, ActionController::Base.helpers.image_path('no_avatar.png')).to_s
gon.default_issues_tracker = Project.new.default_issue_tracker.to_param
- gon.api_version = API::API.version
- gon.relative_url_root = Gitlab.config.gitlab.relative_url_root
- gon.default_avatar_url = URI::join(Gitlab.config.gitlab.url, ActionController::Base.helpers.image_path('no_avatar.png')).to_s
- gon.max_file_size = current_application_settings.max_attachment_size;
+ gon.max_file_size = current_application_settings.max_attachment_size
+ gon.relative_url_root = Gitlab.config.gitlab.relative_url_root
+ gon.user_color_scheme = Gitlab::ColorSchemes.for_user(current_user).css_class
if current_user
gon.current_user_id = current_user.id
diff --git a/app/controllers/projects/hooks_controller.rb b/app/controllers/projects/hooks_controller.rb
index 76062446c92..4e5b4125f5a 100644
--- a/app/controllers/projects/hooks_controller.rb
+++ b/app/controllers/projects/hooks_controller.rb
@@ -53,6 +53,7 @@ class Projects::HooksController < Projects::ApplicationController
end
def hook_params
- params.require(:hook).permit(:url, :push_events, :issues_events, :merge_requests_events, :tag_push_events, :note_events)
+ params.require(:hook).permit(:url, :push_events, :issues_events,
+ :merge_requests_events, :tag_push_events, :note_events, :enable_ssl_verification)
end
end
diff --git a/app/controllers/projects/services_controller.rb b/app/controllers/projects/services_controller.rb
index 01105532479..b0cf5866d41 100644
--- a/app/controllers/projects/services_controller.rb
+++ b/app/controllers/projects/services_controller.rb
@@ -8,7 +8,7 @@ class Projects::ServicesController < Projects::ApplicationController
:push_events, :issues_events, :merge_requests_events, :tag_push_events,
:note_events, :send_from_committer_email, :disable_diffs, :external_wiki_url,
:notify, :color,
- :server_host, :server_port, :default_irc_uri]
+ :server_host, :server_port, :default_irc_uri, :enable_ssl_verification]
# Authorize
before_action :authorize_admin_project!
before_action :service, only: [:edit, :update, :test]
diff --git a/app/controllers/projects/snippets_controller.rb b/app/controllers/projects/snippets_controller.rb
index 64306637423..b07a2a8db2f 100644
--- a/app/controllers/projects/snippets_controller.rb
+++ b/app/controllers/projects/snippets_controller.rb
@@ -30,9 +30,14 @@ class Projects::SnippetsController < Projects::ApplicationController
def create
@snippet = CreateSnippetService.new(@project, current_user,
snippet_params).execute
- respond_with(@snippet,
- location: namespace_project_snippet_path(@project.namespace,
- @project, @snippet))
+
+ if @snippet.valid?
+ respond_with(@snippet,
+ location: namespace_project_snippet_path(@project.namespace,
+ @project, @snippet))
+ else
+ render :new
+ end
end
def edit
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 2bb5c338cf6..1484356a7f4 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -51,10 +51,6 @@ class UsersController < ApplicationController
def set_user
@user = User.find_by_username!(params[:username])
-
- unless current_user || @user.public_profile?
- return authenticate_user!
- end
end
def authorized_projects_ids
diff --git a/app/finders/trending_projects_finder.rb b/app/finders/trending_projects_finder.rb
index a79bd47d986..f3f4d461efa 100644
--- a/app/finders/trending_projects_finder.rb
+++ b/app/finders/trending_projects_finder.rb
@@ -2,13 +2,21 @@ class TrendingProjectsFinder
def execute(current_user, start_date = nil)
start_date ||= Date.today - 1.month
- projects = projects_for(current_user)
-
# Determine trending projects based on comments count
# for period of time - ex. month
- projects.joins(:notes).where('notes.created_at > ?', start_date).
- select("projects.*, count(notes.id) as ncount").
- group("projects.id").reorder("ncount DESC")
+ trending_project_ids = Note.
+ select("notes.project_id, count(notes.project_id) as pcount").
+ where('notes.created_at > ?', start_date).
+ group("project_id").
+ reorder("pcount DESC").
+ map(&:project_id)
+
+ sql_order_ids = trending_project_ids.reverse.
+ map { |project_id| "id = #{project_id}" }.join(", ")
+
+ # Get list of projects that user allowed to see
+ projects = projects_for(current_user)
+ projects.where(id: trending_project_ids).reorder(sql_order_ids)
end
private
diff --git a/app/helpers/gitlab_markdown_helper.rb b/app/helpers/gitlab_markdown_helper.rb
index eb3f72a307d..114730eb948 100644
--- a/app/helpers/gitlab_markdown_helper.rb
+++ b/app/helpers/gitlab_markdown_helper.rb
@@ -58,7 +58,7 @@ module GitlabMarkdownHelper
@options = options
# see https://github.com/vmg/redcarpet#darling-i-packed-you-a-couple-renderers-for-lunch
- rend = Redcarpet::Render::GitlabHTML.new(self, user_color_scheme_class, options)
+ rend = Redcarpet::Render::GitlabHTML.new(self, options)
# see https://github.com/vmg/redcarpet#and-its-like-really-simple-to-use
@markdown = Redcarpet::Markdown.new(rend, MARKDOWN_OPTIONS)
diff --git a/app/helpers/page_layout_helper.rb b/app/helpers/page_layout_helper.rb
index 01b6a63552c..8473d6d75d0 100644
--- a/app/helpers/page_layout_helper.rb
+++ b/app/helpers/page_layout_helper.rb
@@ -23,4 +23,12 @@ module PageLayoutHelper
@sidebar
end
end
+
+ def fluid_layout(enabled = false)
+ if @fluid_layout.nil?
+ @fluid_layout = enabled
+ else
+ @fluid_layout
+ end
+ end
end
diff --git a/app/helpers/preferences_helper.rb b/app/helpers/preferences_helper.rb
index ea774e28ecf..7f1b6a69926 100644
--- a/app/helpers/preferences_helper.rb
+++ b/app/helpers/preferences_helper.rb
@@ -1,25 +1,5 @@
# Helper methods for per-User preferences
module PreferencesHelper
- COLOR_SCHEMES = {
- 1 => 'white',
- 2 => 'dark',
- 3 => 'solarized-light',
- 4 => 'solarized-dark',
- 5 => 'monokai',
- }
- COLOR_SCHEMES.default = 'white'
-
- # Helper method to access the COLOR_SCHEMES
- #
- # The keys are the `color_scheme_ids`
- # The values are the `name` of the scheme.
- #
- # The preview images are `name-scheme-preview.png`
- # The stylesheets should use the css class `.name`
- def color_schemes
- COLOR_SCHEMES.freeze
- end
-
# Maps `dashboard` values to more user-friendly option text
DASHBOARD_CHOICES = {
projects: 'Your Projects (default)',
@@ -50,12 +30,11 @@ module PreferencesHelper
end
def user_application_theme
- theme = Gitlab::Themes.by_id(current_user.try(:theme_id))
- theme.css_class
+ Gitlab::Themes.for_user(current_user).css_class
end
- def user_color_scheme_class
- COLOR_SCHEMES[current_user.try(:color_scheme_id)] if defined?(current_user)
+ def user_color_scheme
+ Gitlab::ColorSchemes.for_user(current_user).css_class
end
def prefer_readme?
diff --git a/app/models/hooks/web_hook.rb b/app/models/hooks/web_hook.rb
index 46fb85336e5..9a8251bdad5 100644
--- a/app/models/hooks/web_hook.rb
+++ b/app/models/hooks/web_hook.rb
@@ -25,6 +25,7 @@ class WebHook < ActiveRecord::Base
default_value_for :note_events, false
default_value_for :merge_requests_events, false
default_value_for :tag_push_events, false
+ default_value_for :enable_ssl_verification, false
# HTTParty timeout
default_timeout Gitlab.config.gitlab.webhook_timeout
@@ -41,7 +42,7 @@ class WebHook < ActiveRecord::Base
"Content-Type" => "application/json",
"X-Gitlab-Event" => hook_name.singularize.titleize
},
- verify: false)
+ verify: enable_ssl_verification)
else
post_url = url.gsub("#{parsed_url.userinfo}@", "")
auth = {
@@ -54,7 +55,7 @@ class WebHook < ActiveRecord::Base
"Content-Type" => "application/json",
"X-Gitlab-Event" => hook_name.singularize.titleize
},
- verify: false,
+ verify: enable_ssl_verification,
basic_auth: auth)
end
rescue SocketError, Errno::ECONNRESET, Errno::ECONNREFUSED, Net::OpenTimeout => e
diff --git a/app/models/project_services/buildkite_service.rb b/app/models/project_services/buildkite_service.rb
index a714bc82246..9e5da6f45d2 100644
--- a/app/models/project_services/buildkite_service.rb
+++ b/app/models/project_services/buildkite_service.rb
@@ -23,7 +23,7 @@ require "addressable/uri"
class BuildkiteService < CiService
ENDPOINT = "https://buildkite.com"
- prop_accessor :project_url, :token
+ prop_accessor :project_url, :token, :enable_ssl_verification
validates :project_url, presence: true, if: :activated?
validates :token, presence: true, if: :activated?
@@ -37,6 +37,7 @@ class BuildkiteService < CiService
def compose_service_hook
hook = service_hook || build_service_hook
hook.url = webhook_url
+ hook.enable_ssl_verification = enable_ssl_verification
hook.save
end
@@ -96,7 +97,11 @@ class BuildkiteService < CiService
{ type: 'text',
name: 'project_url',
- placeholder: "#{ENDPOINT}/example/project" }
+ placeholder: "#{ENDPOINT}/example/project" },
+
+ { type: 'checkbox',
+ name: 'enable_ssl_verification',
+ title: "Enable SSL verification" }
]
end
diff --git a/app/models/project_services/gitlab_ci_service.rb b/app/models/project_services/gitlab_ci_service.rb
index ecdcd48ae60..acbbc9935b6 100644
--- a/app/models/project_services/gitlab_ci_service.rb
+++ b/app/models/project_services/gitlab_ci_service.rb
@@ -21,7 +21,7 @@
class GitlabCiService < CiService
API_PREFIX = "api/v1"
- prop_accessor :project_url, :token
+ 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?
@@ -34,6 +34,7 @@ class GitlabCiService < CiService
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
@@ -136,7 +137,8 @@ class GitlabCiService < CiService
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: 'text', name: 'project_url', placeholder: 'http://ci.gitlabhq.com/projects/3' },
+ { type: 'checkbox', name: 'enable_ssl_verification', title: "Enable SSL verification" }
]
end
diff --git a/app/models/user.rb b/app/models/user.rb
index f70761074c5..48e0e6ed48b 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -104,7 +104,7 @@ class User < ActiveRecord::Base
# Profile
has_many :keys, dependent: :destroy
has_many :emails, dependent: :destroy
- has_many :identities, dependent: :destroy
+ has_many :identities, dependent: :destroy, autosave: true
# Groups
has_many :members, dependent: :destroy
@@ -637,10 +637,6 @@ class User < ActiveRecord::Base
email.start_with?('temp-email-for-oauth')
end
- def public_profile?
- authorized_projects.public_only.any?
- end
-
def avatar_url(size = nil)
if avatar.present?
[gitlab_config.url, avatar.url].join
diff --git a/app/services/notification_service.rb b/app/services/notification_service.rb
index 3735a136365..e294b23bc23 100644
--- a/app/services/notification_service.rb
+++ b/app/services/notification_service.rb
@@ -107,12 +107,17 @@ class NotificationService
recipients = []
+ mentioned_users = note.mentioned_users
+ mentioned_users.select! do |user|
+ user.can?(:read_project, note.project)
+ end
+
# Add all users participating in the thread (author, assignee, comment authors)
participants =
if target.respond_to?(:participants)
target.participants(note.author)
else
- note.mentioned_users
+ mentioned_users
end
recipients = recipients.concat(participants)
@@ -120,8 +125,8 @@ class NotificationService
recipients = add_project_watchers(recipients, note.project)
# Reject users with Mention notification level, except those mentioned in _this_ note.
- recipients = reject_mention_users(recipients - note.mentioned_users, note.project)
- recipients = recipients + note.mentioned_users
+ recipients = reject_mention_users(recipients - mentioned_users, note.project)
+ recipients = recipients + mentioned_users
recipients = reject_muted_users(recipients, note.project)
diff --git a/app/views/admin/hooks/index.html.haml b/app/views/admin/hooks/index.html.haml
index e74e1e85f41..b120f4dea67 100644
--- a/app/views/admin/hooks/index.html.haml
+++ b/app/views/admin/hooks/index.html.haml
@@ -18,6 +18,13 @@
= f.label :url, "URL:", class: 'control-label'
.col-sm-10
= f.text_field :url, class: "form-control"
+ .form-group
+ = f.label :enable_ssl_verification, "SSL verification", class: 'control-label checkbox'
+ .col-sm-10
+ .checkbox
+ = f.label :enable_ssl_verification do
+ = f.check_box :enable_ssl_verification
+ %strong Enable SSL verification
.form-actions
= f.submit "Add System Hook", class: "btn btn-create"
%hr
@@ -32,6 +39,7 @@
.list-item-name
= link_to admin_hook_path(hook) do
%strong= hook.url
+ %p SSL Verification: #{hook.enable_ssl_verification ? "enabled" : "disabled"}
.pull-right
= link_to 'Test Hook', admin_hook_test_path(hook), class: "btn btn-sm"
diff --git a/app/views/dashboard/_projects.html.haml b/app/views/dashboard/_projects.html.haml
index dc83d5343f2..ef9b9ce756a 100644
--- a/app/views/dashboard/_projects.html.haml
+++ b/app/views/dashboard/_projects.html.haml
@@ -7,7 +7,4 @@
= link_to new_project_path, class: 'btn btn-success' do
New project
- %ul.projects-list.bordered-list.my-projects
- - @projects.each do |project|
- %li.project-row
- = render partial: 'shared/project', locals: { project: project, avatar: true, stars: true }
+ = render 'shared/projects/list', projects: @projects
diff --git a/app/views/dashboard/groups/index.html.haml b/app/views/dashboard/groups/index.html.haml
index 0860fe3c761..fbe523b4b66 100644
--- a/app/views/dashboard/groups/index.html.haml
+++ b/app/views/dashboard/groups/index.html.haml
@@ -8,32 +8,9 @@
= link_to new_group_path, class: "btn btn-new btn-sm" do
%i.fa.fa-plus
New Group
-.panel.panel-default
- .panel-heading
- %strong Groups
- (#{@group_members.count})
- %ul.well-list
- - @group_members.each do |group_member|
- - group = group_member.group
- %li
- .pull-right.hidden-xs
- - if can?(current_user, :admin_group, group)
- = link_to edit_group_path(group), class: "btn-sm btn btn-grouped" do
- %i.fa.fa-cogs
- Settings
-
- = link_to leave_group_group_members_path(group), data: { confirm: leave_group_message(group.name) }, method: :delete, class: "btn-sm btn btn-grouped", title: 'Leave this group' do
- %i.fa.fa-sign-out
- Leave
-
- = image_tag group_icon(group), class: "avatar s40 avatar-tile hidden-xs"
- = link_to group, class: 'group-name' do
- %strong= group.name
-
- as
- %strong #{group_member.human_access}
-
- %div.light
- #{pluralize(group.projects.count, "project")}, #{pluralize(group.users.count, "user")}
+%ul.bordered-list
+ - @group_members.each do |group_member|
+ - group = group_member.group
+ = render 'shared/groups/group', group: group, group_member: group_member
= paginate @group_members
diff --git a/app/views/dashboard/projects/starred.html.haml b/app/views/dashboard/projects/starred.html.haml
index 027387028b9..19f3975e530 100644
--- a/app/views/dashboard/projects/starred.html.haml
+++ b/app/views/dashboard/projects/starred.html.haml
@@ -5,9 +5,9 @@
= render 'shared/show_aside'
.dashboard.row
- %section.activities.col-md-8
+ %section.activities.col-md-7
= render 'dashboard/activities'
- %aside.col-md-4
+ %aside.col-md-5
.panel.panel-default.projects-list-holder
.panel-heading.clearfix
.input-group
@@ -17,8 +17,7 @@
= link_to new_project_path, class: 'btn btn-success' do
New project
- = render 'shared/projects_list', projects: @projects,
- projects_limit: 20, stars: true, avatar: false
+ = render 'shared/projects/list', projects: @projects, projects_limit: 20
- else
%h3 You don't have starred projects yet
diff --git a/app/views/explore/groups/index.html.haml b/app/views/explore/groups/index.html.haml
index 7dcefd330a1..80acb914365 100644
--- a/app/views/explore/groups/index.html.haml
+++ b/app/views/explore/groups/index.html.haml
@@ -32,17 +32,7 @@
%ul.bordered-list
- @groups.each do |group|
- %li
- .clearfix
- %h4
- = link_to group_path(id: group.path) do
- = group.name
- .clearfix
- %p
- = truncate group.description, length: 150
- .clearfix
- %p.light
- #{pluralize(group.members.size, 'member')}, #{pluralize(group.projects.count, 'project')}
+ = render 'shared/groups/group', group: group
- unless @groups.present?
.nothing-here-block No public groups
diff --git a/app/views/explore/projects/_projects.html.haml b/app/views/explore/projects/_projects.html.haml
index 22cc541115c..669079e9521 100644
--- a/app/views/explore/projects/_projects.html.haml
+++ b/app/views/explore/projects/_projects.html.haml
@@ -1,6 +1,6 @@
-%ul.projects-list.bordered-list.my-projects.public-projects
- - projects.each do |project|
- %li.project-row
- = render partial: 'shared/project', locals: { project: project, avatar: true, stars: true }
-- unless projects.present?
- .nothing-here-block No such projects
+- if projects.any?
+ .public-projects
+ = render 'shared/projects/list', projects: projects
+- else
+ .nothing-here-block
+ No such projects
diff --git a/app/views/groups/_projects.html.haml b/app/views/groups/_projects.html.haml
index 2ae51a1c8c0..b2e32ced5e0 100644
--- a/app/views/groups/_projects.html.haml
+++ b/app/views/groups/_projects.html.haml
@@ -7,4 +7,4 @@
= link_to new_project_path(namespace_id: @group.id), class: 'btn btn-success' do
New project
- = render 'shared/projects_list', projects: @projects, projects_limit: 20
+ = render 'shared/projects/list', projects: @projects, projects_limit: 20
diff --git a/app/views/groups/show.html.haml b/app/views/groups/show.html.haml
index d31dae7d648..0577f4ec142 100644
--- a/app/views/groups/show.html.haml
+++ b/app/views/groups/show.html.haml
@@ -17,7 +17,7 @@
= render 'shared/show_aside'
.row
- %section.activities.col-md-8
+ %section.activities.col-md-7
.hidden-xs
- if current_user
= render "events/event_last_push", event: @last_push
@@ -33,5 +33,5 @@
.content_list
= spinner
- %aside.side.col-md-4
+ %aside.side.col-md-5
= render "projects", projects: @projects
diff --git a/app/views/layouts/_page.html.haml b/app/views/layouts/_page.html.haml
index 96e15783a36..0104d7198df 100644
--- a/app/views/layouts/_page.html.haml
+++ b/app/views/layouts/_page.html.haml
@@ -1,6 +1,11 @@
.page-with-sidebar{ class: nav_sidebar_class }
= render "layouts/broadcast"
.sidebar-wrapper.nicescroll
+ .header-logo
+ = 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
- if defined?(sidebar) && sidebar
= render "layouts/nav/#{sidebar}"
- elsif current_user
@@ -13,7 +18,7 @@
.username
= current_user.username
.content-wrapper
- .container-fluid
+ %div{ class: fluid_layout ? "container-fluid" : "container-fluid container-limited" }
.content
= render "layouts/flash"
.clearfix
diff --git a/app/views/layouts/header/_default.html.haml b/app/views/layouts/header/_default.html.haml
index 12ddbe6f1b7..0b630b55c70 100644
--- a/app/views/layouts/header/_default.html.haml
+++ b/app/views/layouts/header/_default.html.haml
@@ -1,10 +1,5 @@
%header.navbar.navbar-fixed-top.navbar-gitlab{ class: nav_header_class }
- .container
- .header-logo
- = 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
+ %div{ class: fluid_layout ? "container-fluid" : "container-fluid container-limited" }
.header-content
%button.navbar-toggle{type: 'button'}
%span.sr-only Toggle navigation
@@ -17,15 +12,6 @@
%li.visible-sm.visible-xs
= link_to search_path, title: 'Search', data: {toggle: 'tooltip', placement: 'bottom'} do
= icon('search')
- -#%li.hidden-xs
- = link_to help_path, title: 'Help', data: {toggle: 'tooltip', placement: 'bottom'} do
- = icon('question-circle fw')
- -#%li
- = link_to explore_root_path, title: 'Explore', data: {toggle: 'tooltip', placement: 'bottom'} do
- = icon('globe fw')
- -#%li
- = link_to user_snippets_path(current_user), title: 'Your snippets', data: {toggle: 'tooltip', placement: 'bottom'} do
- = icon('clipboard fw')
- if current_user.is_admin?
%li
= link_to admin_root_path, title: 'Admin area', data: {toggle: 'tooltip', placement: 'bottom'} do
@@ -34,9 +20,6 @@
%li.hidden-xs
= link_to new_project_path, title: 'New project', data: {toggle: 'tooltip', placement: 'bottom'} do
= icon('plus fw')
- -#%li
- = link_to profile_path, title: 'Profile settings', data: {toggle: 'tooltip', placement: 'bottom'} do
- = icon('cog fw')
%li
= link_to destroy_user_session_path, class: 'logout', method: :delete, title: 'Sign out', data: {toggle: 'tooltip', placement: 'bottom'} do
= icon('sign-out')
diff --git a/app/views/layouts/header/_public.html.haml b/app/views/layouts/header/_public.html.haml
index 15c2e292be3..af4b9ba58f6 100644
--- a/app/views/layouts/header/_public.html.haml
+++ b/app/views/layouts/header/_public.html.haml
@@ -1,10 +1,5 @@
%header.navbar.navbar-fixed-top.navbar-gitlab{ class: nav_header_class }
- .container
- .header-logo
- = link_to explore_root_path, class: "home" do
- = brand_header_logo
- .gitlab-text-container
- %h3 GitLab
+ %div{ class: fluid_layout ? "container-fluid" : "container-fluid container-limited" }
.header-content
- unless current_controller?('sessions')
.pull-right
diff --git a/app/views/layouts/nav/_project.html.haml b/app/views/layouts/nav/_project.html.haml
index d17d1c5fbd4..5e7b902622b 100644
--- a/app/views/layouts/nav/_project.html.haml
+++ b/app/views/layouts/nav/_project.html.haml
@@ -100,7 +100,7 @@
- if project_nav_tab? :snippets
= nav_link(controller: :snippets) do
= link_to namespace_project_snippets_path(@project.namespace, @project), title: 'Snippets', class: 'shortcuts-snippets', data: {placement: 'right'} do
- = icon('file-text-o fw')
+ = icon('clipboard fw')
%span
Snippets
diff --git a/app/views/profiles/notifications/show.html.haml b/app/views/profiles/notifications/show.html.haml
index 9480a19f5b2..db7fa2eabe3 100644
--- a/app/views/profiles/notifications/show.html.haml
+++ b/app/views/profiles/notifications/show.html.haml
@@ -48,7 +48,7 @@
= f.radio_button :notification_level, Notification::N_WATCH
.level-title
Watch
- %p You will receive all notifications from projects in which you participate
+ %p You will receive notifications for any activity
.form-actions
= f.submit 'Save changes', class: "btn btn-create"
diff --git a/app/views/profiles/preferences/show.html.haml b/app/views/profiles/preferences/show.html.haml
index 1134317ee06..aa0361a0a1b 100644
--- a/app/views/profiles/preferences/show.html.haml
+++ b/app/views/profiles/preferences/show.html.haml
@@ -22,11 +22,11 @@
.panel-heading
Syntax highlighting theme
.panel-body
- - color_schemes.each do |color_scheme_id, color_scheme|
+ - Gitlab::ColorSchemes.each do |scheme|
= label_tag do
- .preview= image_tag "#{color_scheme}-scheme-preview.png"
- = f.radio_button :color_scheme_id, color_scheme_id
- = color_scheme.tr('-_', ' ').titleize
+ .preview= image_tag "#{scheme.css_class}-scheme-preview.png"
+ = f.radio_button :color_scheme_id, scheme.id
+ = scheme.name
.panel.panel-default
.panel-heading
diff --git a/app/views/profiles/show.html.haml b/app/views/profiles/show.html.haml
index 9fdeddfcc7a..c519e52e596 100644
--- a/app/views/profiles/show.html.haml
+++ b/app/views/profiles/show.html.haml
@@ -100,11 +100,6 @@
%hr
= link_to 'Remove avatar', profile_avatar_path, data: { confirm: "Avatar will be removed. Are you sure?"}, method: :delete, class: "btn btn-remove btn-sm remove-avatar"
- - if @user.public_profile?
- .alert.alert-info
- %h4 Public profile
- %p Your profile is publicly visible because you joined public project(s)
-
.row
.col-md-7
diff --git a/app/views/projects/_home_panel.html.haml b/app/views/projects/_home_panel.html.haml
index bec40ec27a5..b93036e78e6 100644
--- a/app/views/projects/_home_panel.html.haml
+++ b/app/views/projects/_home_panel.html.haml
@@ -2,7 +2,7 @@
.project-home-panel.clearfix{:class => ("empty-project" if empty_repo)}
.project-identicon-holder
= project_icon(@project, alt: '', class: 'project-avatar avatar s90')
- .project-home-desc.lead
+ .project-home-desc
%h1= @project.name
- if @project.description.present?
= markdown(@project.description, pipeline: :description)
diff --git a/app/views/projects/blame/show.html.haml b/app/views/projects/blame/show.html.haml
index a3ff7ce2f1f..c1ec42aefca 100644
--- a/app/views/projects/blame/show.html.haml
+++ b/app/views/projects/blame/show.html.haml
@@ -27,7 +27,7 @@
.light
= commit_author_link(commit, avatar: false)
authored
- #{time_ago_with_tooltip(commit.committed_date)}
+ #{time_ago_with_tooltip(commit.committed_date, skip_js: true)}
%td.lines.blame-numbers
%pre
- line_count = blame_group[:lines].count
diff --git a/app/views/projects/buttons/_dropdown.html.haml b/app/views/projects/buttons/_dropdown.html.haml
index cade930c8cc..bc7625e8989 100644
--- a/app/views/projects/buttons/_dropdown.html.haml
+++ b/app/views/projects/buttons/_dropdown.html.haml
@@ -2,7 +2,7 @@
%span.dropdown
%a.dropdown-toggle.btn.btn-new{href: '#', "data-toggle" => "dropdown"}
= icon('plus')
- %ul.dropdown-menu
+ %ul.dropdown-menu.dropdown-menu-right.project-home-dropdown
- if can?(current_user, :create_issue, @project)
%li
= link_to url_for_new_issue do
diff --git a/app/views/projects/deploy_keys/index.html.haml b/app/views/projects/deploy_keys/index.html.haml
index 2e9c5dc08c8..8e24c778b7c 100644
--- a/app/views/projects/deploy_keys/index.html.haml
+++ b/app/views/projects/deploy_keys/index.html.haml
@@ -1,4 +1,5 @@
- page_title "Deploy Keys"
+
%h3.page-title
Deploy keys allow read-only access to the repository
diff --git a/app/views/projects/diffs/_diffs.html.haml b/app/views/projects/diffs/_diffs.html.haml
index 52c1e03040c..30943f49bba 100644
--- a/app/views/projects/diffs/_diffs.html.haml
+++ b/app/views/projects/diffs/_diffs.html.haml
@@ -1,3 +1,6 @@
+- if params[:view] == 'parallel'
+ - fluid_layout true
+
.prepend-top-20.append-bottom-20
.pull-right
.btn-group
diff --git a/app/views/projects/graphs/commits.html.haml b/app/views/projects/graphs/commits.html.haml
index 141acbdcf72..a357736bf52 100644
--- a/app/views/projects/graphs/commits.html.haml
+++ b/app/views/projects/graphs/commits.html.haml
@@ -50,39 +50,42 @@
datasets : [{
fillColor : "rgba(220,220,220,0.5)",
strokeColor : "rgba(220,220,220,1)",
- pointColor : "rgba(220,220,220,1)",
- pointStrokeColor : "#EEE",
+ barStrokeWidth: 1,
+ barValueSpacing: 1,
+ barDatasetSpacing: 1,
data : #{@commits_per_time.values.to_json}
}]
}
ctx = $("#hour-chart").get(0).getContext("2d");
- new Chart(ctx).Line(data,{"scaleOverlay": true, responsive: true, pointHitDetectionRadius: 2})
+ new Chart(ctx).Bar(data,{"scaleOverlay": true, responsive: true, pointHitDetectionRadius: 2})
data = {
labels : #{@commits_per_week_days.keys.to_json},
datasets : [{
fillColor : "rgba(220,220,220,0.5)",
strokeColor : "rgba(220,220,220,1)",
- pointColor : "rgba(220,220,220,1)",
- pointStrokeColor : "#EEE",
+ barStrokeWidth: 1,
+ barValueSpacing: 1,
+ barDatasetSpacing: 1,
data : #{@commits_per_week_days.values.to_json}
}]
}
ctx = $("#weekday-chart").get(0).getContext("2d");
- new Chart(ctx).Line(data,{"scaleOverlay": true, responsive: true, pointHitDetectionRadius: 2})
+ new Chart(ctx).Bar(data,{"scaleOverlay": true, responsive: true, pointHitDetectionRadius: 2})
data = {
labels : #{@commits_per_month.keys.to_json},
datasets : [{
fillColor : "rgba(220,220,220,0.5)",
strokeColor : "rgba(220,220,220,1)",
- pointColor : "rgba(220,220,220,1)",
- pointStrokeColor : "#EEE",
+ barStrokeWidth: 1,
+ barValueSpacing: 1,
+ barDatasetSpacing: 1,
data : #{@commits_per_month.values.to_json}
}]
}
ctx = $("#month-chart").get(0).getContext("2d");
- new Chart(ctx).Line(data, {"scaleOverlay": true, responsive: true, pointHitDetectionRadius: 2})
+ new Chart(ctx).Bar(data, {"scaleOverlay": true, responsive: true, pointHitDetectionRadius: 2})
diff --git a/app/views/projects/hooks/index.html.haml b/app/views/projects/hooks/index.html.haml
index eadbf61fdd4..85dbfd67862 100644
--- a/app/views/projects/hooks/index.html.haml
+++ b/app/views/projects/hooks/index.html.haml
@@ -55,6 +55,13 @@
%strong Merge Request events
%p.light
This url will be triggered when a merge request is created
+ .form-group
+ = f.label :enable_ssl_verification, "SSL verification", class: 'control-label checkbox'
+ .col-sm-10
+ .checkbox
+ = f.label :enable_ssl_verification do
+ = f.check_box :enable_ssl_verification
+ %strong Enable SSL verification
.form-actions
= f.submit "Add Web Hook", class: "btn btn-create"
@@ -74,3 +81,4 @@
- %w(push_events tag_push_events issues_events note_events merge_requests_events).each do |trigger|
- if hook.send(trigger)
%span.label.label-gray= trigger.titleize
+ SSL Verification: #{hook.enable_ssl_verification ? "enabled" : "disabled"}
diff --git a/app/views/projects/merge_requests/_show.html.haml b/app/views/projects/merge_requests/_show.html.haml
index 007f6c6a787..ec1838eb489 100644
--- a/app/views/projects/merge_requests/_show.html.haml
+++ b/app/views/projects/merge_requests/_show.html.haml
@@ -1,4 +1,7 @@
- page_title "#{@merge_request.title} (##{@merge_request.iid})", "Merge Requests"
+- if params[:view] == 'parallel'
+ - fluid_layout true
+
.merge-request{'data-url' => merge_request_path(@merge_request)}
.merge-request-details.issuable-details
= render "projects/merge_requests/show/mr_title"
diff --git a/app/views/projects/snippets/_snippet.html.haml b/app/views/projects/snippets/_snippet.html.haml
deleted file mode 100644
index b2c35edc44c..00000000000
--- a/app/views/projects/snippets/_snippet.html.haml
+++ /dev/null
@@ -1,15 +0,0 @@
-%li
- %h4.snippet-title
- = link_to reliable_snippet_path(snippet) do
- = truncate(snippet.title, length: 60)
- %span.cgray.monospace.tiny.pull-right
- = snippet.file_name
-
- .snippet-info
- = "##{snippet.id}"
- %span
- by
- = image_tag avatar_icon(snippet.author_email), class: "avatar avatar-inline s16"
- = snippet.author_name
- %span.light
- #{time_ago_with_tooltip(snippet.created_at)}
diff --git a/app/views/projects/snippets/index.html.haml b/app/views/projects/snippets/index.html.haml
index 30081673ffc..45d4de6a385 100644
--- a/app/views/projects/snippets/index.html.haml
+++ b/app/views/projects/snippets/index.html.haml
@@ -8,9 +8,8 @@
%p.light
Share code pastes with others out of git repository
-%hr
%ul.bordered-list
- = render partial: "projects/snippets/snippet", collection: @snippets
+ = render partial: "shared/snippets/snippet", collection: @snippets
- if @snippets.empty?
%li
.nothing-here-block Nothing here.
diff --git a/app/views/search/_category.html.haml b/app/views/search/_category.html.haml
index a75cd7bd809..d637abfa76b 100644
--- a/app/views/search/_category.html.haml
+++ b/app/views/search/_category.html.haml
@@ -1,4 +1,4 @@
-%ul.nav.nav-pills.search-filter
+%ul.nav.nav-tabs.search-filter
- if @project
%li{class: ("active" if @scope == 'blobs')}
= link_to search_filter_path(scope: 'blobs') do
diff --git a/app/views/search/_filter.html.haml b/app/views/search/_filter.html.haml
index e2d0cab9e79..ec478a5963d 100644
--- a/app/views/search/_filter.html.haml
+++ b/app/views/search/_filter.html.haml
@@ -1,6 +1,5 @@
.dropdown.inline
- %button.dropdown-toggle.btn.btn{type: 'button', 'data-toggle' => 'dropdown'}
- %i.fa.fa-tags
+ %button.dropdown-toggle.btn.btn-sm{type: 'button', 'data-toggle' => 'dropdown'}
%span.light Group:
- if @group.present?
%strong= @group.name
@@ -17,8 +16,7 @@
= group.name
.dropdown.inline.prepend-left-10.project-filter
- %button.dropdown-toggle.btn.btn{type: 'button', 'data-toggle' => 'dropdown'}
- %i.fa.fa-tags
+ %button.dropdown-toggle.btn.btn-sm{type: 'button', 'data-toggle' => 'dropdown'}
%span.light Project:
- if @project.present?
%strong= @project.name_with_namespace
diff --git a/app/views/search/_form.html.haml b/app/views/search/_form.html.haml
index 5ee70be1ad6..3938c545cad 100644
--- a/app/views/search/_form.html.haml
+++ b/app/views/search/_form.html.haml
@@ -1,12 +1,14 @@
-= form_tag search_path, method: :get, class: 'form-inline' do |f|
+= form_tag search_path, method: :get do |f|
= hidden_field_tag :project_id, params[:project_id]
= hidden_field_tag :group_id, params[:group_id]
= hidden_field_tag :snippets, params[:snippets]
= hidden_field_tag :scope, params[:scope]
+
.search-holder.clearfix
- .form-group
+ .input-group
= search_field_tag :search, params[:search], placeholder: "Search for projects, issues etc", class: "form-control search-text-input", id: "dashboard_search", autofocus: true
- = button_tag 'Search', class: "btn btn-primary"
+ %span.input-group-btn
+ = button_tag 'Search', class: "btn btn-primary"
- unless params[:snippets].eql? 'true'
- .pull-right
- = render 'filter'
+ %br
+ = render 'filter'
diff --git a/app/views/search/_results.html.haml b/app/views/search/_results.html.haml
index 741c780ad96..2a38c98dcfc 100644
--- a/app/views/search/_results.html.haml
+++ b/app/views/search/_results.html.haml
@@ -1,7 +1,7 @@
- if @search_results.empty?
= render partial: "search/results/empty"
- else
- .light
+ %p.light
Search results for
%code
= @search_term
@@ -11,10 +11,13 @@
- elsif @group
in group #{link_to @group.name, @group}
- %br
.results.prepend-top-10
.search-results
- = render partial: "search/results/#{@scope.singularize}", collection: @objects
+ - if @scope == 'projects'
+ .term
+ = render 'shared/projects/list', projects: @objects
+ - else
+ = render partial: "search/results/#{@scope.singularize}", collection: @objects
= paginate @objects, theme: 'gitlab'
:javascript
diff --git a/app/views/search/results/_blob.html.haml b/app/views/search/results/_blob.html.haml
index 58f58eff54d..0fe8a3b490a 100644
--- a/app/views/search/results/_blob.html.haml
+++ b/app/views/search/results/_blob.html.haml
@@ -7,4 +7,4 @@
%strong
= blob.filename
.file-content.code.term
- = render 'shared/file_highlight', blob: blob, first_line_number: blob.startline, user_color_scheme_class: 'white'
+ = render 'shared/file_highlight', blob: blob, first_line_number: blob.startline
diff --git a/app/views/search/results/_project.html.haml b/app/views/search/results/_project.html.haml
deleted file mode 100644
index 195cf06c8ea..00000000000
--- a/app/views/search/results/_project.html.haml
+++ /dev/null
@@ -1,6 +0,0 @@
-.search-result-row
- %h4
- = link_to [project.namespace.becomes(Namespace), project] do
- %span.term= project.name_with_namespace
- - if project.description.present?
- %span.light.term= project.description
diff --git a/app/views/search/results/_snippet_blob.html.haml b/app/views/search/results/_snippet_blob.html.haml
index 95099853918..9a4f9fb9485 100644
--- a/app/views/search/results/_snippet_blob.html.haml
+++ b/app/views/search/results/_snippet_blob.html.haml
@@ -23,7 +23,7 @@
.nothing-here-block Empty file
- else
.file-content.code
- %div.highlighted-data{class: user_color_scheme_class}
+ %div.highlighted-data{ class: user_color_scheme }
.line-numbers
- snippet_blob[:snippet_chunks].each do |snippet|
- unless snippet[:data].empty?
diff --git a/app/views/search/results/_wiki_blob.html.haml b/app/views/search/results/_wiki_blob.html.haml
index c03438eb952..f5859481d46 100644
--- a/app/views/search/results/_wiki_blob.html.haml
+++ b/app/views/search/results/_wiki_blob.html.haml
@@ -7,4 +7,4 @@
%strong
= wiki_blob.filename
.file-content.code.term
- = render 'shared/file_highlight', blob: wiki_blob, first_line_number: wiki_blob.startline, user_color_scheme_class: 'white'
+ = render 'shared/file_highlight', blob: wiki_blob, first_line_number: wiki_blob.startline
diff --git a/app/views/search/show.html.haml b/app/views/search/show.html.haml
index 60f9e9ac9de..f4f3dcfc29f 100644
--- a/app/views/search/show.html.haml
+++ b/app/views/search/show.html.haml
@@ -1,7 +1,5 @@
- page_title @search_term
= render 'search/form'
-%hr
- if @search_term
= render 'search/category'
- %hr
= render 'search/results'
diff --git a/app/views/shared/_file_highlight.html.haml b/app/views/shared/_file_highlight.html.haml
index d6a2e177da1..57c3aff3e18 100644
--- a/app/views/shared/_file_highlight.html.haml
+++ b/app/views/shared/_file_highlight.html.haml
@@ -1,4 +1,4 @@
-.file-content.code{class: user_color_scheme_class}
+.file-content.code.js-syntax-highlight{ class: user_color_scheme }
.line-numbers
- if blob.data.present?
- blob.data.lines.each_index do |index|
diff --git a/app/views/shared/_project.html.haml b/app/views/shared/_project.html.haml
deleted file mode 100644
index 15df97b1333..00000000000
--- a/app/views/shared/_project.html.haml
+++ /dev/null
@@ -1,20 +0,0 @@
-= cache [project.namespace, project, controller.controller_name, controller.action_name] do
- = link_to project_path(project), class: dom_class(project) do
- - if avatar
- .dash-project-avatar
- = project_icon(project, alt: '', class: 'avatar project-avatar s40')
- %span.str-truncated.project-full-name
- %span.namespace-name
- - if project.namespace
- = project.namespace.human_name
- \/
- %span.project-name.filter-title
- = project.name
- - if stars
- %span.pull-right.light
- %i.fa.fa-star
- = project.star_count
- - if project.description.present?
- .project-description
- .str-truncated
- = markdown(project.description, pipeline: :description)
diff --git a/app/views/shared/_projects_list.html.haml b/app/views/shared/_projects_list.html.haml
deleted file mode 100644
index 4c58092af44..00000000000
--- a/app/views/shared/_projects_list.html.haml
+++ /dev/null
@@ -1,17 +0,0 @@
-- projects_limit = 20 unless local_assigns[:projects_limit]
-- avatar = true unless local_assigns[:avatar] == false
-- stars = false unless local_assigns[:stars] == true
-%ul.well-list.projects-list
- - projects.each_with_index do |project, i|
- %li{class: (i >= projects_limit) ? 'project-row hide' : 'project-row'}
- = render "shared/project", project: project, avatar: avatar, stars: stars
- - if projects.blank?
- %li
- .nothing-here-block There are no projects here.
- - if projects.count > projects_limit
- %li.bottom
- %span.light
- #{projects_limit} of #{pluralize(projects.count, 'project')} displayed.
- %span
- = link_to '#', class: 'js-expand' do
- Show all
diff --git a/app/views/shared/groups/_group.html.haml b/app/views/shared/groups/_group.html.haml
new file mode 100644
index 00000000000..229ae359bc5
--- /dev/null
+++ b/app/views/shared/groups/_group.html.haml
@@ -0,0 +1,24 @@
+- group_member = local_assigns[:group_member]
+%li
+ - if group_member
+ .pull-right.hidden-xs
+ - if can?(current_user, :admin_group, group)
+ = link_to edit_group_path(group), class: "btn-sm btn btn-grouped" do
+ %i.fa.fa-cogs
+ Settings
+
+ = link_to leave_group_group_members_path(group), data: { confirm: leave_group_message(group.name) }, method: :delete, class: "btn-sm btn btn-grouped", title: 'Leave this group' do
+ %i.fa.fa-sign-out
+ Leave
+
+ = image_tag group_icon(group), class: "avatar s40 avatar-tile hidden-xs"
+ = link_to group, class: 'group-name' do
+ %strong= group.name
+
+ - if group_member
+ as
+ %strong #{group_member.human_access}
+
+ %div.light
+ #{pluralize(group.projects.count, "project")}, #{pluralize(group.users.count, "user")}
+
diff --git a/app/views/shared/projects/_list.html.haml b/app/views/shared/projects/_list.html.haml
new file mode 100644
index 00000000000..021e3b689a1
--- /dev/null
+++ b/app/views/shared/projects/_list.html.haml
@@ -0,0 +1,19 @@
+- projects_limit = 20 unless local_assigns[:projects_limit]
+- avatar = true unless local_assigns[:avatar] == false
+- stars = true unless local_assigns[:stars] == false
+
+%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
+
+ - if projects.count > projects_limit
+ %li.bottom.center
+ .light
+ #{projects_limit} of #{pluralize(projects.count, 'project')} displayed.
+ = link_to '#', class: 'js-expand' do
+ Show all
+
+:coffeescript
+ new ProjectsList()
diff --git a/app/views/shared/projects/_project.html.haml b/app/views/shared/projects/_project.html.haml
new file mode 100644
index 00000000000..4bfdf4d55ff
--- /dev/null
+++ b/app/views/shared/projects/_project.html.haml
@@ -0,0 +1,23 @@
+- avatar = true unless local_assigns[:avatar] == false
+- stars = true unless local_assigns[:stars] == false
+- css_class = nil unless local_assigns[:css_class]
+%li.project-row{ class: css_class }
+ = cache [project.namespace, project, controller.controller_name, controller.action_name, 'v2'] do
+ = link_to project_path(project), class: dom_class(project) do
+ - if avatar
+ .dash-project-avatar
+ = project_icon(project, alt: '', class: 'avatar project-avatar s40')
+ %span.project-full-name
+ %span.namespace-name
+ - if project.namespace
+ = project.namespace.human_name
+ \/
+ %span.project-name.filter-title
+ = project.name
+ - if stars
+ %span.pull-right.light
+ %i.fa.fa-star
+ = project.star_count
+ - if project.description.present?
+ .project-description
+ = markdown(project.description, pipeline: :description)
diff --git a/app/views/snippets/_snippet.html.haml b/app/views/shared/snippets/_snippet.html.haml
index 5bb28664349..69a713ad9aa 100644
--- a/app/views/snippets/_snippet.html.haml
+++ b/app/views/shared/snippets/_snippet.html.haml
@@ -1,12 +1,12 @@
-%li
- %h4.snippet-title
+%li.snippet-row
+ .snippet-title
= link_to reliable_snippet_path(snippet) do
= truncate(snippet.title, length: 60)
- if snippet.private?
%span.label.label-gray
%i.fa.fa-lock
private
- %span.cgray.monospace.tiny.pull-right
+ %span.monospace.pull-right
= snippet.file_name
%small.pull-right.cgray
@@ -14,10 +14,8 @@
= link_to snippet.project.name_with_namespace, namespace_project_path(snippet.project.namespace, snippet.project)
.snippet-info
- = "##{snippet.id}"
- %span
- by
- = link_to user_snippets_path(snippet.author) do
- = image_tag avatar_icon(snippet.author_email), class: "avatar avatar-inline s16", alt: ''
- = snippet.author_name
- %span.light #{time_ago_with_tooltip(snippet.created_at)}
+ = link_to user_snippets_path(snippet.author) do
+ = image_tag avatar_icon(snippet.author_email), class: "avatar s24", alt: ''
+ = snippet.author_name
+ authored #{time_ago_with_tooltip(snippet.created_at)}
+
diff --git a/app/views/snippets/_snippets.html.haml b/app/views/snippets/_snippets.html.haml
index 40df42b6cf5..d9aa4dd1d2e 100644
--- a/app/views/snippets/_snippets.html.haml
+++ b/app/views/snippets/_snippets.html.haml
@@ -1,5 +1,5 @@
%ul.bordered-list
- = render partial: 'snippet', collection: @snippets
+ = render partial: 'shared/snippets/snippet', collection: @snippets
- if @snippets.empty?
%li
.nothing-here-block Nothing here.
diff --git a/app/views/users/_projects.html.haml b/app/views/users/_projects.html.haml
index 297fa537394..a126a858ea8 100644
--- a/app/views/users/_projects.html.haml
+++ b/app/views/users/_projects.html.haml
@@ -1,13 +1,13 @@
- if local_assigns.has_key?(:contributed_projects) && contributed_projects.present?
.panel.panel-default.contributed-projects
.panel-heading Projects contributed to
- = render 'shared/projects_list',
+ = render 'shared/projects/list',
projects: contributed_projects.sort_by(&:star_count).reverse,
projects_limit: 5, stars: true, avatar: false
- if local_assigns.has_key?(:projects) && projects.present?
.panel.panel-default
.panel-heading Personal projects
- = render 'shared/projects_list',
+ = render 'shared/projects/list',
projects: projects.sort_by(&:star_count).reverse,
projects_limit: 10, stars: true, avatar: false
diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml
index 64b7f25ad37..aa4e8722fb1 100644
--- a/app/views/users/show.html.haml
+++ b/app/views/users/show.html.haml
@@ -7,7 +7,7 @@
= render 'shared/show_aside'
.row
- %section.col-md-8
+ %section.col-md-7
.header-with-avatar
= link_to avatar_icon(@user.email, 400), target: '_blank' do
= image_tag avatar_icon(@user.email, 90), class: "avatar avatar-tile s90", alt: ''
@@ -59,7 +59,7 @@
.content_list
= spinner
- %aside.col-md-4
+ %aside.col-md-5
= render 'profile', user: @user
= render 'projects', projects: @projects, contributed_projects: @contributed_projects
diff --git a/app/workers/merge_worker.rb b/app/workers/merge_worker.rb
index 6a8665c179a..5d1a8555b7d 100644
--- a/app/workers/merge_worker.rb
+++ b/app/workers/merge_worker.rb
@@ -14,6 +14,10 @@ class MergeWorker
if result[:status] == :success && params[:should_remove_source_branch].present?
DeleteBranchService.new(merge_request.source_project, current_user).
execute(merge_request.source_branch)
+
+ merge_request.source_project.repository.expire_branch_names
end
+
+ result
end
end
diff --git a/bin/daemon_with_pidfile b/bin/daemon_with_pidfile
new file mode 100755
index 00000000000..f138c27a0e2
--- /dev/null
+++ b/bin/daemon_with_pidfile
@@ -0,0 +1,33 @@
+#!/usr/bin/env ruby
+# daemon_with_pidfile
+#
+# Daemonize, write a pidfile, and exec the remainder of the command line.
+
+def main(pidfile, cmd)
+ if middle_pid = Process.fork
+ # outer process
+ # Do not exit the outer process before the middle process finishes
+ Process.waitpid(middle_pid)
+ exit $?.exitstatus
+ end
+
+ if final_pid = Process.fork
+ # middle process
+ open(pidfile, 'w') { |f| f.puts final_pid }
+ exit
+ end
+
+ # Standard daemon things: become session leader, ignore SIGHUP, close stdin.
+ Signal.trap("HUP", "IGNORE")
+ Process.setsid
+ IO.new(0).close
+
+ exec(*cmd)
+end
+
+if ARGV.count < 2
+ abort "Usage: #$0 pidfile command [args...]"
+end
+
+pidfile = ARGV.shift
+main(pidfile, ARGV)
diff --git a/bin/mail_room b/bin/mail_room
index f4f1a170c04..74a84f5b2b4 100755
--- a/bin/mail_room
+++ b/bin/mail_room
@@ -19,9 +19,7 @@ get_mail_room_pid()
start()
{
- bundle exec mail_room -q -c $mail_room_config >> $mail_room_logfile 2>&1 &
- PID=$!
- echo $PID > $mail_room_pidfile
+ bin/daemon_with_pidfile $mail_room_pidfile bundle exec mail_room -q -c $mail_room_config >> $mail_room_logfile 2>&1
}
stop()
diff --git a/config/initializers/doorkeeper.rb b/config/initializers/doorkeeper.rb
index 6139ddbe6cd..66ac88e9f4a 100644
--- a/config/initializers/doorkeeper.rb
+++ b/config/initializers/doorkeeper.rb
@@ -12,8 +12,7 @@ Doorkeeper.configure do
end
resource_owner_from_credentials do |routes|
- u = User.find_by(email: params[:username]) || User.find_by(username: params[:username])
- u if u && u.valid_password?(params[:password])
+ Gitlab::Auth.new.find(params[:username], params[:password])
end
# If you want to restrict access to the web interface for adding oauth authorized applications, you need to declare the block below.
diff --git a/db/migrate/20150817163600_deduplicate_user_identities.rb b/db/migrate/20150817163600_deduplicate_user_identities.rb
new file mode 100644
index 00000000000..fab669c2905
--- /dev/null
+++ b/db/migrate/20150817163600_deduplicate_user_identities.rb
@@ -0,0 +1,14 @@
+class DeduplicateUserIdentities < ActiveRecord::Migration
+ def change
+ execute 'DROP TABLE IF EXISTS tt_migration_DeduplicateUserIdentities;'
+ execute 'CREATE TEMPORARY TABLE tt_migration_DeduplicateUserIdentities AS SELECT id,provider,user_id FROM identities;'
+ execute 'DELETE FROM identities WHERE id NOT IN ( SELECT MIN(id) FROM tt_migration_DeduplicateUserIdentities GROUP BY user_id, provider);'
+ execute 'DROP TABLE IF EXISTS tt_migration_DeduplicateUserIdentities;'
+ end
+
+ def down
+ # This is an irreversible migration;
+ # If someone is trying to rollback for other reasons, we should not throw an Exception.
+ # raise ActiveRecord::IrreversibleMigration
+ end
+end
diff --git a/db/migrate/20150824002011_add_enable_ssl_verification.rb b/db/migrate/20150824002011_add_enable_ssl_verification.rb
new file mode 100644
index 00000000000..093c068fbde
--- /dev/null
+++ b/db/migrate/20150824002011_add_enable_ssl_verification.rb
@@ -0,0 +1,5 @@
+class AddEnableSslVerification < ActiveRecord::Migration
+ def change
+ add_column :web_hooks, :enable_ssl_verification, :boolean, default: false
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 108c48bf321..7ee1c6e2146 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 20150818213832) do
+ActiveRecord::Schema.define(version: 20150824002011) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -566,13 +566,14 @@ ActiveRecord::Schema.define(version: 20150818213832) do
t.integer "project_id"
t.datetime "created_at"
t.datetime "updated_at"
- t.string "type", default: "ProjectHook"
+ t.string "type", default: "ProjectHook"
t.integer "service_id"
- t.boolean "push_events", default: true, null: false
- t.boolean "issues_events", default: false, null: false
- t.boolean "merge_requests_events", default: false, null: false
- t.boolean "tag_push_events", default: false
- t.boolean "note_events", default: false, null: false
+ t.boolean "push_events", default: true, null: false
+ t.boolean "issues_events", default: false, null: false
+ t.boolean "merge_requests_events", default: false, null: false
+ t.boolean "tag_push_events", default: false
+ t.boolean "note_events", default: false, null: false
+ t.boolean "enable_ssl_verification", default: false
end
add_index "web_hooks", ["created_at", "id"], name: "index_web_hooks_on_created_at_and_id", using: :btree
diff --git a/doc/workflow/importing/README.md b/doc/workflow/importing/README.md
index cd98d1b9852..5cde90993d2 100644
--- a/doc/workflow/importing/README.md
+++ b/doc/workflow/importing/README.md
@@ -8,5 +8,5 @@
### Note
* If you'd like to migrate from a self-hosted GitLab instance to GitLab.com, you can copy your repos by changing the remote and pushing to the new server; but issues and merge requests can't be imported.
-* Repositories are imported to GitLab via HTTP.
-If the repository is too large, it can timeout. We have a soft limit of 10GB.
+* You can import any Git repository via HTTP from the New Project page.
+If the repository is too large, it can timeout.
diff --git a/doc/workflow/importing/import_projects_from_github.md b/doc/workflow/importing/import_projects_from_github.md
index 3efa92cb868..2d77c6d1172 100644
--- a/doc/workflow/importing/import_projects_from_github.md
+++ b/doc/workflow/importing/import_projects_from_github.md
@@ -17,4 +17,4 @@ If you want to import from a GitHub Enterprise instance, you need to use GitLab
* To import a project, you can simple click "Add". The importer will import your repository and issues. Once the importer is done, a new GitLab project will be created with your imported data.
### Note
-When you import your projects from GitHub, it is not possible to keep your labels and milestones and issue numbers won't match. We are working on improving this in the near future.
+When you import your projects from GitHub, it is not possible to keep your labels and milestones. We are working on improving this in the near future.
diff --git a/features/admin/hooks.feature b/features/admin/hooks.feature
new file mode 100644
index 00000000000..5ca332d9f1c
--- /dev/null
+++ b/features/admin/hooks.feature
@@ -0,0 +1,9 @@
+@admin
+Feature: Admin Hooks
+ Background:
+ Given I sign in as an admin
+
+ Scenario: On Admin Hooks
+ Given I visit admin hooks page
+ Then I submit the form with enabled SSL verification
+ And I see new hook with enabled SSL verification \ No newline at end of file
diff --git a/features/project/hooks.feature b/features/project/hooks.feature
index 1a60846a23e..627738004c4 100644
--- a/features/project/hooks.feature
+++ b/features/project/hooks.feature
@@ -13,6 +13,11 @@ Feature: Project Hooks
When I submit new hook
Then I should see newly created hook
+ Scenario: I add new hook with SSL verification enabled
+ Given I visit project hooks page
+ When I submit new hook with SSL verification enabled
+ Then I should see newly created hook with SSL verification enabled
+
Scenario: I test hook
Given project has hook
And I visit project hooks page
diff --git a/features/steps/admin/hooks.rb b/features/steps/admin/hooks.rb
new file mode 100644
index 00000000000..541e25fcb70
--- /dev/null
+++ b/features/steps/admin/hooks.rb
@@ -0,0 +1,15 @@
+class Spinach::Features::AdminHooks < Spinach::FeatureSteps
+ include SharedAuthentication
+ include SharedPaths
+ include SharedAdmin
+
+ step "I submit the form with enabled SSL verification" do
+ fill_in 'hook_url', with: 'http://google.com'
+ check "Enable SSL verification"
+ click_on "Add System Hook"
+ end
+
+ step "I see new hook with enabled SSL verification" do
+ expect(page).to have_content "SSL Verification: enabled"
+ end
+end
diff --git a/features/steps/project/hooks.rb b/features/steps/project/hooks.rb
index 04e3bf78ede..df4a23a3716 100644
--- a/features/steps/project/hooks.rb
+++ b/features/steps/project/hooks.rb
@@ -28,11 +28,24 @@ class Spinach::Features::ProjectHooks < Spinach::FeatureSteps
expect { click_button "Add Web Hook" }.to change(ProjectHook, :count).by(1)
end
+ step 'I submit new hook with SSL verification enabled' do
+ @url = FFaker::Internet.uri("http")
+ fill_in "hook_url", with: @url
+ check "hook_enable_ssl_verification"
+ expect { click_button "Add Web Hook" }.to change(ProjectHook, :count).by(1)
+ end
+
step 'I should see newly created hook' do
expect(current_path).to eq namespace_project_hooks_path(current_project.namespace, current_project)
expect(page).to have_content(@url)
end
+ step 'I should see newly created hook with SSL verification enabled' do
+ expect(current_path).to eq namespace_project_hooks_path(current_project.namespace, current_project)
+ expect(page).to have_content(@url)
+ expect(page).to have_content("SSL Verification: enabled")
+ end
+
step 'I click test hook button' do
stub_request(:post, @hook.url).to_return(status: 200)
click_link 'Test Hook'
diff --git a/features/user.feature b/features/user.feature
index 69618e929c4..35eae842e77 100644
--- a/features/user.feature
+++ b/features/user.feature
@@ -14,11 +14,6 @@ Feature: User
And I should not see project "Internal"
And I should see project "Community"
- Scenario: I visit user "John Doe" page while not signed in when he is not authorized to a public project
- Given "John Doe" owns internal project "Internal"
- When I visit user "John Doe" page
- Then I should be redirected to sign in page
-
# Signed in as someone else
Scenario: I visit user "John Doe" page while signed in as someone else when he owns a public project
diff --git a/lib/gitlab/color_schemes.rb b/lib/gitlab/color_schemes.rb
new file mode 100644
index 00000000000..9c4664df903
--- /dev/null
+++ b/lib/gitlab/color_schemes.rb
@@ -0,0 +1,67 @@
+module Gitlab
+ # Module containing GitLab's syntax color scheme definitions and helper
+ # methods for accessing them.
+ module ColorSchemes
+ # Struct class representing a single Scheme
+ Scheme = Struct.new(:id, :name, :css_class)
+
+ SCHEMES = [
+ Scheme.new(1, 'White', 'white'),
+ Scheme.new(2, 'Dark', 'dark'),
+ Scheme.new(3, 'Solarized Light', 'solarized-light'),
+ Scheme.new(4, 'Solarized Dark', 'solarized-dark'),
+ Scheme.new(5, 'Monokai', 'monokai')
+ ].freeze
+
+ # Convenience method to get a space-separated String of all the color scheme
+ # classes that might be applied to a code block.
+ #
+ # Returns a String
+ def self.body_classes
+ SCHEMES.collect(&:css_class).uniq.join(' ')
+ end
+
+ # Get a Scheme by its ID
+ #
+ # If the ID is invalid, returns the default Scheme.
+ #
+ # id - Integer ID
+ #
+ # Returns a Scheme
+ def self.by_id(id)
+ SCHEMES.detect { |s| s.id == id } || default
+ end
+
+ # Returns the number of defined Schemes
+ def self.count
+ SCHEMES.size
+ end
+
+ # Get the default Scheme
+ #
+ # Returns a Scheme
+ def self.default
+ by_id(1)
+ end
+
+ # Iterate through each Scheme
+ #
+ # Yields the Scheme object
+ def self.each(&block)
+ SCHEMES.each(&block)
+ end
+
+ # Get the Scheme for the specified user, or the default
+ #
+ # user - User record
+ #
+ # Returns a Scheme
+ def self.for_user(user)
+ if user
+ by_id(user.color_scheme_id)
+ else
+ default
+ end
+ end
+ end
+end
diff --git a/lib/gitlab/current_settings.rb b/lib/gitlab/current_settings.rb
index 1a2a50a14d0..7ad3ed8728f 100644
--- a/lib/gitlab/current_settings.rb
+++ b/lib/gitlab/current_settings.rb
@@ -4,7 +4,7 @@ module Gitlab
key = :current_application_settings
RequestStore.store[key] ||= begin
- if ActiveRecord::Base.connected? && ActiveRecord::Base.connection.table_exists?('application_settings')
+ if ActiveRecord::Base.connection.active? && ActiveRecord::Base.connection.table_exists?('application_settings')
ApplicationSetting.current || ApplicationSetting.create_from_defaults
else
fake_application_settings
diff --git a/lib/gitlab/ldap/user.rb b/lib/gitlab/ldap/user.rb
index f7f3ba9ad7d..04a22237478 100644
--- a/lib/gitlab/ldap/user.rb
+++ b/lib/gitlab/ldap/user.rb
@@ -44,9 +44,14 @@ module Gitlab
gl_user.skip_reconfirmation!
gl_user.email = auth_hash.email
- # Build new identity only if we dont have have same one
- gl_user.identities.find_or_initialize_by(provider: auth_hash.provider,
- extern_uid: auth_hash.uid)
+ # find_or_initialize_by doesn't update `gl_user.identities`, and isn't autosaved.
+ identity = gl_user.identities.find { |identity| identity.provider == auth_hash.provider }
+ identity ||= gl_user.identities.build(provider: auth_hash.provider)
+
+ # For a new user set extern_uid to the LDAP DN
+ # For an existing user with matching email but changed DN, update the DN.
+ # For an existing user with no change in DN, this line changes nothing.
+ identity.extern_uid = auth_hash.uid
gl_user
end
diff --git a/lib/gitlab/themes.rb b/lib/gitlab/themes.rb
index 5209df92795..83f91de810c 100644
--- a/lib/gitlab/themes.rb
+++ b/lib/gitlab/themes.rb
@@ -37,6 +37,11 @@ module Gitlab
THEMES.detect { |t| t.id == id } || default
end
+ # Returns the number of defined Themes
+ def self.count
+ THEMES.size
+ end
+
# Get the default Theme
#
# Returns a Theme
@@ -51,6 +56,19 @@ module Gitlab
THEMES.each(&block)
end
+ # Get the Theme for the specified user, or the default
+ #
+ # user - User record
+ #
+ # Returns a Theme
+ def self.for_user(user)
+ if user
+ by_id(user.theme_id)
+ else
+ default
+ end
+ end
+
private
def self.default_id
diff --git a/lib/redcarpet/render/gitlab_html.rb b/lib/redcarpet/render/gitlab_html.rb
index f57b56cbdf0..9cb8e91d6e3 100644
--- a/lib/redcarpet/render/gitlab_html.rb
+++ b/lib/redcarpet/render/gitlab_html.rb
@@ -4,9 +4,8 @@ class Redcarpet::Render::GitlabHTML < Redcarpet::Render::HTML
attr_reader :template
alias_method :h, :template
- def initialize(template, color_scheme, options = {})
+ def initialize(template, options = {})
@template = template
- @color_scheme = color_scheme
@options = options.dup
@options.reverse_merge!(
@@ -35,7 +34,7 @@ class Redcarpet::Render::GitlabHTML < Redcarpet::Render::HTML
end
formatter = Rouge::Formatters::HTMLGitlab.new(
- cssclass: "code highlight #{@color_scheme} #{lexer.tag}"
+ cssclass: "code highlight js-syntax-highlight #{lexer.tag}"
)
formatter.format(lexer.lex(code))
end
diff --git a/lib/support/init.d/gitlab b/lib/support/init.d/gitlab
index 41a2f254db6..457bd31e23b 100755
--- a/lib/support/init.d/gitlab
+++ b/lib/support/init.d/gitlab
@@ -288,7 +288,7 @@ print_status() {
fi
if [ "$mail_room_enabled" = true ]; then
if [ "$mail_room_status" = "0" ]; then
- echo "The GitLab MailRoom email processor with pid $spid is running."
+ echo "The GitLab MailRoom email processor with pid $mpid is running."
else
printf "The GitLab MailRoom email processor is \033[31mnot running\033[0m.\n"
fi
diff --git a/spec/features/markdown_spec.rb b/spec/features/markdown_spec.rb
index 3da4dfc2b23..4fe019f8342 100644
--- a/spec/features/markdown_spec.rb
+++ b/spec/features/markdown_spec.rb
@@ -64,8 +64,8 @@ describe 'GitLab Markdown', feature: true do
it 'parses fenced code blocks' do
aggregate_failures do
- expect(doc).to have_selector('pre.code.highlight.white.c')
- expect(doc).to have_selector('pre.code.highlight.white.python')
+ expect(doc).to have_selector('pre.code.highlight.js-syntax-highlight.c')
+ expect(doc).to have_selector('pre.code.highlight.js-syntax-highlight.python')
end
end
@@ -224,8 +224,4 @@ describe 'GitLab Markdown', feature: true do
def current_user
@feat.user
end
-
- def user_color_scheme_class
- :white
- end
end
diff --git a/spec/helpers/events_helper_spec.rb b/spec/helpers/events_helper_spec.rb
index da58ab98462..e68a5ec29ab 100644
--- a/spec/helpers/events_helper_spec.rb
+++ b/spec/helpers/events_helper_spec.rb
@@ -28,8 +28,7 @@ describe EventsHelper do
it 'should display the first line of a code block' do
input = "```\nCode block\nwith two lines\n```"
- expected = '<pre class="code highlight white plaintext"><code>' \
- 'Code block...</code></pre>'
+ expected = %r{<pre.+><code>Code block\.\.\.</code></pre>}
expect(event_note(input)).to match(expected)
end
@@ -55,7 +54,7 @@ describe EventsHelper do
it 'should preserve code color scheme' do
input = "```ruby\ndef test\n 'hello world'\nend\n```"
- expected = '<pre class="code highlight white ruby">' \
+ expected = '<pre class="code highlight js-syntax-highlight ruby">' \
"<code><span class=\"k\">def</span> <span class=\"nf\">test</span>\n" \
" <span class=\"s1\">\'hello world\'</span>\n" \
"<span class=\"k\">end</span>" \
diff --git a/spec/helpers/preferences_helper_spec.rb b/spec/helpers/preferences_helper_spec.rb
index d814b562113..06f69262b71 100644
--- a/spec/helpers/preferences_helper_spec.rb
+++ b/spec/helpers/preferences_helper_spec.rb
@@ -1,72 +1,82 @@
require 'spec_helper'
describe PreferencesHelper do
+ describe 'dashboard_choices' do
+ it 'raises an exception when defined choices may be missing' do
+ expect(User).to receive(:dashboards).and_return(foo: 'foo')
+ expect { helper.dashboard_choices }.to raise_error(RuntimeError)
+ end
+
+ it 'raises an exception when defined choices may be using the wrong key' do
+ expect(User).to receive(:dashboards).and_return(foo: 'foo', bar: 'bar')
+ expect { helper.dashboard_choices }.to raise_error(KeyError)
+ end
+
+ it 'provides better option descriptions' do
+ expect(helper.dashboard_choices).to match_array [
+ ['Your Projects (default)', 'projects'],
+ ['Starred Projects', 'stars']
+ ]
+ end
+ end
+
describe 'user_application_theme' do
context 'with a user' do
it "returns user's theme's css_class" do
- user = double('user', theme_id: 3)
- allow(self).to receive(:current_user).and_return(user)
- expect(user_application_theme).to eq 'ui_green'
+ stub_user(theme_id: 3)
+
+ expect(helper.user_application_theme).to eq 'ui_green'
end
it 'returns the default when id is invalid' do
- user = double('user', theme_id: Gitlab::Themes::THEMES.size + 5)
+ stub_user(theme_id: Gitlab::Themes.count + 5)
allow(Gitlab.config.gitlab).to receive(:default_theme).and_return(2)
- allow(self).to receive(:current_user).and_return(user)
- expect(user_application_theme).to eq 'ui_charcoal'
+ expect(helper.user_application_theme).to eq 'ui_charcoal'
end
end
context 'without a user' do
- before do
- allow(self).to receive(:current_user).and_return(nil)
- end
-
it 'returns the default theme' do
- expect(user_application_theme).to eq Gitlab::Themes.default.css_class
+ stub_user
+
+ expect(helper.user_application_theme).to eq Gitlab::Themes.default.css_class
end
end
end
- describe 'dashboard_choices' do
- it 'raises an exception when defined choices may be missing' do
- expect(User).to receive(:dashboards).and_return(foo: 'foo')
- expect { dashboard_choices }.to raise_error(RuntimeError)
- end
+ describe 'user_color_scheme' do
+ context 'with a user' do
+ it "returns user's scheme's css_class" do
+ allow(helper).to receive(:current_user).
+ and_return(double(color_scheme_id: 3))
- it 'raises an exception when defined choices may be using the wrong key' do
- expect(User).to receive(:dashboards).and_return(foo: 'foo', bar: 'bar')
- expect { dashboard_choices }.to raise_error(KeyError)
- end
+ expect(helper.user_color_scheme).to eq 'solarized-light'
+ end
- it 'provides better option descriptions' do
- expect(dashboard_choices).to match_array [
- ['Your Projects (default)', 'projects'],
- ['Starred Projects', 'stars']
- ]
+ it 'returns the default when id is invalid' do
+ allow(helper).to receive(:current_user).
+ and_return(double(color_scheme_id: Gitlab::ColorSchemes.count + 5))
+ end
end
- end
- describe 'user_color_scheme_class' do
- context 'with current_user is nil' do
- it 'should return a string' do
- allow(self).to receive(:current_user).and_return(nil)
- expect(user_color_scheme_class).to be_kind_of(String)
+ context 'without a user' do
+ it 'returns the default theme' do
+ stub_user
+
+ expect(helper.user_color_scheme).
+ to eq Gitlab::ColorSchemes.default.css_class
end
end
+ end
- context 'with a current_user' do
- (1..5).each do |color_scheme_id|
- context "with color_scheme_id == #{color_scheme_id}" do
- it 'should return a string' do
- current_user = double(color_scheme_id: color_scheme_id)
- allow(self).to receive(:current_user).and_return(current_user)
- expect(user_color_scheme_class).to be_kind_of(String)
- end
- end
- end
+ def stub_user(messages = {})
+ if messages.empty?
+ allow(helper).to receive(:current_user).and_return(nil)
+ else
+ allow(helper).to receive(:current_user).
+ and_return(double('user', messages))
end
end
end
diff --git a/spec/lib/gitlab/color_schemes_spec.rb b/spec/lib/gitlab/color_schemes_spec.rb
new file mode 100644
index 00000000000..c7be45dbcd3
--- /dev/null
+++ b/spec/lib/gitlab/color_schemes_spec.rb
@@ -0,0 +1,45 @@
+require 'spec_helper'
+
+describe Gitlab::ColorSchemes do
+ describe '.body_classes' do
+ it 'returns a space-separated list of class names' do
+ css = described_class.body_classes
+
+ expect(css).to include('white')
+ expect(css).to include(' solarized-light ')
+ expect(css).to include(' monokai')
+ end
+ end
+
+ describe '.by_id' do
+ it 'returns a scheme by its ID' do
+ expect(described_class.by_id(1).name).to eq 'White'
+ expect(described_class.by_id(4).name).to eq 'Solarized Dark'
+ end
+ end
+
+ describe '.default' do
+ it 'returns the default scheme' do
+ expect(described_class.default.id).to eq 1
+ end
+ end
+
+ describe '.each' do
+ it 'passes the block to the SCHEMES Array' do
+ ids = []
+ described_class.each { |scheme| ids << scheme.id }
+ expect(ids).not_to be_empty
+ end
+ end
+
+ describe '.for_user' do
+ it 'returns default when user is nil' do
+ expect(described_class.for_user(nil).id).to eq 1
+ end
+
+ it "returns user's preferred color scheme" do
+ user = double(color_scheme_id: 5)
+ expect(described_class.for_user(user).id).to eq 5
+ end
+ end
+end
diff --git a/spec/lib/gitlab/ldap/user_spec.rb b/spec/lib/gitlab/ldap/user_spec.rb
index 7cfca96f4e0..84d9fb54b61 100644
--- a/spec/lib/gitlab/ldap/user_spec.rb
+++ b/spec/lib/gitlab/ldap/user_spec.rb
@@ -47,6 +47,28 @@ describe Gitlab::LDAP::User do
expect(existing_user.ldap_identity.provider).to eql 'ldapmain'
end
+ it 'connects to existing ldap user if the extern_uid changes' do
+ existing_user = create(:omniauth_user, email: 'john@example.com', extern_uid: 'old-uid', provider: 'ldapmain')
+ expect{ ldap_user.save }.not_to change{ User.count }
+
+ existing_user.reload
+ expect(existing_user.ldap_identity.extern_uid).to eql 'my-uid'
+ expect(existing_user.ldap_identity.provider).to eql 'ldapmain'
+ expect(existing_user.id).to eql ldap_user.gl_user.id
+ end
+
+ it 'maintains an identity per provider' do
+ existing_user = create(:omniauth_user, email: 'john@example.com', provider: 'twitter')
+ expect(existing_user.identities.count).to eql(1)
+
+ ldap_user.save
+ expect(ldap_user.gl_user.identities.count).to eql(2)
+
+ # Expect that find_by provider only returns a single instance of an identity and not an Enumerable
+ expect(ldap_user.gl_user.identities.find_by(provider: 'twitter')).to be_instance_of Identity
+ expect(ldap_user.gl_user.identities.find_by(provider: auth_hash.provider)).to be_instance_of Identity
+ end
+
it "creates a new user if not found" do
expect{ ldap_user.save }.to change{ User.count }.by(1)
end
diff --git a/spec/lib/gitlab/themes_spec.rb b/spec/lib/gitlab/themes_spec.rb
index 9c6c3fd8104..e554458e41c 100644
--- a/spec/lib/gitlab/themes_spec.rb
+++ b/spec/lib/gitlab/themes_spec.rb
@@ -43,9 +43,6 @@ describe Gitlab::Themes do
ids = []
described_class.each { |theme| ids << theme.id }
expect(ids).not_to be_empty
-
- # TODO (rspeicher): RSpec 3.x
- # expect(described_class.each).to yield_with_arg(described_class::Theme)
end
end
end
diff --git a/spec/services/notification_service_spec.rb b/spec/services/notification_service_spec.rb
index 9da6c9dc949..8865335d0d1 100644
--- a/spec/services/notification_service_spec.rb
+++ b/spec/services/notification_service_spec.rb
@@ -31,13 +31,16 @@ describe NotificationService do
describe 'Notes' do
context 'issue note' do
- let(:project) { create(:empty_project, :public) }
+ let(:project) { create(:empty_project, :private) }
let(:issue) { create(:issue, project: project, assignee: create(:user)) }
let(:mentioned_issue) { create(:issue, assignee: issue.assignee) }
- let(:note) { create(:note_on_issue, noteable: issue, project_id: issue.project_id, note: '@mention referenced') }
+ let(:note) { create(:note_on_issue, noteable: issue, project_id: issue.project_id, note: '@mention referenced, @outsider also') }
before do
build_team(note.project)
+ project.team << [issue.author, :master]
+ project.team << [issue.assignee, :master]
+ project.team << [note.author, :master]
end
describe :new_note do
@@ -53,6 +56,7 @@ describe NotificationService do
should_not_email(@u_participating.id)
should_not_email(@u_disabled.id)
should_not_email(@unsubscriber.id)
+ should_not_email(@u_outsider_mentioned)
notification.new_note(note)
end
@@ -444,12 +448,15 @@ describe NotificationService do
@u_mentioned = create(:user, username: 'mention', notification_level: Notification::N_MENTION)
@u_committer = create(:user, username: 'committer')
@u_not_mentioned = create(:user, username: 'regular', notification_level: Notification::N_PARTICIPATING)
+ @u_outsider_mentioned = create(:user, username: 'outsider')
project.team << [@u_watcher, :master]
project.team << [@u_participating, :master]
+ project.team << [@u_participant_mentioned, :master]
project.team << [@u_disabled, :master]
project.team << [@u_mentioned, :master]
project.team << [@u_committer, :master]
+ project.team << [@u_not_mentioned, :master]
end
def add_users_with_subscription(project, issuable)
diff --git a/spec/workers/merge_worker_spec.rb b/spec/workers/merge_worker_spec.rb
new file mode 100644
index 00000000000..b11c5de94e3
--- /dev/null
+++ b/spec/workers/merge_worker_spec.rb
@@ -0,0 +1,28 @@
+require 'spec_helper'
+
+describe MergeWorker do
+ describe "remove source branch" do
+ let!(:merge_request) { create(:merge_request, source_branch: "markdown") }
+ let!(:source_project) { merge_request.source_project }
+ let!(:project) { merge_request.project }
+ let!(:author) { merge_request.author }
+
+ before do
+ source_project.team << [author, :master]
+ source_project.repository.expire_branch_names
+ end
+
+ it 'clears cache of source repo after removing source branch' do
+ expect(source_project.repository.branch_names).to include('markdown')
+
+ MergeWorker.new.perform(
+ merge_request.id, merge_request.author_id,
+ commit_message: 'wow such merge',
+ should_remove_source_branch: true)
+
+ merge_request.reload
+ expect(merge_request).to be_merged
+ expect(source_project.repository.branch_names).not_to include('markdown')
+ end
+ end
+end
diff --git a/spec/workers/post_receive_spec.rb b/spec/workers/post_receive_spec.rb
index 46eae9ab081..e4151b9bb6a 100644
--- a/spec/workers/post_receive_spec.rb
+++ b/spec/workers/post_receive_spec.rb
@@ -4,7 +4,7 @@ describe PostReceive do
let(:changes) { "123456 789012 refs/heads/tést\n654321 210987 refs/tags/tag" }
let(:wrongly_encoded_changes) { changes.encode("ISO-8859-1").force_encoding("UTF-8") }
let(:base64_changes) { Base64.encode64(wrongly_encoded_changes) }
-
+
context "as a resque worker" do
it "reponds to #perform" do
expect(PostReceive.new).to respond_to(:perform)