Commit 05a7e8b9c0b1ebdc01470a31f933b7526ca2cd08

Authored by Dmitriy Zaporozhets
1 parent 15f62fcc

Better design for SSH keys page

app/assets/stylesheets/gitlab_bootstrap/common.scss
... ... @@ -87,3 +87,10 @@ fieldset legend { font-size: 17px; }
87 87 color: #333;
88 88 text-shadow: 0 1px 1px #FFF;
89 89 }
  90 +
  91 +pre.well-pre {
  92 + border: 1px solid #EEE;
  93 + background: #f9f9f9;
  94 + border-radius: 0;
  95 + color: #555;
  96 +}
... ...
app/controllers/profiles/keys_controller.rb
... ... @@ -2,7 +2,7 @@ class Profiles::KeysController < ApplicationController
2 2 layout "profile"
3 3  
4 4 def index
5   - @keys = current_user.keys.all
  5 + @keys = current_user.keys.order('id DESC').all
6 6 end
7 7  
8 8 def show
... ...
app/views/profiles/keys/_form.html.haml
... ... @@ -12,13 +12,12 @@
12 12 .clearfix
13 13 = f.label :key
14 14 .input
  15 + %p.light
  16 + Paste your public key here. Read more about how generate it #{link_to "here", help_ssh_path}
15 17 = f.text_area :key, class: [:xxlarge, :thin_area]
16   - %p.hint
17   - Paste your public key here. Read more about how generate it
18   - = link_to "here", help_ssh_path
19 18  
20 19  
21 20 .actions
22   - = f.submit 'Save', class: "btn btn-save"
  21 + = f.submit 'Add key', class: "btn btn-create"
23 22 = link_to "Cancel", profile_keys_path, class: "btn btn-cancel"
24 23  
... ...
app/views/profiles/keys/_key.html.haml
1   -%tr
2   - %td
3   - = link_to profile_key_path(key) do
4   - %strong= key.title
5   - %td
6   - %span.cgray
7   - Added
8   - = time_ago_in_words(key.created_at)
9   - ago
10   - %td
11   - = link_to 'Remove', profile_key_path(key), confirm: 'Are you sure?', method: :delete, class: "btn btn-small btn-remove delete-key pull-right"
  1 +%li
  2 + = link_to profile_key_path(key) do
  3 + %strong= key.title
  4 + %span.cgray
  5 + added
  6 + = time_ago_in_words(key.created_at)
  7 + ago
  8 + = link_to 'Remove', profile_key_path(key), confirm: 'Are you sure?', method: :delete, class: "btn btn-small btn-remove delete-key pull-right"
12 9  
... ...
app/views/profiles/keys/edit.html.haml
... ... @@ -1,7 +0,0 @@
1   -%h1 Editing key
2   -
3   -= render 'form'
4   -
5   -= link_to 'Show', profile_keys_path(key)
6   -\|
7   -= link_to 'Back', profile_keys_path
app/views/profiles/keys/index.html.haml
1 1 %h3.page_title
2 2 SSH Keys
3   - = link_to "Add new", new_profile_key_path, class: "btn pull-right"
  3 + = link_to "Add SSH Key", new_profile_key_path, class: "btn pull-right btn-primary"
4 4  
5   -%hr
6   -%p.slead
  5 +%br
  6 +%p.light
7 7 SSH key allows you to establish a secure connection between your computer and GitLab
  8 +%p.light
  9 + Before you can add ssh key you need to
  10 + = link_to "generate it", help_ssh_path
8 11  
9 12  
10   -%table#keys-table
11   - %thead
12   - %tr
13   - %th Name
14   - %th Added
15   - %th
16   - = render @keys
17   - - if @keys.blank?
18   - %tr
19   - %td{colspan: 3}
20   - %p.nothing_here_message There are no SSH keys with access to your account.
  13 +
  14 +.ui-box
  15 + %h5.title
  16 + SSH Keys (#{@keys.count})
  17 + .pull-right
  18 + %ul.well-list#keys-table
  19 + = render @keys
  20 + - if @keys.blank?
  21 + %li
  22 + %h3.nothing_here_message There are no SSH keys with access to your account.
  23 +
21 24  
... ...
app/views/profiles/keys/show.html.haml
1   -%h3.page_title
2   - Public key:
3   - = @key.title
4   - %small
5   - created at
6   - = @key.created_at.stamp("Aug 21, 2011")
7   -.back_link
8   - = link_to profile_keys_path do
9   - ← To keys list
10   -%hr
  1 +.row
  2 + .span4
  3 + .ui-box
  4 + %h5.title
  5 + SSH Key
  6 + %ul.well-list
  7 + %li
  8 + %span.light Title:
  9 + %strong= @key.title
  10 + %li
  11 + %span.light Created at:
  12 + %strong= @key.created_at.stamp("Aug 21, 2011")
  13 +
  14 + .span8
  15 + %pre.well-pre
  16 + = @key.key
11 17  
12   -%pre= @key.key
13 18 .pull-right
14 19 = link_to 'Remove', profile_key_path(@key), confirm: 'Are you sure?', method: :delete, class: "btn btn-remove delete-key"
... ...