UI ameliorations

This commit is contained in:
Nicolas Bally 2013-06-29 17:59:38 +02:00
parent 9f841c7e39
commit cb8af65caf
12 changed files with 104 additions and 55 deletions

View File

@ -23,6 +23,31 @@
body.admin{
padding:0px;
.right{
float:right;
}
.icon{
border:1px solid #0088cc;
display:inline-block;
padding:6px;
border-radius:50%;
font-size:1.1em;
width:1.1em;
height:1.1em;
text-align:center;
background:white;
&:hover{
background:#0088cc;
color:white;
text-decoration:none;
}
}
#upload_details{
display:none;
.content{

View File

@ -25,7 +25,7 @@ table {
padding: 8px;
line-height: @baseLineHeight;
text-align: left;
vertical-align: top;
vertical-align: middle;
border-top: 1px solid @tableBorder;
}
th {

View File

@ -46,12 +46,12 @@ color:white;
}
.box-shadow(0px 0px 10px rgba(0,0,0,0.8));
position:fixed;
top:20px;
left:20px;
right:20px;
bottom:20px;
top:0px;
left:0px;
right:0px;
bottom:0px;
z-index:2000;
background:white;
.content{

View File

@ -2,8 +2,19 @@
module IconHelper
def i(icon_name)
raw ('<i class="icon-'+icon_name.to_s+'"></i>')
def i(icon_name, options = {:icon => true})
if options[:icon]
raw ('<i class="icon icon-'+icon_name.to_s+'"></i>')
else
raw ('<i class="icon-'+icon_name.to_s+'"></i>')
end
end

View File

@ -1,4 +1,4 @@
= link_to i(:plus)+' Ajouter une petition', new_admin_petition_path, :class => "btn"
= link_to i(:plus, :icon => false)+' Ajouter une petition', new_admin_petition_path, :class => "btn"
%h1 Liste des petitions en ligne
%table.stat_table.table.table-striped
@ -19,7 +19,7 @@
=petition.confirmed_signators_number
="("+(petition.signators_number-petition.confirmed_signators_number).to_s+" en attente)" if petition.signators_number-petition.confirmed_signators_number > 0
%td
= link_to i(:"eye-open"), [:admin, petition]
= link_to i(:pencil), edit_admin_petition_path(petition)
= link_to i(:trash), [:admin, petition], method: :delete, data: { confirm: 'Voulez-vous vraiment supprimer cette petition ? Les signatures seront également supprimées.' }
= link_to i(:pencil), edit_admin_petition_path(petition)
= link_to i(:info), [:admin, petition]

View File

@ -31,10 +31,12 @@
%a.brand{:href => "/admin"} Administration
%a.brand{:href => "/admin"}
=i(:home, :icon => false)
Administration
.collapse.nav-collapse
%ul.nav
%li=link_to i(:home), "/admin"
%li=link_to "Admins", admin_admins_path
%li.dropdown
%a{:href => "#", :class => "dropdown-toggle", :data => {:toggle => "dropdown"}}

View File

@ -1,7 +1,10 @@
.links
=link_to "Créer une newsletter", new_newsletter_path
%table.admin_table#newsletters-list.table.table-stripped.table-bordered
.right
=link_to i(:plus, :icon => false)+" Créer une newsletter", new_newsletter_path, :class => "btn btn-primary"
%h1 Newsletters
%table.admin_table#newsletters-list.table.table-striped
%tr
%th Expéditeur
@ -17,16 +20,24 @@
=u.email_from
%td
= u.title
%td
%td{:style => "text-align:right;"}
- if has_permission?('newsletter.send')
=form_tag send_test_newsletter_path(u) do
= text_field_tag :email
= submit_tag "Envoyer un email de test", :class => "lien"
%td.link-column{:style => "width:200px;"}
= link_to "Prévualiser", newsletter_path(u)
= link_to "Editer", edit_newsletter_path(u)
= link_to "Effacer", u, :method => :delete, :confirm => 'Voulez-vous vraiment supprimer cette newsletter ?'
= link_to "Envoyer", select_recipients_newsletter_path(u)
=form_tag send_test_newsletter_path(u), :style => "display:inline;" do
.input-append{:style => "display:inline-block;margin:2px;"}
= text_field_tag :email,"", :class => ""
= submit_tag "Envoyer un email de test", :class => "btn"
%td{:style => "width:150px;text-align:right;"}
= link_to i(:trash), u, :method => :delete, :confirm => 'Voulez-vous vraiment supprimer cette newsletter ?'
= link_to i(:"envelope-alt"), select_recipients_newsletter_path(u)
= link_to i(:pencil), edit_newsletter_path(u)
= link_to i(:"eye-open"), newsletter_path(u), :target => "_blank"

View File

@ -1,22 +1,22 @@
%tr#sheet_line{:id => sheet.id}
-if sheet.corporate and sheet.corporate != ""
%td{:colspan => 2}=sheet.corporate
-else
%td= sheet.person.surname if sheet.person
%td= sheet.person.firstname if sheet.person
%td
-if sheet.person and sheet.person.phone and sheet.person.phone != ""
=sheet.person.phone
-else
=sheet.other_phone
-if sheet.corporate and sheet.corporate != ""
%td{:colspan => 2}=sheet.corporate
-else
%td= sheet.person.surname if sheet.person
%td= sheet.person.firstname if sheet.person
%td
-if sheet.person and sheet.person.phone and sheet.person.phone != ""
=sheet.person.phone
-else
=sheet.other_phone
%td
-if sheet.person and sheet.person.email and sheet.person.email != ""
=sheet.person.email
-else
=sheet.other_mail
%td.hidden-phone
-if sheet.person and sheet.person.email and sheet.person.email != ""
=sheet.person.email
-else
=sheet.other_mail
%td.link-column
=link_to 'Modifier', edit_sheet_path(sheet), :method => :get, :remote => true
=link_to "Voir", sheet, :class => "lien", :remote => true
=link_to "Supprimer", sheet, :method => :delete, :confirm => "*********ATTENTION*********\n Supprimer cette fiche entrainera la suppression de toutes traces concernant celle-ci : y compris les traces d'années d'adhésion, pouvant donc fausser les statistiques de l'ensemble du fichier. \n \nVous pouvez convertir la fiche en fiche 'sympathisant'.\n\n\ Pour annuler cliquez sur 'annuler', pour supprimer cette fiche malgrès cet avertissement cliquez sur 'OK'. \n\n", :class => "lien"
%td.link-column
=link_to i(:trash), sheet, :method => :delete, :confirm => "*********ATTENTION*********\n Supprimer cette fiche entrainera la suppression de toutes traces concernant celle-ci : y compris les traces d'années d'adhésion, pouvant donc fausser les statistiques de l'ensemble du fichier. \n \nVous pouvez convertir la fiche en fiche 'sympathisant'.\n\n\ Pour annuler cliquez sur 'annuler', pour supprimer cette fiche malgrès cet avertissement cliquez sur 'OK'. \n\n", :class => "lien"
=link_to i(:info), sheet, :class => "lien", :remote => true
=link_to i(:pencil), edit_sheet_path(sheet), :method => :get, :remote => true

View File

@ -7,6 +7,6 @@ résultats
%th Nom
%th Prénom
%th Téléphone
%th Email
%th
%th.hidden-phone Email
%th{:style => "width:100px;"}
=render @sheets.sort{|u,v| ((u.person.surname if u.person) || u.corporate).to_s <=>(( v.person.surname if v.person )|| v.corporate).to_s}

View File

@ -1,8 +1,8 @@
#sheet_show.edit
.links
=link_to "Détail", @sheet, :class => "button", :remote => true, :confirm => "Attention, les changements éventuellements apportés ne seront pas sauvegardés."
= link_to 'Fermer', "#",:class => "button", :onclick => "$('#sheet_show').remove();$('body').css('overflow', 'auto');return false;"
%input{:type => "submit", :onclick => "$(this).closest('#sheet_show').find('form').submit();return false;", :value => "Sauvegarder"}
=link_to i(:info), @sheet, :class => "button", :remote => true, :confirm => "Attention, les changements éventuellements apportés ne seront pas sauvegardés."
= link_to i(:remove), "#",:class => "button", :onclick => "$('#sheet_show').remove();$('body').css('overflow', 'auto');return false;"
%input{:type => "submit", :onclick => "$(this).closest('#sheet_show').find('form').submit();return false;", :value => "Sauvegarder", :class => "btn"}
.content
%h1 Modifier une fiche

View File

@ -1,7 +1,7 @@
#sheet_show.show
.links
= link_to 'Modifier', edit_sheet_path(@sheet), :class => "button", :method => :get, :remote => true
= link_to 'Fermer', "#", :class => "button", :onclick => "$('#sheet_show').remove();$('body').css('overflow', 'auto');return false;"
= link_to i(:pencil), edit_sheet_path(@sheet), :class => "button", :method => :get, :remote => true
= link_to i(:remove), "#", :class => "button", :onclick => "$('#sheet_show').remove();$('body').css('overflow', 'auto');return false;"

View File

@ -1,4 +1,4 @@
= link_to i(:plus)+' Ajouter une url courte', new_tiny_url_path, :class => "btn"
= link_to i(:plus, :icon => false)+' Ajouter une url courte', new_tiny_url_path, :class => "btn"
%h1 Liste des urls courtes
%table.stat_table.table.table-striped.table-hover
@ -15,6 +15,6 @@
%td= tiny_url.url
%td= tiny_url.nbr_views
%td
= link_to i(:pencil), edit_tiny_url_path(tiny_url)
= link_to i(:trash), tiny_url, method: :delete, data: { confirm: 'Voulez-vous vraiment supprimer cette url ? Le lien deviendra mort.' }
= link_to i(:pencil), edit_tiny_url_path(tiny_url)