diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2016-12-09 17:24:21 +0000 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2016-12-09 17:24:21 +0000 |
commit | 1e8271b60bcd16b6fcc20d574c9583d593084eef (patch) | |
tree | 3882121dbea1ee40de190866d7b560008fa7789c /app/views/ci | |
parent | 78757a0d372b306aefbd16d9c0178d86e02fcb51 (diff) | |
download | gitlab-ce-1e8271b60bcd16b6fcc20d574c9583d593084eef.tar.gz |
Adds new partial for graph icons.
Fix tests
Diffstat (limited to 'app/views/ci')
4 files changed, 22 insertions, 3 deletions
diff --git a/app/views/ci/status/_graph_icon_with_name.html.haml b/app/views/ci/status/_graph_icon_with_name.html.haml new file mode 100644 index 00000000000..51037a3bd20 --- /dev/null +++ b/app/views/ci/status/_graph_icon_with_name.html.haml @@ -0,0 +1,12 @@ +- detailed_status = subject.detailed_status(current_user) +- details_path = detailed_status.details_path if detailed_status.has_details? +- klass = "ci-status-icon ci-status-icon-#{detailed_status}" +- graph_status_icon = "#{detailed_status.icon}_graph" + +- if details_path + = link_to details_path, class: klass, data: { toggle: 'tooltip', title: "#{subject.name} - #{detailed_status}" } do + %span{ class: klass }= custom_icon(graph_status_icon) + .ci-status-text= subject.name +- else + %span{ class: klass }= custom_icon(graph_status_icon) + .ci-status-text= subject.name diff --git a/app/views/ci/status/_graph_icon_with_name_and_action.html.haml b/app/views/ci/status/_graph_icon_with_name_and_action.html.haml new file mode 100644 index 00000000000..525075ced70 --- /dev/null +++ b/app/views/ci/status/_graph_icon_with_name_and_action.html.haml @@ -0,0 +1,8 @@ += render "ci/status/graph_icon_with_name", subject: subject + +- detailed_status = subject.detailed_status(current_user) +- if detailed_status.has_action? + = link_to detailed_status.action_path, method: detailed_status.action_method, + title: "#{subject.name}: #{detailed_status.action_title}", class: 'ci-action-icon-container' do + %i.ci-action-icon-wrapper + = icon(detailed_status.action_icon, class: detailed_status.action_class) diff --git a/app/views/ci/status/_icon_with_name.html.haml b/app/views/ci/status/_icon_with_name.html.haml index a467316ef47..028e1fe9402 100644 --- a/app/views/ci/status/_icon_with_name.html.haml +++ b/app/views/ci/status/_icon_with_name.html.haml @@ -1,11 +1,10 @@ - detailed_status = subject.detailed_status(current_user) - details_path = detailed_status.details_path if detailed_status.has_details? - klass = "ci-status-icon ci-status-icon-#{detailed_status}" -- status_icon = graph ? "#{detailed_status.icon}_graph" : detailed_status.icon - if details_path = link_to details_path, class: klass, data: { toggle: 'tooltip', title: "#{subject.name} - #{detailed_status}" } do - %span{ class: klass }= custom_icon(status_icon) + %span{ class: klass }= custom_icon(detailed_status.icon) .ci-status-text= subject.name - else %span{ class: klass }= custom_icon(detailed_status.icon) diff --git a/app/views/ci/status/_icon_with_name_and_action.html.haml b/app/views/ci/status/_icon_with_name_and_action.html.haml index b912c212534..76db3b7f38a 100644 --- a/app/views/ci/status/_icon_with_name_and_action.html.haml +++ b/app/views/ci/status/_icon_with_name_and_action.html.haml @@ -1,4 +1,4 @@ -= render "ci/status/icon_with_name", subject: subject, graph: true += render "ci/status/icon_with_name", subject: subject - detailed_status = subject.detailed_status(current_user) - if detailed_status.has_action? |