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