From 130f60d55b13682cc4ca4cba390535dc10dbca07 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 31 Jan 2013 11:22:06 +0200 Subject: [PATCH] a bit of restyling. Replace some images with icons. Simplify note form --- app/assets/images/home_icon.PNG | Bin 596 -> 0 bytes app/assets/images/icon-attachment.png | Bin 450 -> 0 bytes app/assets/javascripts/notes.js | 4 +- app/assets/stylesheets/common.scss | 4 -- app/assets/stylesheets/sections/nav.scss | 12 ++-- app/assets/stylesheets/sections/notes.scss | 58 +++++-------------- app/views/layouts/admin.html.haml | 3 +- app/views/layouts/application.html.haml | 3 +- app/views/layouts/group.html.haml | 3 +- app/views/layouts/profile.html.haml | 3 +- app/views/layouts/project_resource.html.haml | 3 +- app/views/layouts/user_team.html.haml | 3 +- app/views/notes/_form.html.haml | 32 +++++----- app/views/notes/_note.html.haml | 2 +- 14 files changed, 50 insertions(+), 80 deletions(-) delete mode 100644 app/assets/images/home_icon.PNG delete mode 100644 app/assets/images/icon-attachment.png diff --git a/app/assets/images/home_icon.PNG b/app/assets/images/home_icon.PNG deleted file mode 100644 index b1d60d5935760d7f7c448a6ea3e7270fe405a664..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 596 zcmeAS@N?(olHy`uVBq!ia0y~yU=RXf4mJh`hOl#e;S3B6jKx9jP7LeL$-HD>U|>t~ zc6VX;4}uH!E}zW6z`$AH5n0T@z%2~Ij105pNH8!ku$OrHy0YJ465%ytOEGcsXJBBw z;_2cTVsU!zWZR5TN0FBOJMCPhJEtoAn5=N)=E=iBTXwLE8n#a3GGnwB71=sLBAQ!J zu{SeB;7VD3<`E~sBq_%uZXepGm?g!Xk?wvo`K+n^qm|z_JU@5t%uMdrAuc6KNgDHS zm)D<*VrIB4>pA&A-Gdabm&LKyl_&Kvybt!$XZw6rDn-k)zrpx`U4og?Ht$zVlMlR1 zJ**wr+aY^k%iG1<@)@r;_#X&=P$2hy`u(y~YD-;QdKfMrF!Ky=ls=I5fT@7Vg8hbB zy`k0&mJfV0Hrq1#FgQ!TkTYPu!={qyztW{N_Oc0YY3zI^Iq#~OlChcI=XK;fs%A6J zUp|G8QA5d$ae8Cn1H})#J5p{>s$=*pna;eyH2;_62dN!=XKvWV-IUvA%QuI$j8UAC zc~kA>Z;T7Ft3_U<7P~bX-ael5e%hAc)^p(w6)!VQ9 z{ALp!H`uDZT=`c0Kx{&?b~d-*#_fCm9W7H*y}PkCK4_}sS*B>O|Lm2kuKm3F%lGn^ zV6XiRtz~6lzTdc(K4tlO-{F5usQ3F-sk66j*`$B=pGM|7hBplNyMNDH!hbU+eWmDy wZ04)piD5q<)g)dJfAAndE&c2P|Azab-ba;Qnce-#z`(%Z>FVdQ&MBb@0KpdYQUCw| diff --git a/app/assets/images/icon-attachment.png b/app/assets/images/icon-attachment.png deleted file mode 100644 index 168ad8dce3765ac98968def2101ba9f298e9f637..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 450 zcmeAS@N?(olHy`uVBq!ia0y~yU=RRd4mJh`2Kmqb6B!s7BuiW)N`mv#O3D+9QW+dm z@{>{(JaZG%Q-e|yQz{EjrrIztFs69AIEGZ*s+oM=oh4D?_;SN(|C;?SYI-fdq!_d& zO!Jbi($c^#y}Ln+O1xJ`FPY*SxoGP|jkPO+t&Rw7{3bBh%GE`uR&L*EiOug%AAfVs z=5yu!=f_P_jU@Z0Ht|L@rd6~vt#LkEyvE^r?%os-H@^}U0}Nuw`^ z1!Q*lJ#eqve{|ko2PwDMNxKe|#Wsumeczx}(kPnA^ev_-^hcBX)7<5eO))M;%)5J8 z_H+H3u!NUS#j?-iS%UFO?ysh7(;OYOdavT05=@cF#Ja`Lv#2^{QgX8`(2a&;La5dfh6N zIA_wz9nf~}#+sPO<4rBs><%yJntI)ni?eW=-_d-7gw)=m^{*y%+2)5={oa>+M*G6@ z1np-Hc1FKn#67s9X7S<9>tOYhD|_z?-QF9{{X;x~A<8FMrt-v=Z43+y44$rjF6*2U FngD-##Zv$P diff --git a/app/assets/javascripts/notes.js b/app/assets/javascripts/notes.js index 8a7e08dd..919c6b7f 100644 --- a/app/assets/javascripts/notes.js +++ b/app/assets/javascripts/notes.js @@ -20,12 +20,12 @@ var NoteList = { if(NoteList.reversed) { var form = $(".js-main-target-form"); - form.find(".buttons, .note_options").hide(); + form.find(".note-form-actions").hide(); var textarea = form.find(".js-note-text"); textarea.css("height", "40px"); textarea.on("focus", function(){ textarea.css("height", "80px"); - form.find(".buttons, .note_options").show(); + form.find(".note-form-actions").show(); }); } diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index 1884c39b..c9a11d0a 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -338,10 +338,6 @@ li.note { li { border-bottom:none !important; } - .attachment { - padding-left: 20px; - background:url("icon-attachment.png") no-repeat left center; - } } } diff --git a/app/assets/stylesheets/sections/nav.scss b/app/assets/stylesheets/sections/nav.scss index bc19bc75..50091cd7 100644 --- a/app/assets/stylesheets/sections/nav.scss +++ b/app/assets/stylesheets/sections/nav.scss @@ -6,8 +6,7 @@ ul.main_menu { margin: auto; margin: 30px 0; margin-top: 10px; - border-bottom: 1px solid #DDD; - height: 37px; + height: 38px; position: relative; overflow: hidden; .count { @@ -33,6 +32,7 @@ ul.main_menu { margin: 0; display: table-cell; width: 1%; + border-bottom: 2px solid #EEE; &.active { border-bottom: 2px solid #474D57; a { @@ -42,10 +42,8 @@ ul.main_menu { &.home { a { - background: url(home_icon.PNG) no-repeat center center; - text-indent:-9999px; - min-width: 20px; - img { + i { + font-size: 20px; position: relative; top: 4px; } @@ -56,7 +54,7 @@ ul.main_menu { display: block; text-align: center; font-weight: normal; - height: 35px; + height: 36px; line-height: 36px; color: #777; text-shadow: 0 1px 1px white; diff --git a/app/assets/stylesheets/sections/notes.scss b/app/assets/stylesheets/sections/notes.scss index 895e9dfa..648cb210 100644 --- a/app/assets/stylesheets/sections/notes.scss +++ b/app/assets/stylesheets/sections/notes.scss @@ -81,14 +81,6 @@ ul.notes { .attachment { font-size: 14px; margin-top: -20px; - - .icon-attachment { - @extend .icon-paper-clip; - font-size: 24px; - position: relative; - text-align: right; - top: 6px; - } } .note-body { margin-left: 45px; @@ -229,11 +221,6 @@ ul.notes { .discussion { .new_note { margin: 8px 5px 8px 0; - - .note_options { - // because of the smaller width and the extra "cancel" button - margin-top: 8px; - } } } .new_note { @@ -246,37 +233,6 @@ ul.notes { .clearfix { margin-bottom: 0; } - .note_options { - h6 { - @extend .left; - line-height: 20px; - padding-right: 16px; - padding-bottom: 16px; - } - label { - padding: 0; - } - - .attachment { - @extend .pull-right; - position: relative; - width: 350px; - height: 50px; - margin:0 0 5px !important; - - // hide the actual file field - input { - display: none; - } - - .choose-btn { - float: right; - } - } - .notify_options { - @extend .pull-right; - } - } .note_text_and_preview { // makes the "absolute" position for links relative to this position: relative; @@ -315,3 +271,17 @@ ul.notes { @extend .thumbnail; margin-left: 45px; } + + +.note-form-actions { + background: #F9F9F9; + height: 45px; + padding: 0 5px; + + .note-form-option { + margin-top: 8px; + margin-left: 15px; + @extend .pull-left; + @extend .span4; + } +} diff --git a/app/views/layouts/admin.html.haml b/app/views/layouts/admin.html.haml index 28626b9c..a01886cd 100644 --- a/app/views/layouts/admin.html.haml +++ b/app/views/layouts/admin.html.haml @@ -7,7 +7,8 @@ .container %ul.main_menu = nav_link(controller: :dashboard, html_options: {class: 'home'}) do - = link_to "Stats", admin_root_path + = link_to admin_root_path, title: "Stats" do + %i.icon-home = nav_link(controller: :projects) do = link_to "Projects", admin_projects_path = nav_link(controller: :teams) do diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 261a8608..7ee44238 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -7,7 +7,8 @@ .container %ul.main_menu = nav_link(path: 'dashboard#show', html_options: {class: 'home'}) do - = link_to "Home", root_path, title: "Home" + = link_to root_path, title: "Home" do + %i.icon-home = nav_link(path: 'dashboard#projects') do = link_to projects_dashboard_path do Projects diff --git a/app/views/layouts/group.html.haml b/app/views/layouts/group.html.haml index 46bc9ef1..4395e408 100644 --- a/app/views/layouts/group.html.haml +++ b/app/views/layouts/group.html.haml @@ -7,7 +7,8 @@ .container %ul.main_menu = nav_link(path: 'groups#show', html_options: {class: 'home'}) do - = link_to "Home", group_path(@group), title: "Home" + = link_to group_path(@group), title: "Home" do + %i.icon-home = nav_link(path: 'groups#issues') do = link_to issues_group_path(@group) do Issues diff --git a/app/views/layouts/profile.html.haml b/app/views/layouts/profile.html.haml index 7852ed6f..57f250c7 100644 --- a/app/views/layouts/profile.html.haml +++ b/app/views/layouts/profile.html.haml @@ -7,7 +7,8 @@ .container %ul.main_menu = nav_link(path: 'profiles#show', html_options: {class: 'home'}) do - = link_to "Profile", profile_path + = link_to profile_path, title: "Profile" do + %i.icon-home = nav_link(path: 'profiles#account') do = link_to "Account", account_profile_path = nav_link(controller: :keys) do diff --git a/app/views/layouts/project_resource.html.haml b/app/views/layouts/project_resource.html.haml index c19d33ce..09ccb1d7 100644 --- a/app/views/layouts/project_resource.html.haml +++ b/app/views/layouts/project_resource.html.haml @@ -12,7 +12,8 @@ .container %ul.main_menu = nav_link(html_options: {class: "home #{project_tab_class}"}) do - = link_to @project.path, project_path(@project), title: "Project" + = link_to project_path(@project), title: "Project" do + %i.icon-home - if @project.repo_exists? - if can? current_user, :download_code, @project diff --git a/app/views/layouts/user_team.html.haml b/app/views/layouts/user_team.html.haml index 2d397e80..19bbc373 100644 --- a/app/views/layouts/user_team.html.haml +++ b/app/views/layouts/user_team.html.haml @@ -7,7 +7,8 @@ .container %ul.main_menu = nav_link(path: 'teams#show', html_options: {class: 'home'}) do - = link_to "Home", team_path(@team), title: "Home" + = link_to team_path(@team), title: "Home" do + %i.icon-home = nav_link(path: 'teams#issues') do = link_to issues_team_path(@team) do diff --git a/app/views/notes/_form.html.haml b/app/views/notes/_form.html.haml index f008712c..a154c31e 100644 --- a/app/views/notes/_form.html.haml +++ b/app/views/notes/_form.html.haml @@ -15,30 +15,30 @@ = f.text_area :note, size: 255, class: 'note_text js-note-text js-gfm-input turn-on' .note_preview.js-note-preview.turn-off - .buttons - = f.submit 'Add Comment', class: "btn comment-btn grouped js-comment-button" - %a.btn.grouped.js-close-discussion-note-form Cancel .hint .pull-right Comments are parsed with #{link_to "GitLab Flavored Markdown", help_markdown_path, target: '_blank'}. .clearfix - .note_options - .attachment - %h6 Attachment: - .file_name.js-attachment-filename File name... - %a.choose-btn.btn.btn-small.js-choose-note-attachment-button Choose File ... - .hint Any file up to 10 MB + .note-form-actions + .buttons + = f.submit 'Add Comment', class: "btn comment-btn grouped js-comment-button" + %a.btn.grouped.js-close-discussion-note-form Cancel - = f.file_field :attachment, class: "js-note-attachment-input" - - .notify_options - %h6 Notify via email: + .note-form-option = label_tag :notify do = check_box_tag :notify, 1, !@note.for_commit? - Project team + %span.light Notify team via email .js-notify-commit-author = label_tag :notify_author do = check_box_tag :notify_author, 1 , @note.for_commit? - Commit author - .clearfix + %span.light Notify commit author + .note-form-option + %a.choose-btn.btn.btn-small.js-choose-note-attachment-button + %i.icon-paper-clip + %span Choose File ... +   + %span.file_name.js-attachment-filename File name... + = f.file_field :attachment, class: "js-note-attachment-input hide" + + .clearfix diff --git a/app/views/notes/_note.html.haml b/app/views/notes/_note.html.haml index 9c51da29..4d3007a0 100644 --- a/app/views/notes/_note.html.haml +++ b/app/views/notes/_note.html.haml @@ -32,6 +32,6 @@ = image_tag note.attachment.url, class: 'note-image-attach' .attachment.pull-right = link_to note.attachment.url, target: "_blank" do - %i.icon-attachment + %i.icon-paper-clip = note.attachment_identifier .clear