diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-08-12 16:10:02 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-08-15 15:39:46 +0300 |
commit | 0c81279ea2da8751c58d211d9eb857d227f4318d (patch) | |
tree | 86c92f39a98afa5f3f32150839f243f21e231c7b | |
parent | eec0f5da873a5730e71560330277bf83958a6146 (diff) |
Render collection of badges instead of using iterator
-rw-r--r-- | app/views/projects/pipelines_settings/_badge.html.haml | 27 | ||||
-rw-r--r-- | app/views/projects/pipelines_settings/_badges.html.haml | 28 | ||||
-rw-r--r-- | app/views/projects/pipelines_settings/show.html.haml | 2 |
3 files changed, 28 insertions, 29 deletions
diff --git a/app/views/projects/pipelines_settings/_badge.html.haml b/app/views/projects/pipelines_settings/_badge.html.haml new file mode 100644 index 00000000000..7b7fa56d993 --- /dev/null +++ b/app/views/projects/pipelines_settings/_badge.html.haml @@ -0,0 +1,27 @@ +.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 + · + = 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/_badges.html.haml b/app/views/projects/pipelines_settings/_badges.html.haml deleted file mode 100644 index 436ae4c237a..00000000000 --- a/app/views/projects/pipelines_settings/_badges.html.haml +++ /dev/null @@ -1,28 +0,0 @@ -- 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 - · - = 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 3213fe07ef5..8c7222bfe3d 100644 --- a/app/views/projects/pipelines_settings/show.html.haml +++ b/app/views/projects/pipelines_settings/show.html.haml @@ -77,4 +77,4 @@ %hr .row.prepend-top-default - = render partial: 'badges', object: @badges + = render partial: 'badge', collection: @badges |