Commit 982a4095c193a9256b76ffcc40526e726eac14d1
1 parent
6e5cd8e0
Exists in
master
and in
4 other branches
Use tw style for some buttons. Improved deploy key UI
Showing
8 changed files
with
45 additions
and
32 deletions
Show diff stats
app/assets/stylesheets/gitlab_bootstrap/buttons.scss
1 | .btn { | 1 | .btn { |
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); | 2 | + @include bg-gradient(#f7f7f7, #d5d5d5); |
6 | border-color:#aaa; | 3 | border-color:#aaa; |
7 | &:hover { | 4 | &:hover { |
8 | @include bg-gray-gradient; | 5 | @include bg-gray-gradient; |
@@ -12,10 +9,8 @@ | @@ -12,10 +9,8 @@ | ||
12 | 9 | ||
13 | &.primary { | 10 | &.primary { |
14 | background:#2a79A3; | 11 | background:#2a79A3; |
12 | + @include bg-gradient(#47A7b7, #2585b5); | ||
15 | border-color: #2A79A3; | 13 | 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; | 14 | color:#fff; |
20 | text-shadow: 0 1px 1px #268; | 15 | text-shadow: 0 1px 1px #268; |
21 | &:hover { | 16 | &:hover { |
@@ -30,16 +25,11 @@ | @@ -30,16 +25,11 @@ | ||
30 | } | 25 | } |
31 | 26 | ||
32 | &.success { | 27 | &.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); | ||
37 | - color: #fff; | ||
38 | - text-shadow: 0 1px 1px #141; | 28 | + @extend .btn-success; |
39 | 29 | ||
40 | &:hover { | 30 | &:hover { |
41 | - background: #6C6; | ||
42 | - color: #fff; | 31 | + @extend .btn-success; |
32 | + background: #51a351; | ||
43 | } | 33 | } |
44 | 34 | ||
45 | &.disabled { | 35 | &.disabled { |
@@ -62,10 +52,8 @@ | @@ -62,10 +52,8 @@ | ||
62 | padding-right:30px; | 52 | padding-right:30px; |
63 | } | 53 | } |
64 | 54 | ||
65 | - &.danger, | ||
66 | - &.btn-danger { | ||
67 | - color:#fff; | ||
68 | - background: #DA4E49; | 55 | + &.danger { |
56 | + @extend .btn-danger; | ||
69 | border-color: #BD362F; | 57 | border-color: #BD362F; |
70 | 58 | ||
71 | &:hover { | 59 | &:hover { |
app/assets/stylesheets/main.scss
@@ -56,6 +56,13 @@ $hover: #fdf5d9; | @@ -56,6 +56,13 @@ $hover: #fdf5d9; | ||
56 | border-radius: $radius; | 56 | border-radius: $radius; |
57 | } | 57 | } |
58 | 58 | ||
59 | +@mixin bg-gradient($from, $to) { | ||
60 | + background-image: -webkit-gradient(linear, 0 0, 0 100%, from($from), to($to)); | ||
61 | + background-image: -webkit-linear-gradient($from, $to); | ||
62 | + background-image: -moz-linear-gradient($from, $to); | ||
63 | + background-image: -o-linear-gradient($from, $to); | ||
64 | +} | ||
65 | + | ||
59 | @mixin bg-gray-gradient { | 66 | @mixin bg-gray-gradient { |
60 | background:#eee; | 67 | background:#eee; |
61 | background-image: -webkit-gradient(linear, 0 0, 0 30, color-stop(0.066, #eee), to(#dfdfdf)); | 68 | background-image: -webkit-gradient(linear, 0 0, 0 30, color-stop(0.066, #eee), to(#dfdfdf)); |
app/views/deploy_keys/_form.html.haml
@@ -11,8 +11,13 @@ | @@ -11,8 +11,13 @@ | ||
11 | .input= f.text_field :title | 11 | .input= f.text_field :title |
12 | .clearfix | 12 | .clearfix |
13 | = f.label :key | 13 | = f.label :key |
14 | - .input= f.text_area :key, class: "xlarge" | 14 | + .input |
15 | + = f.text_area :key, class: [:xxlarge, :thin_area] | ||
16 | + %p.hint | ||
17 | + Paste a machine public key here. Read more about how generate it | ||
18 | + = link_to "here", help_ssh_path | ||
19 | + | ||
15 | .actions | 20 | .actions |
16 | - = f.submit 'Save', class: "primary btn" | ||
17 | - = link_to "Cancel", project_deploy_keys_path(@project), class: "btn" | 21 | + = f.submit 'Save', class: "save-btn btn" |
22 | + = link_to "Cancel", project_deploy_keys_path(@project), class: "btn cancel-btn" | ||
18 | 23 |
app/views/deploy_keys/index.html.haml
1 | = render "repositories/head" | 1 | = render "repositories/head" |
2 | -- if can? current_user, :admin_project, @project | ||
3 | - .alert-message.block-message | ||
4 | - Deploy keys allow read-only access to repository. | 2 | + |
3 | +%p.slead | ||
4 | + Deploy keys allow read-only access to repository. It matches perfectly for CI, staging or production servers. | ||
5 | + | ||
6 | + - if can? current_user, :admin_project, @project | ||
5 | = link_to new_project_deploy_key_path(@project), class: "btn small", title: "New Deploy Key" do | 7 | = link_to new_project_deploy_key_path(@project), class: "btn small", title: "New Deploy Key" do |
6 | Add Deploy Key | 8 | Add Deploy Key |
7 | - | ||
8 | - if @keys.any? | 9 | - if @keys.any? |
9 | %table | 10 | %table |
11 | + %thead | ||
12 | + %tr | ||
13 | + %th Keys | ||
14 | + %th | ||
15 | + %th | ||
10 | - @keys.each do |key| | 16 | - @keys.each do |key| |
11 | = render(partial: 'show', locals: {key: key}) | 17 | = render(partial: 'show', locals: {key: key}) |
app/views/deploy_keys/new.html.haml
app/views/deploy_keys/show.html.haml
1 | = render "repositories/head" | 1 | = render "repositories/head" |
2 | -%h3= @key.title | 2 | +%h3.page_title |
3 | + Deploy key: | ||
4 | + = @key.title | ||
5 | + %small | ||
6 | + created at | ||
7 | + = @key.created_at.stamp("Aug 21, 2011") | ||
8 | +.back_link | ||
9 | + = link_to project_deploy_keys_path(@project) do | ||
10 | + ← To keys list | ||
3 | %hr | 11 | %hr |
4 | %pre= @key.key | 12 | %pre= @key.key |
5 | -.actions | 13 | +.right |
6 | = link_to 'Remove', project_deploy_key_path(@key.project, @key), confirm: 'Are you sure?', method: :delete, class: "danger btn delete-key" | 14 | = link_to 'Remove', project_deploy_key_path(@key.project, @key), confirm: 'Are you sure?', method: :delete, class: "danger btn delete-key" |
7 | - .clear |
app/views/keys/show.html.haml
@@ -10,5 +10,5 @@ | @@ -10,5 +10,5 @@ | ||
10 | %hr | 10 | %hr |
11 | 11 | ||
12 | %pre= @key.key | 12 | %pre= @key.key |
13 | -.actions | 13 | +.right |
14 | = link_to 'Remove', @key, confirm: 'Are you sure?', method: :delete, class: "btn danger delete-key" | 14 | = link_to 'Remove', @key, confirm: 'Are you sure?', method: :delete, class: "btn danger delete-key" |
app/views/team_members/show.html.haml
@@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
3 | 3 | ||
4 | .team_member_show | 4 | .team_member_show |
5 | - if can? current_user, :admin_project, @project | 5 | - if can? current_user, :admin_project, @project |
6 | - = link_to 'Remove from team', project_team_member_path(project_id: @project, id: @team_member.id), confirm: 'Are you sure?', method: :delete, class: "right btn btn-danger" | 6 | + = link_to 'Remove from team', project_team_member_path(project_id: @project, id: @team_member.id), confirm: 'Are you sure?', method: :delete, class: "right btn danger" |
7 | .profile_avatar_holder | 7 | .profile_avatar_holder |
8 | = image_tag gravatar_icon(user.email, 60), class: "borders" | 8 | = image_tag gravatar_icon(user.email, 60), class: "borders" |
9 | %h3 | 9 | %h3 |