v1.0
This commit is contained in:
parent
0f43e98ef8
commit
d378468794
317 changed files with 11347 additions and 0 deletions
16
app/views/keys/_form.html.haml
Normal file
16
app/views/keys/_form.html.haml
Normal file
|
@ -0,0 +1,16 @@
|
|||
%div
|
||||
= form_for @key, :remote => true do |f|
|
||||
-if @key.errors.any?
|
||||
%ul
|
||||
- @key.errors.full_messages.each do |msg|
|
||||
%li= msg
|
||||
|
||||
.span-6
|
||||
= f.label :title
|
||||
= f.text_field :title, :style => "width:300px"
|
||||
.span-6
|
||||
= f.label :key
|
||||
= f.text_area :key, :style => "width:300px; height:130px"
|
||||
.span-6
|
||||
= f.submit 'Save', :class => "lbutton vm"
|
||||
|
4
app/views/keys/_show.html.haml
Normal file
4
app/views/keys/_show.html.haml
Normal file
|
@ -0,0 +1,4 @@
|
|||
%tr
|
||||
%td= truncate key.title, :lenght => 12
|
||||
%td= truncate key.key, :lenght => 1114
|
||||
%td= link_to 'Cancel', key, :confirm => 'Are you sure?', :method => :delete, :class => "lbutton negative delete-key", :id => "destroy_key_#{key.id}", :remote => true
|
8
app/views/keys/create.js.haml
Normal file
8
app/views/keys/create.js.haml
Normal file
|
@ -0,0 +1,8 @@
|
|||
- if @key.valid?
|
||||
:plain
|
||||
$("#new_key_dialog").dialog("close");
|
||||
$("#keys-table").append("#{escape_javascript(render(:partial => 'show', :locals => {:key => @key} ))}");
|
||||
- else
|
||||
:plain
|
||||
$("#new_key_dialog").empty();
|
||||
$("#new_key_dialog").append("#{escape_javascript(render('form'))}");
|
7
app/views/keys/edit.html.haml
Normal file
7
app/views/keys/edit.html.haml
Normal file
|
@ -0,0 +1,7 @@
|
|||
%h1 Editing key
|
||||
|
||||
= render 'form'
|
||||
|
||||
= link_to 'Show', @key
|
||||
\|
|
||||
= link_to 'Back', keys_path
|
15
app/views/keys/index.html.haml
Normal file
15
app/views/keys/index.html.haml
Normal file
|
@ -0,0 +1,15 @@
|
|||
%div#new-key-holder
|
||||
= link_to "Add new", new_key_path, :remote => true, :class => "lbutton vm"
|
||||
|
||||
%table.round-borders#keys-table
|
||||
%tr
|
||||
%th title
|
||||
%th key
|
||||
%th Actions
|
||||
- @keys.each do |key|
|
||||
= render(:partial => 'show', :locals => {:key => key})
|
||||
|
||||
:javascript
|
||||
$('.delete-key').live('ajax:success', function() {
|
||||
$(this).closest('tr').fadeOut(); });
|
||||
|
5
app/views/keys/new.html.haml
Normal file
5
app/views/keys/new.html.haml
Normal file
|
@ -0,0 +1,5 @@
|
|||
%h1 New key
|
||||
|
||||
= render 'form'
|
||||
|
||||
= link_to 'Back', keys_path
|
11
app/views/keys/new.js.haml
Normal file
11
app/views/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
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue