Commit 130f60d55b13682cc4ca4cba390535dc10dbca07

Authored by Dmitriy Zaporozhets
1 parent 315fd7d7

a bit of restyling. Replace some images with icons. Simplify note form

app/assets/images/home_icon.PNG

596 Bytes

app/assets/images/icon-attachment.png

450 Bytes

app/assets/javascripts/notes.js
@@ -20,12 +20,12 @@ var NoteList = { @@ -20,12 +20,12 @@ var NoteList = {
20 20
21 if(NoteList.reversed) { 21 if(NoteList.reversed) {
22 var form = $(".js-main-target-form"); 22 var form = $(".js-main-target-form");
23 - form.find(".buttons, .note_options").hide(); 23 + form.find(".note-form-actions").hide();
24 var textarea = form.find(".js-note-text"); 24 var textarea = form.find(".js-note-text");
25 textarea.css("height", "40px"); 25 textarea.css("height", "40px");
26 textarea.on("focus", function(){ 26 textarea.on("focus", function(){
27 textarea.css("height", "80px"); 27 textarea.css("height", "80px");
28 - form.find(".buttons, .note_options").show(); 28 + form.find(".note-form-actions").show();
29 }); 29 });
30 } 30 }
31 31
app/assets/stylesheets/common.scss
@@ -338,10 +338,6 @@ li.note { @@ -338,10 +338,6 @@ li.note {
338 li { 338 li {
339 border-bottom:none !important; 339 border-bottom:none !important;
340 } 340 }
341 - .attachment {  
342 - padding-left: 20px;  
343 - background:url("icon-attachment.png") no-repeat left center;  
344 - }  
345 } 341 }
346 } 342 }
347 343
app/assets/stylesheets/sections/nav.scss
@@ -6,8 +6,7 @@ ul.main_menu { @@ -6,8 +6,7 @@ ul.main_menu {
6 margin: auto; 6 margin: auto;
7 margin: 30px 0; 7 margin: 30px 0;
8 margin-top: 10px; 8 margin-top: 10px;
9 - border-bottom: 1px solid #DDD;  
10 - height: 37px; 9 + height: 38px;
11 position: relative; 10 position: relative;
12 overflow: hidden; 11 overflow: hidden;
13 .count { 12 .count {
@@ -33,6 +32,7 @@ ul.main_menu { @@ -33,6 +32,7 @@ ul.main_menu {
33 margin: 0; 32 margin: 0;
34 display: table-cell; 33 display: table-cell;
35 width: 1%; 34 width: 1%;
  35 + border-bottom: 2px solid #EEE;
36 &.active { 36 &.active {
37 border-bottom: 2px solid #474D57; 37 border-bottom: 2px solid #474D57;
38 a { 38 a {
@@ -42,10 +42,8 @@ ul.main_menu { @@ -42,10 +42,8 @@ ul.main_menu {
42 42
43 &.home { 43 &.home {
44 a { 44 a {
45 - background: url(home_icon.PNG) no-repeat center center;  
46 - text-indent:-9999px;  
47 - min-width: 20px;  
48 - img { 45 + i {
  46 + font-size: 20px;
49 position: relative; 47 position: relative;
50 top: 4px; 48 top: 4px;
51 } 49 }
@@ -56,7 +54,7 @@ ul.main_menu { @@ -56,7 +54,7 @@ ul.main_menu {
56 display: block; 54 display: block;
57 text-align: center; 55 text-align: center;
58 font-weight: normal; 56 font-weight: normal;
59 - height: 35px; 57 + height: 36px;
60 line-height: 36px; 58 line-height: 36px;
61 color: #777; 59 color: #777;
62 text-shadow: 0 1px 1px white; 60 text-shadow: 0 1px 1px white;
app/assets/stylesheets/sections/notes.scss
@@ -81,14 +81,6 @@ ul.notes { @@ -81,14 +81,6 @@ ul.notes {
81 .attachment { 81 .attachment {
82 font-size: 14px; 82 font-size: 14px;
83 margin-top: -20px; 83 margin-top: -20px;
84 -  
85 - .icon-attachment {  
86 - @extend .icon-paper-clip;  
87 - font-size: 24px;  
88 - position: relative;  
89 - text-align: right;  
90 - top: 6px;  
91 - }  
92 } 84 }
93 .note-body { 85 .note-body {
94 margin-left: 45px; 86 margin-left: 45px;
@@ -229,11 +221,6 @@ ul.notes { @@ -229,11 +221,6 @@ ul.notes {
229 .discussion { 221 .discussion {
230 .new_note { 222 .new_note {
231 margin: 8px 5px 8px 0; 223 margin: 8px 5px 8px 0;
232 -  
233 - .note_options {  
234 - // because of the smaller width and the extra "cancel" button  
235 - margin-top: 8px;  
236 - }  
237 } 224 }
238 } 225 }
239 .new_note { 226 .new_note {
@@ -246,37 +233,6 @@ ul.notes { @@ -246,37 +233,6 @@ ul.notes {
246 .clearfix { 233 .clearfix {
247 margin-bottom: 0; 234 margin-bottom: 0;
248 } 235 }
249 - .note_options {  
250 - h6 {  
251 - @extend .left;  
252 - line-height: 20px;  
253 - padding-right: 16px;  
254 - padding-bottom: 16px;  
255 - }  
256 - label {  
257 - padding: 0;  
258 - }  
259 -  
260 - .attachment {  
261 - @extend .pull-right;  
262 - position: relative;  
263 - width: 350px;  
264 - height: 50px;  
265 - margin:0 0 5px !important;  
266 -  
267 - // hide the actual file field  
268 - input {  
269 - display: none;  
270 - }  
271 -  
272 - .choose-btn {  
273 - float: right;  
274 - }  
275 - }  
276 - .notify_options {  
277 - @extend .pull-right;  
278 - }  
279 - }  
280 .note_text_and_preview { 236 .note_text_and_preview {
281 // makes the "absolute" position for links relative to this 237 // makes the "absolute" position for links relative to this
282 position: relative; 238 position: relative;
@@ -315,3 +271,17 @@ ul.notes { @@ -315,3 +271,17 @@ ul.notes {
315 @extend .thumbnail; 271 @extend .thumbnail;
316 margin-left: 45px; 272 margin-left: 45px;
317 } 273 }
  274 +
  275 +
  276 +.note-form-actions {
  277 + background: #F9F9F9;
  278 + height: 45px;
  279 + padding: 0 5px;
  280 +
  281 + .note-form-option {
  282 + margin-top: 8px;
  283 + margin-left: 15px;
  284 + @extend .pull-left;
  285 + @extend .span4;
  286 + }
  287 +}
app/views/layouts/admin.html.haml
@@ -7,7 +7,8 @@ @@ -7,7 +7,8 @@
7 .container 7 .container
8 %ul.main_menu 8 %ul.main_menu
9 = nav_link(controller: :dashboard, html_options: {class: 'home'}) do 9 = nav_link(controller: :dashboard, html_options: {class: 'home'}) do
10 - = link_to "Stats", admin_root_path 10 + = link_to admin_root_path, title: "Stats" do
  11 + %i.icon-home
11 = nav_link(controller: :projects) do 12 = nav_link(controller: :projects) do
12 = link_to "Projects", admin_projects_path 13 = link_to "Projects", admin_projects_path
13 = nav_link(controller: :teams) do 14 = nav_link(controller: :teams) do
app/views/layouts/application.html.haml
@@ -7,7 +7,8 @@ @@ -7,7 +7,8 @@
7 .container 7 .container
8 %ul.main_menu 8 %ul.main_menu
9 = nav_link(path: 'dashboard#show', html_options: {class: 'home'}) do 9 = nav_link(path: 'dashboard#show', html_options: {class: 'home'}) do
10 - = link_to "Home", root_path, title: "Home" 10 + = link_to root_path, title: "Home" do
  11 + %i.icon-home
11 = nav_link(path: 'dashboard#projects') do 12 = nav_link(path: 'dashboard#projects') do
12 = link_to projects_dashboard_path do 13 = link_to projects_dashboard_path do
13 Projects 14 Projects
app/views/layouts/group.html.haml
@@ -7,7 +7,8 @@ @@ -7,7 +7,8 @@
7 .container 7 .container
8 %ul.main_menu 8 %ul.main_menu
9 = nav_link(path: 'groups#show', html_options: {class: 'home'}) do 9 = nav_link(path: 'groups#show', html_options: {class: 'home'}) do
10 - = link_to "Home", group_path(@group), title: "Home" 10 + = link_to group_path(@group), title: "Home" do
  11 + %i.icon-home
11 = nav_link(path: 'groups#issues') do 12 = nav_link(path: 'groups#issues') do
12 = link_to issues_group_path(@group) do 13 = link_to issues_group_path(@group) do
13 Issues 14 Issues
app/views/layouts/profile.html.haml
@@ -7,7 +7,8 @@ @@ -7,7 +7,8 @@
7 .container 7 .container
8 %ul.main_menu 8 %ul.main_menu
9 = nav_link(path: 'profiles#show', html_options: {class: 'home'}) do 9 = nav_link(path: 'profiles#show', html_options: {class: 'home'}) do
10 - = link_to "Profile", profile_path 10 + = link_to profile_path, title: "Profile" do
  11 + %i.icon-home
11 = nav_link(path: 'profiles#account') do 12 = nav_link(path: 'profiles#account') do
12 = link_to "Account", account_profile_path 13 = link_to "Account", account_profile_path
13 = nav_link(controller: :keys) do 14 = nav_link(controller: :keys) do
app/views/layouts/project_resource.html.haml
@@ -12,7 +12,8 @@ @@ -12,7 +12,8 @@
12 .container 12 .container
13 %ul.main_menu 13 %ul.main_menu
14 = nav_link(html_options: {class: "home #{project_tab_class}"}) do 14 = nav_link(html_options: {class: "home #{project_tab_class}"}) do
15 - = link_to @project.path, project_path(@project), title: "Project" 15 + = link_to project_path(@project), title: "Project" do
  16 + %i.icon-home
16 17
17 - if @project.repo_exists? 18 - if @project.repo_exists?
18 - if can? current_user, :download_code, @project 19 - if can? current_user, :download_code, @project
app/views/layouts/user_team.html.haml
@@ -7,7 +7,8 @@ @@ -7,7 +7,8 @@
7 .container 7 .container
8 %ul.main_menu 8 %ul.main_menu
9 = nav_link(path: 'teams#show', html_options: {class: 'home'}) do 9 = nav_link(path: 'teams#show', html_options: {class: 'home'}) do
10 - = link_to "Home", team_path(@team), title: "Home" 10 + = link_to team_path(@team), title: "Home" do
  11 + %i.icon-home
11 12
12 = nav_link(path: 'teams#issues') do 13 = nav_link(path: 'teams#issues') do
13 = link_to issues_team_path(@team) do 14 = link_to issues_team_path(@team) do
app/views/notes/_form.html.haml
@@ -15,30 +15,30 @@ @@ -15,30 +15,30 @@
15 = f.text_area :note, size: 255, class: 'note_text js-note-text js-gfm-input turn-on' 15 = f.text_area :note, size: 255, class: 'note_text js-note-text js-gfm-input turn-on'
16 .note_preview.js-note-preview.turn-off 16 .note_preview.js-note-preview.turn-off
17 17
18 - .buttons  
19 - = f.submit 'Add Comment', class: "btn comment-btn grouped js-comment-button"  
20 - %a.btn.grouped.js-close-discussion-note-form Cancel  
21 .hint 18 .hint
22 .pull-right Comments are parsed with #{link_to "GitLab Flavored Markdown", help_markdown_path, target: '_blank'}. 19 .pull-right Comments are parsed with #{link_to "GitLab Flavored Markdown", help_markdown_path, target: '_blank'}.
23 .clearfix 20 .clearfix
24 21
25 - .note_options  
26 - .attachment  
27 - %h6 Attachment:  
28 - .file_name.js-attachment-filename File name...  
29 - %a.choose-btn.btn.btn-small.js-choose-note-attachment-button Choose File ...  
30 - .hint Any file up to 10 MB 22 + .note-form-actions
  23 + .buttons
  24 + = f.submit 'Add Comment', class: "btn comment-btn grouped js-comment-button"
  25 + %a.btn.grouped.js-close-discussion-note-form Cancel
31 26
32 - = f.file_field :attachment, class: "js-note-attachment-input"  
33 -  
34 - .notify_options  
35 - %h6 Notify via email: 27 + .note-form-option
36 = label_tag :notify do 28 = label_tag :notify do
37 = check_box_tag :notify, 1, !@note.for_commit? 29 = check_box_tag :notify, 1, !@note.for_commit?
38 - Project team 30 + %span.light Notify team via email
39 31
40 .js-notify-commit-author 32 .js-notify-commit-author
41 = label_tag :notify_author do 33 = label_tag :notify_author do
42 = check_box_tag :notify_author, 1 , @note.for_commit? 34 = check_box_tag :notify_author, 1 , @note.for_commit?
43 - Commit author  
44 - .clearfix 35 + %span.light Notify commit author
  36 + .note-form-option
  37 + %a.choose-btn.btn.btn-small.js-choose-note-attachment-button
  38 + %i.icon-paper-clip
  39 + %span Choose File ...
  40 +  
  41 + %span.file_name.js-attachment-filename File name...
  42 + = f.file_field :attachment, class: "js-note-attachment-input hide"
  43 +
  44 + .clearfix
app/views/notes/_note.html.haml
@@ -32,6 +32,6 @@ @@ -32,6 +32,6 @@
32 = image_tag note.attachment.url, class: 'note-image-attach' 32 = image_tag note.attachment.url, class: 'note-image-attach'
33 .attachment.pull-right 33 .attachment.pull-right
34 = link_to note.attachment.url, target: "_blank" do 34 = link_to note.attachment.url, target: "_blank" do
35 - %i.icon-attachment 35 + %i.icon-paper-clip
36 = note.attachment_identifier 36 = note.attachment_identifier
37 .clear 37 .clear