Skip to content
Extraits de code Groupes Projets
Valider 34f9e33f rédigé par echarp's avatar echarp
Parcourir les fichiers

Consultation d'événement en place

parent a76e23c1
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -61,8 +61,26 @@ header.top ...@@ -61,8 +61,26 @@ header.top
margin-right: 0.6em margin-right: 0.6em
vertical-align: middle vertical-align: middle
main h1 main
margin-top: 1em h1
margin: 10px 5px 5px 5px
letter-spacing: 2px
h2
margin: 52px 0px 18px
h3
margin: 1.1em 0 1em
font-size: 1.2em
text-align: left
ul, ol
margin: 10px 0px 10px 35px
text-align: left
li
margin-left: 2em
line-height: 1.3em
p
margin: 0.9em 0
line-height: 1.3em
text-align: justify
footer.bottom nav footer.bottom nav
margin: 29px auto -3px margin: 29px auto -3px
......
@import "compass"
form.region_selector form.region_selector
width: 98.4% width: 98.4%
position: absolute position: absolute
...@@ -11,9 +13,9 @@ main form.region_selector + h2 ...@@ -11,9 +13,9 @@ main form.region_selector + h2
a a
font-weight: normal font-weight: normal
&.previous-month &.previous-month
margin-right: 0.35em margin-right: 0.33em
&.next-month &.next-month
margin-left: 0.35em margin-left: 0.33em
// For whole year calendar // For whole year calendar
main form.region_selector + h2 + h2 main form.region_selector + h2 + h2
...@@ -89,3 +91,26 @@ table.calendar ...@@ -89,3 +91,26 @@ table.calendar
margin: 10px auto margin: 10px auto
font-size: smaller font-size: smaller
text-align: right text-align: right
#lug-list
float: right
width: 15em
border: 1px solid #96CFFF
margin: 5em 1.2em 0px
padding: 5px
font-size: 0.7em
background-color: #D6ECFF
@include border-radius(10px)
h1
font-size: 1.22em
line-height: 1.1em
font-weight: normal
border-bottom: 1px black solid
padding-bottom: 4px
ul
text-align: left
line-height: 1.2em
margin-left: 1em
li
margin-left: 2em
line-height: 1.3em
...@@ -11,4 +11,8 @@ class Event < ActiveRecord::Base ...@@ -11,4 +11,8 @@ class Event < ActiveRecord::Base
} }
scope :region, -> region { where region: region } scope :region, -> region { where region: region }
scope :tag, -> tag { where "tags like ?", "%#{tag}%" } scope :tag, -> tag { where "tags like ?", "%#{tag}%" }
def same_day?
start_time.to_date == end_time.to_date
end
end end
class Region < ActiveRecord::Base class Region < ActiveRecord::Base
has_many :lugs, foreign_key: :region
end end
...@@ -31,16 +31,23 @@ xml.tag! 'rdf:RDF', 'xmlns:rdf' => "http://www.w3.org/1999/02/22-rdf-syntax-ns#" ...@@ -31,16 +31,23 @@ xml.tag! 'rdf:RDF', 'xmlns:rdf' => "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xml.tag! 'georss:point', City.find_all_by_majname(event.city.upcase).collect { |c| "#{c.latitude} #{c.longitude}" }.first xml.tag! 'georss:point', City.find_all_by_majname(event.city.upcase).collect { |c| "#{c.latitude} #{c.longitude}" }.first
content = "<h2><em>#{event.city}</em>: #{event.title}</h2> content = "<h2><em>#{event.city}</em>: #{event.title}</h2>
<h3>Date et lieu</h3> <h3>Date et lieu</h3>"
<p>#{l event.start_time.to_date, format: :long}, if event.same_day?
de #{event.start_time.hour}h#{event.start_time.min} à #{event.end_time.hour}h#{event.end_time.min}.</p> content += "
<p>À <em><a href=\"http://fr.wikipedia.org/wiki/#{event.city}\">#{event.city}</a></em>, <p>Le #{l event.start_time.to_date, format: :long},
<a href=\"http://fr.wikipedia.org/wiki/#{event.region.name}\">#{event.region.name}</a></p> de #{l event.start_time, format: :hours} à #{l event.end_time, format: :hours}.</p>
<p>À <em>#{link_to event.city, 'http://fr.wikipedia.org/wiki/'+event.city}</em>,
#{link_to event.region.name, 'http://fr.wikipedia.org/wiki/'+event.region.name}</p>"
else
content += "
<p>Du #{l event.start_time, format: :at} au #{l event.end_time, format: :at}.</p>"
end
content += "
<h3>Description</h3> <h3>Description</h3>
#{event.description} #{event.description}
<h3>Informations</h3> <h3>Informations</h3>
<p>Site Web: <a href=\"#{event.url}\">#{event.url}</a></p> <p>Site Web: <a href=\"#{event.url}\">#{event.url}</a></p>
<p>Contact: #{mail_to event.contact.sub('@', ' CHEZ ').sub('.', ' POINT '), event.contact.sub('@', ' CHEZ ').sub('.', ' POINT ')}</p> <p>Contact: #{mail_to event.contact.gsub('@', ' CHEZ ').gsub('.', ' POINT '), event.contact.gsub('@', ' CHEZ ').gsub('.', ' POINT ')}</p>
" "
if (event.tags && event.tags.present?) if (event.tags && event.tags.present?)
......
%p#notice= notice %p#notice= notice
%p #lug-list
%b Title: %h1=t '.lug-list'
%ul
- @event.region.lugs.order(department: :asc).each do |lug|
%li
= link_to lug.name, lug.url
(#{lug.department})
%h1 Actions
= link_to t('.add_to_calendar'), root_url
%h2
%em
= @event.city
\:
= @event.title = @event.title
%h3
Date et lieu
%p %p
%b Description: - if @event.same_day?
= @event.description Le #{l @event.start_time.to_date, format: :long},
%p de #{l @event.start_time, format: :hours} à #{l @event.end_time, format: :hours}.</p>
%b Start time: - else
= @event.start_time Du
%p =l @event.start_time, format: :at
%b End time: au
= @event.end_time #{l @event.end_time, format: :at}.
%p
%b City:
= @event.city
%p
%b Region:
= @event.region.name
%p
%b Locality:
= @event.locality
%p
%b Url:
= @event.url
%p
%b Contact:
= @event.contact
%p
%b Submitter:
= @event.submitter
%p
%b Moderated:
= @event.moderated
%p
%b Tags:
= @event.tags
%p
%b Secret:
= @event.secret
%p
%b Decision time:
= @event.decision_time
%p %p
%b Submission time: À
= @event.submission_time %em
= link_to(@event.city, "http://fr.wikipedia.org/wiki/#{@event.city}") + ','
= link_to @event.region.name, "http://fr.wikipedia.org/wiki/#{@event.region.name}"
%h3 Description
=raw @event.description
%h3 Informations
%p %p
%b Moderator mail: Site Web:
= @event.moderator_mail_id = link_to @event.url, @event.url
%p %p
%b Submitter mail: Contact:
= @event.submitter_mail_id = mail_to @event.contact.gsub('@', ' CHEZ ').gsub('.', ' POINT '), @event.contact.gsub('@', ' CHEZ ').gsub('.', ' POINT ')
= link_to 'Edit', edit_event_path(@event) - if (@event.tags && @event.tags.present?)
\| %p
= link_to 'Back', events_path Tags:
- @event.tags.split.each do |tag|
= link_to tag, events_url(tag: tag)
...@@ -53,7 +53,11 @@ fr: ...@@ -53,7 +53,11 @@ fr:
- Vendredi - Vendredi
- Samedi - Samedi
formats: formats:
long: "le %A %d %B %Y" long: "%A %d %B %Y"
time:
formats:
at: "%A %d %B %Y à %Hh%M"
hours: "%Hh%M"
layouts: layouts:
application: application:
...@@ -73,3 +77,6 @@ fr: ...@@ -73,3 +77,6 @@ fr:
index: index:
calendar_in: Ce calendrier en calendar_in: Ce calendrier en
all_regions: Toutes les régions all_regions: Toutes les régions
show:
lug-list: Groupes d'utilisateurs de la région
add_to_calendar: Ajouter à mon calendrier
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter