summaryrefslogtreecommitdiff
path: root/app/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/ci_status_helper.rb16
-rw-r--r--app/helpers/page_layout_helper.rb3
-rw-r--r--app/helpers/selects_helper.rb13
3 files changed, 29 insertions, 3 deletions
diff --git a/app/helpers/ci_status_helper.rb b/app/helpers/ci_status_helper.rb
index 0ecf77bb45e..70f8c9ae221 100644
--- a/app/helpers/ci_status_helper.rb
+++ b/app/helpers/ci_status_helper.rb
@@ -8,6 +8,10 @@ module CiStatusHelper
ci_icon_for_status(ci_commit.status)
end
+ def ci_status_label(ci_commit)
+ ci_label_for_status(ci_commit.status)
+ end
+
def ci_status_color(ci_commit)
case ci_commit.status
when 'success'
@@ -23,7 +27,15 @@ module CiStatusHelper
def ci_status_with_icon(status)
content_tag :span, class: "ci-status ci-#{status}" do
- ci_icon_for_status(status) + ' '.html_safe + status
+ ci_icon_for_status(status) + ' '.html_safe + ci_label_for_status(status)
+ end
+ end
+
+ def ci_label_for_status(status)
+ if status == 'success'
+ 'passed'
+ else
+ status
end
end
@@ -46,7 +58,7 @@ module CiStatusHelper
def render_ci_status(ci_commit)
link_to ci_status_path(ci_commit),
class: "c#{ci_status_color(ci_commit)}",
- title: "Build status: #{ci_commit.status}",
+ title: "Build status: #{ci_status_label(ci_commit)}",
data: { toggle: 'tooltip', placement: 'left' } do
ci_status_icon(ci_commit)
end
diff --git a/app/helpers/page_layout_helper.rb b/app/helpers/page_layout_helper.rb
index 775cf5a3dd4..9bf750124b2 100644
--- a/app/helpers/page_layout_helper.rb
+++ b/app/helpers/page_layout_helper.rb
@@ -4,7 +4,8 @@ module PageLayoutHelper
@page_title.push(*titles.compact) if titles.any?
- @page_title.join(" | ")
+ # Segments are seperated by middot
+ @page_title.join(" \u00b7 ")
end
def header_title(title = nil, title_url = nil)
diff --git a/app/helpers/selects_helper.rb b/app/helpers/selects_helper.rb
index 7e175d0de8a..05386d790ca 100644
--- a/app/helpers/selects_helper.rb
+++ b/app/helpers/selects_helper.rb
@@ -48,6 +48,19 @@ module SelectsHelper
select2_tag(id, opts)
end
+ def project_select_tag(id, opts = {})
+ opts[:class] ||= ''
+ opts[:class] << ' ajax-project-select'
+
+ unless opts.delete(:scope) == :all
+ if @group
+ opts['data-group-id'] = @group.id
+ end
+ end
+
+ hidden_field_tag(id, opts[:selected], opts)
+ end
+
def select2_tag(id, opts = {})
css_class = ''
css_class << 'multiselect ' if opts[:multiple]