Adds CSS to match the mockups and makes table responsive

This commit is contained in:
Filipa Lacerda 2016-12-12 16:00:50 +00:00
parent f726dfba62
commit ce867db6b8
2 changed files with 46 additions and 31 deletions

View file

@ -166,3 +166,17 @@
min-width: 120px; min-width: 120px;
} }
} }
.deploy-keys-list {
width: 100%;
overflow: auto;
table {
border: 1px solid $table-border-color;
}
}
.deploy-keys-title {
padding-bottom: 2px;
line-height: 2;
}

View file

@ -1,33 +1,34 @@
- page_title "Deploy Keys" - page_title "Deploy Keys"
.panel.panel-default.prepend-top-default
.panel-heading %h3.page-title.deploy-keys-title
Public deploy keys (#{@deploy_keys.count}) Public deploy keys (#{@deploy_keys.count})
.controls .pull-right
= link_to 'New Deploy Key', new_admin_deploy_key_path, class: "btn btn-new btn-sm btn-inverted" = link_to 'New Deploy Key', new_admin_deploy_key_path, class: 'btn btn-new btn-sm btn-inverted'
- if @deploy_keys.any?
.table-holder - if @deploy_keys.any?
%table.table .table-holder.deploy-keys-list
%thead.panel-heading %table.table
%thead
%tr
%th.col-sm-2 Title
%th.col-sm-4 Fingerprint
%th.col-sm-2 Write access allowed
%th.col-sm-2 Added at
%th.col-sm-2
%tbody
- @deploy_keys.each do |deploy_key|
%tr %tr
%th Title %td
%th Fingerprint %strong= deploy_key.title
%th Write access allowed %td
%th Added at %code.key-fingerprint= deploy_key.fingerprint
%th %td
%tbody - if deploy_key.can_push?
- @deploy_keys.each do |deploy_key| Yes
%tr - else
%td No
%strong= deploy_key.title %td
%td %span.cgray
%code.key-fingerprint= deploy_key.fingerprint added #{time_ago_with_tooltip(deploy_key.created_at)}
%td %td
- if deploy_key.can_push? = link_to 'Remove', admin_deploy_key_path(deploy_key), data: { confirm: 'Are you sure?'}, method: :delete, class: 'btn btn-sm btn-remove delete-key pull-right'
Yes
- else
No
%td
%span.cgray
added #{time_ago_with_tooltip(deploy_key.created_at)}
%td
= link_to 'Remove', admin_deploy_key_path(deploy_key), data: { confirm: 'Are you sure?'}, method: :delete, class: "btn btn-sm btn-remove delete-key pull-right"