diff --git a/Gemfile b/Gemfile index e27057be..4a52ebb9 100644 --- a/Gemfile +++ b/Gemfile @@ -19,8 +19,6 @@ gem 'therubyracer', platforms: :ruby # Use jquery as the JavaScript library gem 'jquery-rails' -# Messages and notifications displayed nicely using javascript -gem 'gritter' # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks gem 'turbolinks' @@ -49,6 +47,8 @@ gem 'spring', group: :development gem 'haml-rails' gem 'compass-rails' gem 'modernizr-rails' +# Using presentation framework http://foundation.zurb.com +gem 'foundation-rails' gem 'activeadmin', github: 'gregbell/active_admin' gem 'devise' diff --git a/Gemfile.lock b/Gemfile.lock index 9c6e7bd7..621a4130 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -113,8 +113,10 @@ GEM formatador (0.2.5) formtastic (2.3.0.rc3) actionpack (>= 3.0) + foundation-rails (5.3.0.1) + railties (>= 3.1.0) + sass (>= 3.2.0) fssm (0.2.10) - gritter (1.1.0) guard (2.6.1) formatador (>= 0.2.4) listen (~> 2.7) @@ -298,7 +300,7 @@ DEPENDENCIES differ email_validator font-awesome-rails - gritter + foundation-rails guard-brakeman guard-bundler guard-livereload diff --git a/app/assets/javascripts/flash.js.coffee b/app/assets/javascripts/flash.js.coffee index d4ac62d9..90fff30e 100644 --- a/app/assets/javascripts/flash.js.coffee +++ b/app/assets/javascripts/flash.js.coffee @@ -1,7 +1 @@ $(document).ready -> - $('#flash_messages .flash, #error_explanation.flash').removeClass('flash').each -> - $(this).hide() - jQuery.gritter.add - image: "/assets/#{$(this).attr('class')}.png", - title: $(this).children('h2').text(), - text: $(this).children('p').text() diff --git a/app/assets/stylesheets/all.css.sass b/app/assets/stylesheets/all.css.sass index 8793e6f9..44d4e5af 100644 --- a/app/assets/stylesheets/all.css.sass +++ b/app/assets/stylesheets/all.css.sass @@ -7,12 +7,6 @@ line-height: 1em @include transition-duration(0.5s) -[class^="fa-"], [class*=" fa-"] - font-family: FontAwesome, georgia, serif !important - &:before - font-style: normal - font-weight: normal !important - html color: black line-height: 1.3em @@ -29,14 +23,20 @@ body border-bottom: 0px a:link, a:visited - color: #369 + color: #258 font-weight: bold text-decoration: none a:hover, a:active, a:focus color: #2E97FF -.js #flash_messages - display: none +#flash_messages + font-size: x-large + .flash.notice + color: green + +.fa:before + font-style: normal + font-weight: normal !important header.top position: relative @@ -110,7 +110,9 @@ main line-height: 1.1em font-weight: normal vertical-align: baseline - background-color: buttonface + select, option + color: black + background-color: white .field_with_errors display: inline diff --git a/app/assets/stylesheets/application.sass b/app/assets/stylesheets/application.css.sass similarity index 97% rename from app/assets/stylesheets/application.sass rename to app/assets/stylesheets/application.css.sass index 286c77ec..146e6c98 100644 --- a/app/assets/stylesheets/application.sass +++ b/app/assets/stylesheets/application.css.sass @@ -10,7 +10,6 @@ * defined in the other CSS/SCSS files in this directory. It is generally better to create a new * file per style scope. * - *= require gritter *= require_tree . *= require_self */ diff --git a/app/assets/stylesheets/events.css.sass b/app/assets/stylesheets/events.css.sass index 8ec540f3..bcb32517 100644 --- a/app/assets/stylesheets/events.css.sass +++ b/app/assets/stylesheets/events.css.sass @@ -7,7 +7,6 @@ form.region_selector label display: none - header.calendar-header font-size: 1.5em margin-top: 1em @@ -44,14 +43,14 @@ body.events.index table background-color: #A1C3E7 &.today border: 1px solid #FFB578 - background-color: #ffe0c7 + background-color: #FFE0C7 .day_number - color: #544f32 + color: #531 font-size: 0.8em margin-top: -1px .event a:link, a:visited - color: #8F4900 + color: #730 &.future border-color: rgb(150, 207, 255) background-color: #C6E5FF @@ -62,16 +61,17 @@ body.events.index table border: none background-color: #ededed .day_number + color: #444 font-size: 0.6em li color: #555 .event a:link, a:visited - color: #888 + color: #444 .day_number float: left - color: #727070 + color: #111 margin: 0 1px 3px 1px font-size: 0.6em font-weight: bolder @@ -101,7 +101,7 @@ body.events.index table content: ':' margin-right: -1px a:link, a:visited - color: #666 + color: #111 font-weight: normal &:hover color: black diff --git a/app/controllers/events_controller.rb b/app/controllers/events_controller.rb index 478a4e91..4f9de7b4 100644 --- a/app/controllers/events_controller.rb +++ b/app/controllers/events_controller.rb @@ -4,6 +4,7 @@ class EventsController < ApplicationController before_filter :set_mailer_host def index + flash[:notice] = 'hello world' @events = Event.moderated if (params[:region] && params[:region].present? && params[:region] != 'all') @events = @events.region(params[:region]) diff --git a/app/views/layouts/_flash.html.haml b/app/views/layouts/_flash.html.haml index 0f9e2786..b67eec4e 100644 --- a/app/views/layouts/_flash.html.haml +++ b/app/views/layouts/_flash.html.haml @@ -1,5 +1,3 @@ #flash_messages - flash.each do |key, value| - .flash(class="#{key}") - %h2=t key, scope: [:gflash, :titles] - %p= value + .flash(class="#{key}")= value diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 58731d72..b69f77c6 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -16,7 +16,7 @@ %meta(name='dcterms.subject' content='agenda') = favicon_link_tag '/favicon.ico' - = auto_discovery_link_tag :rss, { controller: 'events', format: :rss } + = auto_discovery_link_tag :rss, { controller: '/events', format: :rss } = stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true = javascript_include_tag 'application', 'data-turbolinks-track' => true @@ -29,8 +29,6 @@ // /https://github.com/aFarkas/iepp/wiki %body(class = "#{controller.controller_name} #{controller.action_name}") - = render 'layouts/flash', flash: flash if flash.present? - %header.top = image_tag 'baby_gnu_adl.png', alt: 'Baby GNU', class: :logo %h1= link_to t('.title'), root_url @@ -58,6 +56,8 @@ = image_tag 'suisse.png', alt: t('.flag') =t '.suisse' + = render 'layouts/flash', flash: flash if flash.present? + %main = yield diff --git a/app/views/moderations/index.html.haml b/app/views/moderations/index.html.haml index 55b39cca..1766df9d 100644 --- a/app/views/moderations/index.html.haml +++ b/app/views/moderations/index.html.haml @@ -27,20 +27,30 @@ Du =l event.start_time, format: :at au - #{l event.end_time, format: :at} + =l event.end_time, format: :at %td= event.city %td= event.region.name %td= time_ago_in_words event.submission_time.to_date %th.actions - = link_to t('edit'), edit_moderation_path(event), class: 'fa-pencil' + = link_to edit_moderation_path event do + %em.fa.fa-pencil + =t 'edit' \- - = link_to t('validate'), edit_moderation_path(event), class: 'fa-thumbs-up' + = link_to edit_moderation_path event do + %em.fa.fa-thumbs-up + =t 'validate' \- - = link_to t('refuse'), edit_moderation_path(event), class: 'fa-thumbs-down' + = link_to edit_moderation_path event do + %em.fa.fa-thumbs-down + =t 'refuse' %br/ - = link_to t('.askInfos'), new_moderation_note_path(event, envoiParMail: :oui), class: 'fa-bullhorn' + = link_to new_moderation_note_path event, envoiParMail: :oui do + %em.fa.fa-bullhorn + =t '.askInfos' %br/ - = link_to t('.createNote'), new_moderation_note_path(event), class: 'fa-files-o' + = link_to new_moderation_note_path event do + %em.fa.fa-files-o + =t '.createNote' - event.notes.each do |note| %tr