Commit 70d2fde4 authored by Robert Speicher's avatar Robert Speicher

Restructure SSH key table partial rendering

Prior, we were double-checking `@keys.any?`, and unnecessarily assigning
`is_admin` in a view where it wasn't needed.
parent 1b10724e
- is_admin = defined?(admin) ? true : false - is_admin = local_assigns.fetch(:admin, false)
- if @keys.any? - if @keys.any?
%ul.well-list %ul.well-list
- @keys.each do |key| = render partial: 'profiles/keys/key', collection: @keys, locals: { is_admin: is_admin }
= render 'profiles/keys/key', key: key, is_admin: is_admin - else
%p.profile-settings-message.text-center
- if is_admin
There are no SSH keys associated with this account.
- else
There are no SSH keys with access to your account.
- page_title "SSH Keys" - page_title "SSH Keys"
- header_title page_title, profile_keys_path - header_title page_title, profile_keys_path
- is_admin = defined?(admin) ? true : false
.row.prepend-top-default .row.prepend-top-default
.col-lg-3.profile-settings-sidebar .col-lg-3.profile-settings-sidebar
...@@ -19,11 +18,4 @@ ...@@ -19,11 +18,4 @@
%h5 %h5
Your SSH keys (#{@keys.count}) Your SSH keys (#{@keys.count})
%div.append-bottom-default %div.append-bottom-default
- if @keys.any?
= render 'key_table' = render 'key_table'
- else
%p.profile-settings-message.text-center
- if is_admin
User has no ssh keys
- else
There are no SSH keys with access to your account.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment