summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-08-12 14:32:46 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-08-15 14:39:46 +0200
commiteec0f5da873a5730e71560330277bf83958a6146 (patch)
tree417790abbb678ce7f462f24bbe59869a3e8f40c7
parentb646adef131eb41521ca0a56884d5b3862c4f5ef (diff)
downloadgitlab-ce-eec0f5da873a5730e71560330277bf83958a6146.tar.gz
Extract pipeline badges to the separate view partial
-rw-r--r--app/views/projects/pipelines_settings/_badges.html.haml28
-rw-r--r--app/views/projects/pipelines_settings/show.html.haml29
2 files changed, 29 insertions, 28 deletions
diff --git a/app/views/projects/pipelines_settings/_badges.html.haml b/app/views/projects/pipelines_settings/_badges.html.haml
new file mode 100644
index 00000000000..436ae4c237a
--- /dev/null
+++ b/app/views/projects/pipelines_settings/_badges.html.haml
@@ -0,0 +1,28 @@
+- badges.each do |badge|
+ .row{ class: badge.title.gsub(' ', '-') }
+ .col-lg-3.profile-settings-sidebar
+ %h4.prepend-top-0
+ = badge.title.capitalize
+ .col-lg-9
+ .prepend-top-10
+ .panel.panel-default
+ .panel-heading
+ %b
+ = badge.title.capitalize
+ &middot;
+ = badge.to_html
+ .pull-right
+ = render 'shared/ref_switcher', destination: 'badges', align_right: true
+ .panel-body
+ .row
+ .col-md-2.text-center
+ Markdown
+ .col-md-10.code.js-syntax-highlight
+ = highlight('.md', badge.to_markdown)
+ .row
+ %hr
+ .row
+ .col-md-2.text-center
+ HTML
+ .col-md-10.code.js-syntax-highlight
+ = highlight('.html', badge.to_html)
diff --git a/app/views/projects/pipelines_settings/show.html.haml b/app/views/projects/pipelines_settings/show.html.haml
index 5570dc0481b..3213fe07ef5 100644
--- a/app/views/projects/pipelines_settings/show.html.haml
+++ b/app/views/projects/pipelines_settings/show.html.haml
@@ -77,31 +77,4 @@
%hr
.row.prepend-top-default
- - @badges.each do |badge|
- .row{ class: badge.title.gsub(' ', '-') }
- .col-lg-3.profile-settings-sidebar
- %h4.prepend-top-0
- = badge.title.capitalize
- .col-lg-9
- .prepend-top-10
- .panel.panel-default
- .panel-heading
- %b
- = badge.title.capitalize
- &middot;
- = badge.to_html
- .pull-right
- = render 'shared/ref_switcher', destination: 'badges', align_right: true
- .panel-body
- .row
- .col-md-2.text-center
- Markdown
- .col-md-10.code.js-syntax-highlight
- = highlight('.md', badge.to_markdown)
- .row
- %hr
- .row
- .col-md-2.text-center
- HTML
- .col-md-10.code.js-syntax-highlight
- = highlight('.html', badge.to_html)
+ = render partial: 'badges', object: @badges