Commit cd3d50caf2691116424a8df73939f095814c7ab5

Authored by Dmitriy Zaporozhets
1 parent 5b88c1e3

Changed colors for buttons. Imporved preview area. Added clone panel to empty project

app/assets/javascripts/note.js
@@ -45,7 +45,9 @@ init: @@ -45,7 +45,9 @@ init:
45 $("#note_note").live("focus", function(){ 45 $("#note_note").live("focus", function(){
46 $(this).css("height", "80px"); 46 $(this).css("height", "80px");
47 $('.note_advanced_opts').show(); 47 $('.note_advanced_opts').show();
48 - $(this).closest("form").find(".submit_note").attr("disabled", "disabled"); 48 + if($(this).val() == "") {
  49 + $(this).closest("form").find(".submit_note").attr("disabled", "disabled").addClass("disabled");
  50 + }
49 }); 51 });
50 52
51 $("#note_attachment").change(function(e){ 53 $("#note_attachment").change(function(e){
app/assets/stylesheets/gitlab_bootstrap/buttons.scss
1 .btn { 1 .btn {
2 - @include bg-dark-gray-gradient; 2 + background-image: -webkit-gradient(linear, 0 0, 0 26, color-stop(0.076, #f7f7f7), to(#d5d5d5));
  3 + background-image: -webkit-linear-gradient(#f7f7f7 7.6%, #d5d5d5);
  4 + background-image: -moz-linear-gradient(#f7f7f7 7.6%, #d5d5d5);
  5 + background-image: -o-linear-gradient(#f7f7f7 7.6%, #d5d5d5);
3 border-color:#aaa; 6 border-color:#aaa;
4 &:hover { 7 &:hover {
5 @include bg-gray-gradient; 8 @include bg-gray-gradient;
@@ -7,28 +10,42 @@ @@ -7,28 +10,42 @@
7 color:#333; 10 color:#333;
8 } 11 }
9 12
10 - &.btn-primary { 13 + &.primary {
11 background:#2a79A3; 14 background:#2a79A3;
12 border-color: #2A79A3; 15 border-color: #2A79A3;
  16 + background-image: -webkit-linear-gradient(#47A7b7 7.6%, #2585b5);
  17 + background-image: -moz-linear-gradient(#47A7b7 7.6%, #2585b5);
  18 + background-image: -o-linear-gradient(#47A7b7 7.6%, #2585b5);
  19 + color:#fff;
  20 + text-shadow: 0 1px 1px #268;
13 &:hover { 21 &:hover {
14 background:$blue_link; 22 background:$blue_link;
15 color:#fff; 23 color:#fff;
16 } 24 }
17 - }  
18 - &.primary {  
19 - @extend .btn-primary; 25 +
  26 + &.disabled {
  27 + color:#fff;
  28 + background:#29B;
  29 + }
20 } 30 }
21 31
22 &.success { 32 &.success {
  33 + border-color: #4A4;
  34 + background-image: -webkit-linear-gradient(#82D482 7.6%, #22B442);
  35 + background-image: -moz-linear-gradient(#82D482 7.6%, #22B442);
  36 + background-image: -o-linear-gradient(#82D482 7.6%, #22B442);
23 color: #fff; 37 color: #fff;
24 - text-shadow: 0 0 1px #111;  
25 - background: #5bb75b;;  
26 - font-weight: bold; 38 + text-shadow: 0 1px 1px #141;
27 39
28 &:hover { 40 &:hover {
29 - background-color: #51a351; 41 + background: #6C6;
30 color: #fff; 42 color: #fff;
31 } 43 }
  44 +
  45 + &.disabled {
  46 + color:#fff;
  47 + background:#2b2;
  48 + }
32 } 49 }
33 50
34 &.save-btn { 51 &.save-btn {
app/assets/stylesheets/sections/notes.scss
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 * Notes 2 * Notes
3 * 3 *
4 */ 4 */
5 -#notes-list, 5 +#notes-list,
6 #new_notes_list { 6 #new_notes_list {
7 display:block; 7 display:block;
8 list-style:none; 8 list-style:none;
@@ -10,7 +10,7 @@ @@ -10,7 +10,7 @@
10 padding:0px; 10 padding:0px;
11 } 11 }
12 12
13 -#new_notes_list li:last-child{ 13 +#new_notes_list li:last-child{
14 border-bottom:1px solid #aaa; 14 border-bottom:1px solid #aaa;
15 } 15 }
16 16
@@ -38,12 +38,16 @@ @@ -38,12 +38,16 @@
38 } 38 }
39 } 39 }
40 40
41 -#preview-note {  
42 - margin-bottom: 0; 41 +.preview_note {
  42 + margin: 2px;
  43 + border: 1px solid #ddd;
  44 + padding: 10px;
  45 + min-height: 60px;
  46 + background:#f5f5f5;
43 } 47 }
44 48
45 -.note {  
46 - padding: 8px 0; 49 +.note {
  50 + padding: 8px 0;
47 border-bottom: 1px solid #eee; 51 border-bottom: 1px solid #eee;
48 overflow: hidden; 52 overflow: hidden;
49 display: block; 53 display: block;
@@ -53,16 +57,16 @@ @@ -53,16 +57,16 @@
53 .note-author { color: $style_color;} 57 .note-author { color: $style_color;}
54 58
55 .note-title { margin-left:45px; padding-top: 5px;} 59 .note-title { margin-left:45px; padding-top: 5px;}
56 - .avatar { 60 + .avatar {
57 margin-top:3px; 61 margin-top:3px;
58 } 62 }
59 63
60 - .delete-note {  
61 - display:none; 64 + .delete-note {
  65 + display:none;
62 float:right; 66 float:right;
63 } 67 }
64 68
65 - &:hover { 69 + &:hover {
66 .delete-note { display:block; } 70 .delete-note { display:block; }
67 } 71 }
68 } 72 }
@@ -76,18 +80,18 @@ p.notify_controls span{ @@ -76,18 +80,18 @@ p.notify_controls span{
76 font-weight: 700; 80 font-weight: 700;
77 } 81 }
78 82
79 -tr.line_notes_row { 83 +tr.line_notes_row {
80 border-bottom:1px solid #DDD; 84 border-bottom:1px solid #DDD;
81 border-left: 7px solid #2A79A3; 85 border-left: 7px solid #2A79A3;
82 86
83 - &.reply { 87 + &.reply {
84 background:#eee; 88 background:#eee;
85 border-left: 7px solid #2A79A3; 89 border-left: 7px solid #2A79A3;
86 border-top:1px solid #ddd; 90 border-top:1px solid #ddd;
87 - td { 91 + td {
88 padding:7px 10px; 92 padding:7px 10px;
89 } 93 }
90 - a.line_note_reply_link { 94 + a.line_note_reply_link {
91 @include round-borders-all(4px); 95 @include round-borders-all(4px);
92 padding: 3px 10px; 96 padding: 3px 10px;
93 margin-left:5px; 97 margin-left:5px;
@@ -96,9 +100,9 @@ tr.line_notes_row { @@ -96,9 +100,9 @@ tr.line_notes_row {
96 border-color: #2A79A3; 100 border-color: #2A79A3;
97 } 101 }
98 } 102 }
99 - ul { 103 + ul {
100 margin:0; 104 margin:0;
101 - li { 105 + li {
102 padding:0; 106 padding:0;
103 border:none; 107 border:none;
104 } 108 }
@@ -107,26 +111,26 @@ tr.line_notes_row { @@ -107,26 +111,26 @@ tr.line_notes_row {
107 111
108 .line_notes_row, .per_line_form { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; } 112 .line_notes_row, .per_line_form { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; }
109 113
110 -.per_line_form { 114 +.per_line_form {
111 background:#f5f5f5; 115 background:#f5f5f5;
112 border-top:1px solid #eee; 116 border-top:1px solid #eee;
113 form { margin: 0; } 117 form { margin: 0; }
114 - td { 118 + td {
115 border-bottom:1px solid #ddd; 119 border-bottom:1px solid #ddd;
116 } 120 }
117 - .note_actions { 121 + .note_actions {
118 margin:0; 122 margin:0;
119 padding-top: 10px; 123 padding-top: 10px;
120 124
121 - .buttons { 125 + .buttons {
122 float:left; 126 float:left;
123 width:300px; 127 width:300px;
124 } 128 }
125 - .options {  
126 - .labels { 129 + .options {
  130 + .labels {
127 float:left; 131 float:left;
128 padding-left:10px; 132 padding-left:10px;
129 - label { 133 + label {
130 padding: 6px 0; 134 padding: 6px 0;
131 margin: 0; 135 margin: 0;
132 width:120px; 136 width:120px;
@@ -136,7 +140,7 @@ tr.line_notes_row { @@ -136,7 +140,7 @@ tr.line_notes_row {
136 } 140 }
137 } 141 }
138 142
139 -td .line_note_link { 143 +td .line_note_link {
140 position:absolute; 144 position:absolute;
141 margin-left:-70px; 145 margin-left:-70px;
142 margin-top:-10px; 146 margin-top:-10px;
@@ -148,14 +152,14 @@ td .line_note_link { @@ -148,14 +152,14 @@ td .line_note_link {
148 opacity: 0.0; 152 opacity: 0.0;
149 filter: alpha(opacity=0); 153 filter: alpha(opacity=0);
150 154
151 - &:hover { 155 + &:hover {
152 opacity: 1.0; 156 opacity: 1.0;
153 filter: alpha(opacity=100); 157 filter: alpha(opacity=100);
154 } 158 }
155 } 159 }
156 160
157 .diff_file_content tr.line_holder:hover > td { background: $hover !important; } 161 .diff_file_content tr.line_holder:hover > td { background: $hover !important; }
158 -.diff_file_content tr.line_holder:hover > td .line_note_link { 162 +.diff_file_content tr.line_holder:hover > td .line_note_link {
159 opacity: 1.0; 163 opacity: 1.0;
160 filter: alpha(opacity=100); 164 filter: alpha(opacity=100);
161 } 165 }
@@ -173,8 +177,8 @@ td .line_note_link { @@ -173,8 +177,8 @@ td .line_note_link {
173 margin: 0; 177 margin: 0;
174 } 178 }
175 179
176 - .note_advanced_opts {  
177 - h6 { 180 + .note_advanced_opts {
  181 + h6 {
178 line-height: 32px; 182 line-height: 32px;
179 padding-right: 15px; 183 padding-right: 15px;
180 } 184 }
@@ -187,7 +191,7 @@ td .line_note_link { @@ -187,7 +191,7 @@ td .line_note_link {
187 overflow:hidden; 191 overflow:hidden;
188 margin:0 0 5px !important; 192 margin:0 0 5px !important;
189 193
190 - .input_file { 194 + .input_file {
191 .file_upload { 195 .file_upload {
192 position: absolute; 196 position: absolute;
193 right:14px; 197 right:14px;
@@ -200,7 +204,7 @@ td .line_note_link { @@ -200,7 +204,7 @@ td .line_note_link {
200 height:28px; 204 height:28px;
201 overflow:hidden; 205 overflow:hidden;
202 } 206 }
203 - .input-file { 207 + .input-file {
204 width: 260px; 208 width: 260px;
205 height: 41px; 209 height: 41px;
206 float: right; 210 float: right;
app/views/commits/compare.html.haml
@@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
20 = "..." 20 = "..."
21 = text_field_tag :to, params[:to], placeholder: "aa8b4ef", class: "xlarge" 21 = text_field_tag :to, params[:to], placeholder: "aa8b4ef", class: "xlarge"
22 .actions 22 .actions
23 - = submit_tag "Compare", class: "btn btn-primary" 23 + = submit_tag "Compare", class: "btn primary"
24 24
25 25
26 - unless @commits.empty? 26 - unless @commits.empty?
app/views/notes/_form.html.haml
@@ -8,14 +8,14 @@ @@ -8,14 +8,14 @@
8 = f.hidden_field :noteable_id 8 = f.hidden_field :noteable_id
9 = f.hidden_field :noteable_type 9 = f.hidden_field :noteable_type
10 = f.text_area :note, size: 255 10 = f.text_area :note, size: 255
11 - #preview-note.well.hide 11 + #preview-note.preview_note.hide
12 .hint 12 .hint
13 .right Comments are parsed with #{link_to "Gitlab Flavored Markdown", help_markdown_path, target: '_blank'}. 13 .right Comments are parsed with #{link_to "Gitlab Flavored Markdown", help_markdown_path, target: '_blank'}.
14 .clearfix 14 .clearfix
15 15
16 .row.note_advanced_opts.hide 16 .row.note_advanced_opts.hide
17 .span3 17 .span3
18 - = f.submit 'Add Comment', class: "btn primary submit_note grouped", id: "submit_note" 18 + = f.submit 'Add Comment', class: "btn success submit_note grouped", id: "submit_note"
19 = link_to 'Preview', preview_project_notes_path(@project), class: 'btn grouped', id: 'preview-link' 19 = link_to 'Preview', preview_project_notes_path(@project), class: 'btn grouped', id: 'preview-link'
20 .span4.notify_opts 20 .span4.notify_opts
21 %h6.left Notify via email: 21 %h6.left Notify via email:
@@ -30,7 +30,7 @@ @@ -30,7 +30,7 @@
30 .span5.attachments 30 .span5.attachments
31 %h6.left Attachment: 31 %h6.left Attachment:
32 %span.file_name File name... 32 %span.file_name File name...
33 - 33 +
34 .input.input_file 34 .input.input_file
35 %a.file_upload.btn.small Upload File 35 %a.file_upload.btn.small Upload File
36 = f.file_field :attachment, class: "input-file" 36 = f.file_field :attachment, class: "input-file"
app/views/projects/_clone_panel.html.haml 0 → 100644
@@ -0,0 +1,21 @@ @@ -0,0 +1,21 @@
  1 +.project_clone_panel
  2 + .row
  3 + .span7
  4 + .form-horizontal
  5 + .input-prepend.project_clone_holder
  6 + = link_to "SSH", "#", class: "btn small active", :"data-clone" => @project.ssh_url_to_repo
  7 + = link_to "HTTP", "#", class: "btn small", :"data-clone" => @project.http_url_to_repo
  8 + = text_field_tag :project_clone, @project.url_to_repo, class: "one_click_select span5"
  9 + .span4.right
  10 + .right
  11 + - if can? current_user, :download_code, @project
  12 + = link_to archive_project_repository_path(@project), class: "btn small grouped" do
  13 + %i.icon-download-alt
  14 + Download
  15 + - if @project.merge_requests_enabled && can?(current_user, :write_merge_request, @project)
  16 + = link_to new_project_merge_request_path(@project), title: "New Merge Request", class: "btn small grouped" do
  17 + Merge Request
  18 + - if @project.issues_enabled && can?(current_user, :write_issue, @project)
  19 + = link_to new_project_issue_path(@project), title: "New Issue", class: "btn small grouped" do
  20 + Issue
  21 +
app/views/projects/empty.html.haml
1 = render 'shared/no_ssh' 1 = render 'shared/no_ssh'
  2 +.project_clone_panel
  3 + .row
  4 + .span7
  5 + .form-horizontal
  6 + .input-prepend.project_clone_holder
  7 + = link_to "SSH", "#", class: "btn small active", :"data-clone" => @project.ssh_url_to_repo
  8 + = link_to "HTTP", "#", class: "btn small", :"data-clone" => @project.http_url_to_repo
  9 + = text_field_tag :project_clone, @project.url_to_repo, class: "one_click_select span5"
2 %div.git-empty 10 %div.git-empty
3 %h4 Git global setup: 11 %h4 Git global setup:
4 %pre.dark 12 %pre.dark
@@ -28,3 +36,16 @@ @@ -28,3 +36,16 @@
28 - if can? current_user, :admin_project, @project 36 - if can? current_user, :admin_project, @project
29 .prepend-top-20 37 .prepend-top-20
30 = link_to 'Remove project', @project, confirm: 'Are you sure?', method: :delete, class: "btn danger right" 38 = link_to 'Remove project', @project, confirm: 'Are you sure?', method: :delete, class: "btn danger right"
  39 +
  40 +
  41 +
  42 +:javascript
  43 + $(function(){
  44 + var link_sel = ".project_clone_holder a";
  45 + $(link_sel).bind("click", function() {
  46 + $(link_sel).removeClass("active");
  47 + $(this).addClass("active");
  48 + $("#project_clone").val($(this).attr("data-clone"));
  49 + })
  50 + })
  51 +
app/views/projects/show.html.haml
1 = render "project_head" 1 = render "project_head"
2 -  
3 -.project_clone_panel  
4 - .row  
5 - .span7  
6 - .form-horizontal  
7 - .input-prepend.project_clone_holder  
8 - = link_to "SSH", "#", class: "btn small active", :"data-clone" => @project.ssh_url_to_repo  
9 - = link_to "HTTP", "#", class: "btn small", :"data-clone" => @project.http_url_to_repo  
10 - = text_field_tag :project_clone, @project.url_to_repo, class: "one_click_select span5"  
11 - .span4.right  
12 - .right  
13 - - if can? current_user, :download_code, @project  
14 - = link_to archive_project_repository_path(@project), class: "btn small grouped" do  
15 - %i.icon-download-alt  
16 - Download  
17 - - if @project.merge_requests_enabled && can?(current_user, :write_merge_request, @project)  
18 - = link_to new_project_merge_request_path(@project), title: "New Merge Request", class: "btn small grouped" do  
19 - Merge Request  
20 - - if @project.issues_enabled && can?(current_user, :write_issue, @project)  
21 - = link_to new_project_issue_path(@project), title: "New Issue", class: "btn small grouped" do  
22 - Issue  
23 - 2 += render 'clone_panel'
24 = render "events/event_last_push", event: @last_push 3 = render "events/event_last_push", event: @last_push
25 .content_list= render @events 4 .content_list= render @events
26 5
27 -:javascript 6 +:javascript
28 $(function(){ 7 $(function(){
29 var link_sel = ".project_clone_holder a"; 8 var link_sel = ".project_clone_holder a";
30 - $(link_sel).bind("click", function() { 9 + $(link_sel).bind("click", function() {
31 $(link_sel).removeClass("active"); 10 $(link_sel).removeClass("active");
32 $(this).addClass("active"); 11 $(this).addClass("active");
33 $("#project_clone").val($(this).attr("data-clone")); 12 $("#project_clone").val($(this).attr("data-clone"));
app/views/search/show.html.haml
@@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
4 %strong Looking for 4 %strong Looking for
5 .input 5 .input
6 = text_field_tag :search, params[:search], placeholder: "issue 143", class: "input-xxlarge", id: "dashboard_search" 6 = text_field_tag :search, params[:search], placeholder: "issue 143", class: "input-xxlarge", id: "dashboard_search"
7 - = submit_tag 'Search', class: "btn btn-primary" 7 + = submit_tag 'Search', class: "btn primary"
8 - if params[:search].present? 8 - if params[:search].present?
9 %br 9 %br
10 %h3 10 %h3