mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-12 06:06:05 +10:00
+1
-1
@@ -954,7 +954,7 @@ Lint/Void:
|
||||
|
||||
Rails/ActionFilter:
|
||||
Description: 'Enforces consistent use of action filter methods.'
|
||||
Enabled: false
|
||||
Enabled: true
|
||||
|
||||
Rails/DefaultScope:
|
||||
Description: 'Checks if the argument passed to default_scope is a block.'
|
||||
|
||||
@@ -3,14 +3,20 @@ Please view this file on the master branch, on stable branches it's out of date.
|
||||
v 7.11.0 (unreleased)
|
||||
- Fix clone URL field and X11 Primary selection (Dmitry Medvinsky)
|
||||
- Ignore invalid lines in .gitmodules
|
||||
- Fix "Cannot move project" error message from popping up after a successful transfer (Stan Hu)
|
||||
- Redirect to sign in page after signing out.
|
||||
-
|
||||
- Add "Reply quoting selected text" shortcut key (`r`)
|
||||
- Fix bug causing `@whatever` inside an issue's first code block to be picked up as a user mention.
|
||||
- Fix bug causing `@whatever` inside an inline code snippet (backtick-style) to be picked up as a user mention.
|
||||
-
|
||||
-
|
||||
-
|
||||
-
|
||||
-
|
||||
-
|
||||
-
|
||||
- Move snippets UI to fluid layout
|
||||
- Improve UI for sidebar. Increase separation between navigation and content
|
||||
- Improve new project command options (Ben Bodenmiller)
|
||||
- Prevent sending empty messages to HipChat (Chulki Lee)
|
||||
|
||||
v 7.10.0 (unreleased)
|
||||
- Ignore submodules that are defined in .gitmodules but are checked in as directories.
|
||||
@@ -38,7 +44,6 @@ v 7.10.0 (unreleased)
|
||||
- Allow HTML tags in Markdown input
|
||||
- Fix code unfold not working on Compare commits page (Stan Hu)
|
||||
- Fix generating SSH key fingerprints with OpenSSH 6.8. (Sašo Stanovnik)
|
||||
- Include missing events and fix save functionality in admin service template settings form (Stan Hu)
|
||||
- Fix "Import projects from" button to show the correct instructions (Stan Hu)
|
||||
- Fix dots in Wiki slugs causing errors (Stan Hu)
|
||||
- Make maximum attachment size configurable via Application Settings (Stan Hu)
|
||||
|
||||
@@ -42,7 +42,7 @@ gem "browser"
|
||||
gem "gitlab_git", '~> 7.1.10'
|
||||
|
||||
# Ruby/Rack Git Smart-HTTP Server Handler
|
||||
gem 'gitlab-grack', '~> 2.0.0.rc2', require: 'grack'
|
||||
gem 'gitlab-grack', '~> 2.0.2', require: 'grack'
|
||||
|
||||
# LDAP Auth
|
||||
gem 'gitlab_omniauth-ldap', '1.2.1', require: "omniauth-ldap"
|
||||
@@ -89,7 +89,7 @@ gem "six"
|
||||
gem "seed-fu"
|
||||
|
||||
# Markup pipeline for GitLab
|
||||
gem 'html-pipeline-gitlab', '~> 0.1'
|
||||
gem 'html-pipeline', '~> 1.11.0'
|
||||
|
||||
# Markdown to HTML
|
||||
gem "github-markup"
|
||||
@@ -144,7 +144,7 @@ gem "redis-rails"
|
||||
gem 'tinder', '~> 1.9.2'
|
||||
|
||||
# HipChat integration
|
||||
gem "hipchat", "~> 1.4.0"
|
||||
gem 'hipchat', '~> 1.5.0'
|
||||
|
||||
# Flowdock integration
|
||||
gem "gitlab-flowdock-git-hook", "~> 0.4.2"
|
||||
@@ -252,12 +252,13 @@ group :development, :test do
|
||||
# PhantomJS driver for Capybara
|
||||
gem 'poltergeist', '~> 1.5.1'
|
||||
|
||||
gem 'jasmine', '2.0.2'
|
||||
gem 'jasmine', '~> 2.2.0'
|
||||
gem 'jasmine-rails'
|
||||
|
||||
gem "spring", '~> 1.3.1'
|
||||
gem "spring-commands-rspec", '1.0.4'
|
||||
gem "spring-commands-spinach", '1.0.0'
|
||||
|
||||
|
||||
gem "byebug"
|
||||
end
|
||||
|
||||
|
||||
+19
-17
@@ -199,7 +199,7 @@ GEM
|
||||
gitlab-flowdock-git-hook (0.4.2.2)
|
||||
gitlab-grit (>= 2.4.1)
|
||||
multi_json
|
||||
gitlab-grack (2.0.0)
|
||||
gitlab-grack (2.0.2)
|
||||
rack (~> 1.5.1)
|
||||
gitlab-grit (2.7.2)
|
||||
charlock_holmes (~> 0.6)
|
||||
@@ -271,20 +271,15 @@ GEM
|
||||
hashie (2.1.2)
|
||||
highline (1.6.21)
|
||||
hike (1.2.3)
|
||||
hipchat (1.4.0)
|
||||
hipchat (1.5.0)
|
||||
httparty
|
||||
mimemagic
|
||||
hitimes (1.2.2)
|
||||
html-pipeline (1.11.0)
|
||||
activesupport (>= 2)
|
||||
nokogiri (~> 1.4)
|
||||
html-pipeline-gitlab (0.2.0)
|
||||
actionpack (~> 4)
|
||||
gitlab_emoji (~> 0.1)
|
||||
html-pipeline (~> 1.11.0)
|
||||
mime-types
|
||||
sanitize (~> 2.1)
|
||||
http_parser.rb (0.5.3)
|
||||
httparty (0.13.0)
|
||||
httparty (0.13.3)
|
||||
json (~> 1.8)
|
||||
multi_xml (>= 0.5.2)
|
||||
httpauth (0.2.1)
|
||||
@@ -292,12 +287,17 @@ GEM
|
||||
i18n (0.7.0)
|
||||
ice_cube (0.11.1)
|
||||
ice_nine (0.10.0)
|
||||
jasmine (2.0.2)
|
||||
jasmine-core (~> 2.0.0)
|
||||
jasmine (2.2.0)
|
||||
jasmine-core (~> 2.2)
|
||||
phantomjs
|
||||
rack (>= 1.2.1)
|
||||
rake
|
||||
jasmine-core (2.0.0)
|
||||
jasmine-core (2.2.0)
|
||||
jasmine-rails (0.10.8)
|
||||
jasmine-core (>= 1.3, < 3.0)
|
||||
phantomjs (>= 1.9)
|
||||
railties (>= 3.2.0)
|
||||
sprockets-rails
|
||||
jquery-atwho-rails (0.3.3)
|
||||
jquery-rails (3.1.0)
|
||||
railties (>= 3.0, < 5.0)
|
||||
@@ -329,6 +329,7 @@ GEM
|
||||
mime-types (>= 1.16, < 3)
|
||||
method_source (0.8.2)
|
||||
mime-types (1.25.1)
|
||||
mimemagic (0.3.0)
|
||||
mini_portile (0.6.1)
|
||||
minitest (5.3.5)
|
||||
mousetrap-rails (1.4.6)
|
||||
@@ -391,7 +392,7 @@ GEM
|
||||
parser (2.2.0.2)
|
||||
ast (>= 1.1, < 3.0)
|
||||
pg (0.15.1)
|
||||
phantomjs (1.9.2.0)
|
||||
phantomjs (1.9.8.0)
|
||||
poltergeist (1.5.1)
|
||||
capybara (~> 2.1)
|
||||
cliver (~> 0.3.1)
|
||||
@@ -700,7 +701,7 @@ DEPENDENCIES
|
||||
gemnasium-gitlab-service (~> 0.2)
|
||||
github-markup
|
||||
gitlab-flowdock-git-hook (~> 0.4.2)
|
||||
gitlab-grack (~> 2.0.0.rc2)
|
||||
gitlab-grack (~> 2.0.2)
|
||||
gitlab-linguist (~> 3.0.1)
|
||||
gitlab_emoji (~> 0.1)
|
||||
gitlab_git (~> 7.1.10)
|
||||
@@ -714,10 +715,11 @@ DEPENDENCIES
|
||||
guard-rspec
|
||||
guard-spinach
|
||||
haml-rails
|
||||
hipchat (~> 1.4.0)
|
||||
html-pipeline-gitlab (~> 0.1)
|
||||
hipchat (~> 1.5.0)
|
||||
html-pipeline (~> 1.11.0)
|
||||
httparty
|
||||
jasmine (= 2.0.2)
|
||||
jasmine (~> 2.2.0)
|
||||
jasmine-rails
|
||||
jquery-atwho-rails (~> 0.3.3)
|
||||
jquery-rails
|
||||
jquery-scrollto-rails
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
#= require shortcuts
|
||||
#= require shortcuts_navigation
|
||||
#= require shortcuts_dashboard_navigation
|
||||
#= require shortcuts_issueable
|
||||
#= require shortcuts_issuable
|
||||
#= require shortcuts_network
|
||||
#= require cal-heatmap
|
||||
#= require_tree .
|
||||
@@ -173,6 +173,7 @@ $ ->
|
||||
$(@).closest(".diff-file").find(".notes_holder").toggle()
|
||||
e.preventDefault()
|
||||
|
||||
$(document).off "click", '.js-confirm-danger'
|
||||
$(document).on "click", '.js-confirm-danger', (e) ->
|
||||
e.preventDefault()
|
||||
btn = $(e.target)
|
||||
|
||||
@@ -8,11 +8,13 @@ class @ConfirmDangerModal
|
||||
submit = $('.js-confirm-danger-submit')
|
||||
submit.disable()
|
||||
|
||||
$('.js-confirm-danger-input').off 'input'
|
||||
$('.js-confirm-danger-input').on 'input', ->
|
||||
if rstrip($(@).val()) is project_path
|
||||
submit.enable()
|
||||
else
|
||||
submit.disable()
|
||||
|
||||
$('.js-confirm-danger-submit').off 'click'
|
||||
$('.js-confirm-danger-submit').on 'click', =>
|
||||
@form.submit()
|
||||
|
||||
@@ -22,7 +22,7 @@ class Dispatcher
|
||||
shortcut_handler = new ShortcutsNavigation()
|
||||
when 'projects:issues:show'
|
||||
new Issue()
|
||||
shortcut_handler = new ShortcutsIssueable()
|
||||
shortcut_handler = new ShortcutsIssuable()
|
||||
new ZenMode()
|
||||
when 'projects:milestones:show'
|
||||
new Milestone()
|
||||
@@ -47,7 +47,7 @@ class Dispatcher
|
||||
new IssuableForm($('.merge-request-form'))
|
||||
when 'projects:merge_requests:show'
|
||||
new Diff()
|
||||
shortcut_handler = new ShortcutsIssueable()
|
||||
shortcut_handler = new ShortcutsIssuable()
|
||||
new ZenMode()
|
||||
when "projects:merge_requests:diffs"
|
||||
new Diff()
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
#= require jquery
|
||||
#= require mousetrap
|
||||
|
||||
#= require shortcuts_navigation
|
||||
|
||||
class @ShortcutsIssuable extends ShortcutsNavigation
|
||||
constructor: (isMergeRequest) ->
|
||||
super()
|
||||
Mousetrap.bind('a', ->
|
||||
$('.js-assignee').select2('open')
|
||||
return false
|
||||
)
|
||||
Mousetrap.bind('m', ->
|
||||
$('.js-milestone').select2('open')
|
||||
return false
|
||||
)
|
||||
Mousetrap.bind('r', =>
|
||||
@replyWithSelectedText()
|
||||
return false
|
||||
)
|
||||
|
||||
if isMergeRequest
|
||||
@enabledHelp.push('.hidden-shortcut.merge_requests')
|
||||
else
|
||||
@enabledHelp.push('.hidden-shortcut.issues')
|
||||
|
||||
replyWithSelectedText: ->
|
||||
if window.getSelection
|
||||
selected = window.getSelection().toString()
|
||||
replyField = $('.js-main-target-form #note_note')
|
||||
|
||||
return if selected.trim() == ""
|
||||
|
||||
# Put a '>' character before each non-empty line in the selection
|
||||
quote = _.map selected.split("\n"), (val) ->
|
||||
"> #{val}\n" if val.trim() != ''
|
||||
|
||||
# If replyField already has some content, add a newline before our quote
|
||||
separator = replyField.val().trim() != "" and "\n" or ''
|
||||
|
||||
replyField.val (_, current) ->
|
||||
current + separator + quote.join('') + "\n"
|
||||
|
||||
# Trigger autosave for the added text
|
||||
replyField.trigger('input')
|
||||
|
||||
# Focus the input field
|
||||
replyField.focus()
|
||||
@@ -1,19 +0,0 @@
|
||||
#= require shortcuts_navigation
|
||||
|
||||
class @ShortcutsIssueable extends ShortcutsNavigation
|
||||
constructor: (isMergeRequest) ->
|
||||
super()
|
||||
Mousetrap.bind('a', ->
|
||||
$('.js-assignee').select2('open')
|
||||
return false
|
||||
)
|
||||
Mousetrap.bind('m', ->
|
||||
$('.js-milestone').select2('open')
|
||||
return false
|
||||
)
|
||||
|
||||
if isMergeRequest
|
||||
@enabledHelp.push('.hidden-shortcut.merge_reuests')
|
||||
else
|
||||
@enabledHelp.push('.hidden-shortcut.issues')
|
||||
|
||||
@@ -4,6 +4,7 @@ $(document).on("click", '.toggle-nav-collapse', (e) ->
|
||||
expanded = 'page-sidebar-expanded'
|
||||
|
||||
$('.page-with-sidebar').toggleClass("#{collapsed} #{expanded}")
|
||||
$('header').toggleClass("header-collapsed header-expanded")
|
||||
$('.toggle-nav-collapse i').toggleClass("fa-angle-right fa-angle-left")
|
||||
$.cookie("collapsed_nav", $('.page-with-sidebar').hasClass(collapsed), { path: '/' })
|
||||
)
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
#= require d3
|
||||
#= require jquery
|
||||
#= require stat_graph_contributors_util
|
||||
|
||||
class @ContributorsStatGraph
|
||||
init: (log) ->
|
||||
@parsed_log = ContributorsStatGraphUtil.parse_log(log)
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
#= require d3
|
||||
#= require jquery
|
||||
#= require underscore
|
||||
|
||||
class @ContributorsGraph
|
||||
MARGIN:
|
||||
top: 20
|
||||
|
||||
@@ -50,13 +50,6 @@
|
||||
@include box-shadow(0 0 0 3px #f1f1f1);
|
||||
}
|
||||
|
||||
@mixin header-font {
|
||||
color: $style_color;
|
||||
font-size: 16px;
|
||||
line-height: 44px;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
@mixin md-typography {
|
||||
font-size: 15px;
|
||||
line-height: 1.5;
|
||||
|
||||
+73
-26
@@ -11,9 +11,55 @@ header {
|
||||
width: 100%;
|
||||
|
||||
.navbar-inner {
|
||||
background: #FFF;
|
||||
border-bottom: 1px solid #DDD;
|
||||
filter: none;
|
||||
|
||||
.title {
|
||||
position: relative;
|
||||
float: left;
|
||||
margin: 0;
|
||||
margin-left: 25px;
|
||||
font-size: 18px;
|
||||
line-height: 44px;
|
||||
font-weight: normal;
|
||||
color: #555;
|
||||
|
||||
@include str-truncated(37%);
|
||||
|
||||
a {
|
||||
color: #555;
|
||||
&:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.app_logo {
|
||||
border-bottom: 1px solid transparent;
|
||||
margin-bottom: -1px;
|
||||
|
||||
a {
|
||||
padding: 5px 8px;
|
||||
|
||||
img {
|
||||
float: left;
|
||||
}
|
||||
|
||||
h3 {
|
||||
width: 158px;
|
||||
float: left;
|
||||
margin: 0;
|
||||
margin-left: 20px;
|
||||
font-size: 18px;
|
||||
line-height: 34px;
|
||||
font-weight: normal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.nav > li > a {
|
||||
color: #666;
|
||||
font-size: 14px;
|
||||
line-height: 32px;
|
||||
padding: 6px 10px;
|
||||
@@ -30,15 +76,10 @@ header {
|
||||
}
|
||||
|
||||
.navbar-toggle {
|
||||
color: $style_color;
|
||||
color: #666;
|
||||
margin: 0;
|
||||
padding: 10px;
|
||||
border-radius: 0;
|
||||
|
||||
button i { font-size: 22px; }
|
||||
|
||||
&.collapsed { background-color: transparent !important;}
|
||||
|
||||
&:hover {
|
||||
background-color: #EEE;
|
||||
}
|
||||
@@ -60,8 +101,6 @@ header {
|
||||
|
||||
.navbar-collapse {
|
||||
margin-top: 47px;
|
||||
padding-right: 0;
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
.navbar-nav {
|
||||
@@ -100,10 +139,8 @@ header {
|
||||
|
||||
a {
|
||||
float: left;
|
||||
padding: 5px 0;
|
||||
height: 46px;
|
||||
width: 52px;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
|
||||
img {
|
||||
width: 36px;
|
||||
@@ -115,20 +152,6 @@ header {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Project / Area name
|
||||
*
|
||||
*/
|
||||
.title {
|
||||
position: relative;
|
||||
float: left;
|
||||
margin: 0;
|
||||
margin-left: 5px;
|
||||
@include header-font;
|
||||
@include str-truncated(37%);
|
||||
}
|
||||
|
||||
.profile-pic {
|
||||
padding: 0px !important;
|
||||
width: 46px;
|
||||
@@ -164,9 +187,10 @@ header {
|
||||
padding-left: 25px;
|
||||
font-size: 13px;
|
||||
@include border-radius(3px);
|
||||
border: 1px solid #c6c6c6;
|
||||
border: 1px solid #DDD;
|
||||
box-shadow: none;
|
||||
@include transition(all 0.15s ease-in 0s);
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -192,3 +216,26 @@ header {
|
||||
right: 35px !important;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: $screen-md-max) {
|
||||
.header-collapsed, .header-expanded {
|
||||
width: 52px;
|
||||
|
||||
h3 {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media(min-width: $screen-md-max) {
|
||||
.header-collapsed {
|
||||
width: 52px;
|
||||
|
||||
h3 {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.header-expanded {
|
||||
}
|
||||
}
|
||||
+6
-27
@@ -6,7 +6,6 @@
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 100%;
|
||||
border-right: 1px solid $border-color;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,28 +37,10 @@
|
||||
}
|
||||
|
||||
.nav-sidebar li {
|
||||
&.active a {
|
||||
color: $text-color;
|
||||
background: #FFF !important;
|
||||
font-weight: bold;
|
||||
border: 1px solid #EEE;
|
||||
border-right: 1px solid transparent;
|
||||
border-left: 3px solid $style_color;
|
||||
|
||||
&.no-highlight {
|
||||
background: none !important;
|
||||
border: none;
|
||||
}
|
||||
|
||||
i {
|
||||
color: $text-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.nav-sidebar li {
|
||||
&.separate-item {
|
||||
border-top: 1px solid $border-color;
|
||||
padding-top: 10px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
@@ -71,12 +52,10 @@
|
||||
padding: 8px 15px;
|
||||
font-size: 13px;
|
||||
line-height: 20px;
|
||||
padding-left: 20px;
|
||||
padding-left: 16px;
|
||||
|
||||
&:hover {
|
||||
text-decoration: none;
|
||||
color: $text-color;
|
||||
background: $border-color;
|
||||
}
|
||||
|
||||
&:active, &:focus {
|
||||
@@ -146,7 +125,7 @@
|
||||
|
||||
.collapse-nav a {
|
||||
left: 0px;
|
||||
padding: 7px 23px 3px 22px;
|
||||
width: 52px;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -154,13 +133,13 @@
|
||||
.collapse-nav a {
|
||||
position: fixed;
|
||||
top: 46px;
|
||||
padding: 5px 13px 5px 13px;
|
||||
left: 198px;
|
||||
font-size: 13px;
|
||||
background: transparent;
|
||||
color: black;
|
||||
border-left: 1px solid $border-color;
|
||||
border-bottom: 1px solid $border-color;
|
||||
width: 32px;
|
||||
height: 28px;
|
||||
text-align: center;
|
||||
line-height: 28px;
|
||||
}
|
||||
|
||||
.collapse-nav a:hover {
|
||||
@@ -37,7 +37,7 @@
|
||||
}
|
||||
|
||||
&.default {
|
||||
background: #f1f1f1;
|
||||
background: #888888;
|
||||
}
|
||||
|
||||
&.modern {
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
@mixin dark-theme($color-light, $color, $color-darker, $color-dark) {
|
||||
header {
|
||||
&.navbar-gitlab {
|
||||
.navbar-inner {
|
||||
background: $color;
|
||||
|
||||
.navbar-toggle {
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
.app_logo, .navbar-toggle {
|
||||
&:hover {
|
||||
background-color: $color-darker;
|
||||
}
|
||||
}
|
||||
|
||||
.app_logo {
|
||||
background-color: $color-dark;
|
||||
}
|
||||
|
||||
.title {
|
||||
color: #FFF;
|
||||
|
||||
a {
|
||||
color: #FFF;
|
||||
&:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.search {
|
||||
.search-input {
|
||||
background-color: $color-light;
|
||||
background-color: rgba(255, 255, 255, 0.5);
|
||||
border: 1px solid $color-light;
|
||||
|
||||
&:focus {
|
||||
background-color: white;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.search-input::-webkit-input-placeholder {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.nav > li > a {
|
||||
color: $color-light;
|
||||
|
||||
&:hover, &:focus, &:active {
|
||||
background: none;
|
||||
color: #FFF;
|
||||
}
|
||||
}
|
||||
|
||||
.search-input {
|
||||
border-color: $color-light;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
@mixin gitlab-theme($color-light, $color, $color-darker, $color-dark) {
|
||||
header {
|
||||
&.navbar-gitlab {
|
||||
.navbar-inner {
|
||||
.app_logo {
|
||||
background-color: $color-darker;
|
||||
|
||||
a {
|
||||
color: $color-light;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background-color: $color-dark;
|
||||
a {
|
||||
color: #FFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.page-with-sidebar {
|
||||
background: $color-darker;
|
||||
|
||||
.collapse-nav a {
|
||||
color: #FFF;
|
||||
background: $color;
|
||||
}
|
||||
|
||||
.sidebar-wrapper {
|
||||
background: $color-darker;
|
||||
border-right: 1px solid $color-darker;
|
||||
}
|
||||
|
||||
.nav-sidebar li {
|
||||
a {
|
||||
color: $color-light;
|
||||
|
||||
&:hover, &:focus, &:active {
|
||||
background: $color-dark;
|
||||
}
|
||||
|
||||
i {
|
||||
color: $color-light;
|
||||
}
|
||||
|
||||
.count {
|
||||
color: $color-light;
|
||||
background: $color-dark;
|
||||
}
|
||||
}
|
||||
|
||||
&.separate-item {
|
||||
border-top: 1px solid $color;
|
||||
}
|
||||
|
||||
&.active a {
|
||||
color: #FFF;
|
||||
font-weight: bold;
|
||||
|
||||
&.no-highlight {
|
||||
border: none;
|
||||
}
|
||||
|
||||
i {
|
||||
color: #FFF
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,27 +4,5 @@
|
||||
*
|
||||
*/
|
||||
.ui_basic {
|
||||
header {
|
||||
&.navbar-gitlab {
|
||||
.navbar-inner {
|
||||
background: #F1F1F1;
|
||||
border-bottom: 1px solid #DDD;
|
||||
|
||||
.title {
|
||||
color: #555;
|
||||
|
||||
a {
|
||||
color: #555;
|
||||
&:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.nav > li > a {
|
||||
color: $style_color;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@include gitlab-theme(#CCCCCC, #888888, #777777, #666666);
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
* Blue GitLab UI theme
|
||||
*/
|
||||
.ui_blue {
|
||||
@include dark-theme(#BECDE9, #2980b9, #1970a9, #096099);
|
||||
@include gitlab-theme(#BECDE9, #2980b9, #1970a9, #096099);
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
* Violet GitLab UI theme
|
||||
*/
|
||||
.ui_color {
|
||||
@include dark-theme(#98C, #548, #436, #325);
|
||||
@include gitlab-theme(#98C, #548, #436, #325);
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
* Gray GitLab UI theme
|
||||
*/
|
||||
.ui_gray {
|
||||
@include dark-theme(#979797, #373737, #272727, #222222);
|
||||
@include gitlab-theme(#979797, #373737, #272727, #222222);
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
* Classic GitLab UI theme
|
||||
*/
|
||||
.ui_mars {
|
||||
@include dark-theme(#979DA7, #474D57, #373D47, #24272D);
|
||||
@include gitlab-theme(#979DA7, #474D57, #373D47, #24272D);
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
* Modern GitLab UI theme
|
||||
*/
|
||||
.ui_modern {
|
||||
@include dark-theme(#ADC, #019875, #018865, #017855);
|
||||
@include gitlab-theme(#ADC, #019875, #018865, #017855);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class Admin::AppearancesController < Admin::ApplicationController
|
||||
before_filter :set_appearance, except: :create
|
||||
before_action :set_appearance, except: :create
|
||||
|
||||
def show
|
||||
end
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# Automatically sets the layout and ensures an administrator is logged in
|
||||
class Admin::ApplicationController < ApplicationController
|
||||
layout 'admin'
|
||||
before_filter :authenticate_admin!
|
||||
before_action :authenticate_admin!
|
||||
|
||||
def authenticate_admin!
|
||||
return render_404 unless current_user.is_admin?
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class Admin::ApplicationSettingsController < Admin::ApplicationController
|
||||
before_filter :set_application_setting
|
||||
before_action :set_application_setting
|
||||
|
||||
def show
|
||||
end
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class Admin::BroadcastMessagesController < Admin::ApplicationController
|
||||
before_filter :broadcast_messages
|
||||
before_action :broadcast_messages
|
||||
|
||||
def index
|
||||
@broadcast_message = BroadcastMessage.new
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
class Admin::DeployKeysController < Admin::ApplicationController
|
||||
before_filter :deploy_keys, only: [:index]
|
||||
before_filter :deploy_key, only: [:show, :destroy]
|
||||
before_action :deploy_keys, only: [:index]
|
||||
before_action :deploy_key, only: [:show, :destroy]
|
||||
|
||||
def index
|
||||
|
||||
end
|
||||
|
||||
def show
|
||||
|
||||
|
||||
end
|
||||
|
||||
def new
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class Admin::GitHooksController < Admin::ApplicationController
|
||||
before_filter :git_hook
|
||||
before_action :git_hook
|
||||
|
||||
respond_to :html
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class Admin::GroupsController < Admin::ApplicationController
|
||||
before_filter :group, only: [:edit, :show, :update, :destroy, :project_update, :members_update]
|
||||
before_action :group, only: [:edit, :show, :update, :destroy, :project_update, :members_update]
|
||||
|
||||
def index
|
||||
@groups = Group.all
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class Admin::KeysController < Admin::ApplicationController
|
||||
before_filter :user, only: [:show, :destroy]
|
||||
before_action :user, only: [:show, :destroy]
|
||||
|
||||
def show
|
||||
@key = user.keys.find(params[:id])
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
class Admin::ProjectsController < Admin::ApplicationController
|
||||
before_filter :project, only: [:show, :transfer]
|
||||
before_filter :group, only: [:show, :transfer]
|
||||
before_filter :repository, only: [:show, :transfer]
|
||||
before_action :project, only: [:show, :transfer]
|
||||
before_action :group, only: [:show, :transfer]
|
||||
before_action :repository, only: [:show, :transfer]
|
||||
|
||||
def index
|
||||
@projects = Project.all
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class Admin::ServicesController < Admin::ApplicationController
|
||||
before_filter :service, only: [:edit, :update]
|
||||
before_action :service, only: [:edit, :update]
|
||||
|
||||
def index
|
||||
@services = services_templates
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class Admin::UsersController < Admin::ApplicationController
|
||||
before_filter :user, only: [:show, :edit, :update, :destroy]
|
||||
before_action :user, only: [:show, :edit, :update, :destroy]
|
||||
|
||||
def index
|
||||
@users = User.order_name_asc.filter(params[:filter])
|
||||
|
||||
@@ -6,15 +6,15 @@ class ApplicationController < ActionController::Base
|
||||
|
||||
PER_PAGE = 20
|
||||
|
||||
before_filter :authenticate_user_from_token!
|
||||
before_filter :authenticate_user!
|
||||
before_filter :reject_blocked!
|
||||
before_filter :check_password_expiration
|
||||
before_filter :ldap_security_check
|
||||
before_filter :default_headers
|
||||
before_filter :add_gon_variables
|
||||
before_filter :configure_permitted_parameters, if: :devise_controller?
|
||||
before_filter :require_email, unless: :devise_controller?
|
||||
before_action :authenticate_user_from_token!
|
||||
before_action :authenticate_user!
|
||||
before_action :reject_blocked!
|
||||
before_action :check_password_expiration
|
||||
before_action :ldap_security_check
|
||||
before_action :default_headers
|
||||
before_action :add_gon_variables
|
||||
before_action :configure_permitted_parameters, if: :devise_controller?
|
||||
before_action :require_email, unless: :devise_controller?
|
||||
|
||||
protect_from_forgery with: :exception
|
||||
|
||||
@@ -87,6 +87,10 @@ class ApplicationController < ActionController::Base
|
||||
end
|
||||
end
|
||||
|
||||
def after_sign_out_path_for(resource)
|
||||
new_user_session_path
|
||||
end
|
||||
|
||||
def abilities
|
||||
Ability.abilities
|
||||
end
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
class AuditEventsController < ApplicationController
|
||||
# Authorize
|
||||
before_filter :repository, only: :project_log
|
||||
before_filter :authorize_admin_project!, only: :project_log
|
||||
before_filter :group, only: :group_log
|
||||
before_filter :authorize_admin_group!, only: :group_log
|
||||
before_action :repository, only: :project_log
|
||||
before_action :authorize_admin_project!, only: :project_log
|
||||
before_action :group, only: :group_log
|
||||
before_action :authorize_admin_group!, only: :group_log
|
||||
|
||||
layout :determine_layout
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class Dashboard::MilestonesController < ApplicationController
|
||||
before_filter :load_projects
|
||||
before_action :load_projects
|
||||
|
||||
def index
|
||||
project_milestones = case params[:state]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class Dashboard::ProjectsController < ApplicationController
|
||||
before_filter :event_filter
|
||||
before_action :event_filter
|
||||
|
||||
def starred
|
||||
@projects = current_user.starred_projects
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
class DashboardController < ApplicationController
|
||||
respond_to :html
|
||||
|
||||
before_filter :load_projects, except: [:projects]
|
||||
before_filter :event_filter, only: :show
|
||||
before_action :load_projects, except: [:projects]
|
||||
before_action :event_filter, only: :show
|
||||
|
||||
def show
|
||||
@projects = @projects.includes(:namespace)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class Explore::GroupsController < ApplicationController
|
||||
skip_before_filter :authenticate_user!,
|
||||
skip_before_action :authenticate_user!,
|
||||
:reject_blocked, :set_current_user_for_observers
|
||||
|
||||
layout "explore"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class Explore::ProjectsController < ApplicationController
|
||||
skip_before_filter :authenticate_user!,
|
||||
skip_before_action :authenticate_user!,
|
||||
:reject_blocked
|
||||
|
||||
layout 'explore'
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
class Groups::GroupMembersController < Groups::ApplicationController
|
||||
skip_before_filter :authenticate_user!, only: [:index]
|
||||
before_filter :group
|
||||
skip_before_action :authenticate_user!, only: [:index]
|
||||
before_action :group
|
||||
|
||||
# Authorize
|
||||
before_filter :authorize_read_group!
|
||||
before_filter :authorize_admin_group!, except: [:index, :leave]
|
||||
before_action :authorize_read_group!
|
||||
before_action :authorize_admin_group!, except: [:index, :leave]
|
||||
|
||||
layout :determine_layout
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
class Groups::HooksController < Groups::ApplicationController
|
||||
# Authorize
|
||||
before_filter :group
|
||||
before_filter :authorize_admin_group!
|
||||
before_action :group
|
||||
before_action :authorize_admin_group!
|
||||
|
||||
respond_to :html
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class Groups::LdapsController < Groups::ApplicationController
|
||||
before_filter :group
|
||||
before_filter :authorize_admin_group!
|
||||
before_action :group
|
||||
before_action :authorize_admin_group!
|
||||
|
||||
def reset_access
|
||||
LdapGroupResetService.new.execute(group, current_user)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
class Groups::MilestonesController < ApplicationController
|
||||
layout 'group'
|
||||
|
||||
before_filter :authorize_group_milestone!, only: :update
|
||||
before_action :authorize_group_milestone!, only: :update
|
||||
|
||||
def index
|
||||
project_milestones = case params[:state]
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
class GroupsController < Groups::ApplicationController
|
||||
skip_before_filter :authenticate_user!, only: [:show, :issues, :merge_requests]
|
||||
skip_before_action :authenticate_user!, only: [:show, :issues, :merge_requests]
|
||||
respond_to :html
|
||||
before_filter :group, except: [:new, :create]
|
||||
before_action :group, except: [:new, :create]
|
||||
|
||||
# Authorize
|
||||
before_filter :authorize_read_group!, except: [:new, :create]
|
||||
before_filter :authorize_admin_group!, only: [:edit, :update, :destroy, :projects]
|
||||
before_filter :authorize_create_group!, only: [:new, :create]
|
||||
before_action :authorize_read_group!, except: [:new, :create]
|
||||
before_action :authorize_admin_group!, only: [:edit, :update, :destroy, :projects]
|
||||
before_action :authorize_create_group!, only: [:new, :create]
|
||||
|
||||
# Load group projects
|
||||
before_filter :load_projects, except: [:new, :create, :projects, :edit, :update]
|
||||
before_filter :event_filter, only: :show
|
||||
before_filter :set_title, only: [:new, :create]
|
||||
before_action :load_projects, except: [:new, :create, :projects, :edit, :update]
|
||||
before_action :event_filter, only: :show
|
||||
before_action :set_title, only: [:new, :create]
|
||||
|
||||
layout :determine_layout
|
||||
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
class Import::BitbucketController < Import::BaseController
|
||||
before_filter :verify_bitbucket_import_enabled
|
||||
before_filter :bitbucket_auth, except: :callback
|
||||
before_action :verify_bitbucket_import_enabled
|
||||
before_action :bitbucket_auth, except: :callback
|
||||
|
||||
rescue_from OAuth::Error, with: :bitbucket_unauthorized
|
||||
|
||||
def callback
|
||||
request_token = session.delete(:oauth_request_token)
|
||||
request_token = session.delete(:oauth_request_token)
|
||||
raise "Session expired!" if request_token.nil?
|
||||
|
||||
request_token.symbolize_keys!
|
||||
|
||||
|
||||
access_token = client.get_token(request_token, params[:oauth_verifier], callback_import_bitbucket_url)
|
||||
|
||||
current_user.bitbucket_access_token = access_token.token
|
||||
@@ -21,7 +21,7 @@ class Import::BitbucketController < Import::BaseController
|
||||
|
||||
def status
|
||||
@repos = client.projects
|
||||
|
||||
|
||||
@already_added_projects = current_user.created_projects.where(import_type: "bitbucket")
|
||||
already_added_projects_names = @already_added_projects.pluck(:import_source)
|
||||
|
||||
@@ -41,7 +41,7 @@ class Import::BitbucketController < Import::BaseController
|
||||
repo_owner = repo["owner"]
|
||||
repo_owner = current_user.username if repo_owner == client.user["user"]["username"]
|
||||
@target_namespace = params[:new_namespace].presence || repo_owner
|
||||
|
||||
|
||||
namespace = get_or_create_namespace || (render and return)
|
||||
|
||||
unless Gitlab::BitbucketImport::KeyAdder.new(repo, current_user).execute
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class Import::GithubController < Import::BaseController
|
||||
before_filter :verify_github_import_enabled
|
||||
before_filter :github_auth, except: :callback
|
||||
before_action :verify_github_import_enabled
|
||||
before_action :github_auth, except: :callback
|
||||
|
||||
rescue_from Octokit::Unauthorized, with: :github_unauthorized
|
||||
|
||||
@@ -36,7 +36,7 @@ class Import::GithubController < Import::BaseController
|
||||
repo_owner = repo.owner.login
|
||||
repo_owner = current_user.username if repo_owner == client.user.login
|
||||
@target_namespace = params[:new_namespace].presence || repo_owner
|
||||
|
||||
|
||||
namespace = get_or_create_namespace || (render and return)
|
||||
|
||||
@project = Gitlab::GithubImport::ProjectCreator.new(repo, namespace, current_user).execute
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class Import::GitlabController < Import::BaseController
|
||||
before_filter :verify_gitlab_import_enabled
|
||||
before_filter :gitlab_auth, except: :callback
|
||||
before_action :verify_gitlab_import_enabled
|
||||
before_action :gitlab_auth, except: :callback
|
||||
|
||||
rescue_from OAuth2::Error, with: :gitlab_unauthorized
|
||||
|
||||
@@ -13,7 +13,7 @@ class Import::GitlabController < Import::BaseController
|
||||
|
||||
def status
|
||||
@repos = client.projects
|
||||
|
||||
|
||||
@already_added_projects = current_user.created_projects.where(import_type: "gitlab")
|
||||
already_added_projects_names = @already_added_projects.pluck(:import_source)
|
||||
|
||||
@@ -33,7 +33,7 @@ class Import::GitlabController < Import::BaseController
|
||||
repo_owner = repo["namespace"]["path"]
|
||||
repo_owner = current_user.username if repo_owner == client.user["username"]
|
||||
@target_namespace = params[:new_namespace].presence || repo_owner
|
||||
|
||||
|
||||
namespace = get_or_create_namespace || (render and return)
|
||||
|
||||
@project = Gitlab::GitlabImport::ProjectCreator.new(repo, namespace, current_user).execute
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
class Import::GoogleCodeController < Import::BaseController
|
||||
before_filter :user_map, only: [:new_user_map, :create_user_map]
|
||||
before_action :user_map, only: [:new_user_map, :create_user_map]
|
||||
|
||||
def new
|
||||
|
||||
|
||||
end
|
||||
|
||||
def callback
|
||||
@@ -68,7 +68,7 @@ class Import::GoogleCodeController < Import::BaseController
|
||||
|
||||
def status
|
||||
unless client.valid?
|
||||
return redirect_to new_import_google_path
|
||||
return redirect_to new_import_google_code_path
|
||||
end
|
||||
|
||||
@repos = client.repos
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class InvitesController < ApplicationController
|
||||
before_filter :member
|
||||
skip_before_filter :authenticate_user!, only: :decline
|
||||
before_action :member
|
||||
skip_before_action :authenticate_user!, only: :decline
|
||||
|
||||
respond_to :html
|
||||
|
||||
@@ -24,7 +24,7 @@ class InvitesController < ApplicationController
|
||||
if member.decline_invite!
|
||||
label, _ = source_info(member.source)
|
||||
|
||||
path =
|
||||
path =
|
||||
if current_user
|
||||
dashboard_path
|
||||
else
|
||||
@@ -41,7 +41,7 @@ class InvitesController < ApplicationController
|
||||
|
||||
def member
|
||||
return @member if defined?(@member)
|
||||
|
||||
|
||||
@token = params[:id]
|
||||
@member = Member.find_by_invite_token(@token)
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class NamespacesController < ApplicationController
|
||||
skip_before_filter :authenticate_user!
|
||||
skip_before_action :authenticate_user!
|
||||
|
||||
def show
|
||||
namespace = Namespace.find_by(path: params[:id])
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class Oauth::ApplicationsController < Doorkeeper::ApplicationsController
|
||||
before_filter :authenticate_user!
|
||||
before_action :authenticate_user!
|
||||
layout "profile"
|
||||
|
||||
def index
|
||||
@@ -10,7 +10,7 @@ class Oauth::ApplicationsController < Doorkeeper::ApplicationsController
|
||||
@application = Doorkeeper::Application.new(application_params)
|
||||
|
||||
@application.owner = current_user
|
||||
|
||||
|
||||
if @application.save
|
||||
flash[:notice] = I18n.t(:notice, scope: [:doorkeeper, :flash, :applications, :create])
|
||||
redirect_to oauth_application_url(@application)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class Oauth::AuthorizationsController < Doorkeeper::AuthorizationsController
|
||||
before_filter :authenticate_resource_owner!
|
||||
before_action :authenticate_resource_owner!
|
||||
layout "profile"
|
||||
|
||||
def new
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class Profiles::KeysController < ApplicationController
|
||||
layout "profile"
|
||||
skip_before_filter :authenticate_user!, only: [:get_keys]
|
||||
skip_before_action :authenticate_user!, only: [:get_keys]
|
||||
|
||||
def index
|
||||
@keys = current_user.keys
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
class Profiles::PasswordsController < ApplicationController
|
||||
layout :determine_layout
|
||||
|
||||
skip_before_filter :check_password_expiration, only: [:new, :create]
|
||||
skip_before_action :check_password_expiration, only: [:new, :create]
|
||||
|
||||
before_filter :set_user
|
||||
before_filter :set_title
|
||||
before_filter :authorize_change_password!
|
||||
before_action :set_user
|
||||
before_action :set_title
|
||||
before_action :authorize_change_password!
|
||||
|
||||
def new
|
||||
end
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
class ProfilesController < ApplicationController
|
||||
include ActionView::Helpers::SanitizeHelper
|
||||
|
||||
before_filter :user
|
||||
before_filter :authorize_change_username!, only: :update_username
|
||||
skip_before_filter :require_email, only: [:show, :update]
|
||||
before_action :user
|
||||
before_action :authorize_change_username!, only: :update_username
|
||||
skip_before_action :require_email, only: [:show, :update]
|
||||
|
||||
layout 'profile'
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class Projects::ApplicationController < ApplicationController
|
||||
before_filter :project
|
||||
before_filter :repository
|
||||
before_action :project
|
||||
before_action :repository
|
||||
layout :determine_layout
|
||||
|
||||
def authenticate_user!
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
class Projects::AvatarsController < Projects::ApplicationController
|
||||
layout 'project'
|
||||
|
||||
before_filter :project
|
||||
before_action :project
|
||||
|
||||
def show
|
||||
@blob = @project.repository.blob_at_branch('master', @project.avatar_in_git)
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
class Projects::BlameController < Projects::ApplicationController
|
||||
include ExtractsPath
|
||||
|
||||
before_filter :require_non_empty_project
|
||||
before_filter :assign_ref_vars
|
||||
before_filter :authorize_download_code!
|
||||
before_action :require_non_empty_project
|
||||
before_action :assign_ref_vars
|
||||
before_action :authorize_download_code!
|
||||
|
||||
def show
|
||||
@blame = Gitlab::Git::Blame.new(@repository, @commit.id, @path)
|
||||
|
||||
@@ -6,15 +6,15 @@ class Projects::BlobController < Projects::ApplicationController
|
||||
# Raised when given an invalid file path
|
||||
class InvalidPathError < StandardError; end
|
||||
|
||||
before_filter :require_non_empty_project, except: [:new, :create]
|
||||
before_filter :authorize_download_code!
|
||||
before_filter :authorize_push_code!, only: [:destroy]
|
||||
before_filter :assign_blob_vars
|
||||
before_filter :commit, except: [:new, :create]
|
||||
before_filter :blob, except: [:new, :create]
|
||||
before_filter :from_merge_request, only: [:edit, :update]
|
||||
before_filter :after_edit_path, only: [:edit, :update]
|
||||
before_filter :require_branch_head, only: [:edit, :update]
|
||||
before_action :require_non_empty_project, except: [:new, :create]
|
||||
before_action :authorize_download_code!
|
||||
before_action :authorize_push_code!, only: [:destroy]
|
||||
before_action :assign_blob_vars
|
||||
before_action :commit, except: [:new, :create]
|
||||
before_action :blob, except: [:new, :create]
|
||||
before_action :from_merge_request, only: [:edit, :update]
|
||||
before_action :after_edit_path, only: [:edit, :update]
|
||||
before_action :require_branch_head, only: [:edit, :update]
|
||||
|
||||
def new
|
||||
commit unless @repository.empty?
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
class Projects::BranchesController < Projects::ApplicationController
|
||||
include ActionView::Helpers::SanitizeHelper
|
||||
# Authorize
|
||||
before_filter :require_non_empty_project
|
||||
before_filter :authorize_download_code!
|
||||
before_filter :authorize_push_code!, only: [:create, :destroy]
|
||||
before_action :require_non_empty_project
|
||||
before_action :authorize_download_code!
|
||||
before_action :authorize_push_code!, only: [:create, :destroy]
|
||||
|
||||
def index
|
||||
@sort = params[:sort] || 'name'
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
# Not to be confused with CommitsController, plural.
|
||||
class Projects::CommitController < Projects::ApplicationController
|
||||
# Authorize
|
||||
before_filter :require_non_empty_project
|
||||
before_filter :authorize_download_code!
|
||||
before_filter :commit
|
||||
before_action :require_non_empty_project
|
||||
before_action :authorize_download_code!
|
||||
before_action :commit
|
||||
|
||||
def show
|
||||
return git_not_found! unless @commit
|
||||
|
||||
@@ -3,9 +3,9 @@ require "base64"
|
||||
class Projects::CommitsController < Projects::ApplicationController
|
||||
include ExtractsPath
|
||||
|
||||
before_filter :require_non_empty_project
|
||||
before_filter :assign_ref_vars
|
||||
before_filter :authorize_download_code!
|
||||
before_action :require_non_empty_project
|
||||
before_action :assign_ref_vars
|
||||
before_action :authorize_download_code!
|
||||
|
||||
def show
|
||||
@repo = @project.repository
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
class Projects::CompareController < Projects::ApplicationController
|
||||
# Authorize
|
||||
before_filter :require_non_empty_project
|
||||
before_filter :authorize_download_code!
|
||||
before_action :require_non_empty_project
|
||||
before_action :authorize_download_code!
|
||||
|
||||
def index
|
||||
end
|
||||
|
||||
@@ -2,7 +2,7 @@ class Projects::DeployKeysController < Projects::ApplicationController
|
||||
respond_to :html
|
||||
|
||||
# Authorize
|
||||
before_filter :authorize_admin_project!
|
||||
before_action :authorize_admin_project!
|
||||
|
||||
layout "project_settings"
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
class Projects::ForksController < Projects::ApplicationController
|
||||
# Authorize
|
||||
before_filter :require_non_empty_project
|
||||
before_filter :authorize_download_code!
|
||||
before_action :require_non_empty_project
|
||||
before_action :authorize_download_code!
|
||||
|
||||
def new
|
||||
@namespaces = current_user.manageable_namespaces
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class Projects::GitHooksController < Projects::ApplicationController
|
||||
# Authorize
|
||||
before_filter :authorize_admin_project!
|
||||
before_action :authorize_admin_project!
|
||||
|
||||
respond_to :html
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
class Projects::GraphsController < Projects::ApplicationController
|
||||
# Authorize
|
||||
before_filter :require_non_empty_project
|
||||
before_filter :authorize_download_code!
|
||||
before_action :require_non_empty_project
|
||||
before_action :authorize_download_code!
|
||||
|
||||
def show
|
||||
respond_to do |format|
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class Projects::GroupLinksController < Projects::ApplicationController
|
||||
layout 'project_settings'
|
||||
before_filter :authorize_admin_project!
|
||||
before_action :authorize_admin_project!
|
||||
|
||||
def index
|
||||
@group_links = project.project_group_links.all
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class Projects::HooksController < Projects::ApplicationController
|
||||
# Authorize
|
||||
before_filter :authorize_admin_project!
|
||||
before_action :authorize_admin_project!
|
||||
|
||||
respond_to :html
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
class Projects::ImportsController < Projects::ApplicationController
|
||||
# Authorize
|
||||
before_filter :authorize_admin_project!
|
||||
before_filter :require_no_repo
|
||||
before_filter :redirect_if_progress, except: :show
|
||||
before_action :authorize_admin_project!
|
||||
before_action :require_no_repo
|
||||
before_action :redirect_if_progress, except: :show
|
||||
|
||||
def new
|
||||
end
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
class Projects::IssuesController < Projects::ApplicationController
|
||||
before_filter :module_enabled
|
||||
before_filter :issue, only: [:edit, :update, :show, :toggle_subscription]
|
||||
before_action :module_enabled
|
||||
before_action :issue, only: [:edit, :update, :show, :toggle_subscription]
|
||||
|
||||
# Allow read any issue
|
||||
before_filter :authorize_read_issue!
|
||||
before_action :authorize_read_issue!
|
||||
|
||||
# Allow write(create) issue
|
||||
before_filter :authorize_write_issue!, only: [:new, :create]
|
||||
before_action :authorize_write_issue!, only: [:new, :create]
|
||||
|
||||
# Allow modify issue
|
||||
before_filter :authorize_modify_issue!, only: [:edit, :update]
|
||||
before_action :authorize_modify_issue!, only: [:edit, :update]
|
||||
|
||||
# Allow issues bulk update
|
||||
before_filter :authorize_admin_issues!, only: [:bulk_update]
|
||||
before_action :authorize_admin_issues!, only: [:bulk_update]
|
||||
|
||||
respond_to :html
|
||||
|
||||
@@ -99,7 +99,7 @@ class Projects::IssuesController < Projects::ApplicationController
|
||||
|
||||
def toggle_subscription
|
||||
@issue.toggle_subscription(current_user)
|
||||
|
||||
|
||||
render nothing: true
|
||||
end
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
class Projects::LabelsController < Projects::ApplicationController
|
||||
before_filter :module_enabled
|
||||
before_filter :label, only: [:edit, :update, :destroy]
|
||||
before_filter :authorize_labels!
|
||||
before_filter :authorize_admin_labels!, except: [:index]
|
||||
before_action :module_enabled
|
||||
before_action :label, only: [:edit, :update, :destroy]
|
||||
before_action :authorize_labels!
|
||||
before_action :authorize_admin_labels!, except: [:index]
|
||||
|
||||
respond_to :js, :html
|
||||
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
require 'gitlab/satellite/satellite'
|
||||
|
||||
class Projects::MergeRequestsController < Projects::ApplicationController
|
||||
before_filter :module_enabled
|
||||
before_filter :merge_request, only: [:edit, :update, :show, :diffs, :automerge, :automerge_check, :ci_status, :toggle_subscription]
|
||||
before_filter :closes_issues, only: [:edit, :update, :show, :diffs]
|
||||
before_filter :validates_merge_request, only: [:show, :diffs]
|
||||
before_filter :define_show_vars, only: [:show, :diffs]
|
||||
before_action :module_enabled
|
||||
before_action :merge_request, only: [:edit, :update, :show, :diffs, :automerge, :automerge_check, :ci_status, :toggle_subscription]
|
||||
before_action :closes_issues, only: [:edit, :update, :show, :diffs]
|
||||
before_action :validates_merge_request, only: [:show, :diffs]
|
||||
before_action :define_show_vars, only: [:show, :diffs]
|
||||
|
||||
# Allow read any merge_request
|
||||
before_filter :authorize_read_merge_request!
|
||||
before_action :authorize_read_merge_request!
|
||||
|
||||
# Allow write(create) merge_request
|
||||
before_filter :authorize_write_merge_request!, only: [:new, :create]
|
||||
before_action :authorize_write_merge_request!, only: [:new, :create]
|
||||
|
||||
# Allow modify merge_request
|
||||
before_filter :authorize_modify_merge_request!, only: [:close, :edit, :update, :sort]
|
||||
before_action :authorize_modify_merge_request!, only: [:close, :edit, :update, :sort]
|
||||
|
||||
def index
|
||||
terms = params['issue_search']
|
||||
@@ -176,7 +176,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController
|
||||
|
||||
def toggle_subscription
|
||||
@merge_request.toggle_subscription(current_user)
|
||||
|
||||
|
||||
render nothing: true
|
||||
end
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
class Projects::MilestonesController < Projects::ApplicationController
|
||||
before_filter :module_enabled
|
||||
before_filter :milestone, only: [:edit, :update, :destroy, :show, :sort_issues, :sort_merge_requests]
|
||||
before_action :module_enabled
|
||||
before_action :milestone, only: [:edit, :update, :destroy, :show, :sort_issues, :sort_merge_requests]
|
||||
|
||||
# Allow read any milestone
|
||||
before_filter :authorize_read_milestone!
|
||||
before_action :authorize_read_milestone!
|
||||
|
||||
# Allow admin milestone
|
||||
before_filter :authorize_admin_milestone!, except: [:index, :show]
|
||||
before_action :authorize_admin_milestone!, except: [:index, :show]
|
||||
|
||||
respond_to :html
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@ class Projects::NetworkController < Projects::ApplicationController
|
||||
include ExtractsPath
|
||||
include ApplicationHelper
|
||||
|
||||
before_filter :require_non_empty_project
|
||||
before_filter :assign_ref_vars
|
||||
before_filter :authorize_download_code!
|
||||
before_action :require_non_empty_project
|
||||
before_action :assign_ref_vars
|
||||
before_action :authorize_download_code!
|
||||
|
||||
def show
|
||||
respond_to do |format|
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
class Projects::NotesController < Projects::ApplicationController
|
||||
# Authorize
|
||||
before_filter :authorize_read_note!
|
||||
before_filter :authorize_write_note!, only: [:create]
|
||||
before_filter :authorize_admin_note!, only: [:update, :destroy]
|
||||
before_filter :find_current_user_notes, except: [:destroy, :delete_attachment]
|
||||
before_action :authorize_read_note!
|
||||
before_action :authorize_write_note!, only: [:create]
|
||||
before_action :authorize_admin_note!, only: [:update, :destroy]
|
||||
before_action :find_current_user_notes, except: [:destroy, :delete_attachment]
|
||||
|
||||
def index
|
||||
current_fetched_at = Time.now.to_i
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class Projects::ProjectMembersController < Projects::ApplicationController
|
||||
# Authorize
|
||||
before_filter :authorize_admin_project!, except: :leave
|
||||
before_action :authorize_admin_project!, except: :leave
|
||||
|
||||
layout "project_settings"
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
class Projects::ProtectedBranchesController < Projects::ApplicationController
|
||||
# Authorize
|
||||
before_filter :require_non_empty_project
|
||||
before_filter :authorize_admin_project!
|
||||
before_action :require_non_empty_project
|
||||
before_action :authorize_admin_project!
|
||||
|
||||
layout "project_settings"
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
class Projects::RawController < Projects::ApplicationController
|
||||
include ExtractsPath
|
||||
|
||||
before_filter :require_non_empty_project
|
||||
before_filter :assign_ref_vars
|
||||
before_filter :authorize_download_code!
|
||||
before_action :require_non_empty_project
|
||||
before_action :assign_ref_vars
|
||||
before_action :authorize_download_code!
|
||||
|
||||
def show
|
||||
@blob = @repository.blob_at(@commit.id, @path)
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
class Projects::RefsController < Projects::ApplicationController
|
||||
include ExtractsPath
|
||||
|
||||
before_filter :require_non_empty_project
|
||||
before_filter :assign_ref_vars
|
||||
before_filter :authorize_download_code!
|
||||
before_action :require_non_empty_project
|
||||
before_action :assign_ref_vars
|
||||
before_action :authorize_download_code!
|
||||
|
||||
def switch
|
||||
respond_to do |format|
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
class Projects::RepositoriesController < Projects::ApplicationController
|
||||
# Authorize
|
||||
before_filter :require_non_empty_project, except: :create
|
||||
before_filter :authorize_download_code!
|
||||
before_filter :authorize_admin_project!, only: :create
|
||||
before_action :require_non_empty_project, except: :create
|
||||
before_action :authorize_download_code!
|
||||
before_action :authorize_admin_project!, only: :create
|
||||
|
||||
def create
|
||||
@project.create_repository
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
class Projects::ServicesController < Projects::ApplicationController
|
||||
# Authorize
|
||||
before_filter :authorize_admin_project!
|
||||
before_filter :service, only: [:edit, :update, :test]
|
||||
before_action :authorize_admin_project!
|
||||
before_action :service, only: [:edit, :update, :test]
|
||||
|
||||
respond_to :html
|
||||
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
class Projects::SnippetsController < Projects::ApplicationController
|
||||
before_filter :module_enabled
|
||||
before_filter :snippet, only: [:show, :edit, :destroy, :update, :raw]
|
||||
before_action :module_enabled
|
||||
before_action :snippet, only: [:show, :edit, :destroy, :update, :raw]
|
||||
|
||||
# Allow read any snippet
|
||||
before_filter :authorize_read_project_snippet!
|
||||
before_action :authorize_read_project_snippet!
|
||||
|
||||
# Allow write(create) snippet
|
||||
before_filter :authorize_write_project_snippet!, only: [:new, :create]
|
||||
before_action :authorize_write_project_snippet!, only: [:new, :create]
|
||||
|
||||
# Allow modify snippet
|
||||
before_filter :authorize_modify_project_snippet!, only: [:edit, :update]
|
||||
before_action :authorize_modify_project_snippet!, only: [:edit, :update]
|
||||
|
||||
# Allow destroy snippet
|
||||
before_filter :authorize_admin_project_snippet!, only: [:destroy]
|
||||
before_action :authorize_admin_project_snippet!, only: [:destroy]
|
||||
|
||||
respond_to :html
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
class Projects::TagsController < Projects::ApplicationController
|
||||
# Authorize
|
||||
before_filter :require_non_empty_project
|
||||
before_filter :authorize_download_code!
|
||||
before_filter :authorize_push_code!, only: [:create]
|
||||
before_filter :authorize_admin_project!, only: [:destroy]
|
||||
before_action :require_non_empty_project
|
||||
before_action :authorize_download_code!
|
||||
before_action :authorize_push_code!, only: [:create]
|
||||
before_action :authorize_admin_project!, only: [:destroy]
|
||||
|
||||
def index
|
||||
sorted = VersionSorter.rsort(@repository.tag_names)
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
class Projects::TreeController < Projects::ApplicationController
|
||||
include ExtractsPath
|
||||
|
||||
before_filter :require_non_empty_project, except: [:new, :create]
|
||||
before_filter :assign_ref_vars
|
||||
before_filter :authorize_download_code!
|
||||
before_action :require_non_empty_project, except: [:new, :create]
|
||||
before_action :assign_ref_vars
|
||||
before_action :authorize_download_code!
|
||||
|
||||
def show
|
||||
if tree.entries.empty?
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
class Projects::UploadsController < Projects::ApplicationController
|
||||
layout 'project'
|
||||
|
||||
# We want to skip these filters for only the `show` action if `image?` is true,
|
||||
# but `skip_before_filter` doesn't work with both `only` and `if`, so we accomplish the same like this.
|
||||
# We want to skip these filters for only the `show` action if `image?` is true,
|
||||
# but `skip_before_action` doesn't work with both `only` and `if`, so we accomplish the same like this.
|
||||
skipped_filters = [:authenticate_user!, :reject_blocked!, :project, :repository]
|
||||
skip_before_filter *skipped_filters, only: [:show]
|
||||
before_filter *skipped_filters, only: [:show], unless: :image?
|
||||
skip_before_action *skipped_filters, only: [:show]
|
||||
before_action *skipped_filters, only: [:show], unless: :image?
|
||||
|
||||
def create
|
||||
link_to_file = ::Projects::UploadService.new(project, params[:file]).
|
||||
@@ -40,7 +40,7 @@ class Projects::UploadsController < Projects::ApplicationController
|
||||
file_project = Project.find_with_namespace("#{namespace}/#{id}")
|
||||
|
||||
if file_project.nil?
|
||||
@uploader = nil
|
||||
@uploader = nil
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
require 'project_wiki'
|
||||
|
||||
class Projects::WikisController < Projects::ApplicationController
|
||||
before_filter :authorize_read_wiki!
|
||||
before_filter :authorize_write_wiki!, only: [:edit, :create, :history]
|
||||
before_filter :authorize_admin_wiki!, only: :destroy
|
||||
before_filter :load_project_wiki
|
||||
before_action :authorize_read_wiki!
|
||||
before_action :authorize_write_wiki!, only: [:edit, :create, :history]
|
||||
before_action :authorize_admin_wiki!, only: :destroy
|
||||
before_action :load_project_wiki
|
||||
include WikiHelper
|
||||
|
||||
def pages
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
class ProjectsController < ApplicationController
|
||||
prepend_before_filter :render_go_import, only: [:show]
|
||||
skip_before_filter :authenticate_user!, only: [:show]
|
||||
before_filter :project, except: [:new, :create]
|
||||
before_filter :repository, except: [:new, :create]
|
||||
prepend_before_action :render_go_import, only: [:show]
|
||||
skip_before_action :authenticate_user!, only: [:show]
|
||||
before_action :project, except: [:new, :create]
|
||||
before_action :repository, except: [:new, :create]
|
||||
|
||||
# Authorize
|
||||
before_filter :authorize_admin_project!, only: [:edit, :update, :destroy, :transfer, :archive, :unarchive]
|
||||
before_filter :set_title, only: [:new, :create]
|
||||
before_filter :event_filter, only: :show
|
||||
before_action :authorize_admin_project!, only: [:edit, :update, :destroy, :transfer, :archive, :unarchive]
|
||||
before_action :set_title, only: [:new, :create]
|
||||
before_action :event_filter, only: :show
|
||||
|
||||
layout 'navless', only: [:new, :create, :fork]
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class RegistrationsController < Devise::RegistrationsController
|
||||
before_filter :signup_enabled?
|
||||
before_action :signup_enabled?
|
||||
|
||||
def new
|
||||
redirect_to(new_user_session_path)
|
||||
|
||||
@@ -1,39 +1,39 @@
|
||||
class SnippetsController < ApplicationController
|
||||
before_filter :snippet, only: [:show, :edit, :destroy, :update, :raw]
|
||||
before_action :snippet, only: [:show, :edit, :destroy, :update, :raw]
|
||||
|
||||
# Allow modify snippet
|
||||
before_filter :authorize_modify_snippet!, only: [:edit, :update]
|
||||
before_action :authorize_modify_snippet!, only: [:edit, :update]
|
||||
|
||||
# Allow destroy snippet
|
||||
before_filter :authorize_admin_snippet!, only: [:destroy]
|
||||
before_action :authorize_admin_snippet!, only: [:destroy]
|
||||
|
||||
before_filter :set_title
|
||||
before_action :set_title
|
||||
|
||||
skip_before_filter :authenticate_user!, only: [:index, :user_index, :show, :raw]
|
||||
skip_before_action :authenticate_user!, only: [:index, :user_index, :show, :raw]
|
||||
|
||||
respond_to :html
|
||||
|
||||
layout :determine_layout
|
||||
|
||||
def index
|
||||
@snippets = SnippetsFinder.new.execute(current_user, filter: :all).page(params[:page]).per(PER_PAGE)
|
||||
end
|
||||
if params[:username].present?
|
||||
@user = User.find_by(username: params[:username])
|
||||
|
||||
def user_index
|
||||
@user = User.find_by(username: params[:username])
|
||||
render_404 and return unless @user
|
||||
|
||||
render_404 and return unless @user
|
||||
@snippets = SnippetsFinder.new.execute(current_user, {
|
||||
filter: :by_user,
|
||||
user: @user,
|
||||
scope: params[:scope] }).
|
||||
page(params[:page]).per(PER_PAGE)
|
||||
|
||||
@snippets = SnippetsFinder.new.execute(current_user, {
|
||||
filter: :by_user,
|
||||
user: @user,
|
||||
scope: params[:scope] }).
|
||||
page(params[:page]).per(PER_PAGE)
|
||||
|
||||
if @user == current_user
|
||||
render 'current_user_index'
|
||||
if @user == current_user
|
||||
render 'current_user_index'
|
||||
else
|
||||
render 'user_index'
|
||||
end
|
||||
else
|
||||
render 'user_index'
|
||||
@snippets = SnippetsFinder.new.execute(current_user, filter: :all).page(params[:page]).per(PER_PAGE)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -108,6 +108,6 @@ class SnippetsController < ApplicationController
|
||||
end
|
||||
|
||||
def determine_layout
|
||||
current_user ? 'navless' : 'public_users'
|
||||
current_user ? 'snippets' : 'public_users'
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class UnsubscribesController < ApplicationController
|
||||
skip_before_filter :authenticate_user!,
|
||||
skip_before_action :authenticate_user!,
|
||||
:reject_blocked, :set_current_user_for_observers,
|
||||
:add_abilities
|
||||
layout 'public_users'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class UploadsController < ApplicationController
|
||||
skip_before_filter :authenticate_user!
|
||||
before_filter :find_model, :authorize_access!
|
||||
skip_before_action :authenticate_user!
|
||||
before_action :find_model, :authorize_access!
|
||||
|
||||
def show
|
||||
uploader = @model.send(upload_mount)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class UsersController < ApplicationController
|
||||
skip_before_filter :authenticate_user!
|
||||
before_filter :set_user
|
||||
skip_before_action :authenticate_user!
|
||||
before_action :set_user
|
||||
layout :determine_layout
|
||||
|
||||
def show
|
||||
|
||||
@@ -255,11 +255,15 @@ module ApplicationHelper
|
||||
#
|
||||
# Returns `html_options`, adding `rel: nofollow` for external links
|
||||
def add_nofollow(link, html_options = {})
|
||||
uri = URI(link)
|
||||
begin
|
||||
uri = URI(link)
|
||||
|
||||
if uri && uri.absolute? && uri.host != Gitlab.config.gitlab.host
|
||||
rel = html_options.fetch(:rel, '')
|
||||
html_options[:rel] = (rel + ' nofollow').strip
|
||||
if uri && uri.absolute? && uri.host != Gitlab.config.gitlab.host
|
||||
rel = html_options.fetch(:rel, '')
|
||||
html_options[:rel] = (rel + ' nofollow').strip
|
||||
end
|
||||
rescue URI::Error
|
||||
# noop
|
||||
end
|
||||
|
||||
html_options
|
||||
@@ -314,12 +318,4 @@ module ApplicationHelper
|
||||
profile_key_path(key)
|
||||
end
|
||||
end
|
||||
|
||||
def nav_sidebar_class
|
||||
if nav_menu_collapsed?
|
||||
"page-sidebar-collapsed"
|
||||
else
|
||||
"page-sidebar-expanded"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -74,6 +74,7 @@ module GitlabMarkdownHelper
|
||||
end
|
||||
end
|
||||
|
||||
# TODO (rspeicher): This should be its own filter
|
||||
def create_relative_links(text)
|
||||
paths = extract_paths(text)
|
||||
|
||||
|
||||
@@ -108,4 +108,7 @@ module IssuesHelper
|
||||
xml.summary issue.title
|
||||
end
|
||||
end
|
||||
|
||||
# Required for Gitlab::Markdown::IssueReferenceFilter
|
||||
module_function :url_for_issue, :title_for_issue
|
||||
end
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
module LabelsHelper
|
||||
include ActionView::Helpers::TagHelper
|
||||
|
||||
def project_label_names
|
||||
@project.labels.pluck(:title)
|
||||
end
|
||||
@@ -7,9 +9,13 @@ module LabelsHelper
|
||||
label_color = label.color || Label::DEFAULT_COLOR
|
||||
text_color = text_color_for_bg(label_color)
|
||||
|
||||
content_tag :span, class: 'label color-label', style: "background-color:#{label_color};color:#{text_color}" do
|
||||
label.name
|
||||
end
|
||||
# Intentionally not using content_tag here so that this method can be called
|
||||
# by LabelReferenceFilter
|
||||
span = %(<span class="label color-label") +
|
||||
%( style="background-color: #{label_color}; color: #{text_color}">) +
|
||||
escape_once(label.name) + '</span>'
|
||||
|
||||
span.html_safe
|
||||
end
|
||||
|
||||
def suggested_colors
|
||||
@@ -42,13 +48,16 @@ module LabelsHelper
|
||||
r, g, b = bg_color.slice(1,7).scan(/.{2}/).map(&:hex)
|
||||
|
||||
if (r + g + b) > 500
|
||||
"#333"
|
||||
'#333333'
|
||||
else
|
||||
"#FFF"
|
||||
'#FFFFFF'
|
||||
end
|
||||
end
|
||||
|
||||
def project_labels_options(project)
|
||||
options_from_collection_for_select(project.labels, 'name', 'name', params[:label_name])
|
||||
end
|
||||
|
||||
# Required for Gitlab::Markdown::LabelReferenceFilter
|
||||
module_function :render_colored_label, :text_color_for_bg, :escape_once
|
||||
end
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user