diff --git a/app/assets/stylesheets/public.scss b/app/assets/stylesheets/public.scss index 0fcecec..b231b83 100644 --- a/app/assets/stylesheets/public.scss +++ b/app/assets/stylesheets/public.scss @@ -4,8 +4,8 @@ $orange: #FF931E; $blue: #2BAADA; $dark_orange: #E94F25; -$title_font : "Lato", sans-serif; -$sans_serif_font:"Lato", Arial, sans-serif; +$title_font : "Oswald", sans-serif; +$sans_serif_font:"caviar_dreams", Arial, sans-serif; $serif_font : "Roboto Slab", serif; $cursive_font : 'Galada', cursive; @@ -28,9 +28,11 @@ $cursive_font : 'Galada', cursive; body{ padding:0; - font-family:lato; + font-family:$sans_serif_font; width:100%; margin:0; + background:#c5c6e4; + background:#deddec; } .slide_home_wrapper{ @@ -131,18 +133,23 @@ body{ text-decoration:none; cursor:pointer; } +h1,h2,h3,h4,h5{ + font-family:$title_font; + text-transform:uppercase; + font-weight:700; +} + h1{ background:no-repeat bottom center; text-align:center; - background-image:url('/bottom-lines.png'); + background-size: 225px; padding-top:20px; padding-bottom:10px; margin-bottom:30px; margin-top:0; - text-transform:uppercase; - font-weight:500; + } @@ -220,42 +227,6 @@ h1{ } } -#sub_footer{ - padding: 0 30px; - padding-right:20px; - a{ - text-decoration:none; - color:inherit; - } - i{ - width:17px; - display:inline-block; - } - p{ - padding:0; - margin:0; - } - - #place,#contacts{ - display:inline-block; - padding:25px 0; - font-size:14px; - color:rgba(0,0,0,0.6); - line-height:19px; - } - #place{ - padding-right:25px; - } - - #logos{ - padding:15px 0; - float:right; - img{ - height:90px; - margin:0 10px; - } - } -} #actus{ padding:20px 0; padding-bottom:50px; @@ -310,11 +281,11 @@ h2{ -#logo_fond{ +#logo{ position:absolute; - top:0; - left:0; - height:190px; + top:20px; + left:25px; + height:60px; z-index:3; } @@ -329,7 +300,9 @@ h2{ padding-right:20px; padding-top:30px; - + font-family:$title_font; + text-transform:uppercase; + font-weight:700; background: linear-gradient(to bottom, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0) 100%); @@ -343,19 +316,14 @@ h2{ color:white; text-decoration:none; } - .sub_menu{ - font-size:0.8em; - opacity:0.7; - padding-right:10px; - - } + .menu{ padding:10px 0; a{ display:inline-block; padding:0 10px; font-weight:500; - font-size:1.2em; + font-size:1.4em; text-transform:uppercase; } } @@ -499,4 +467,163 @@ a{ } } +} +.partners{ + + + + text-align:center; + .inner{ + max-width:1000px; + padding:30px 20px; + margin:auto; + + } + .partner{ + + background:white; + + margin:5px; + + display:inline-block; + //border:1px solid rgba(white,0.6); + padding:15px 10px; + &:hover{ + + cursor:pointer; + + } + .p_inner{ + width:150px; + background:no-repeat center center; + background-size:100%; + background-size:contain; + } + + } + + + + +} + +#sub_footer{ + background:rgba(#20102d, 1); + text-align:center; + color:white; + + #contacts{ + padding:0px; + padding-top:20px; + padding-bottom:140px; + text-align:center; + font-weight:bold; + a{ + padding:0 10px; + color:white; + } + } + h3{ + color:rgba(white,0.9); + text-align:center; + font-size:1.7em; + padding-top:40px; + margin:0; + + } + + .partners{ + .inner{max-width:100%; + padding-right:5px; + padding-left:5px;} + + + .partner{ + -webkit-filter: grayscale(100%); /* Safari 6.0 - 9.0 */ + filter: grayscale(100%); + opacity:0.5; + + &:hover{ + opacity:1; + + -webkit-filter: grayscale(0%); /* Safari 6.0 - 9.0 */ + filter: grayscale(0%); + } + + + } + + + + + } + + +} + +#top_band{ + position:relative; + .h1_inner{ + position:absolute; + bottom:0; + right:0; + left:0; + text-align:center; + padding:30px 20px; + + + } + h1{ + display:inline-block; + border-bottom:5px solid white; + font-size:3em; + color:white; + padding:0; + padding-bottom:0px; + margin:0; + + + } +} + +.events{ + text-align:center; + vertical-align:top; + .event{ + vertical-align:top; + background:white; + max-width:700px; + margin:60px auto; + margin-top:0; + box-shadow:0 0 20px rgba(black,0.4); + h2{ + margin:0; + padding:25px 20px; + text-align:center; + } + .img{ + + background:no-repeat center center; + background-size:100%; + background-size:cover; + margin:auto; + max-width:600px; + + + } + + .desc{ + max-width:470px; + padding:10px 30px; + margin:auto; + padding-bottom:30px; + text-align:left; + min-height:150px; + } + + + } + + + } diff --git a/app/controllers/admin/events_controller.rb b/app/controllers/admin/events_controller.rb index 21b1ee6..58f15a3 100644 --- a/app/controllers/admin/events_controller.rb +++ b/app/controllers/admin/events_controller.rb @@ -1,89 +1,83 @@ # -*- encoding : utf-8 -*- class Admin::EventsController < ApplicationController + before_filter :auth_admin - before_filter :auth_admin + + layout "admin" - layout "admin" - - - before_filter :find_events + def index end def cible - + @events = Event.all + render :layout => false - end - + def new - - @event = Event.new() + if params[:event_id] and Event.find(params[:event_id]) + @event = Event.find(params[:event_id]).dup + @event.event_id = params[:event_id] + else + @event = Event.new(:start_at_date =>[ Date.today.day, Date.today.month, Date.today.year].join("/"), :start_at_time => "20:00") + + end end - def edit - @event = Event.find(params[:id]) - + end def create - - @event = Event.new(event_params) + @event = Event.new(params.require(:event).permit!) + - if @event.save - flash[:notice] = "L'event à été ajouté avec succès." - self.find_events + + flash[:notice] = "L'événement à été ajouté avec succès." + + self.find_events #reload events to show new events in the list sort by date. + else render :action => "new" + + end + + end + + def update + @event = Event.find(params[:id]) + + if @event.update_attributes(params.require(:event).permit!) + flash[:notice] = "L'événement à été modifié avec succès." + else + render :action => "edit" + end - end - - - def update - - @event = Event.find(params[:id]) - - - if params[:event] - if @event.update_attributes(event_params) - flash[:notice] = "L'event à été modifié avec succès." - else - render :action => "edit" - end - - - elsif params[:tag_id] - @event.tag_by_tag_ids(params[:tag_id]) - end - - - - end def destroy - @event = Event.find(params[:id]) @event.destroy end + protected def find_events @@ -92,33 +86,29 @@ class Admin::EventsController < ApplicationController start = Date.parse(params[:start]).beginning_of_day params[:start]= start.strftime('%d/%m/%Y') else - params[:start] = "" + params[:start] = "Début" end if params[:stop] and params[:stop] =~ date_regex stop = Date.parse(params[:stop]).end_of_day params[:stop]= stop.strftime('%d/%m/%Y') else - params[:stop] = "" + params[:stop] = "Fin" end - @events = Event.order('start_at DESC') + @events = Event.order('start_at, stop_at') @events = @events.after(start) if start @events = @events.before(stop) if stop - per_page = (params[:per_page] and params[:per_page] != "") ? params[:per_page] : 5000 + per_page = (params[:per_page] and params[:per_page] != "") ? params[:per_page] : 20 page = (params[:page] and params[:page] != "") ? params[:page] : 1 - @events = @events.page(page).per(per_page) + #@events = Event.all.page(page).per(per_page) - #@events = Event.order('start_at, stop_at').after(start).before(stop) + @events = Event.order('start_at DESC, stop_at DESC') + @events = @events.after(start) if start + @events = @events.before(stop) if stop + + + + + @events = @events.page(page).per(per_page) end - - private - def event_params - params.require(:event).permit(:start_at, :title, :slug, :description, :image_file_id) - - - - - end - - end diff --git a/app/controllers/admin/partners_controller.rb b/app/controllers/admin/partners_controller.rb new file mode 100644 index 0000000..66ccca0 --- /dev/null +++ b/app/controllers/admin/partners_controller.rb @@ -0,0 +1,54 @@ +# -*- encoding : utf-8 -*- + +class Admin::PartnersController < ApplicationController + layout "admin" + before_filter :auth_admin + + def index + @partners = Partner.all + end + + def new + @partner = Partner.new + end + + def edit + @partner = Partner.find(params[:id]) + end + + def create + @partner = Partner.new(params.require(:partner).permit!) + + + if @partner.save + redirect_to admin_partners_url, notice: 'Url courte crée.' + + else + render action: "new" + + end + + end + + def update + @partner = Partner.find(params[:id]) + + + if @partner.update_attributes(params.require(:partner).permit!) + redirect_to admin_partners_url, notice: 'Url courte modifiée.' + + else + render action: "edit" + + end + + end + + + def destroy + @partner = Partner.find(params[:id]) + @partner.destroy + + redirect_to admin_partners_url, :notice => "Url courte supprimée." + end +end diff --git a/app/helpers/events_helper.rb b/app/helpers/events_helper.rb new file mode 100644 index 0000000..d3edeeb --- /dev/null +++ b/app/helpers/events_helper.rb @@ -0,0 +1,27 @@ +module EventsHelper + def event_human_date(event, date_format = "%A %e %B %Y", time_format = "%kh%M") + + if event.entire_day? + if event.stop_date? + if event.start_at.strftime('%d/%m/%Y') == event.stop_at.strftime('%d/%m/%Y') + "le #{l(event.start_at, :format => date_format)}" + else + "du #{l(event.start_at, :format => date_format)} au #{l(event.stop_at, :format => date_format)}" + end + else + "le #{l(event.start_at, :format => date_format)}" + end + else + if event.stop_date? + if event.start_at.strftime('%d/%m/%Y') == event.stop_at.strftime('%d/%m/%Y') + "le #{l(event.start_at, :format => date_format)} de #{l(event.start_at, :format => time_format)} à #{l(event.stop_at, :format => time_format)} " + else + "du #{l(event.start_at, :format => date_format)} à #{l(event.start_at, :format => time_format)} au #{l(event.stop_at, :format => date_format)} à #{l(event.stop_at, :format => time_format)} " + end + else + "le #{l(event.start_at, :format => date_format)} à #{l(event.start_at, :format => time_format)}" + end + end + + end +end diff --git a/app/models/dynamic_content.rb b/app/models/dynamic_content.rb index 5c6fb2b..e948317 100644 --- a/app/models/dynamic_content.rb +++ b/app/models/dynamic_content.rb @@ -5,16 +5,8 @@ class DynamicContent < ActiveRecord::Base belongs_to :item NAMES = { - "militer" => "Index militer", - "detenus" => "Index détenus", - "index_label" => "Index Label", - "index_petitions" => "Index Pétitions", - "index_sponsorship" => "Index Parrainages", - "contact" => "Formulaire contact", - "contact_leg" => "Formulaire contact leg", - "contact_militer" => "Formulaire contact militer", - "plan" => "Plan du site", - "newsletter" => "Formulaire newsletter", + "partners" => "Partenaires", + "prog" => "Programation", } diff --git a/app/models/event.rb b/app/models/event.rb index 8969229..efe4e88 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -1,54 +1,118 @@ class Event < ActiveRecord::Base + date_format = /\A(0[1-9]|[12][0-9]|3[01])[\/](0[1-9]|1[012])[\/](19|20)\d\d\z/i + hour_format = /\A([0-1]?[0-9]|2[0-3]):([0-5][0-9])(:[0-5][0-9])?\z/i + validates :title, :presence => true + belongs_to :image_file - - validates :title, :presence => true - validates :slug, :presence => true, :uniqueness => true - has_one :block, :as => :blockable - - after_create :after_creation - - before_validation do - self.slug = self.title.to_slug - - end - after_initialize do - if self.start_at - self.start_at = self.start_at.strftime('%d/%m/%Y') - end - - end +# validates :start_at_date, :presence => true, :format => { :with => date_format } +# validates :start_at_time, :presence => true, :format => { :with => hour_format }, :if => :with_time? +# validates :stop_at_date, :presence => true, :format => { :with => date_format }, :if => :stop_date +# validates :stop_at_time, :presence => true, :format => { :with => hour_format }, :if => [:with_time?,:stop_date] + + attr_accessor :start_at_date, :start_at_time, :stop_at_date, :stop_at_time, :event_id, :skip_date + + has_one :block, :as => :blockable + - def after_creation - @block = Block.new(:block_name => "Contenu") - @block.blockable = self - @block.save - - - end - - def alloweds_types - self.block.allow_types :TitleContent, :TextContent, :ImageContent, :LinkContent, :GalleryContent, :HtmlContent - - end - - #where("enabled = ?",true ). - scope :recents, -> {order("start_at DESC, created_at DESC")} - scope :between, lambda { |start, stop| after(start).before(stop) } scope :after, lambda { |date| - where("(start_at >= ?)", date ) + where("(start_at >= ? or stop_at >= ?)", date, date ) } scope :before, lambda { |date| - where("(start_at <= ?)", date ) + where("(stop_at <= ?) or (start_at <= ?)", date, date ) } + def alloweds_types + self.block.allow_types :TitleContent, :TextContent, :ImageContent, :LinkContent, :GalleryContent, :HtmlContent + + end + + after_create do + if self.event_id and Event.where(:id => self.event_id).exists? + + event = Event.find(self.event_id) + + @block = event.block.dup + @block.blockable = self + @block.save + + else + @block = Block.new(:block_name => "general") + @block.blockable = self + @block.save + end - - - + end + + def create_block(event_id=nil) + if event_id + + else + + + + end + end + + before_validation do + + if !self.skip_date + self.stop_at_date, self.stop_at_time = nil, nil if !self.stop_date + self.start_at_time, self.stop_at_time = nil, nil if self.entire_day + + if self.entire_day + self.start_at = self.start_at_date.to_s + self.stop_at = self.stop_at_date.to_s + else + self.start_at = self.start_at_date.to_s+" "+self.start_at_time.to_s + self.stop_at = self.stop_at_date.to_s+" "+self.stop_at_time.to_s + + end + + end + + if self.stop_date and self.start_at and (self.stop_at.beginning_of_day != self.start_at.beginning_of_day) + self.many_days = true + else + self.many_days = false + end + + true + + end + + def with_time? + true if !self.entire_day + end + + after_initialize do + if self.start_at + if self.entire_day + self.start_at_date = self.start_at.strftime('%d/%m/%Y') + else + self.start_at_date = self.start_at.strftime('%d/%m/%Y') + self.start_at_time = self.start_at.strftime('%H:%M') + end + end + + if self.stop_at + if self.entire_day + self.stop_at_date = self.stop_at.strftime('%d/%m/%Y') + else + self.stop_at_date = self.stop_at.strftime('%d/%m/%Y') + self.stop_at_time = self.stop_at.strftime('%H:%M') + end + end + end + + def human_date + + + + end end diff --git a/app/models/partner.rb b/app/models/partner.rb new file mode 100644 index 0000000..9fdfee4 --- /dev/null +++ b/app/models/partner.rb @@ -0,0 +1,7 @@ +class Partner < ActiveRecord::Base + belongs_to :image_file + belongs_to :second_image_file, :class_name => "ImageFile" + + validates :name, :presence => true + +end diff --git a/app/views/admin/events/_event.html.haml b/app/views/admin/events/_event.html.haml new file mode 100644 index 0000000..02713f4 --- /dev/null +++ b/app/views/admin/events/_event.html.haml @@ -0,0 +1,13 @@ +%tr#event_row.event_row{:id => event.id} + + %td{:style => "width:400px"}=raw event_human_date(event) + %td=event.title + + + %td.actions{:style => "width:200px;text-align:right;"} + = link_to i(:copy), new_admin_event_path(:event_id => event), :remote => true, :style => "padding-right:5px;" + = link_to i(:trash), [:admin, event], :confirm => 'Voulez-vous vraiment supprimer cet événement ?', :method => :delete, :remote => true + = link_to i(:pencil), edit_admin_event_path(event), :remote => true + = link_to i(:plus), edit_admin_event_path(event), :style => "padding:5px;", :class => "show_details" + + diff --git a/app/views/admin/events/_form.html.haml b/app/views/admin/events/_form.html.haml new file mode 100644 index 0000000..f8c1c3e --- /dev/null +++ b/app/views/admin/events/_form.html.haml @@ -0,0 +1,50 @@ += semantic_form_for [:admin,@event], :remote => true do |form| + .content + = form.inputs do + = form.input :title, :label => "Titre :" + = form.hidden_field :event_id + =form.input :image_file_id, :as => :qi_image_select + .event_date_form + -if form.object.errors.messages[:start_at_date] or form.object.errors.messages[:start_at_time] or form.object.errors.messages[:stop_at_date] or form.object.errors.messages[:stop_at_time] + %p.errors + Tout les champs doivent être remplis. Les dates doivent être au format jj/mm/yyyy et les heures au format hh:mm. + .div + =form.label :start_at_date, "Début :", :style=>"display:inline-block;width:50px" + =form.text_field :start_at_date, :id => "event_start_at_date", :class => "datepicker" + .event_time{:style => "display:inline;"} + =form.label :start_at_time, "heure :" + .input-append.bootstrap-timepicke{:style => "display:inline-block;"} + =form.text_field :start_at_time, :id => "event_start_at_time", :class => "timepicker input-small", :style => "width:50px" + %span.add-on + %i.icon-time + + + =form.check_box :entire_day, :id => "event_entire_day" + =form.label :entire_day, "jour entier ?" + .div + %span.stop_at + =form.label :stop_at_date, "Fin :", :style=>"display:inline-block;width:50px" + =form.text_field :stop_at_date, :id => "event_stop_at_date", :class => "datepicker" + .event_time{:style => "display:inline;"} + =form.label :stop_at_time, "heure :" + .input-append.bootstrap-timepicke{:style => "display:inline-block;"} + =form.text_field :stop_at_time, :id => "event_stop_at_time", :class => "timepicker input-small", :style => "width:50px" + %span.add-on + %i.icon-time + + + =form.check_box :stop_date, :id => "event_stop_date" + =form.label :stop_date, "fin précisée ?" + + + = form.inputs do + = form.input :description, :label => "Description courte :", :as => :text + + + + + .actions + = form.submit "Sauvegarder", :class => "btn" + + :javascript + update_event_form(); \ No newline at end of file diff --git a/app/views/admin/events/_index_block.html.haml b/app/views/admin/events/_index_block.html.haml new file mode 100644 index 0000000..b41a012 --- /dev/null +++ b/app/views/admin/events/_index_block.html.haml @@ -0,0 +1,28 @@ + +.search_pannel + + =form_tag "", :method => "get", :remote => true do + .input-append + =text_field_tag :start, params[:start],:class => "datepicker", :placeholder => "Début" + %button.btn{:onclick => "$(this).prev('input').val('');"} + =i(:remove, :icon => false) + + .input-append + =text_field_tag :stop, params[:stop],:class => "datepicker", :placeholder => "Fin" + %button.btn + =i(:remove, :icon => false) + + + + =submit_tag "filtrer", :class => "btn", :style => "margin-bottom: 10px;" + + + + + +%table#events.table.table-hover + =render @events + #pagination + = paginate @events, :remote => true + + diff --git a/app/views/admin/events/_show.html.haml b/app/views/admin/events/_show.html.haml new file mode 100644 index 0000000..25bd2b6 --- /dev/null +++ b/app/views/admin/events/_show.html.haml @@ -0,0 +1,6 @@ +#event_show + %h1 + =@event.title + %em=event_human_date(@event) + + .desc=simple_format @event.description \ No newline at end of file diff --git a/app/views/admin/events/cible.html.haml b/app/views/admin/events/cible.html.haml new file mode 100644 index 0000000..dc7582c --- /dev/null +++ b/app/views/admin/events/cible.html.haml @@ -0,0 +1,6 @@ + +-Event.all.each do |actuality| + + %h4 + =actuality.title + = link_to i(:check_alt, :gray_light,12), "#",:onclick => "manager_send_cible("+actuality.id.to_s+", 'Folder', '#{escape_javascript(actuality.cible_name)}');return false;" if params[:manager] diff --git a/app/views/admin/events/create.js.erb b/app/views/admin/events/create.js.erb new file mode 100644 index 0000000..9b55c26 --- /dev/null +++ b/app/views/admin/events/create.js.erb @@ -0,0 +1,4 @@ +close_pane_hover(); + +$('#events').html("<%= escape_javascript(render(@events))%>"); +$('#event_row_<%= @event.id %>').effect("highlight", {}, 3000); diff --git a/app/views/admin/events/destroy.js.erb b/app/views/admin/events/destroy.js.erb new file mode 100644 index 0000000..0cb6a02 --- /dev/null +++ b/app/views/admin/events/destroy.js.erb @@ -0,0 +1 @@ +$('#event_row_<%=@event.id%>').remove(); diff --git a/app/views/admin/events/edit.html.haml b/app/views/admin/events/edit.html.haml new file mode 100644 index 0000000..2e2cc9c --- /dev/null +++ b/app/views/admin/events/edit.html.haml @@ -0,0 +1,81 @@ +#toolbar-text + +#menu_item_block_edit{:style => "margin-right:330px;margin-top:45px;"} + + =render :partial => "admin/blocks/block", :locals => {:block => @event.block, :sortable => true} + + +%br +%br +%br +%br +%br +%br +%br +%br +%br +%br +%br +#menu_item_inspector_container + + + + + + + + #menu_item_informations + %h4 + Infos sur l'event + + + .panel#collapseOne{:style => "display:none;"} + =render :partial => "form" + + %h4 éléments + + .panel#collapse2 + .block_portlets_sortable#content_types + -@event.block.alloweds_types.each do |slug, name| + + .content_type{:id => slug, :"data-type" => slug} + =#i slug.to_s.constantize.picto + =image_tag("admin/content_type/type_"+slug.to_s+".png", :alt => name, :title => name, :class => "handle") + + + #collapse3{:style => "display:none;"} + %h4 Modifier l'élément + + + .panel + #element_form + + %div#element_form_action + %a.move.btn.btn-default.portlet_handle{:href => "#", :data => {:portlet_id => nil}} + %span.move_message + =ic :arrows + + déplacer + %span.cancel_message + =ic :ban + + annuler + + =link_to ic(:"trash-o"), "#", :method => :delete, :data => { :confirm => "Etes-vous sûr ?"}, :remote => true, :class => "btn btn-danger trash" + + %button.save.btn.btn-primary + =ic(:"floppy-o") + + Sauvegarder + + + + + + + + + + + + diff --git a/app/views/admin/events/edit.js.erb b/app/views/admin/events/edit.js.erb new file mode 100644 index 0000000..61c7a6f --- /dev/null +++ b/app/views/admin/events/edit.js.erb @@ -0,0 +1 @@ +show_pane_hover("<%= escape_javascript(render(:partial => "form"))%>",850,600); \ No newline at end of file diff --git a/app/views/admin/events/index.html.haml b/app/views/admin/events/index.html.haml new file mode 100644 index 0000000..a0bbac2 --- /dev/null +++ b/app/views/admin/events/index.html.haml @@ -0,0 +1,8 @@ +.header + .right= link_to 'Ajouter un événement', new_admin_event_path, :class => "btn", :remote => true + %h1 Agenda + +#events_index=render :partial => "index_block" + +#event_detail + diff --git a/app/views/admin/events/index.js.erb b/app/views/admin/events/index.js.erb new file mode 100644 index 0000000..3a8ebdc --- /dev/null +++ b/app/views/admin/events/index.js.erb @@ -0,0 +1 @@ +$('#events_index').html("<%= escape_javascript(render(:partial => "index_block"))%>"); diff --git a/app/views/admin/events/new.js.erb b/app/views/admin/events/new.js.erb new file mode 100644 index 0000000..fe50966 --- /dev/null +++ b/app/views/admin/events/new.js.erb @@ -0,0 +1,2 @@ +show_pane_hover("<%= escape_javascript(render(:partial => "form"))%>",850,600); + diff --git a/app/views/admin/events/update.js.erb b/app/views/admin/events/update.js.erb new file mode 100644 index 0000000..64de6b8 --- /dev/null +++ b/app/views/admin/events/update.js.erb @@ -0,0 +1,5 @@ +close_pane_hover(); + +$('#event_show').replaceWith("<%= escape_javascript(render(:partial => "show"))%>"); +$('#events').html("<%= escape_javascript(render(@events))%>"); +$('#event_row_<%= @event.id %>').effect("highlight", {}, 3000); \ No newline at end of file diff --git a/app/views/admin/partners/_form.html.haml b/app/views/admin/partners/_form.html.haml new file mode 100644 index 0000000..87310a7 --- /dev/null +++ b/app/views/admin/partners/_form.html.haml @@ -0,0 +1,9 @@ += semantic_form_for([:admin, @partner]) do |f| + =f.inputs do + = f.input :image_file_id, :label => "Image générale :" , :as => :qi_image_select + = f.input :name, :label => "Nom :" + = f.input :description, :label => "Description:" + = f.input :url, :label => "Url :" + + = f.submit "Sauvegarder", :class => "btn btn-primary" + \ No newline at end of file diff --git a/app/views/admin/partners/edit.html.haml b/app/views/admin/partners/edit.html.haml new file mode 100644 index 0000000..0af3f3c --- /dev/null +++ b/app/views/admin/partners/edit.html.haml @@ -0,0 +1,14 @@ +.qi_header + %h1 + + Url courtes + %span + modifier une url + + + +.qi_row + .qi_pannel.qi_plain.padding + = render 'form' + + diff --git a/app/views/admin/partners/index.html.haml b/app/views/admin/partners/index.html.haml new file mode 100644 index 0000000..df41b09 --- /dev/null +++ b/app/views/admin/partners/index.html.haml @@ -0,0 +1,28 @@ +.qi_header + .right= link_to ic(:plus)+' Ajouter un partenaire', new_admin_partner_path, :class => "btn btn-primary" + %h1 + + Partenaires + + +.qi_row + .qi_pannel.qi_plain.padding + %h1 Liste des urls courtes + + %table.stat_table.table.table-striped.table-hover + %tr + %th + %th Nom / desc + %th + + + - @partners.each do |partner| + %tr + %td= image_tag partner.image_file.file.large.medium.small + %td + = partner.name + = simple_format partner.description + %td.actions + = link_to i(:"trash-o"), [:admin, partner], method: :delete, data: { confirm: 'Voulez-vous vraiment supprimer ce partenaire ?' } + = link_to i(:pencil), edit_admin_partner_path(partner) + diff --git a/app/views/admin/partners/new.html.haml b/app/views/admin/partners/new.html.haml new file mode 100644 index 0000000..8ed7274 --- /dev/null +++ b/app/views/admin/partners/new.html.haml @@ -0,0 +1,14 @@ +.qi_header + %h1 + + Url courtes + %span + ajouter une url + + + +.qi_row + .qi_pannel.qi_plain.padding + = render 'form' + + diff --git a/app/views/layouts/admin.html.haml b/app/views/layouts/admin.html.haml index 86c6a5c..7ca2a8e 100644 --- a/app/views/layouts/admin.html.haml +++ b/app/views/layouts/admin.html.haml @@ -70,7 +70,11 @@ %li.divider %li= link_to "Sliders", admin_home_slider_path(1) - %li= link_to "Contacts", admin_contacts_path + + %li= link_to "Partenaires", admin_partners_path + %li= link_to "Evénements", admin_events_path + + %li=# link_to "Contacts", admin_contacts_path diff --git a/app/views/layouts/public.html.haml b/app/views/layouts/public.html.haml index 187ae42..96d3516 100644 --- a/app/views/layouts/public.html.haml +++ b/app/views/layouts/public.html.haml @@ -69,8 +69,8 @@ = stylesheet_link_tag 'public', :media => :all - - + + = stylesheet_link_tag '/fonts/caviar_dreams/stylesheet.css' =javascript_include_tag "https://maps.googleapis.com/maps/api/js?libraries=places,geometry&sensor=false" @@ -157,7 +157,7 @@ -else - .slide_home_wrapper.with_ratio{:style => "background-image:url('#{@img_url}');", :data => {:ratio => 0.35}} + #top_band.slide_home_wrapper.with_ratio{:style => "background-image:url('#{@img_url}');", :data => {:ratio => 0.35}} #menu_top @@ -165,8 +165,10 @@ =render :partial => "public/shared/second_menu" .menu =render :partial => "public/shared/first_menu" - - + =link_to image_tag("/logo.png", :id => "logo"), "/" + -if @title and (!@menu_item or @menu_item.id != 1) + .h1_inner + %h1=@title -if @menu_item and @menu_item.id == 1 #main=yield @@ -185,7 +187,10 @@ .contact_form.contact_militer#form =render :partial => "public/contacts/form" #sub_footer - + %h3 Nos partenaires + + =render :partial => "public/partners/partners" + #logos @@ -197,7 +202,8 @@ #contacts %p - + =link_to "Menstions légales", "/fr/mentions-legales.html", :target => "_blank" + =link_to "Contactez-nous", "mailto:fraternelle-rugby-moirans@orange.fr" .clear diff --git a/app/views/portlets/dynamic_contents/_contact.html.haml b/app/views/portlets/dynamic_contents/_contact.html.haml deleted file mode 100644 index 7193574..0000000 --- a/app/views/portlets/dynamic_contents/_contact.html.haml +++ /dev/null @@ -1,4 +0,0 @@ --@contact = @contact || Contact.new(:raison_id => 1, :survey_set_id => params[:id]) - -.contact_form.contact_militer#form - =render :partial => "public/contacts/form" \ No newline at end of file diff --git a/app/views/portlets/dynamic_contents/_contact_leg.html.haml b/app/views/portlets/dynamic_contents/_contact_leg.html.haml deleted file mode 100644 index 9f454fe..0000000 --- a/app/views/portlets/dynamic_contents/_contact_leg.html.haml +++ /dev/null @@ -1,4 +0,0 @@ --@contact = @contact || Contact.new(:raison_id => 2, :survey_set_id => params[:id]) - -.contact_form.contact_militer#form - =render :partial => "public/contacts/form" \ No newline at end of file diff --git a/app/views/portlets/dynamic_contents/_contact_militer.html.haml b/app/views/portlets/dynamic_contents/_contact_militer.html.haml deleted file mode 100644 index cd89bf4..0000000 --- a/app/views/portlets/dynamic_contents/_contact_militer.html.haml +++ /dev/null @@ -1,4 +0,0 @@ --@contact = @contact || Contact.new(:raison_id => 4, :survey_set_id => params[:id]) - -.contact_form.contact_militer#form - =render :partial => "public/contacts/form" \ No newline at end of file diff --git a/app/views/portlets/dynamic_contents/_detenus.html.haml b/app/views/portlets/dynamic_contents/_detenus.html.haml deleted file mode 100644 index 4fe842d..0000000 --- a/app/views/portlets/dynamic_contents/_detenus.html.haml +++ /dev/null @@ -1,39 +0,0 @@ -.detenus_container - .detenus - -DetenuGroup.order("name").each do |detenu_group| - .detenu_group - %h4=detenu_group.name - - -if detenu_group.detenus.count > 0 - -detenu_group.detenus.order("name").each do |detenu| - .detenu - =detenu.name - -if detenu.sexe == 1 - =ic :mars - - -if detenu.sexe == 2 - =ic :venus - - -if detenu.link? - =link_to "(+ d'infos)", detenu.link, :target => "_blank", :style => "font-size:0.85em" - - .desc - -if detenu.age_text? - =detenu.age_text - -if detenu.age_text? and detenu.free_text? - = "-" - -if detenu.free_text? - %span.free_text - =ic :"chain-broken" - =detenu.free_text - - -if detenu.provisoire - %span.ident - - en cours d'identification - - - -else - .none - Enquête en cours - \ No newline at end of file diff --git a/app/views/portlets/dynamic_contents/_historique_monde.html.haml b/app/views/portlets/dynamic_contents/_historique_monde.html.haml deleted file mode 100644 index e69de29..0000000 diff --git a/app/views/portlets/dynamic_contents/_index_label.html.haml b/app/views/portlets/dynamic_contents/_index_label.html.haml deleted file mode 100644 index f050597..0000000 --- a/app/views/portlets/dynamic_contents/_index_label.html.haml +++ /dev/null @@ -1,105 +0,0 @@ --if @admin - .dynamic - Label - - -.index_label - %h3 Découvrez les marques 100% labélisées - - -NewLabelEntreprise.order("name").all.each do |new_label_entreprise| - =link_to new_label_entreprise.website, :target => "_blank" do - .label_marque_img - .inner_logo{:style => "background-image:url('#{new_label_entreprise.image_file.file.large.medium.url if new_label_entreprise.image_file}');"} - -if !new_label_entreprise.image_file - .inner_title - =new_label_entreprise.name - - %h3 Découvrez les produits labellisés des marques suivantes - - -LabelMarque.order("name").all.each do |label_marque| - =link_to "/public/label_produits?search=true&q=&label_marque_id=#{label_marque.id}", :target => "_blank" do - .label_marque_img - .inner_logo{:style => "background-image:url('#{label_marque.image_file.file.large.medium.url if label_marque.image_file}');"} - -if !label_marque.image_file - .inner_title - =label_marque.name - -:scss - .index_label{ - text-align:center; - h3{ - text-align:center; - margin-top:30px; - margin-bottom:20px; - } - .label_marque_img{ - - height:140px; - width:140px; - margin:2px; - padding:5px; - - display:inline-block; - - position:relative; - border:1px solid rgba(0,0,0,0.1); - .inner_logo{ - position:absolute; - left:12px; - right:12px; - top:12px; - bottom:12px; - background:center center no-repeat; - background-size:100%; - background-size:contain; - - - - } - .inner_title{ - position:absolute; - left:0; - right:0; - top:60px; - text-align:center; - color:black; - - } - } - - } - - -.bottom_subpages - -@menu_item.children.order(:position).each do |menu_item| - - -menu_item_lang = menu_item.menu_item_langs.find_by_lang_site_id(@lang.id) - - - -name = menu_item_lang.name - -if menu_item_lang.enabled == true and menu_item_lang.visible == true - -if menu_item.image_file - - - - -img_url = menu_item.image_file.file.large.medium.url - - -if menu_item.image_file and menu_item.image_file.photograph - -@page_images_credits << menu_item.image_file.photograph - - - - - -css_style = "background-image:url('#{img_url}');background-size:100%;background-size:cover;background-position:center center;display:block;min-height:50px;" - - - .subpage_link - =link_to @one_voice_host.to_s+menu_item_path(:url => menu_item_lang.url, :lang => @lang.slug) , :class => "with_ratio" do - .with_ratio{:style => css_style, :data => {:ratio => 0.62}} - - - .overlay - - - %h4.title - =menu_item.menu_item_langs.find_by_lang_site_id(@lang.id).name \ No newline at end of file diff --git a/app/views/portlets/dynamic_contents/_index_petitions.html.haml b/app/views/portlets/dynamic_contents/_index_petitions.html.haml deleted file mode 100644 index e7045ab..0000000 --- a/app/views/portlets/dynamic_contents/_index_petitions.html.haml +++ /dev/null @@ -1,10 +0,0 @@ - --@petitions = Petition.joins(:petition_langs).where(:petition_langs => {:lang_site_id => @lang.id, :enabled => true}).order("position ASC") - -.petitions_index - .petition_first_page - =render :collection => @petitions[0..8], :partial => "public/petitions/petition" - .cta{:style => "text-align:center;margin:20px 0;"} - =link_to qit("Voir plus de pétitions >"), "#", :onclick => "$(this).closest('.petitions_index').find('.petition_more').show();$(this).closest('.cta').hide();return false;", :class => "btn" - .petition_more{:style => "display:none;"} - =render :collection => @petitions[9..@petitions.size], :partial => "public/petitions/petition" \ No newline at end of file diff --git a/app/views/portlets/dynamic_contents/_index_sponsorship.html.haml b/app/views/portlets/dynamic_contents/_index_sponsorship.html.haml deleted file mode 100644 index 81576c4..0000000 --- a/app/views/portlets/dynamic_contents/_index_sponsorship.html.haml +++ /dev/null @@ -1,6 +0,0 @@ - --@sponsorship_animals = SponsorshipAnimal.where(:enabled => true).order(:position).all - - -.sponsorship_index - =render :collection => @sponsorship_animals, :partial => "public/sponsorship_animals/sponsorship_animal" \ No newline at end of file diff --git a/app/views/portlets/dynamic_contents/_militer.html.haml b/app/views/portlets/dynamic_contents/_militer.html.haml deleted file mode 100644 index e4c2821..0000000 --- a/app/views/portlets/dynamic_contents/_militer.html.haml +++ /dev/null @@ -1,71 +0,0 @@ - --begin - -params[:cat] = params[:cat] || 3 - -@militer_cat = MiliterCat.find(params[:cat]) - - %a{:id => "documents"} - .militer_index - .main_container - %h3 Documents - - -MiliterCat.where(:parent_id => nil).order("position").all.each do |militer_cat| - -if I18n.locale == :fr - -name =militer_cat.name - -else - -name = militer_cat.english_name - - =link_to raw(name), "?cat=#{militer_cat.id}#documents", :class => ("active" if @militer_cat and militer_cat.id == @militer_cat.id), :data => {:id => militer_cat.id} - - .militer - - - -ig = 0 - -@militer_cat.children.order("position").each do |militer_cat| - -ig += 1 - - %h3 - .right - %span.plus{:style => ("display:none;" if ig == 1)} + - %span.moins{:style => ("display:block;" if ig == 1)}= "-" - =militer_cat.name - .militer_content{:style => ("display:block;" if ig == 1)} - -i = 0 - .row - -militer_cat.data_files.where(:lang_site_id => @lang.id).order("militer_position DESC, created_at DESC").each do |data_file| - -i += 1 - - =render data_file - - -if i== 2 - -i = 0 - =raw "