Merge branch 'deploy_keys'
Conflicts: app/views/layouts/project.html.haml db/schema.rb
This commit is contained in:
commit
cbd78922ee
19 changed files with 234 additions and 8 deletions
16
app/views/deploy_keys/_form.html.haml
Normal file
16
app/views/deploy_keys/_form.html.haml
Normal file
|
@ -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"
|
||||
|
7
app/views/deploy_keys/_show.html.haml
Normal file
7
app/views/deploy_keys/_show.html.haml
Normal file
|
@ -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
|
9
app/views/deploy_keys/create.js.haml
Normal file
9
app/views/deploy_keys/create.js.haml
Normal file
|
@ -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'))}");
|
7
app/views/deploy_keys/edit.html.haml
Normal file
7
app/views/deploy_keys/edit.html.haml
Normal file
|
@ -0,0 +1,7 @@
|
|||
%h1 Editing key
|
||||
|
||||
= render 'form'
|
||||
|
||||
= link_to 'Show', @key
|
||||
\|
|
||||
= link_to 'Back', project_deploy_keys_path
|
11
app/views/deploy_keys/index.html.haml
Normal file
11
app/views/deploy_keys/index.html.haml
Normal file
|
@ -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(); });
|
||||
|
5
app/views/deploy_keys/new.html.haml
Normal file
5
app/views/deploy_keys/new.html.haml
Normal file
|
@ -0,0 +1,5 @@
|
|||
%h1 New key
|
||||
|
||||
= render 'form'
|
||||
|
||||
= link_to 'Back', project_deploy_keys_path
|
11
app/views/deploy_keys/new.js.haml
Normal file
11
app/views/deploy_keys/new.js.haml
Normal file
|
@ -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
|
||||
});
|
10
app/views/deploy_keys/show.html.haml
Normal file
10
app/views/deploy_keys/show.html.haml
Normal file
|
@ -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
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue