summaryrefslogtreecommitdiff
path: root/app/views/profiles/keys
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-06-24 18:24:14 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-06-24 18:24:14 +0300
commit3e09e6f7b8032859a82266282dfd35715b3b3727 (patch)
tree7f882004565743b11cb4c734cbdfb9417fa1a9ab /app/views/profiles/keys
parente55e23bbda6f6a95982109bc46e48a5550e4c181 (diff)
downloadgitlab-ce-3e09e6f7b8032859a82266282dfd35715b3b3727.tar.gz
Move Profile related controllers under Profiles:: module
Diffstat (limited to 'app/views/profiles/keys')
-rw-r--r--app/views/profiles/keys/_form.html.haml24
-rw-r--r--app/views/profiles/keys/_key.html.haml12
-rw-r--r--app/views/profiles/keys/edit.html.haml7
-rw-r--r--app/views/profiles/keys/index.html.haml21
-rw-r--r--app/views/profiles/keys/new.html.haml14
-rw-r--r--app/views/profiles/keys/show.html.haml14
6 files changed, 92 insertions, 0 deletions
diff --git a/app/views/profiles/keys/_form.html.haml b/app/views/profiles/keys/_form.html.haml
new file mode 100644
index 00000000000..59808d60022
--- /dev/null
+++ b/app/views/profiles/keys/_form.html.haml
@@ -0,0 +1,24 @@
+%div
+ = form_for [:profile, @key] do |f|
+ - if @key.errors.any?
+ .alert.alert-error
+ %ul
+ - @key.errors.full_messages.each do |msg|
+ %li= msg
+
+ .clearfix
+ = f.label :title
+ .input= f.text_field :title
+ .clearfix
+ = f.label :key
+ .input
+ = f.text_area :key, class: [:xxlarge, :thin_area]
+ %p.hint
+ Paste your public key here. Read more about how generate it
+ = link_to "here", help_ssh_path
+
+
+ .actions
+ = f.submit 'Save', class: "btn btn-save"
+ = link_to "Cancel", profile_keys_path, class: "btn btn-cancel"
+
diff --git a/app/views/profiles/keys/_key.html.haml b/app/views/profiles/keys/_key.html.haml
new file mode 100644
index 00000000000..a71ad6295cd
--- /dev/null
+++ b/app/views/profiles/keys/_key.html.haml
@@ -0,0 +1,12 @@
+%tr
+ %td
+ = link_to profile_key_path(key) do
+ %strong= key.title
+ %td
+ %span.cgray
+ Added
+ = time_ago_in_words(key.created_at)
+ ago
+ %td
+ = link_to 'Remove', profile_key_path(key), confirm: 'Are you sure?', method: :delete, class: "btn btn-small btn-remove delete-key pull-right"
+
diff --git a/app/views/profiles/keys/edit.html.haml b/app/views/profiles/keys/edit.html.haml
new file mode 100644
index 00000000000..08c5a3dfe1e
--- /dev/null
+++ b/app/views/profiles/keys/edit.html.haml
@@ -0,0 +1,7 @@
+%h1 Editing key
+
+= render 'form'
+
+= link_to 'Show', profile_keys_path(key)
+\|
+= link_to 'Back', profile_keys_path
diff --git a/app/views/profiles/keys/index.html.haml b/app/views/profiles/keys/index.html.haml
new file mode 100644
index 00000000000..b22805bc862
--- /dev/null
+++ b/app/views/profiles/keys/index.html.haml
@@ -0,0 +1,21 @@
+%h3.page_title
+ SSH Keys
+ = link_to "Add new", new_profile_key_path, class: "btn pull-right"
+
+%hr
+%p.slead
+ SSH key allows you to establish a secure connection between your computer and GitLab
+
+
+%table#keys-table
+ %thead
+ %tr
+ %th Name
+ %th Added
+ %th
+ = render @keys
+ - if @keys.blank?
+ %tr
+ %td{colspan: 3}
+ %p.nothing_here_message There are no SSH keys with access to your account.
+
diff --git a/app/views/profiles/keys/new.html.haml b/app/views/profiles/keys/new.html.haml
new file mode 100644
index 00000000000..fff3805890e
--- /dev/null
+++ b/app/views/profiles/keys/new.html.haml
@@ -0,0 +1,14 @@
+%h3.page_title Add an SSH Key
+%hr
+= render 'form'
+
+:javascript
+ $('#key_key').on('keyup', function(){
+ var title = $('#key_title'),
+ val = $('#key_key').val(),
+ key_mail = val.match(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+|\.[a-zA-Z0-9._-]+)/gi);
+
+ if( key_mail && key_mail.length > 0 && title.val() == '' ){
+ $('#key_title').val( key_mail );
+ }
+ });
diff --git a/app/views/profiles/keys/show.html.haml b/app/views/profiles/keys/show.html.haml
new file mode 100644
index 00000000000..64c6621ea5f
--- /dev/null
+++ b/app/views/profiles/keys/show.html.haml
@@ -0,0 +1,14 @@
+%h3.page_title
+ Public key:
+ = @key.title
+ %small
+ created at
+ = @key.created_at.stamp("Aug 21, 2011")
+.back_link
+ = link_to profile_keys_path do
+ &larr; To keys list
+%hr
+
+%pre= @key.key
+.pull-right
+ = link_to 'Remove', profile_key_path(@key), confirm: 'Are you sure?', method: :delete, class: "btn btn-remove delete-key"