diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2012-01-14 21:26:35 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2012-01-14 21:26:35 +0200 |
commit | cbd78922ee43c0124458e2867071f752cae712f4 (patch) | |
tree | 5367dd4e0370f11bc5733de364016f2572a3323f /app/views/deploy_keys | |
parent | 09b877ef29a0c641457eb986c5b228d003c51c16 (diff) | |
parent | dda6b0ab63eb8080e34b4273cfb6aadb7a29c028 (diff) | |
download | gitlab-ce-cbd78922ee43c0124458e2867071f752cae712f4.tar.gz |
Merge branch 'deploy_keys'
Conflicts:
app/views/layouts/project.html.haml
db/schema.rb
Diffstat (limited to 'app/views/deploy_keys')
-rw-r--r-- | app/views/deploy_keys/_form.html.haml | 16 | ||||
-rw-r--r-- | app/views/deploy_keys/_show.html.haml | 7 | ||||
-rw-r--r-- | app/views/deploy_keys/create.js.haml | 9 | ||||
-rw-r--r-- | app/views/deploy_keys/edit.html.haml | 7 | ||||
-rw-r--r-- | app/views/deploy_keys/index.html.haml | 11 | ||||
-rw-r--r-- | app/views/deploy_keys/new.html.haml | 5 | ||||
-rw-r--r-- | app/views/deploy_keys/new.js.haml | 11 | ||||
-rw-r--r-- | app/views/deploy_keys/show.html.haml | 10 |
8 files changed, 76 insertions, 0 deletions
diff --git a/app/views/deploy_keys/_form.html.haml b/app/views/deploy_keys/_form.html.haml new file mode 100644 index 00000000000..d3a2682ae3e --- /dev/null +++ b/app/views/deploy_keys/_form.html.haml @@ -0,0 +1,16 @@ +%div + = form_for [@project, @key], :url => project_deploy_keys_path, :remote => true do |f| + -if @key.errors.any? + %ul + - @key.errors.full_messages.each do |msg| + %li= msg + + .form-row + = f.label :title + = f.text_field :title, :style => "width:300px" + .form-row + = f.label :key + = f.text_area :key, :style => "width:300px; height:130px" + .form-row + = f.submit 'Save', :class => "grey-button" + diff --git a/app/views/deploy_keys/_show.html.haml b/app/views/deploy_keys/_show.html.haml new file mode 100644 index 00000000000..b1622f35167 --- /dev/null +++ b/app/views/deploy_keys/_show.html.haml @@ -0,0 +1,7 @@ +%a.update-item{:href => project_deploy_key_path(key.project, key)} + %span.update-title + = key.title + %span.update-author + Added + = time_ago_in_words(key.created_at) + ago diff --git a/app/views/deploy_keys/create.js.haml b/app/views/deploy_keys/create.js.haml new file mode 100644 index 00000000000..0e8757f880f --- /dev/null +++ b/app/views/deploy_keys/create.js.haml @@ -0,0 +1,9 @@ +- if @key.valid? + :plain + $("#new_key_dialog").dialog("close"); + $("#keys-table .data").append("#{escape_javascript(render(:partial => 'show', :locals => {:key => @key} ))}"); + $("#no_ssh_key_defined").hide(); +- else + :plain + $("#new_key_dialog").empty(); + $("#new_key_dialog").append("#{escape_javascript(render('form'))}"); diff --git a/app/views/deploy_keys/edit.html.haml b/app/views/deploy_keys/edit.html.haml new file mode 100644 index 00000000000..9b1b9aac221 --- /dev/null +++ b/app/views/deploy_keys/edit.html.haml @@ -0,0 +1,7 @@ +%h1 Editing key + += render 'form' + += link_to 'Show', @key +\| += link_to 'Back', project_deploy_keys_path diff --git a/app/views/deploy_keys/index.html.haml b/app/views/deploy_keys/index.html.haml new file mode 100644 index 00000000000..d3feadb8742 --- /dev/null +++ b/app/views/deploy_keys/index.html.haml @@ -0,0 +1,11 @@ += render "repositories/head" + +%div#keys-table{ :class => "update-data ui-box ui-box-small ui-box-big" } + .data + - @keys.each do |key| + = render(:partial => 'show', :locals => {:key => key}) + +:javascript + $('.delete-key').live('ajax:success', function() { + $(this).closest('.update-item').fadeOut(); }); + diff --git a/app/views/deploy_keys/new.html.haml b/app/views/deploy_keys/new.html.haml new file mode 100644 index 00000000000..9be37204567 --- /dev/null +++ b/app/views/deploy_keys/new.html.haml @@ -0,0 +1,5 @@ +%h1 New key + += render 'form' + += link_to 'Back', project_deploy_keys_path diff --git a/app/views/deploy_keys/new.js.haml b/app/views/deploy_keys/new.js.haml new file mode 100644 index 00000000000..86e9db030c5 --- /dev/null +++ b/app/views/deploy_keys/new.js.haml @@ -0,0 +1,11 @@ +:plain + var new_key_dialog = $("<div id='new_key_dialog'></div>"); + new_key_dialog.html("#{escape_javascript(render('form'))}"); + $(new_key_dialog).dialog({ + width: 350, + resizable: false, + draggable: false, + title: "Add new public key", + close: function(event, ui) { $("#new_key_dialog").remove();}, + modal: true + }); diff --git a/app/views/deploy_keys/show.html.haml b/app/views/deploy_keys/show.html.haml new file mode 100644 index 00000000000..2c5c6149313 --- /dev/null +++ b/app/views/deploy_keys/show.html.haml @@ -0,0 +1,10 @@ +.ui-box.width-100p + %h3= @key.title + .data + %pre= @key.key + .clear + .buttons + = link_to 'Remove', project_deploy_key_path(@key.project, @key), :confirm => 'Are you sure?', :method => :delete, :class => "red-button delete-key right" + .clear + + |