Commit d23022c6f68bd78a1d3b63a8bf7551145b1f46fd

Authored by Dmitriy Zaporozhets
1 parent a6f58b9c

Working on dashboard restyle and events refactoring

app/assets/stylesheets/common.scss
... ... @@ -185,36 +185,6 @@ span.update-author {
185 185 }
186 186 }
187 187  
188   -.event_label {
189   - @extend .label;
190   - background-color: #999;
191   -
192   - &.pushed {
193   - background-color: #4A97BD;
194   - }
195   -
196   - &.opened {
197   - background-color: #469847;
198   - }
199   -
200   - &.closed {
201   - background-color: #B94A48;
202   - }
203   -
204   - &.merged {
205   - background-color: #2A2;
206   - }
207   -
208   - &.joined {
209   - background-color: #1ca9dd;
210   - }
211   -
212   - &.left {
213   - background-color: #888;
214   - float:none;
215   - }
216   -}
217   -
218 188 form {
219 189 @extend .form-horizontal;
220 190  
... ... @@ -355,41 +325,6 @@ p.time {
355 325 border:2px solid #ddd;
356 326 }
357 327  
358   -.event_feed {
359   - min-height:40px;
360   - border-bottom:1px solid #ddd;
361   - .avatar {
362   - width:32px;
363   - }
364   - .event_icon {
365   - float:right;
366   - margin-right:2px;
367   - img {
368   - width:20px;
369   - }
370   - }
371   - ul {
372   - margin-left:50px;
373   - margin-bottom:5px;
374   - .avatar {
375   - width:24px;
376   - }
377   - }
378   -
379   - padding: 15px 5px;
380   - &:last-child { border:none }
381   - .wll:hover { background:none }
382   -
383   - .event_commits {
384   - margin-top: 5px;
385   -
386   - li.commit {
387   - background: transparent;
388   - padding:5px;
389   - border:none;
390   - }
391   - }
392   -}
393 328  
394 329 .ico {
395 330 background: url("images.png") no-repeat -85px -77px;
... ... @@ -639,22 +574,6 @@ li.note {
639 574 background:#fff;
640 575 }
641 576  
642   -/**
643   - * Push event widget
644   - *
645   - */
646   -.event_lp {
647   - @extend .ui-box;
648   - color:#777;
649   - margin-bottom:20px;
650   - padding:8px;
651   - @include border-radius(4px);
652   - min-height:22px;
653   -
654   - .avatar {
655   - width:24px;
656   - }
657   -}
658 577  
659 578 .supp_diff_link,
660 579 .mr_show_all_commits {
... ...
app/assets/stylesheets/gitlab_bootstrap/lists.scss
1 1 /** LISTS **/
2 2  
3   -ul {
  3 +ul {
4 4 /**
5 5 * List li block element #1
6 6 *
... ... @@ -18,7 +18,7 @@ ul {
18 18 .author { color: #999; }
19 19  
20 20 p {
21   - padding-top:5px;
  21 + padding-top:5px;
22 22 margin:0;
23 23 color:#222;
24 24 img {
... ...
app/assets/stylesheets/main.scss
... ... @@ -143,6 +143,7 @@ $hover: #fdf5d9;
143 143 @import "sections/projects.scss";
144 144 @import "sections/merge_requests.scss";
145 145 @import "sections/graph.scss";
  146 +@import "sections/events.scss";
146 147  
147 148 /**
148 149 * This scss file redefine chozen selectbox styles for
... ...
app/assets/stylesheets/sections/commits.scss
1 1 .commit-box {
2 2 @extend .main_box;
3 3  
4   - .commit-head {
  4 + .commit-head {
5 5 @extend .top_box_content;
6 6  
7 7 .commit-title {
... ... @@ -29,11 +29,11 @@
29 29  
30 30 .sha-block {
31 31 text-align:right;
32   - &:first-child {
  32 + &:first-child {
33 33 padding-bottom:6px;
34 34 }
35 35  
36   - a {
  36 + a {
37 37 border-bottom: 1px solid #aaa;
38 38 margin-left: 9px;
39 39 }
... ... @@ -54,7 +54,7 @@
54 54 }
55 55  
56 56 /**
57   - *
  57 + *
58 58 * COMMIT SHOw
59 59 *
60 60 */
... ... @@ -71,7 +71,7 @@
71 71 background-image: -moz-linear-gradient(#eee 6.6%, #dfdfdf);
72 72 background-image: -o-linear-gradient(#eee 6.6%, #dfdfdf);
73 73  
74   - span {
  74 + span {
75 75 font-size:14px;
76 76 }
77 77 }
... ... @@ -111,8 +111,8 @@
111 111 }
112 112 }
113 113  
114   - &.img_compared {
115   - img {
  114 + &.img_compared {
  115 + img {
116 116 max-width:300px;
117 117 }
118 118 }
... ... @@ -120,12 +120,12 @@
120 120 }
121 121  
122 122 .diff_file_content{
123   - table {
  123 + table {
124 124 border:none;
125 125 margin:0px;
126 126 padding:0px;
127 127 tr {
128   - td {
  128 + td {
129 129 font-size:12px;
130 130 }
131 131 }
... ... @@ -145,29 +145,29 @@
145 145 moz-user-select: none;
146 146 -khtml-user-select: none;
147 147 user-select: none;
148   - a {
  148 + a {
149 149 float:left;
150 150 width:35px;
151 151 font-weight:normal;
152 152 color:#666;
153   - &:hover {
  153 + &:hover {
154 154 text-decoration:underline;
155 155 }
156 156 }
157 157 }
158   - .line_content {
159   - white-space:pre;
  158 + .line_content {
  159 + white-space:pre;
160 160 height:14px;
161 161 margin:0px;
162 162 padding:0px;
163 163 border:none;
164   - &.new {
  164 + &.new {
165 165 background: #CFD;
166 166 }
167   - &.old {
  167 + &.old {
168 168 background: #FDD;
169 169 }
170   - &.matched {
  170 + &.matched {
171 171 color:#ccc;
172 172 background:#fafafa;
173 173 }
... ... @@ -182,32 +182,32 @@
182 182  
183 183  
184 184 /** COMMIT ROW **/
185   -.commit {
  185 +.commit {
186 186 @extend .wll;
187 187  
188   - .browse_code_link_holder {
  188 + .browse_code_link_holder {
189 189 @extend .span2;
190 190 float:right;
191 191 }
192 192  
193   - .committed_ago {
  193 + .committed_ago {
194 194 float:right;
195 195 @extend .cgray;
196 196 }
197 197  
198   - code {
  198 + code {
199 199 background:#FCEEC1;
200 200 color:$style_color;
201 201 }
202 202  
203   - .commit_short_id {
  203 + .commit_short_id {
204 204 float:left;
205 205 @extend .lined;
206 206 min-width:65px;
207 207 font-family: 'Menlo', 'Liberation Mono', 'Consolas', 'Courier New', 'andale mono','lucida console',monospace;
208 208 }
209   -
210   - .commit-author-name {
  209 +
  210 + .commit-author-name {
211 211 color: #777;
212 212 }
213 213 }
... ...
app/assets/stylesheets/sections/events.scss 0 → 100644
... ... @@ -0,0 +1,105 @@
  1 +/**
  2 + * Events labels
  3 + *
  4 + */
  5 +.event_label {
  6 + /*@extend .label;*/
  7 + /*background-color: #999;*/
  8 +
  9 + /*&.pushed {*/
  10 + /*background-color: #4A97BD;*/
  11 + /*}*/
  12 +
  13 + /*&.opened {*/
  14 + /*background-color: #469847;*/
  15 + /*}*/
  16 +
  17 + /*&.closed {*/
  18 + /*background-color: #B94A48;*/
  19 + /*}*/
  20 +
  21 + /*&.merged {*/
  22 + /*background-color: #2A2;*/
  23 + /*}*/
  24 +
  25 + /*&.joined {*/
  26 + /*background-color: #1ca9dd;*/
  27 + /*}*/
  28 +
  29 + /*&.left {*/
  30 + /*background-color: #888;*/
  31 + /*float:none;*/
  32 + /*}*/
  33 +}
  34 +
  35 +/**
  36 + * Dashboard events feed
  37 + *
  38 + */
  39 +.event-item {
  40 + min-height:40px;
  41 + border-bottom:1px solid #eee;
  42 + .event-title {
  43 + color:#333;
  44 + font-weight: bold;
  45 + .author_name {
  46 + color:#777;
  47 + }
  48 + }
  49 + .event-body {
  50 + p {
  51 + color:#666;
  52 + }
  53 + }
  54 + .avatar {
  55 + width:32px;
  56 + }
  57 + .event_icon {
  58 + float: right;
  59 + border: 1px solid #EEE;
  60 + padding: 5px;
  61 + @include border-radius(5px);
  62 + background: #F9F9F9;
  63 + img {
  64 + width:20px;
  65 + }
  66 + }
  67 + ul {
  68 + margin-left:50px;
  69 + margin-bottom:5px;
  70 + .avatar {
  71 + width:22px;
  72 + }
  73 + }
  74 +
  75 + padding: 15px 5px;
  76 + &:last-child { border:none }
  77 + .wll:hover { background:none }
  78 +
  79 + .event_commits {
  80 + margin-top: 5px;
  81 +
  82 + li.commit {
  83 + background: transparent;
  84 + padding:5px;
  85 + border:none;
  86 + }
  87 + }
  88 +}
  89 +
  90 +/**
  91 + * Push event widget
  92 + *
  93 + */
  94 +.event_lp {
  95 + @extend .ui-box;
  96 + color:#777;
  97 + margin-bottom:20px;
  98 + padding:8px;
  99 + @include border-radius(4px);
  100 + min-height:22px;
  101 +
  102 + .avatar {
  103 + width:24px;
  104 + }
  105 +}
... ...
app/views/events/_commit.html.haml
... ... @@ -2,7 +2,7 @@
2 2 %li.commit
3 3 %p
4 4 = link_to commit.short_id(8), project_commit_path(project, id: commit.id), class: "commit_short_id"
5   - %strong.cdark= commit.author_name
  5 + %span= commit.author_name
6 6 –
7 7 = image_tag gravatar_icon(commit.author_email), class: "avatar", width: 16
8 8 = gfm escape_once(truncate(commit.title, length: 50)) rescue "--broken encoding"
... ...
app/views/events/_event.html.haml
1 1 - if event.allowed?
2   - - if event.issue?
3   - .event_feed
  2 + %div.event-item
  3 + - if event.issue?
4 4 = render "events/event_issue", event: event
5 5  
6   - - elsif event.merge_request?
7   - .event_feed
  6 + - elsif event.merge_request?
8 7 = render "events/event_merge_request", event: event
9 8  
10   - - elsif event.push?
11   - .event_feed
  9 + - elsif event.push?
12 10 = render "events/event_push", event: event
13 11  
14   - - elsif event.membership_changed?
15   - .event_feed
  12 + - elsif event.membership_changed?
16 13 = render "events/event_membership_changed", event: event
17 14  
  15 + %span.cgray.right
  16 + = time_ago_in_words(event.created_at)
  17 + ago.
  18 + .clearfix
... ...
app/views/events/_event_issue.html.haml
1 1 = image_tag gravatar_icon(event.author_email), class: "avatar"
2   -%strong #{event.author_name}
3   -%span.event_label{class: event.action_name}= event.action_name
4   -issue
5   -= link_to project_issue_path(event.project, event.issue) do
6   - %strong= truncate event.issue_title
7   -at
8   -%strong= link_to event.project.name, event.project
9   -%span.cgray
10   - = time_ago_in_words(event.created_at)
11   - ago.
  2 +.event-title
  3 + %strong.author_name #{event.author_name}
  4 + %span.event_label{class: event.action_name}= event.action_name
  5 + issue
  6 + = link_to project_issue_path(event.project, event.issue) do
  7 + %strong= truncate event.issue_title
  8 + at
  9 + %strong= link_to event.project.name, event.project
... ...
app/views/events/_event_membership_changed.html.haml
1 1 = image_tag gravatar_icon(event.author_email), class: "avatar"
2   -%strong #{event.author_name}
3   -%span.event_label{class: event.action_name}= event.action_name
4   -project
5   -%strong= link_to event.project_name, event.project
6   -%span.cgray
7   - = time_ago_in_words(event.created_at)
8   - ago.
  2 +.event-title
  3 + %strong.author_name #{event.author_name}
  4 + %span.event_label{class: event.action_name}= event.action_name
  5 + project
  6 + %strong= link_to event.project_name, event.project
  7 + %span.cgray
  8 + = time_ago_in_words(event.created_at)
  9 + ago.
9 10  
... ...
app/views/events/_event_merge_request.html.haml
1 1 - if event.action_name == "merged"
2 2 .event_icon= image_tag "event_mr_merged.png"
3 3 = image_tag gravatar_icon(event.author_email), class: "avatar"
4   -%strong #{event.author_name}
5   -%span.event_label{class: event.action_name}= event.action_name
6   -merge request
7   -= link_to project_merge_request_path(event.project, event.merge_request) do
8   - %strong= truncate event.merge_request_title
9   -at
10   -%strong= link_to event.project.name, event.project
11   -%span.cgray
12   - = time_ago_in_words(event.created_at)
13   - ago.
14   -%br
15   -%span= event.merge_request.source_branch
16   -→
17   -%span= event.merge_request.target_branch
  4 +.event-title
  5 + %strong.author_name #{event.author_name}
  6 + %span.event_label{class: event.action_name}= event.action_name
  7 + merge request
  8 + = link_to project_merge_request_path(event.project, event.merge_request) do
  9 + %strong= truncate event.merge_request_title
  10 + at
  11 + %strong= link_to event.project.name, event.project
  12 +.event-body
  13 + %span= event.merge_request.source_branch
  14 + →
  15 + %span= event.merge_request.target_branch
18 16  
... ...
app/views/events/_event_push.html.haml
1 1 %div
2 2 .event_icon= image_tag "event_push.png"
3 3 = image_tag gravatar_icon(event.author_email), class: "avatar"
4   - %strong #{event.author_name}
5   - %span.event_label.pushed= event.push_action_name
6   - = event.ref_type
7   - = link_to project_commits_path(event.project, ref: event.ref_name) do
8   - %strong= event.ref_name
9   - at
10   - %strong= link_to event.project.name, event.project
11   - %span.cgray
12   - = time_ago_in_words(event.created_at)
13   - ago.
  4 +
  5 + .event-title
  6 + %strong.author_name #{event.author_name}
  7 + %span.event_label.pushed= event.push_action_name
  8 + = event.ref_type
  9 + = link_to project_commits_path(event.project, ref: event.ref_name) do
  10 + %strong= event.ref_name
  11 + at
  12 + %strong= link_to event.project.name, event.project
  13 + - if event.push_with_commits?
  14 + - if event.commits_count > 1
  15 + = link_to compare_project_commits_path(event.project, from: event.parent_commit.id, to: event.last_commit.id) do
  16 + %strong #{event.parent_commit.id[0..7]}...#{event.last_commit.id[0..7]}
14 17  
15 18 - if event.push_with_commits?
16   - - if event.commits_count > 1
17   - = link_to compare_project_commits_path(event.project, from: event.parent_commit.id, to: event.last_commit.id) do
18   - %strong #{event.parent_commit.id[0..7]}...#{event.last_commit.id[0..7]}
19 19 - project = event.project
20   - %ul.unstyled.event_commits
21   - - if event.commits_count > 3
22   - - event.commits[0...2].each do |commit|
23   - = render "events/commit", commit: commit, project: project
24   - %li
25   - %br
26   - \... and #{event.commits_count - 2} more commits
27   - - else
28   - - event.commits.each do |commit|
29   - = render "events/commit", commit: commit, project: project
30   -
  20 + .event-body
  21 + %ul.unstyled.event_commits
  22 + - if event.commits_count > 3
  23 + - event.commits[0...2].each do |commit|
  24 + = render "events/commit", commit: commit, project: project
  25 + %li
  26 + %br
  27 + \... and #{event.commits_count - 2} more commits
  28 + - else
  29 + - event.commits.each do |commit|
  30 + = render "events/commit", commit: commit, project: project
  31 + .clearfix
... ...