diff options
author | Valery Sizov <valery@gitlab.com> | 2015-06-17 10:54:33 +0000 |
---|---|---|
committer | Valery Sizov <valery@gitlab.com> | 2015-06-17 10:54:33 +0000 |
commit | 7cf28a7c48a59092004a8f69ef6c6b33548e3b2e (patch) | |
tree | 3e726b071ca8e7190330d4ca4dbae31b437556c7 | |
parent | fae69d739d1bba59b63be4df2222aa03143acc6d (diff) | |
parent | 7b95cc07a8b237a88b0e0173811cc61eea801208 (diff) | |
download | gitlab-ci-7cf28a7c48a59092004a8f69ef6c6b33548e3b2e.tar.gz |
Merge branch 'web_editor_link' into 'master'
Link to webeditor with .gitlab-ci.yml
https://dev.gitlab.org/gitlab/gitlab-ci/issues/265
See merge request !145
-rw-r--r-- | CHANGELOG | 1 | ||||
-rw-r--r-- | app/helpers/gitlab_helper.rb | 10 | ||||
-rw-r--r-- | app/views/projects/_form.html.haml | 3 |
3 files changed, 14 insertions, 0 deletions
@@ -13,6 +13,7 @@ v7.12.0 - Implementation of Lint (.gitlab-ci.yml validation tool) - Updated rails to 4.1.11 - API fix: project create call + - Link to web-editor with .gitlab-ci.yml v7.11.0 - Deploy Jobs API calls diff --git a/app/helpers/gitlab_helper.rb b/app/helpers/gitlab_helper.rb index 32e2be8..a912da5 100644 --- a/app/helpers/gitlab_helper.rb +++ b/app/helpers/gitlab_helper.rb @@ -21,4 +21,14 @@ module GitlabHelper gitlab_url << "/commit/#{sha}" link_to Commit.truncate_sha(sha), gitlab_url, no_turbolink end + + def yaml_web_editor_link(project) + commits = project.commits + + if commits.any? && commits.last.push_data[:ci_yaml_file] + "#{@project.gitlab_url}/edit/master/.gitlab-ci.yml" + else + "#{@project.gitlab_url}/new/master" + end + end end diff --git a/app/views/projects/_form.html.haml b/app/views/projects/_form.html.haml index e7c1bad..fca61c6 100644 --- a/app/views/projects/_form.html.haml +++ b/app/views/projects/_form.html.haml @@ -1,6 +1,9 @@ .bs-callout.help-callout %p If you want to test your .gitlab-ci.yml, you can use special tool - #{link_to "Lint", lint_path} + %p + Edit your + #{link_to ".gitlab-ci.yml using web-editor", yaml_web_editor_link(@project)} = nested_form_for @project, html: { class: 'form-horizontal' } do |f| - if @project.errors.any? |