external link

This commit is contained in:
Nicolas Bally 2011-07-08 17:35:30 +02:00
parent 29baca787a
commit 1cc5c635f1
13 changed files with 99 additions and 0 deletions

View File

@ -0,0 +1,11 @@
%tr#external_link_row.external_link_row.row{:id => external_link.id}
%td
= link_to i(:check_alt, :gray_light,12), "#",:onclick => "manager_send_cible("+external_link.id.to_s+", 'ExternalLink', '#{escape_javascript(external_link.cible_name)}');return false;"
=external_link.url
%td.actions
= link_to i(:trash_stroke, :blue), [:admin, external_link], :confirm => 'Voulez-vous vraiment supprimer ce lien externe ?', :method => :delete, :remote => true
= link_to i(:pen_alt_fill, :blue), edit_admin_external_link_path(external_link), :remote => true

View File

@ -0,0 +1,14 @@
= semantic_form_for [:admin, @external_link], :remote => true do |form|
= form.inputs do
= form.input :url, :label => "Url :"
.actions
%button{:type => "submit"} Sauvegarder

View File

@ -0,0 +1,10 @@
= link_to 'Ajouter un lien', new_admin_external_link_path, :remote => true, :class => "button"
%table.normal_table
%tbody#external_link_rows.rows
=render @external_links

View File

@ -0,0 +1,2 @@
close_pane_hover();
$('#external_link_rows').prepend("<%= escape_javascript(render(@external_link))%>");

View File

@ -0,0 +1 @@
$('#external_link_row_<%= @external_link.id %>').remove();

View File

@ -0,0 +1,6 @@
.grid_12
%h1 Modifier un administrateur
=render :partial => "form"

View File

@ -0,0 +1 @@
show_pane_hover("<%= escape_javascript(render(:partial => "form"))%>", 500, 500, 3000);

View File

@ -0,0 +1,2 @@
$('#Admin_index_block').replaceWith("<%= escape_javascript(render(:partial => "index_block")) %>");

View File

@ -0,0 +1 @@
show_pane_hover("<%= escape_javascript(render(:partial => "form"))%>", 500, 500, 3000);

View File

@ -0,0 +1,31 @@
.header
%h1 Détails de l'utilisateur
.back
= link_to "Retour",admin_users_path
.links
= link_to "Modifier", edit_admin_user_path(@user), :class => "lien"
.shadow_box{:style => "padding:10px;"}
%p
<b>Login:</b>
=h @user.login
%p
<b>Email:</b>
=mail_to @user.email
.shadow_box.padding
%h2 Logs
%table.admin_table
-for log in @user.user_logs.find(:all, :order => "created_at DESC")
%tr
%td=l log.created_at
%td=h log.message

View File

@ -0,0 +1,2 @@
close_pane_hover();
$('#external_link_row_<%= @external_link.id %>').replaceWith("<%= escape_javascript(render(@external_link))%>");

11
test/fixtures/external_links.yml vendored Normal file
View File

@ -0,0 +1,11 @@
# Read about fixtures at http://api.rubyonrails.org/classes/Fixtures.html
one:
title: MyString
description: MyText
url: MyString
two:
title: MyString
description: MyText
url: MyString

View File

@ -0,0 +1,7 @@
require 'test_helper'
class ExternalLinkTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end