Added flag and slightly reorganised the moderation page

This commit is contained in:
echarp 2019-12-25 16:46:50 +01:00
parent 2f07502d6f
commit ec4e96d9bb
11 changed files with 44 additions and 24 deletions

View File

@ -1,10 +1,13 @@
h2.warning h2.warning
color: red color: red
body.moderations h3
text-align: center
.moderations, .notes .moderations, .notes
table.list table.list
min-width: 90% margin-top: 25px
margin-top: 15px margin-bottom: 25px
td td
padding-top: 0.5em padding-top: 0.5em
padding-bottom: 0.5em padding-bottom: 0.5em

View File

@ -69,9 +69,6 @@ html.iframe main > ul.regions
.flag-icon-ca-qc .flag-icon-ca-qc
background-image: image-url(regions/CA-QC) background-image: image-url(regions/CA-QC)
body.stats h3
text-align: center
table.list.dates table.list.dates
th, td th, td
padding: 0 0.6em padding: 0 0.6em

View File

@ -1,3 +1,6 @@
body.stats h3
text-align: center
table.list.dates table.list.dates
width: 100% width: 100%
thead th thead th

View File

@ -19,6 +19,10 @@ class Region < ApplicationRecord
name name
end end
def flag
region.try(:flag) || code.try(:downcase)
end
# Attempt to get a corresponding timezone, used for ical # Attempt to get a corresponding timezone, used for ical
def tzid def tzid
country = TZInfo::Country.get region.try(:code) || code country = TZInfo::Country.get region.try(:code) || code

View File

@ -3,24 +3,33 @@
= title t '.title' = title t '.title'
:markdown :markdown
#### #{t '.rules'} ### #{t '.rules'}
- if @orgas.present? - if @orgas.present?
%table.list %table.list
%thead %thead
%tr %tr
%th= Orga.human_attribute_name :name %th(colspan='5')
%h3
%em.fa.fa-users
= Orga.model_name.human.pluralize @orgas.count
%tr
%th= Orga.human_attribute_name :city %th= Orga.human_attribute_name :city
%th= Orga.human_attribute_name :region %th(colspan='2')= Orga.human_attribute_name :name
%th= Orga.human_attribute_name :submission_time %th= Orga.human_attribute_name :submission_time
%th= t '.actions' %th= t '.actions'
%tbody %tbody
- @orgas.each do |orga| - @orgas.each do |orga|
%tr %tr
%td{ title: orga.region }
= flag_icon orga.region.flag
= orga.city || orga.region
%td.kind
- if orga.kind
%em.fa{ class: "fa-#{orga.kind.icon}",
title: Kind.human_attribute_name("name_#{orga.kind.name}") }
%td= orga.name %td= orga.name
%td= orga.city
%td= orga.region
%td= time_ago_in_words orga.submission_time %td= time_ago_in_words orga.submission_time
%th.actions %th.actions
= link_to edit_orga_path orga do = link_to edit_orga_path orga do
@ -39,23 +48,28 @@
%table.list %table.list
%thead %thead
%tr %tr
%th(colspan='5')
%h3
%em.fa.fa-calendar
= Event.model_name.human.pluralize @events.count
%tr
%th= Event.human_attribute_name :city
%th= Event.human_attribute_name :title %th= Event.human_attribute_name :title
%th %th
= Event.human_attribute_name :start_time = Event.human_attribute_name :start_time
\- \-
= Event.human_attribute_name :end_time = Event.human_attribute_name :end_time
%th= Event.human_attribute_name :city
%th= Event.human_attribute_name :region
%th= Event.human_attribute_name :submission_time %th= Event.human_attribute_name :submission_time
%th= t '.actions' %th= t '.actions'
%tbody %tbody
- @events.each do |event| - @events.each do |event|
%tr %tr
%td{ title: event.region }
= flag_icon event.region.flag
= event.city
%td= event.title %td= event.title
%td= display_date event %td= display_date event
%td= event.city
%td= event.region.name
%td= time_ago_in_words event.submission_time %td= time_ago_in_words event.submission_time
%th.actions %th.actions
= link_to edit_moderation_path event do = link_to edit_moderation_path event do
@ -80,8 +94,7 @@
- event.notes.each do |note| - event.notes.each do |note|
%tr %tr
%td.empty/ %td.note(colspan='6')
%td.note(colspan="5")
= note.contents = note.contents
%em.author %em.author
= t '.posted_by', = t '.posted_by',
@ -92,7 +105,7 @@
= link_to edit_user_registration_path do = link_to edit_user_registration_path do
%em.fa.fa-lock %em.fa.fa-lock
= t('change_my_password', scope: 'devise.passwords.edit') = t('change_my_password', scope: 'devise.passwords.edit')
\| \-
= link_to destroy_user_session_path, method: :delete do = link_to destroy_user_session_path, method: :delete do
%em.fa.fa-sign-out-alt %em.fa.fa-sign-out-alt
= t 'logout' = t 'logout'

