diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2016-11-04 21:17:40 +0300 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2016-11-04 21:17:40 +0300 |
commit | 64e8b7ca49b6e00d7a5e218260e836b675c380e0 (patch) | |
tree | 46d43bdd1a287070f8b91e5ff95271713e94bcb4 /app/helpers | |
parent | f16dca30516281aee428e78708cd91825ea7b75d (diff) | |
parent | 86b8fb4e7f376bdb70faf8ce99f34b6ec0fc8dc1 (diff) |
Merge remote-tracking branch 'upstream/master' into pipeline-notifications
* upstream/master: (74 commits)
Fetch locals to avoid undefined method/local error
Remove author according to the document
Simplify implementation of entity serializers
Add documentation for the "Only allow merge requests to be merged if all discussions are resolved" feature
Complete and improve specs
Add setting to only allow merge requests to be merged when all discussions are resolved
Apply `*_params_ce + *_params_ee` pattern to MergeRequestsController
Add tests for deployment and environment entitites
Add tests for serialization entities, add user entity
Only skip group when it's actually a group in the "Share with group" select
Fix: Todos Filter Shows All Users
Fix: Guest sees some repository details and gets 404
Move shared params to a helper
GrapeDSL for project hooks
Update commits.scss
updated styling commit SHA on branches page + added to changelog
change build list height to show 6,5 builds + improve padding of list, with first/last child selectors
Refine build entity tests a little
Expose commit author if author exists
Ignore builds directory from eslint
...
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/application_settings_helper.rb | 4 | ||||
-rw-r--r-- | app/helpers/ci_status_helper.rb | 18 | ||||
-rw-r--r-- | app/helpers/commits_helper.rb | 8 | ||||
-rw-r--r-- | app/helpers/dropdowns_helper.rb | 2 |
4 files changed, 22 insertions, 10 deletions
diff --git a/app/helpers/application_settings_helper.rb b/app/helpers/application_settings_helper.rb index 6229384817b..45a567a1eba 100644 --- a/app/helpers/application_settings_helper.rb +++ b/app/helpers/application_settings_helper.rb @@ -93,11 +93,11 @@ module ApplicationSettingsHelper end end - def repository_storage_options_for_select + def repository_storages_options_for_select options = Gitlab.config.repositories.storages.map do |name, path| ["#{name} - #{path}", name] end - options_for_select(options, @application_setting.repository_storage) + options_for_select(options, @application_setting.repository_storages) end end diff --git a/app/helpers/ci_status_helper.rb b/app/helpers/ci_status_helper.rb index b7f48630bd4..895c3d728ad 100644 --- a/app/helpers/ci_status_helper.rb +++ b/app/helpers/ci_status_helper.rb @@ -47,17 +47,27 @@ module CiStatusHelper 'icon_play' when 'created' 'icon_status_created' + when 'skipped' + 'icon_status_skipped' else - 'icon_status_cancel' + 'icon_status_canceled' end custom_icon(icon_name) end - def render_commit_status(commit, tooltip_placement: 'auto left') + def render_commit_status(commit, ref: nil, tooltip_placement: 'auto left') project = commit.project - path = pipelines_namespace_project_commit_path(project.namespace, project, commit) - render_status_with_link('commit', commit.status, path, tooltip_placement: tooltip_placement) + path = pipelines_namespace_project_commit_path( + project.namespace, + project, + commit) + + render_status_with_link( + 'commit', + commit.status(ref), + path, + tooltip_placement: tooltip_placement) end def render_pipeline_status(pipeline, tooltip_placement: 'auto left') diff --git a/app/helpers/commits_helper.rb b/app/helpers/commits_helper.rb index 33dcee49aee..ed402b698fb 100644 --- a/app/helpers/commits_helper.rb +++ b/app/helpers/commits_helper.rb @@ -25,9 +25,11 @@ module CommitsHelper end end - def commit_to_html(commit, project, inline = true) - template = inline ? "inline_commit" : "commit" - render "projects/commits/#{template}", commit: commit, project: project unless commit.nil? + def commit_to_html(commit, ref, project) + render 'projects/commits/commit', + commit: commit, + ref: ref, + project: project end # Breadcrumb links for a Project and, if applicable, a tree path diff --git a/app/helpers/dropdowns_helper.rb b/app/helpers/dropdowns_helper.rb index 81e0b6bb5ae..cbab1fd5967 100644 --- a/app/helpers/dropdowns_helper.rb +++ b/app/helpers/dropdowns_helper.rb @@ -43,7 +43,7 @@ module DropdownsHelper default_label = data_attr[:default_label] content_tag(:button, class: "dropdown-menu-toggle #{options[:toggle_class] if options.has_key?(:toggle_class)}", id: (options[:id] if options.has_key?(:id)), type: "button", data: data_attr) do output = content_tag(:span, toggle_text, class: "dropdown-toggle-text #{'is-default' if toggle_text == default_label}") - output << icon('chevron-down') + output << icon('caret-down') output.html_safe end end |