Moderation elements are now organised per country
This commit is contained in:
parent
9f27812d70
commit
baa08dc85c
12
Gemfile.lock
12
Gemfile.lock
@ -138,7 +138,7 @@ GEM
|
||||
pry (>= 0.9.12)
|
||||
shellany (~> 0.0)
|
||||
thor (>= 0.18.1)
|
||||
guard-brakeman (0.8.5)
|
||||
guard-brakeman (0.8.6)
|
||||
brakeman (>= 2.1.1)
|
||||
guard (>= 2.0.0)
|
||||
guard-compat (~> 1.0)
|
||||
@ -196,10 +196,10 @@ GEM
|
||||
http_parser.rb (~> 0.6.0)
|
||||
http-cookie (1.0.3)
|
||||
domain_name (~> 0.5)
|
||||
http-form_data (2.1.1)
|
||||
http-form_data (2.2.0)
|
||||
http_accept_language (2.1.1)
|
||||
http_parser.rb (0.6.0)
|
||||
i18n (1.7.0)
|
||||
i18n (1.8.1)
|
||||
concurrent-ruby (~> 1.0)
|
||||
i18n-active_record (0.3.0)
|
||||
i18n (>= 0.5.0)
|
||||
@ -253,7 +253,7 @@ GEM
|
||||
loofah (2.4.0)
|
||||
crass (~> 1.0.2)
|
||||
nokogiri (>= 1.5.9)
|
||||
lumberjack (1.1.0)
|
||||
lumberjack (1.1.1)
|
||||
mail (2.7.1)
|
||||
mini_mime (>= 0.1.1)
|
||||
marcel (0.3.3)
|
||||
@ -284,7 +284,7 @@ GEM
|
||||
activerecord (>= 4.2)
|
||||
request_store (~> 1.1)
|
||||
parallel (1.19.1)
|
||||
parser (2.7.0.1)
|
||||
parser (2.7.0.2)
|
||||
ast (~> 2.4.0)
|
||||
piwik_analytics (1.0.2)
|
||||
actionpack
|
||||
@ -300,7 +300,7 @@ GEM
|
||||
public_suffix (4.0.3)
|
||||
puma (4.3.1)
|
||||
nio4r (~> 2.0)
|
||||
rack (2.0.8)
|
||||
rack (2.1.0)
|
||||
rack-livereload (0.3.17)
|
||||
rack
|
||||
rack-test (1.1.0)
|
||||
|
@ -105,7 +105,7 @@ class Event < ApplicationRecord
|
||||
end
|
||||
|
||||
def to_s
|
||||
"#{start_time.to_date} #{city}: #{title} #{hashtags.join(' ')}"
|
||||
[start_time.to_date, city + ':', title, hashtags.join(' ')].join ' '
|
||||
end
|
||||
|
||||
def to_tweet
|
||||
|
@ -20,7 +20,7 @@ class Region < ApplicationRecord
|
||||
end
|
||||
|
||||
def flag
|
||||
region.try(:flag) || code.try(:downcase)
|
||||
region&.flag || code&.downcase
|
||||
end
|
||||
|
||||
# Attempt to get a corresponding timezone, used for ical
|
||||
|
@ -34,7 +34,11 @@ class User < ApplicationRecord
|
||||
end
|
||||
|
||||
def to_s
|
||||
"#{firstname} #{lastname}"
|
||||
if firstname.present? || lastname.present?
|
||||
[firstname, lastname].join ' '
|
||||
else
|
||||
login
|
||||
end
|
||||
end
|
||||
|
||||
protected
|
||||
|
34
app/views/moderations/_event.html.haml
Normal file
34
app/views/moderations/_event.html.haml
Normal file
@ -0,0 +1,34 @@
|
||||
%tr
|
||||
%td.title= event.title
|
||||
%td= display_date event
|
||||
%td.city= event.city
|
||||
%td.region= event.region
|
||||
%td= time_ago_in_words event.submission_time
|
||||
%th.actions{ rowspan: 1 + event.notes.size }
|
||||
= link_to edit_moderation_path event do
|
||||
%em.fa.fa-edit
|
||||
= t 'edit'
|
||||
\-
|
||||
= link_to validate_moderation_path event do
|
||||
%em.fa.fa-thumbs-up
|
||||
= t 'validate'
|
||||
\-
|
||||
= link_to refuse_moderation_path event do
|
||||
%em.fa.fa-thumbs-down
|
||||
= t 'refuse'
|
||||
%br
|
||||
= link_to new_moderation_note_path event, envoiParMail: :oui do
|
||||
%em.fa.fa-bullhorn
|
||||
= t '.askInfos'
|
||||
\-
|
||||
= link_to new_moderation_note_path event do
|
||||
%em.fa.fa-paperclip
|
||||
= t '.createNote'
|
||||
|
||||
- event.notes.each do |note|
|
||||
%tr
|
||||
%td.note(colspan='5')
|
||||
= note.contents
|
||||
%em.author
|
||||
= t '.posted_by', author: note.author, date: l(note.date, format: :at)
|
||||
|
21
app/views/moderations/_orga.html.haml
Normal file
21
app/views/moderations/_orga.html.haml
Normal file
@ -0,0 +1,21 @@
|
||||
%tr
|
||||
%td.kind
|
||||
- if orga.kind
|
||||
%em.fa{ class: "fa-#{orga.kind.icon}",
|
||||
title: Kind.human_attribute_name("name_#{orga.kind.name}") }
|
||||
%td.name= orga.name
|
||||
%td.city= orga.city
|
||||
%td.region= orga.region
|
||||
%td= time_ago_in_words orga.submission_time
|
||||
%th.actions
|
||||
= link_to edit_orga_path orga do
|
||||
%em.fa.fa-edit
|
||||
= t 'edit'
|
||||
\-
|
||||
= link_to validate_orga_path orga do
|
||||
%em.fa.fa-thumbs-up
|
||||
= t 'validate'
|
||||
\-
|
||||
= link_to cancel_orga_path orga do
|
||||
%em.fa.fa-thumbs-down
|
||||
= t 'refuse'
|
@ -2,61 +2,63 @@
|
||||
%em.fa.fa-gavel
|
||||
= title t '.title'
|
||||
|
||||
:markdown
|
||||
### #{t '.rules'}
|
||||
|
||||
- if @orgas.present?
|
||||
%table.list
|
||||
%thead
|
||||
%tr
|
||||
%th(colspan='7')
|
||||
%th(colspan='6')
|
||||
%h3
|
||||
%em.fa.fa-users
|
||||
= Orga.model_name.human.pluralize @orgas.count
|
||||
|
||||
- @orgas.group_by { |orga| orga.region.flag }.each do |code, orgas|
|
||||
%thead
|
||||
%tr
|
||||
%td(colspan='6')
|
||||
%h4
|
||||
- if code.present?
|
||||
= flag_icon code
|
||||
= t code.upcase, scope: :countries
|
||||
- else
|
||||
= orgas[0].region
|
||||
%tr
|
||||
%th.flag
|
||||
%th.name(colspan='2')= Orga.human_attribute_name :name
|
||||
%th.city= Orga.human_attribute_name :city
|
||||
%th.region= Orga.human_attribute_name :region
|
||||
%th= Orga.human_attribute_name :submission_time
|
||||
%th= t '.actions'
|
||||
|
||||
%tbody
|
||||
- @orgas.each do |orga|
|
||||
%tbody= render partial: 'orga', collection: orgas
|
||||
|
||||
%tfoot
|
||||
%tr
|
||||
%td.flag{ title: orga.region }
|
||||
= flag_icon orga.region.flag
|
||||
%td.kind
|
||||
- if orga.kind
|
||||
%em.fa{ class: "fa-#{orga.kind.icon}",
|
||||
title: Kind.human_attribute_name("name_#{orga.kind.name}") }
|
||||
%td.name= orga.name
|
||||
%td.city= orga.city
|
||||
%td.region= orga.region
|
||||
%td= time_ago_in_words orga.submission_time
|
||||
%th.actions
|
||||
= link_to edit_orga_path orga do
|
||||
%em.fa.fa-edit
|
||||
= t 'edit'
|
||||
\-
|
||||
= link_to validate_orga_path orga do
|
||||
%em.fa.fa-thumbs-up
|
||||
= t 'validate'
|
||||
\-
|
||||
= link_to cancel_orga_path orga do
|
||||
%em.fa.fa-thumbs-down
|
||||
= t 'refuse'
|
||||
%td(colspan='6')
|
||||
:markdown
|
||||
#{t '.rules'}
|
||||
|
||||
- if @orgas.present? && @events.present?
|
||||
%hr
|
||||
|
||||
- if @events.present?
|
||||
%table.list
|
||||
%thead
|
||||
%tr
|
||||
%th(colspan='7')
|
||||
%th(colspan='6')
|
||||
%h3
|
||||
%em.fa.fa-calendar
|
||||
= Event.model_name.human.pluralize @events.count
|
||||
|
||||
- @events.group_by { |event| event.region.flag }.each do |code, events|
|
||||
%thead
|
||||
%tr
|
||||
%td(colspan='6')
|
||||
%h4
|
||||
- if code.present?
|
||||
= flag_icon code
|
||||
= t code.upcase, scope: :countries
|
||||
- else
|
||||
= events[0].region
|
||||
%tr
|
||||
%th.flag
|
||||
%th.title= Event.human_attribute_name :title
|
||||
%th
|
||||
= Event.human_attribute_name :start_time
|
||||
@ -67,46 +69,15 @@
|
||||
%th= Event.human_attribute_name :submission_time
|
||||
%th.actions= t '.actions'
|
||||
|
||||
%tbody
|
||||
- @events.each do |event|
|
||||
%tr
|
||||
%td.flag= flag_icon event.region.flag
|
||||
%td.title= event.title
|
||||
%td= display_date event
|
||||
%td.city= event.city
|
||||
%td.region= event.region
|
||||
%td= time_ago_in_words event.submission_time
|
||||
%th.actions
|
||||
= link_to edit_moderation_path event do
|
||||
%em.fa.fa-edit
|
||||
= t 'edit'
|
||||
\-
|
||||
= link_to validate_moderation_path event do
|
||||
%em.fa.fa-thumbs-up
|
||||
= t 'validate'
|
||||
\-
|
||||
= link_to refuse_moderation_path event do
|
||||
%em.fa.fa-thumbs-down
|
||||
= t 'refuse'
|
||||
\-
|
||||
= link_to new_moderation_note_path event, envoiParMail: :oui do
|
||||
%em.fa.fa-bullhorn
|
||||
= t '.askInfos'
|
||||
\-
|
||||
= link_to new_moderation_note_path event do
|
||||
%em.fa.fa-paperclip
|
||||
= t '.createNote'
|
||||
%tbody= render partial: 'event', collection: events
|
||||
|
||||
- event.notes.each do |note|
|
||||
%tfoot
|
||||
%tr
|
||||
%td.note(colspan='6')
|
||||
= note.contents
|
||||
%em.author
|
||||
= t '.posted_by',
|
||||
author: "#{note.author.firstname} #{note.author.lastname}",
|
||||
date: l(note.date, format: :at) rescue nil
|
||||
%td(colspan='6')
|
||||
:markdown
|
||||
#{t '.rules'}
|
||||
|
||||
.actions
|
||||
%fieldset.actions
|
||||
= link_to edit_user_registration_path do
|
||||
%em.fa.fa-lock
|
||||
= t('change_my_password', scope: 'devise.passwords.edit')
|
||||
|
@ -184,6 +184,7 @@ Veranstaltung zu ändern, um sie vollständiger, lesbarer oder attraktiver zu ge
|
||||
rules: Moderatoren, bitte [Moderation Empfehlungen](/pages/rules)
|
||||
Lesen und Berücksichtigen.
|
||||
actions: Aktionen
|
||||
event:
|
||||
posted_by: Gepostet von %{author} am %{date}
|
||||
date: Datum
|
||||
askInfos: Informationen anfordern
|
||||
|
@ -176,6 +176,7 @@ it more readable or agreable."
|
||||
rules: Moderators, thanks for reading and taking notice of [moderation
|
||||
recommandations](/pages/rules).
|
||||
actions: Actions
|
||||
event:
|
||||
posted_by: Created by %{author} on %{date}
|
||||
date: Date
|
||||
askInfos: Ask informations
|
||||
|
@ -192,6 +192,7 @@ procédure à l'aide d'un [script](/adl-submit.py)"
|
||||
rules: Modérateurs, merci de lire et de tenir compte des [recommandations
|
||||
de modération](/pages/rules).
|
||||
actions: Actions
|
||||
event:
|
||||
posted_by: Posté par %{author} le %{date}
|
||||
date: Date
|
||||
askInfos: Demander des infos
|
||||
|
@ -187,6 +187,7 @@ te maken."
|
||||
rules: Moderators opgelet, aub. na het lezen rekening houden met
|
||||
[aanbevelingen van moderatie](/pages/rules)
|
||||
actions: Acties
|
||||
event:
|
||||
posted_by: Gepost door %{author} op %{date}
|
||||
date: Datum
|
||||
askInfos: Informatie aanvragen
|
||||
|
@ -169,6 +169,7 @@ completa, deixando o texto mais legível e agradável.
|
||||
rules: Moderadores, obrigado por ler e tomar conhecimento das [recomendações
|
||||
de moderação](/pages/rules).
|
||||
actions: Ações
|
||||
event:
|
||||
posted_by: Criado por %{author} em %{date}
|
||||
date: Data
|
||||
askInfos: Peça informações
|
||||
|
Loading…
Reference in New Issue
Block a user