From a853d3e944abb7a6d60ea24381028020166760d1 Mon Sep 17 00:00:00 2001 From: Filipa Lacerda Date: Tue, 1 Aug 2017 13:23:04 +0100 Subject: [PATCH] [ci skip] Adds svgs and css for all icons --- app/assets/images/project_templates/rails.png | Bin 4221 -> 0 bytes app/assets/stylesheets/pages/projects.scss | 54 ++++++++++++------ .../projects/_project_templates.html.haml | 19 ++++-- app/views/projects/new.html.haml | 2 +- app/views/shared/icons/_java_spring.svg | 6 ++ app/views/shared/icons/_node_express.svg | 6 ++ app/views/shared/icons/_rails.svg | 6 ++ lib/gitlab/project_template.rb | 4 +- 8 files changed, 69 insertions(+), 28 deletions(-) delete mode 100644 app/assets/images/project_templates/rails.png create mode 100644 app/views/shared/icons/_java_spring.svg create mode 100644 app/views/shared/icons/_node_express.svg create mode 100644 app/views/shared/icons/_rails.svg diff --git a/app/assets/images/project_templates/rails.png b/app/assets/images/project_templates/rails.png deleted file mode 100644 index dbee6bf6227b420070f6fb580f6f969216c4e684..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4221 zcmaJ_2{aVk+n=I(L$)bJWNpMWm=YN~GnfS#y9iUr)`UTkB`RYXjIj(xvJH~#l(9rZ zOw(i+qPN$+lO;>)@Be-0JLmhK@0{=;&{OkB(pG0r~AA%?WVMnmUyAy(4{oMficknnjDWtEfha1+-_0B`TZZ|Ce zKu{71*SC5wx|FkQJ;oBzi(%{}S+)f#5=*4$QF_OqX8>m+!2rc~4M%A_Hx%_s0j)g$ zSiS52VqA53vz)Bjx73_&D}400(I{+|J=?p#&o~NT?8JZodYFF;llxHqm-?U9e-HeR z+d0_}rY$>jb3_qBs$S{vnt<~9_fIRWI%`*_Z-bQ&0*ujV2X%>WJ6^P8OEPIsD(qRa z9RCR}6Sp?0RVWls^Y)adnzpv0- zbX6lsqLITt6yJa5$z2rZ%iweFx*mf1TI$huO1Zi7mJE!JIN-``o{>NWMoet1g;tFI zx?t^Sh+!;rg&GFtCepI`!)Hph;OUIDEw{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=}$-UjFw9_gk&Zeg!w}{utNf3wYT@R8s z)nX-%=W>+LbX8C7H(kc0laMtMNDot~g6oTqqq^W>yu?hNF`E>Q4E?EYf9l6RZy0)C z7L?36iZc*x>E|Y%-2VRWdJ#L4Q4~x?#ZV=8-n->-;F!pyxtvqUKxmu69Jc|c5}M-{ zcLCRFA7KCL@l(#>atdo)YN+Rx;;&)2_}?x+HPSo>h}0B1ylXs<{vQhdpQQW$uwSi02zX0@t1+oAD diff --git a/app/assets/stylesheets/pages/projects.scss b/app/assets/stylesheets/pages/projects.scss index d870d8dda38..12da6fc075b 100644 --- a/app/assets/stylesheets/pages/projects.scss +++ b/app/assets/stylesheets/pages/projects.scss @@ -474,6 +474,41 @@ a.deploy-project-label { margin-right: 10px; } + .blank-option { + min-width: 70px; + } + + .btn-template-icon { + height: 24px; + width: inherit; + display: block; + margin: 2px auto 5px; + font-size: 24px; + } + + @media (max-width: $screen-md-max) { + .btn-template-icon { + display: inline-block; + height: 20px; + font-size: 14px; + margin: 0; + } + } + + .icon-rails path { + fill: #C00; + } + + .icon-node-express path { + fill: #353535; + } + + .icon-java-spring path { + fill: #70AD51; + } + + + > div { margin-bottom: 10px; padding-left: 0; @@ -482,25 +517,6 @@ a.deploy-project-label { } .project-template { - .project-templates-buttons { - i, - img { - display: block; - height: 24px; - font-size: 24px; - margin: 4px auto; - } - - @media (max-width: $screen-md-max) { - i, - img { - display: inline-block; - height: 20px; - font-size: 14px; - margin: 0; - } - } - } &:after { content: "OR"; diff --git a/app/views/projects/_project_templates.html.haml b/app/views/projects/_project_templates.html.haml index a802705051e..53d0d634ec7 100644 --- a/app/views/projects/_project_templates.html.haml +++ b/app/views/projects/_project_templates.html.haml @@ -1,13 +1,22 @@ .project-templates-buttons.import-buttons{ data: { toggle: "buttons" }} - %div.btn.btn-default.active + %div.btn.blank-option.active %input{ type: "radio", autocomplete: "off", name: "project_templates", id: "blank", checked: "true" } - = icon('file-o') + = icon('file-o', class: 'btn-template-icon') Blank - Gitlab::ProjectTemplate.all.each do |template| - -# The title should be the value posted to the controller, a pretty name to print would be - -# template.name %div.btn %input{ type: "radio", autocomplete: "off", name: "project_templates", id: template.name } - = image_tag(template.logo_path) + = custom_icon(template.logo) = template.title + + -# TODO: Remove this once the templates are generated on the backend. + %div.btn + %input{ type: "radio", autocomplete: "off", name: "project_templates", id: "node" } + = custom_icon("node_express") + Node Express + + %div.btn + %input{ type: "radio", autocomplete: "off", name: "project_templates", id: "java" } + = custom_icon("java_spring") + Java Spring diff --git a/app/views/projects/new.html.haml b/app/views/projects/new.html.haml index 50013ee53b5..8cb4b44a2d2 100644 --- a/app/views/projects/new.html.haml +++ b/app/views/projects/new.html.haml @@ -20,7 +20,7 @@ .row .col-lg-6.col-sm-12.new-project-first-column .project-template - .form_group.clearfix + .form-group = f.label :template_project, class: 'label-light' do Create from template = link_to icon('question-circle'), help_page_path("public_access/public_access"), aria: { label: "What's included in a template?" }, title: "What's included in a template?", class: 'has-tooltip', data: { placement: 'top'} diff --git a/app/views/shared/icons/_java_spring.svg b/app/views/shared/icons/_java_spring.svg new file mode 100644 index 00000000000..508349aa456 --- /dev/null +++ b/app/views/shared/icons/_java_spring.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/app/views/shared/icons/_node_express.svg b/app/views/shared/icons/_node_express.svg new file mode 100644 index 00000000000..f2c94319f19 --- /dev/null +++ b/app/views/shared/icons/_node_express.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/app/views/shared/icons/_rails.svg b/app/views/shared/icons/_rails.svg new file mode 100644 index 00000000000..0bb09a705df --- /dev/null +++ b/app/views/shared/icons/_rails.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/lib/gitlab/project_template.rb b/lib/gitlab/project_template.rb index 01f9492c860..d90ba240fde 100644 --- a/lib/gitlab/project_template.rb +++ b/lib/gitlab/project_template.rb @@ -6,9 +6,7 @@ module Gitlab @name, @title = name, title end - def logo_path - "project_templates/#{name}.png" - end + alias_method :logo, :name def file archive_path.open