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{ body.admin{
padding:0px; 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{ #upload_details{
display:none; display:none;
.content{ .content{

View File

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

View File

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

View File

@ -2,9 +2,20 @@
module IconHelper module IconHelper
def i(icon_name) 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>') raw ('<i class="icon-'+icon_name.to_s+'"></i>')
end end
end
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 %h1 Liste des petitions en ligne
%table.stat_table.table.table-striped %table.stat_table.table.table-striped
@ -19,7 +19,7 @@
=petition.confirmed_signators_number =petition.confirmed_signators_number
="("+(petition.signators_number-petition.confirmed_signators_number).to_s+" en attente)" if petition.signators_number-petition.confirmed_signators_number > 0 ="("+(petition.signators_number-petition.confirmed_signators_number).to_s+" en attente)" if petition.signators_number-petition.confirmed_signators_number > 0
%td %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(: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 .collapse.nav-collapse
%ul.nav %ul.nav
%li=link_to i(:home), "/admin"
%li=link_to "Admins", admin_admins_path %li=link_to "Admins", admin_admins_path
%li.dropdown %li.dropdown
%a{:href => "#", :class => "dropdown-toggle", :data => {:toggle => "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 %tr
%th Expéditeur %th Expéditeur
@ -17,16 +20,24 @@
=u.email_from =u.email_from
%td %td
= u.title = u.title
%td
%td{:style => "text-align:right;"}
- if has_permission?('newsletter.send') - if has_permission?('newsletter.send')
=form_tag send_test_newsletter_path(u) do =form_tag send_test_newsletter_path(u), :style => "display:inline;" do
= text_field_tag :email .input-append{:style => "display:inline-block;margin:2px;"}
= submit_tag "Envoyer un email de test", :class => "lien" = text_field_tag :email,"", :class => ""
%td.link-column{:style => "width:200px;"} = submit_tag "Envoyer un email de test", :class => "btn"
= link_to "Prévualiser", newsletter_path(u)
= link_to "Editer", edit_newsletter_path(u) %td{:style => "width:150px;text-align:right;"}
= link_to "Effacer", u, :method => :delete, :confirm => 'Voulez-vous vraiment supprimer cette newsletter ?' = link_to i(:trash), u, :method => :delete, :confirm => 'Voulez-vous vraiment supprimer cette newsletter ?'
= link_to "Envoyer", select_recipients_newsletter_path(u) = 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

@ -10,13 +10,13 @@
-else -else
=sheet.other_phone =sheet.other_phone
%td %td.hidden-phone
-if sheet.person and sheet.person.email and sheet.person.email != "" -if sheet.person and sheet.person.email and sheet.person.email != ""
=sheet.person.email =sheet.person.email
-else -else
=sheet.other_mail =sheet.other_mail
%td.link-column %td.link-column
=link_to 'Modifier', edit_sheet_path(sheet), :method => :get, :remote => true =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 "Voir", sheet, :class => "lien", :remote => true =link_to i(:info), 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" =link_to i(:pencil), edit_sheet_path(sheet), :method => :get, :remote => true

View File

@ -7,6 +7,6 @@ résultats
%th Nom %th Nom
%th Prénom %th Prénom
%th Téléphone %th Téléphone
%th Email %th.hidden-phone Email
%th %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} =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 #sheet_show.edit
.links .links
=link_to "Détail", @sheet, :class => "button", :remote => true, :confirm => "Attention, les changements éventuellements apportés ne seront pas sauvegardés." =link_to i(:info), @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;" = 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"} %input{:type => "submit", :onclick => "$(this).closest('#sheet_show').find('form').submit();return false;", :value => "Sauvegarder", :class => "btn"}
.content .content
%h1 Modifier une fiche %h1 Modifier une fiche

View File

@ -1,7 +1,7 @@
#sheet_show.show #sheet_show.show
.links .links
= link_to 'Modifier', edit_sheet_path(@sheet), :class => "button", :method => :get, :remote => true = link_to i(:pencil), 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(: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 %h1 Liste des urls courtes
%table.stat_table.table.table-striped.table-hover %table.stat_table.table.table-striped.table-hover
@ -15,6 +15,6 @@
%td= tiny_url.url %td= tiny_url.url
%td= tiny_url.nbr_views %td= tiny_url.nbr_views
%td %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(: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)