diff options
-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? |