View File

@ -2,7 +2,7 @@
- if filter_region.url.present? - if filter_region.url.present?
= link_to filter_region.url do = link_to filter_region.url do
- if filter_region.code.present? - if filter_region.code.present?
= flag_icon filter_region.code.downcase = flag_icon filter_region.flag
= t filter_region.code, scope: :countries, default: filter_region.name = t filter_region.code, scope: :countries, default: filter_region.name
%small %small
%em.fa.fa-external-link-alt %em.fa.fa-external-link-alt
@ -10,7 +10,7 @@
- else - else
= link_to region: params[:region] == filter_region.id.to_s ? '' : filter_region do = link_to region: params[:region] == filter_region.id.to_s ? '' : filter_region do
- if filter_region.code.present? - if filter_region.code.present?
= flag_icon filter_region.code.downcase = flag_icon filter_region.flag
= t filter_region.code, scope: :countries, default: filter_region.name = t filter_region.code, scope: :countries, default: filter_region.name
- else - else

View File

@ -182,7 +182,7 @@ Veranstaltung zu ändern, um sie vollständiger, lesbarer oder attraktiver zu ge
link: Diese Veranstaltung findet statt im Rahmen des link: Diese Veranstaltung findet statt im Rahmen des
moderations: moderations:
index: index:
title: Veranstaltungen zu bestätigen title: Zu bestätigen
rules: Moderatoren, bitte [Moderation Empfehlungen](/pages/rules) rules: Moderatoren, bitte [Moderation Empfehlungen](/pages/rules)
Lesen und Berücksichtigen. Lesen und Berücksichtigen.
actions: Aktionen actions: Aktionen

View File

@ -174,7 +174,7 @@ it more readable or agreable."
link: This event is part of link: This event is part of
moderations: moderations:
index: index:
title: Events to moderate title: To moderate
rules: Moderators, thanks for reading and taking notice of [moderation rules: Moderators, thanks for reading and taking notice of [moderation
recommandations](/pages/rules). recommandations](/pages/rules).
actions: Actions actions: Actions

View File

@ -190,7 +190,7 @@ procédure à l'aide d'un [script](/adl-submit.py)"
link: Cet événement s'inscrit dans le cadre de link: Cet événement s'inscrit dans le cadre de
moderations: moderations:
index: index:
title: Événements à modérer title: À modérer
rules: Modérateurs, merci de lire et de tenir compte des [recommandations rules: Modérateurs, merci de lire et de tenir compte des [recommandations
de modération](/pages/rules). de modération](/pages/rules).
actions: Actions actions: Actions

View File

@ -185,7 +185,7 @@ te maken."
link: Dit evenement past in het kader van link: Dit evenement past in het kader van
moderations: moderations:
index: index:
title: Evaluatie van de evenementen title: Evaluatie
rules: Moderators opgelet, aub. na het lezen rekening houden met rules: Moderators opgelet, aub. na het lezen rekening houden met
[aanbevelingen van moderatie](/pages/rules) [aanbevelingen van moderatie](/pages/rules)
actions: Acties actions: Acties

View File

@ -167,7 +167,7 @@ completa, deixando o texto mais legível e agradável.
other: "%{count} eventos" other: "%{count} eventos"
moderations: moderations:
index: index:
title: Eventos para moderar title: Para moderar
rules: Moderadores, obrigado por ler e tomar conhecimento das [recomendações rules: Moderadores, obrigado por ler e tomar conhecimento das [recomendações
de moderação](/pages/rules). de moderação](/pages/rules).
actions: Ações actions: Ações