parent
cac94c2379
commit
e474a9a8ea
14 changed files with 283 additions and 97 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -4,3 +4,4 @@ locale
|
||||||
db/*.sqlite3
|
db/*.sqlite3
|
||||||
db/*.sqlite3-*
|
db/*.sqlite3-*
|
||||||
config/environments/development.rb
|
config/environments/development.rb
|
||||||
|
vedia.log
|
||||||
|
|
|
||||||
11
Rakefile
11
Rakefile
|
|
@ -2,9 +2,9 @@ require_relative 'vedia'
|
||||||
require 'sinatra/activerecord/rake'
|
require 'sinatra/activerecord/rake'
|
||||||
|
|
||||||
desc "Update PO files"
|
desc "Update PO files"
|
||||||
task :updatepo do
|
task :update_po do
|
||||||
require 'gettext/tools/xgettext'
|
require 'gettext/tools/xgettext'
|
||||||
GetText::Tools::XGetText.run(*["vedia.rb"] + Dir.glob("views/*.{rb,erb}") + ["-o", "po/vedia.pot"])
|
GetText::Tools::XGetText.run(*["vedia.rb"] + Dir.glob("views/*.{rb,erb}") + ["config/environments/defaults.rb"] + ["-o", "po/vedia.pot"])
|
||||||
require 'gettext/tools/msgmerge'
|
require 'gettext/tools/msgmerge'
|
||||||
Dir.glob("po/**/vedia.po").collect { |po| /po\/(.+)\/vedia\.po/.match(po)[1] }.each do |locale|
|
Dir.glob("po/**/vedia.po").collect { |po| /po\/(.+)\/vedia\.po/.match(po)[1] }.each do |locale|
|
||||||
GetText::Tools::MsgMerge.run("po/#{locale}/vedia.po", "po/vedia.pot", "-o", "po/#{locale}/vedia.po")
|
GetText::Tools::MsgMerge.run("po/#{locale}/vedia.po", "po/vedia.pot", "-o", "po/#{locale}/vedia.po")
|
||||||
|
|
@ -12,7 +12,7 @@ task :updatepo do
|
||||||
end
|
end
|
||||||
|
|
||||||
desc "Build MO files"
|
desc "Build MO files"
|
||||||
task :buildmo do
|
task :build_mo do
|
||||||
require 'gettext/tools/msgfmt'
|
require 'gettext/tools/msgfmt'
|
||||||
Dir.mkdir("locale") unless Dir.exist?("locale")
|
Dir.mkdir("locale") unless Dir.exist?("locale")
|
||||||
Dir.glob("po/**/vedia.po").collect { |po| /po\/(.+)\/vedia\.po/.match(po)[1] }.each do |locale|
|
Dir.glob("po/**/vedia.po").collect { |po| /po\/(.+)\/vedia\.po/.match(po)[1] }.each do |locale|
|
||||||
|
|
@ -20,3 +20,8 @@ task :buildmo do
|
||||||
GetText::Tools::MsgFmt.run("po/#{locale}/vedia.po", "-o", "locale/#{locale}/vedia.mo")
|
GetText::Tools::MsgFmt.run("po/#{locale}/vedia.po", "-o", "locale/#{locale}/vedia.mo")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
desc "Close votes that have expired"
|
||||||
|
task :close_expired_votes do
|
||||||
|
close_expired_votes
|
||||||
|
end
|
||||||
|
|
|
||||||
8
config/environments/defaults.rb
Normal file
8
config/environments/defaults.rb
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
set :admin_email, 'vedia@potager.org'
|
||||||
|
set :values, [ { :id => 1, :label => _("Awful"), :color => '#ff4500' },
|
||||||
|
{ :id => 2, :label => _("Very bad"), :color => '#ffa500' },
|
||||||
|
{ :id => 3, :label => _("Bad"), :color => '#ffff00' },
|
||||||
|
{ :id => 4, :label => _("Mediocre"), :color => '#9acd32' },
|
||||||
|
{ :id => 5, :label => _("Good"), :color => '#228b22' },
|
||||||
|
{ :id => 6, :label => _("Very good"), :color => '#006400' } ]
|
||||||
|
set :expire_after, 7 * 24 * 60 * 60 # 7 days
|
||||||
9
config/schedule.rb
Normal file
9
config/schedule.rb
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
if ENV['RAILS_ENV']
|
||||||
|
set :environment, ENV['RAILS_ENV']
|
||||||
|
end
|
||||||
|
|
||||||
|
set :output, 'vedia.log'
|
||||||
|
|
||||||
|
every 5.minutes do
|
||||||
|
rake "close_expired_votes"
|
||||||
|
end
|
||||||
113
po/ca/vedia.po
113
po/ca/vedia.po
|
|
@ -7,7 +7,7 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: PACKAGE VERSION\n"
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2025-06-07 20:04-0600\n"
|
"POT-Creation-Date: 2025-06-08 15:49-0600\n"
|
||||||
"PO-Revision-Date: 2025-03-29 20:41-0600\n"
|
"PO-Revision-Date: 2025-03-29 20:41-0600\n"
|
||||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
|
|
@ -17,39 +17,39 @@ msgstr ""
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
|
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
|
||||||
|
|
||||||
#: ../vedia.rb:69
|
#: ../config/environments/defaults.rb:2
|
||||||
msgid "Awful"
|
msgid "Awful"
|
||||||
msgstr "Molt malament"
|
msgstr "Molt malament"
|
||||||
|
|
||||||
#: ../vedia.rb:70
|
#: ../config/environments/defaults.rb:3
|
||||||
msgid "Very bad"
|
msgid "Very bad"
|
||||||
msgstr "Malament"
|
msgstr "Malament"
|
||||||
|
|
||||||
#: ../vedia.rb:71
|
#: ../config/environments/defaults.rb:4
|
||||||
msgid "Bad"
|
msgid "Bad"
|
||||||
msgstr "Poc bé"
|
msgstr "Poc bé"
|
||||||
|
|
||||||
#: ../vedia.rb:72
|
#: ../config/environments/defaults.rb:5
|
||||||
msgid "Mediocre"
|
msgid "Mediocre"
|
||||||
msgstr "Mig bé"
|
msgstr "Mig bé"
|
||||||
|
|
||||||
#: ../vedia.rb:73
|
#: ../config/environments/defaults.rb:6
|
||||||
msgid "Good"
|
msgid "Good"
|
||||||
msgstr "Bé"
|
msgstr "Bé"
|
||||||
|
|
||||||
#: ../vedia.rb:74
|
#: ../config/environments/defaults.rb:7
|
||||||
msgid "Very good"
|
msgid "Very good"
|
||||||
msgstr "Molt bé"
|
msgstr "Molt bé"
|
||||||
|
|
||||||
#: ../vedia.rb:126
|
#: ../vedia.rb:118
|
||||||
msgid "Incorrect email or password."
|
msgid "Incorrect email or password."
|
||||||
msgstr "Correu o contrasenya incorrecte."
|
msgstr "Correu o contrasenya incorrecte."
|
||||||
|
|
||||||
#: ../vedia.rb:144
|
#: ../vedia.rb:140
|
||||||
msgid "Reset your password"
|
msgid "Reset your password"
|
||||||
msgstr "Reiniciar contrasenya"
|
msgstr "Reiniciar contrasenya"
|
||||||
|
|
||||||
#: ../views/home.erb:1 ../views/layout.erb:14
|
#: ../views/home.erb:1 ../views/layout.erb:23
|
||||||
msgid "Home"
|
msgid "Home"
|
||||||
msgstr "Inici"
|
msgstr "Inici"
|
||||||
|
|
||||||
|
|
@ -85,21 +85,21 @@ msgstr "(Tancada)"
|
||||||
msgid "Create new vote"
|
msgid "Create new vote"
|
||||||
msgstr "Crear una nova votació"
|
msgstr "Crear una nova votació"
|
||||||
|
|
||||||
#: ../views/layout.erb:13
|
#: ../views/layout.erb:22
|
||||||
msgid "Logged in as %{email}."
|
msgid "Logged in as %{email}."
|
||||||
msgstr "Estàs connectada com a %{email}."
|
msgstr "Estàs connectada com a %{email}."
|
||||||
|
|
||||||
#: ../views/layout.erb:13
|
#: ../views/layout.erb:22
|
||||||
msgid "Logout"
|
msgid "Logout"
|
||||||
msgstr "Desconnexió"
|
msgstr "Desconnexió"
|
||||||
|
|
||||||
#: ../views/layout.erb:16 ../views/login.erb:1 ../views/login.erb:16
|
#: ../views/layout.erb:25 ../views/login.erb:1 ../views/login.erb:16
|
||||||
msgid "Login"
|
msgid "Login"
|
||||||
msgstr "Connexió"
|
msgstr "Connexió"
|
||||||
|
|
||||||
#: ../views/login.erb:9 ../views/reset.erb:5 ../views/reset_change.erb:13
|
#: ../views/login.erb:9 ../views/reset.erb:5 ../views/reset_change.erb:13
|
||||||
#: ../views/signup.erb:24 ../views/votes_edit.erb:51
|
#: ../views/signup.erb:24 ../views/votes_edit.erb:51
|
||||||
#: ../views/votes_show_closed.erb:85 ../views/votes_show_open.erb:58
|
#: ../views/votes_show_closed.erb:99 ../views/votes_show_open.erb:62
|
||||||
msgid "Email"
|
msgid "Email"
|
||||||
msgstr "Correu"
|
msgstr "Correu"
|
||||||
|
|
||||||
|
|
@ -122,7 +122,7 @@ msgid "Specify a password."
|
||||||
msgstr "Entra una contrasenya."
|
msgstr "Entra una contrasenya."
|
||||||
|
|
||||||
#: ../views/reset_email.erb:1
|
#: ../views/reset_email.erb:1
|
||||||
msgid "Visit the following link to reset your password:"
|
msgid "Visit this link to reset your password:"
|
||||||
msgstr "Visita aquest enllaç per reiniciar la teva contrasenya:"
|
msgstr "Visita aquest enllaç per reiniciar la teva contrasenya:"
|
||||||
|
|
||||||
#: ../views/reset_invalid.erb:3
|
#: ../views/reset_invalid.erb:3
|
||||||
|
|
@ -153,6 +153,14 @@ msgstr "El correu no és una direcció de correu vàlida."
|
||||||
msgid "An account already exists for %{email}."
|
msgid "An account already exists for %{email}."
|
||||||
msgstr "Un compte ja existeix pel correu %{email}."
|
msgstr "Un compte ja existeix pel correu %{email}."
|
||||||
|
|
||||||
|
#: ../views/votes_close_email.erb:1
|
||||||
|
msgid "Results:"
|
||||||
|
msgstr "Resultats:"
|
||||||
|
|
||||||
|
#: ../views/votes_close_email.erb:5
|
||||||
|
msgid "Visit this link to see the full results:"
|
||||||
|
msgstr "Visita aquest enllaç per veure els resultats complets:"
|
||||||
|
|
||||||
#: ../views/votes_edit.erb:1
|
#: ../views/votes_edit.erb:1
|
||||||
msgid "Edit draft vote"
|
msgid "Edit draft vote"
|
||||||
msgstr "Editar un esborrany de votació"
|
msgstr "Editar un esborrany de votació"
|
||||||
|
|
@ -166,11 +174,12 @@ msgstr "Títol"
|
||||||
msgid "Description"
|
msgid "Description"
|
||||||
msgstr "Descripció"
|
msgstr "Descripció"
|
||||||
|
|
||||||
#: ../views/votes_edit.erb:12 ../views/votes_show_open.erb:23
|
#: ../views/votes_edit.erb:12 ../views/votes_show_open.erb:27
|
||||||
msgid "Save"
|
msgid "Save"
|
||||||
msgstr "Guardar"
|
msgstr "Guardar"
|
||||||
|
|
||||||
#: ../views/votes_edit.erb:15 ../views/votes_show_draft.erb:13
|
#: ../views/votes_edit.erb:15 ../views/votes_open.erb:23
|
||||||
|
#: ../views/votes_show_draft.erb:13
|
||||||
msgid "Candidates"
|
msgid "Candidates"
|
||||||
msgstr "Opcions"
|
msgstr "Opcions"
|
||||||
|
|
||||||
|
|
@ -186,23 +195,24 @@ msgstr "Afegeix una opció"
|
||||||
msgid "Name"
|
msgid "Name"
|
||||||
msgstr "Nom"
|
msgstr "Nom"
|
||||||
|
|
||||||
#: ../views/votes_edit.erb:39 ../views/votes_show_closed.erb:65
|
#: ../views/votes_edit.erb:39 ../views/votes_show_closed.erb:79
|
||||||
#: ../views/votes_show_draft.erb:5 ../views/votes_show_open.erb:34
|
#: ../views/votes_show_draft.erb:5 ../views/votes_show_open.erb:38
|
||||||
msgid "Organizers"
|
msgid "Organizers"
|
||||||
msgstr "Organitzadores"
|
msgstr "Organitzadores"
|
||||||
|
|
||||||
#: ../views/votes_edit.erb:47 ../views/votes_edit.erb:54
|
#: ../views/votes_edit.erb:47 ../views/votes_edit.erb:54
|
||||||
#: ../views/votes_show_closed.erb:81 ../views/votes_show_closed.erb:88
|
#: ../views/votes_show_closed.erb:95 ../views/votes_show_closed.erb:102
|
||||||
#: ../views/votes_show_open.erb:54 ../views/votes_show_open.erb:61
|
#: ../views/votes_show_open.erb:58 ../views/votes_show_open.erb:65
|
||||||
msgid "Add organizer"
|
msgid "Add organizer"
|
||||||
msgstr "Afegeix organitzadora"
|
msgstr "Afegeix organitzadora"
|
||||||
|
|
||||||
#: ../views/votes_edit.erb:57 ../views/votes_show_closed.erb:75
|
#: ../views/votes_edit.erb:57 ../views/votes_show_closed.erb:89
|
||||||
#: ../views/votes_show_open.erb:44
|
#: ../views/votes_show_open.erb:48
|
||||||
msgid "Actions for organizers"
|
msgid "Actions for organizers"
|
||||||
msgstr "Accions per les organitzadores"
|
msgstr "Accions per les organitzadores"
|
||||||
|
|
||||||
#: ../views/votes_edit.erb:61 ../views/votes_edit.erb:64
|
#: ../views/votes_edit.erb:61 ../views/votes_edit.erb:64
|
||||||
|
#: ../views/votes_open.erb:12
|
||||||
msgid "Open vote to participants"
|
msgid "Open vote to participants"
|
||||||
msgstr "Obrir la votació als votants"
|
msgstr "Obrir la votació als votants"
|
||||||
|
|
||||||
|
|
@ -218,59 +228,80 @@ msgstr "Suprimir la votació"
|
||||||
msgid "New vote"
|
msgid "New vote"
|
||||||
msgstr "Nova votació"
|
msgstr "Nova votació"
|
||||||
|
|
||||||
#: ../views/votes_show_closed.erb:5
|
#: ../views/votes_open.erb:1
|
||||||
|
msgid "Open vote"
|
||||||
|
msgstr "Obrir la votació"
|
||||||
|
|
||||||
|
#: ../views/votes_open.erb:5
|
||||||
|
msgid ""
|
||||||
|
"The vote will automatically close on that date and the results will\n"
|
||||||
|
"be sent to all users by email."
|
||||||
|
msgstr ""
|
||||||
|
"La votació es tancarà automàticament en aquesta data i els resultats\n"
|
||||||
|
"s'enviaran a tothom per email."
|
||||||
|
|
||||||
|
#: ../views/votes_open.erb:8
|
||||||
|
msgid ""
|
||||||
|
"You won't be able to modify or delete this vote anymore after\n"
|
||||||
|
"opening it."
|
||||||
|
msgstr "Ja no podràs modificar o suprimir aquesta votació desprès d'obrir-la."
|
||||||
|
|
||||||
|
#: ../views/votes_open.erb:16
|
||||||
|
msgid "Cancel"
|
||||||
|
msgstr "Cancel·lar"
|
||||||
|
|
||||||
|
#: ../views/votes_show_closed.erb:11
|
||||||
msgid "All ratings"
|
msgid "All ratings"
|
||||||
msgstr "Totes les valoracions"
|
msgstr "Totes les valoracions"
|
||||||
|
|
||||||
#: ../views/votes_show_closed.erb:9
|
#: ../views/votes_show_closed.erb:15
|
||||||
msgid "Participant"
|
msgid "Participant"
|
||||||
msgstr "Votant"
|
msgstr "Votant"
|
||||||
|
|
||||||
#: ../views/votes_show_closed.erb:27
|
#: ../views/votes_show_closed.erb:33 ../views/votes_show_closed.erb:73
|
||||||
msgid "Results"
|
msgid "Results"
|
||||||
msgstr "Resultats"
|
msgstr "Resultats"
|
||||||
|
|
||||||
#: ../views/votes_show_closed.erb:31
|
#: ../views/votes_show_closed.erb:37
|
||||||
msgid "Rank"
|
msgid "Rank"
|
||||||
msgstr "Rang"
|
msgstr "Rang"
|
||||||
|
|
||||||
#: ../views/votes_show_closed.erb:32
|
#: ../views/votes_show_closed.erb:38
|
||||||
msgid "Candidate"
|
msgid "Candidate"
|
||||||
msgstr "Opció"
|
msgstr "Opció"
|
||||||
|
|
||||||
#: ../views/votes_show_closed.erb:33
|
#: ../views/votes_show_closed.erb:39
|
||||||
msgid "Majority Judgment"
|
msgid "Majority Judgment"
|
||||||
msgstr "Judici majoritari"
|
msgstr "Judici majoritari"
|
||||||
|
|
||||||
#: ../views/votes_show_closed.erb:34
|
#: ../views/votes_show_closed.erb:40
|
||||||
msgid "Proponents"
|
msgid "Proponents"
|
||||||
msgstr "Defensores"
|
msgstr "Defensores"
|
||||||
|
|
||||||
#: ../views/votes_show_closed.erb:35
|
#: ../views/votes_show_closed.erb:41
|
||||||
msgid "Opponents"
|
msgid "Opponents"
|
||||||
msgstr "Detractores"
|
msgstr "Detractores"
|
||||||
|
|
||||||
#: ../views/votes_show_closed.erb:78
|
#: ../views/votes_show_closed.erb:75
|
||||||
|
msgid "No results are available because nobody voted on this vote."
|
||||||
|
msgstr "No hi ha cap resultat perquè ningú va votar en aquesta votació."
|
||||||
|
|
||||||
|
#: ../views/votes_show_closed.erb:92
|
||||||
msgid "Reopen voting period"
|
msgid "Reopen voting period"
|
||||||
msgstr "Reobrir el període de votació"
|
msgstr "Reobrir el període de votació"
|
||||||
|
|
||||||
#: ../views/votes_show_open.erb:5
|
#: ../views/votes_show_open.erb:9
|
||||||
msgid "Your ratings"
|
msgid "Your ratings"
|
||||||
msgstr "Les teves valoracions"
|
msgstr "Les teves valoracions"
|
||||||
|
|
||||||
#: ../views/votes_show_open.erb:26
|
#: ../views/votes_show_open.erb:30
|
||||||
msgid "Participants"
|
msgid "Participants"
|
||||||
msgstr "Votants"
|
msgstr "Votants"
|
||||||
|
|
||||||
#: ../views/votes_show_open.erb:47
|
#: ../views/votes_show_open.erb:51
|
||||||
msgid "Change back to draft vote"
|
msgid "Change back to draft vote"
|
||||||
msgstr "Tornar a l'esborrany de votació"
|
msgstr "Tornar a l'esborrany de votació"
|
||||||
|
|
||||||
#: ../views/votes_show_open.erb:51
|
#: ../views/votes_show_open.erb:55
|
||||||
msgid "Close votes and show results"
|
msgid "Close votes and show results"
|
||||||
msgstr "Tancar la votació i veure els resultats"
|
msgstr "Tancar la votació i veure els resultats"
|
||||||
|
|
||||||
#: ../views/votes_show_closed.erb:81 ../views/votes_show_closed.erb:88
|
|
||||||
#: ../views/votes_show_open.erb:61
|
|
||||||
#~ msgid "Add"
|
|
||||||
#~ msgstr "Afegir"
|
|
||||||
|
|
|
||||||
108
po/vedia.pot
108
po/vedia.pot
|
|
@ -8,8 +8,8 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: PACKAGE VERSION\n"
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2025-06-07 20:04-0600\n"
|
"POT-Creation-Date: 2025-06-08 15:49-0600\n"
|
||||||
"PO-Revision-Date: 2025-06-07 20:04-0600\n"
|
"PO-Revision-Date: 2025-06-08 15:49-0600\n"
|
||||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
"Language: \n"
|
"Language: \n"
|
||||||
|
|
@ -18,39 +18,39 @@ msgstr ""
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
|
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
|
||||||
|
|
||||||
#: ../vedia.rb:69
|
#: ../config/environments/defaults.rb:2
|
||||||
msgid "Awful"
|
msgid "Awful"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../vedia.rb:70
|
#: ../config/environments/defaults.rb:3
|
||||||
msgid "Very bad"
|
msgid "Very bad"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../vedia.rb:71
|
#: ../config/environments/defaults.rb:4
|
||||||
msgid "Bad"
|
msgid "Bad"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../vedia.rb:72
|
#: ../config/environments/defaults.rb:5
|
||||||
msgid "Mediocre"
|
msgid "Mediocre"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../vedia.rb:73
|
#: ../config/environments/defaults.rb:6
|
||||||
msgid "Good"
|
msgid "Good"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../vedia.rb:74
|
#: ../config/environments/defaults.rb:7
|
||||||
msgid "Very good"
|
msgid "Very good"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../vedia.rb:126
|
#: ../vedia.rb:118
|
||||||
msgid "Incorrect email or password."
|
msgid "Incorrect email or password."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../vedia.rb:144
|
#: ../vedia.rb:140
|
||||||
msgid "Reset your password"
|
msgid "Reset your password"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../views/home.erb:1 ../views/layout.erb:14
|
#: ../views/home.erb:1 ../views/layout.erb:23
|
||||||
msgid "Home"
|
msgid "Home"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
|
@ -86,21 +86,21 @@ msgstr ""
|
||||||
msgid "Create new vote"
|
msgid "Create new vote"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../views/layout.erb:13
|
#: ../views/layout.erb:22
|
||||||
msgid "Logged in as %{email}."
|
msgid "Logged in as %{email}."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../views/layout.erb:13
|
#: ../views/layout.erb:22
|
||||||
msgid "Logout"
|
msgid "Logout"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../views/layout.erb:16 ../views/login.erb:1 ../views/login.erb:16
|
#: ../views/layout.erb:25 ../views/login.erb:1 ../views/login.erb:16
|
||||||
msgid "Login"
|
msgid "Login"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../views/login.erb:9 ../views/reset.erb:5 ../views/reset_change.erb:13
|
#: ../views/login.erb:9 ../views/reset.erb:5 ../views/reset_change.erb:13
|
||||||
#: ../views/signup.erb:24 ../views/votes_edit.erb:51
|
#: ../views/signup.erb:24 ../views/votes_edit.erb:51
|
||||||
#: ../views/votes_show_closed.erb:85 ../views/votes_show_open.erb:58
|
#: ../views/votes_show_closed.erb:99 ../views/votes_show_open.erb:62
|
||||||
msgid "Email"
|
msgid "Email"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
|
@ -123,7 +123,7 @@ msgid "Specify a password."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../views/reset_email.erb:1
|
#: ../views/reset_email.erb:1
|
||||||
msgid "Visit the following link to reset your password:"
|
msgid "Visit this link to reset your password:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../views/reset_invalid.erb:3
|
#: ../views/reset_invalid.erb:3
|
||||||
|
|
@ -152,6 +152,14 @@ msgstr ""
|
||||||
msgid "An account already exists for %{email}."
|
msgid "An account already exists for %{email}."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../views/votes_close_email.erb:1
|
||||||
|
msgid "Results:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../views/votes_close_email.erb:5
|
||||||
|
msgid "Visit this link to see the full results:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: ../views/votes_edit.erb:1
|
#: ../views/votes_edit.erb:1
|
||||||
msgid "Edit draft vote"
|
msgid "Edit draft vote"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
@ -165,11 +173,12 @@ msgstr ""
|
||||||
msgid "Description"
|
msgid "Description"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../views/votes_edit.erb:12 ../views/votes_show_open.erb:23
|
#: ../views/votes_edit.erb:12 ../views/votes_show_open.erb:27
|
||||||
msgid "Save"
|
msgid "Save"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../views/votes_edit.erb:15 ../views/votes_show_draft.erb:13
|
#: ../views/votes_edit.erb:15 ../views/votes_open.erb:23
|
||||||
|
#: ../views/votes_show_draft.erb:13
|
||||||
msgid "Candidates"
|
msgid "Candidates"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
|
@ -185,23 +194,24 @@ msgstr ""
|
||||||
msgid "Name"
|
msgid "Name"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../views/votes_edit.erb:39 ../views/votes_show_closed.erb:65
|
#: ../views/votes_edit.erb:39 ../views/votes_show_closed.erb:79
|
||||||
#: ../views/votes_show_draft.erb:5 ../views/votes_show_open.erb:34
|
#: ../views/votes_show_draft.erb:5 ../views/votes_show_open.erb:38
|
||||||
msgid "Organizers"
|
msgid "Organizers"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../views/votes_edit.erb:47 ../views/votes_edit.erb:54
|
#: ../views/votes_edit.erb:47 ../views/votes_edit.erb:54
|
||||||
#: ../views/votes_show_closed.erb:81 ../views/votes_show_closed.erb:88
|
#: ../views/votes_show_closed.erb:95 ../views/votes_show_closed.erb:102
|
||||||
#: ../views/votes_show_open.erb:54 ../views/votes_show_open.erb:61
|
#: ../views/votes_show_open.erb:58 ../views/votes_show_open.erb:65
|
||||||
msgid "Add organizer"
|
msgid "Add organizer"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../views/votes_edit.erb:57 ../views/votes_show_closed.erb:75
|
#: ../views/votes_edit.erb:57 ../views/votes_show_closed.erb:89
|
||||||
#: ../views/votes_show_open.erb:44
|
#: ../views/votes_show_open.erb:48
|
||||||
msgid "Actions for organizers"
|
msgid "Actions for organizers"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../views/votes_edit.erb:61 ../views/votes_edit.erb:64
|
#: ../views/votes_edit.erb:61 ../views/votes_edit.erb:64
|
||||||
|
#: ../views/votes_open.erb:12
|
||||||
msgid "Open vote to participants"
|
msgid "Open vote to participants"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
|
@ -217,54 +227,78 @@ msgstr ""
|
||||||
msgid "New vote"
|
msgid "New vote"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../views/votes_show_closed.erb:5
|
#: ../views/votes_open.erb:1
|
||||||
|
msgid "Open vote"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../views/votes_open.erb:5
|
||||||
|
msgid ""
|
||||||
|
"The vote will automatically close on that date and the results will\n"
|
||||||
|
"be sent to all users by email."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../views/votes_open.erb:8
|
||||||
|
msgid ""
|
||||||
|
"You won't be able to modify or delete this vote anymore after\n"
|
||||||
|
"opening it."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../views/votes_open.erb:16
|
||||||
|
msgid "Cancel"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../views/votes_show_closed.erb:11
|
||||||
msgid "All ratings"
|
msgid "All ratings"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../views/votes_show_closed.erb:9
|
#: ../views/votes_show_closed.erb:15
|
||||||
msgid "Participant"
|
msgid "Participant"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../views/votes_show_closed.erb:27
|
#: ../views/votes_show_closed.erb:33 ../views/votes_show_closed.erb:73
|
||||||
msgid "Results"
|
msgid "Results"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../views/votes_show_closed.erb:31
|
#: ../views/votes_show_closed.erb:37
|
||||||
msgid "Rank"
|
msgid "Rank"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../views/votes_show_closed.erb:32
|
#: ../views/votes_show_closed.erb:38
|
||||||
msgid "Candidate"
|
msgid "Candidate"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../views/votes_show_closed.erb:33
|
#: ../views/votes_show_closed.erb:39
|
||||||
msgid "Majority Judgment"
|
msgid "Majority Judgment"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../views/votes_show_closed.erb:34
|
#: ../views/votes_show_closed.erb:40
|
||||||
msgid "Proponents"
|
msgid "Proponents"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../views/votes_show_closed.erb:35
|
#: ../views/votes_show_closed.erb:41
|
||||||
msgid "Opponents"
|
msgid "Opponents"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../views/votes_show_closed.erb:78
|
#: ../views/votes_show_closed.erb:75
|
||||||
|
msgid "No results are available because nobody voted on this vote."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../views/votes_show_closed.erb:92
|
||||||
msgid "Reopen voting period"
|
msgid "Reopen voting period"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../views/votes_show_open.erb:5
|
#: ../views/votes_show_open.erb:9
|
||||||
msgid "Your ratings"
|
msgid "Your ratings"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../views/votes_show_open.erb:26
|
#: ../views/votes_show_open.erb:30
|
||||||
msgid "Participants"
|
msgid "Participants"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../views/votes_show_open.erb:47
|
#: ../views/votes_show_open.erb:51
|
||||||
msgid "Change back to draft vote"
|
msgid "Change back to draft vote"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../views/votes_show_open.erb:51
|
#: ../views/votes_show_open.erb:55
|
||||||
msgid "Close votes and show results"
|
msgid "Close votes and show results"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
||||||
60
vedia.rb
60
vedia.rb
|
|
@ -5,7 +5,12 @@ require 'gettext'
|
||||||
require 'securerandom'
|
require 'securerandom'
|
||||||
require 'chartkick'
|
require 'chartkick'
|
||||||
require 'mail'
|
require 'mail'
|
||||||
|
require 'tzinfo'
|
||||||
|
|
||||||
|
include GetText
|
||||||
|
|
||||||
require_relative 'mj'
|
require_relative 'mj'
|
||||||
|
require_relative 'config/environments/defaults.rb'
|
||||||
require_relative "config/environments/#{settings.environment}"
|
require_relative "config/environments/#{settings.environment}"
|
||||||
|
|
||||||
class Vote < ActiveRecord::Base
|
class Vote < ActiveRecord::Base
|
||||||
|
|
@ -55,19 +60,11 @@ def verify_password(password, hash)
|
||||||
BCrypt::Password.new(hash) == password
|
BCrypt::Password.new(hash) == password
|
||||||
end
|
end
|
||||||
|
|
||||||
include GetText
|
|
||||||
set_output_charset('UTF-8')
|
set_output_charset('UTF-8')
|
||||||
bindtextdomain('vedia', 'locale')
|
bindtextdomain('vedia', 'locale')
|
||||||
set_locale('ca')
|
set_locale('ca')
|
||||||
|
|
||||||
enable :sessions
|
enable :sessions
|
||||||
set :values, [ { :id => 1, :label => _("Awful"), :color => '#ff4500' },
|
|
||||||
{ :id => 2, :label => _("Very bad"), :color => '#ffa500' },
|
|
||||||
{ :id => 3, :label => _("Bad"), :color => '#ffff00' },
|
|
||||||
{ :id => 4, :label => _("Mediocre"), :color => '#9acd32' },
|
|
||||||
{ :id => 5, :label => _("Good"), :color => '#228b22' },
|
|
||||||
{ :id => 6, :label => _("Very good"), :color => '#006400' } ]
|
|
||||||
set :admin_email, 'vedia@potager.org'
|
|
||||||
MajorityJudgment.values = settings.values
|
MajorityJudgment.values = settings.values
|
||||||
|
|
||||||
get '/' do
|
get '/' do
|
||||||
|
|
@ -123,6 +120,10 @@ post '/login' do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
post '/timezone' do
|
||||||
|
session[:timezone] = JSON.parse(request.body.read)['timezone']
|
||||||
|
end
|
||||||
|
|
||||||
get '/reset' do
|
get '/reset' do
|
||||||
erb :reset
|
erb :reset
|
||||||
end
|
end
|
||||||
|
|
@ -220,10 +221,6 @@ get '/votes/:id' do
|
||||||
erb :votes_show_open
|
erb :votes_show_open
|
||||||
when 'closed'
|
when 'closed'
|
||||||
erb :votes_show_closed
|
erb :votes_show_closed
|
||||||
else
|
|
||||||
@vote.state = 'draft'
|
|
||||||
@vote.save
|
|
||||||
erb :votes_edit
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -260,6 +257,15 @@ post '/votes/:id/candidates/:cid/delete' do
|
||||||
redirect '/votes/' + @vote.secure_id
|
redirect '/votes/' + @vote.secure_id
|
||||||
end
|
end
|
||||||
|
|
||||||
|
get '/votes/:id/open' do
|
||||||
|
require_login
|
||||||
|
find_vote
|
||||||
|
require_organizer
|
||||||
|
require_draft_vote
|
||||||
|
@expire_on = Time.now.utc + settings.expire_after
|
||||||
|
erb :votes_open
|
||||||
|
end
|
||||||
|
|
||||||
post '/votes/:id/open' do
|
post '/votes/:id/open' do
|
||||||
require_login
|
require_login
|
||||||
find_vote
|
find_vote
|
||||||
|
|
@ -267,6 +273,7 @@ post '/votes/:id/open' do
|
||||||
require_draft_vote
|
require_draft_vote
|
||||||
if not @vote.candidates.length < 2
|
if not @vote.candidates.length < 2
|
||||||
@vote.state = 'open'
|
@vote.state = 'open'
|
||||||
|
@vote.expire_on = Time.now.utc + settings.expire_after
|
||||||
@vote.save
|
@vote.save
|
||||||
end
|
end
|
||||||
redirect '/votes/' + @vote.secure_id
|
redirect '/votes/' + @vote.secure_id
|
||||||
|
|
@ -277,6 +284,7 @@ post '/votes/:id/draft' do
|
||||||
find_vote
|
find_vote
|
||||||
require_organizer
|
require_organizer
|
||||||
require_open_vote
|
require_open_vote
|
||||||
|
require_no_expire_on
|
||||||
@vote.ratings.each {|r| r.destroy}
|
@vote.ratings.each {|r| r.destroy}
|
||||||
@vote.state = 'draft'
|
@vote.state = 'draft'
|
||||||
@vote.save
|
@vote.save
|
||||||
|
|
@ -288,6 +296,7 @@ post '/votes/:id/close' do
|
||||||
find_vote
|
find_vote
|
||||||
require_organizer
|
require_organizer
|
||||||
require_open_vote
|
require_open_vote
|
||||||
|
require_no_expire_on
|
||||||
@vote.state = 'closed'
|
@vote.state = 'closed'
|
||||||
@vote.save
|
@vote.save
|
||||||
redirect '/votes/' + @vote.secure_id
|
redirect '/votes/' + @vote.secure_id
|
||||||
|
|
@ -298,6 +307,7 @@ post '/votes/:id/reopen' do
|
||||||
find_vote
|
find_vote
|
||||||
require_organizer
|
require_organizer
|
||||||
require_closed_vote
|
require_closed_vote
|
||||||
|
require_no_expire_on
|
||||||
@vote.state = 'open'
|
@vote.state = 'open'
|
||||||
@vote.save
|
@vote.save
|
||||||
redirect '/votes/' + @vote.secure_id
|
redirect '/votes/' + @vote.secure_id
|
||||||
|
|
@ -332,6 +342,24 @@ post '/votes/:id/delete' do
|
||||||
redirect '/'
|
redirect '/'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def close_expired_votes
|
||||||
|
Vote.where(state: 'open').where("expire_on < :now", { now: Time.now.utc }).each do |vote|
|
||||||
|
puts "#{Time.now.utc} Closing vote \"#{vote.title}\" because it expired on #{vote.expire_on}..."
|
||||||
|
vote.state = 'closed'
|
||||||
|
vote.save
|
||||||
|
User.all.each do |user|
|
||||||
|
puts "#{Time.now.utc} Sending results by email to #{user.email}..."
|
||||||
|
mail = Mail.new
|
||||||
|
mail.from = settings.admin_email
|
||||||
|
mail.to = user.email
|
||||||
|
mail.subject = _("Results of the vote: #{vote.title}")
|
||||||
|
template = ERB.new(File.read("views/votes_close_email.erb"))
|
||||||
|
mail.body = template.result(binding)
|
||||||
|
mail.deliver
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
helpers do
|
helpers do
|
||||||
def current_user
|
def current_user
|
||||||
if session[:user_id]
|
if session[:user_id]
|
||||||
|
|
@ -364,4 +392,12 @@ helpers do
|
||||||
def require_closed_vote
|
def require_closed_vote
|
||||||
redirect '/votes/' + @vote.secure_id unless @vote.state == 'closed'
|
redirect '/votes/' + @vote.secure_id unless @vote.state == 'closed'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def require_no_expire_on
|
||||||
|
redirect '/votes/' + @vote.secure_id unless @vote.expire_on.nil?
|
||||||
|
end
|
||||||
|
|
||||||
|
def format_date(timestamp)
|
||||||
|
"#{TZInfo::Timezone.get(session[:timezone]).to_local(timestamp).strftime('%F %R')} (#{session[:timezone].gsub('_', ' ')})"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,15 @@
|
||||||
<script src="/Chart.bundle.js"></script>
|
<script src="/Chart.bundle.js"></script>
|
||||||
<link rel="stylesheet" href="/style.css">
|
<link rel="stylesheet" href="/style.css">
|
||||||
</head>
|
</head>
|
||||||
|
<script>
|
||||||
|
fetch('/timezone', {
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
},
|
||||||
|
body: JSON.stringify({ timezone: Intl.DateTimeFormat().resolvedOptions().timeZone })
|
||||||
|
});
|
||||||
|
</script>
|
||||||
<body>
|
<body>
|
||||||
<% if current_user %>
|
<% if current_user %>
|
||||||
<p><%= _("Logged in as %{email}.") % { email: current_user.email } %> <a href="/logout"><%= _("Logout") %></a></p>
|
<p><%= _("Logged in as %{email}.") % { email: current_user.email } %> <a href="/logout"><%= _("Logout") %></a></p>
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
<%= _("Visit the following link to reset your password:") %>
|
<%= _("Visit this link to reset your password:") %>
|
||||||
|
|
||||||
<%= "#{settings.base_url}reset/#{@reset}" %>
|
<%= "#{settings.base_url}reset/#{@reset}" %>
|
||||||
|
|
|
||||||
7
views/votes_close_email.erb
Normal file
7
views/votes_close_email.erb
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
<%= _("Results:") %>
|
||||||
|
<% i = 0 %><% vote.candidates.sort { |a, b| a.mj <=> b.mj }.reverse.each do |candidate| %><% i = i + 1 %>
|
||||||
|
<%= "#{i}. #{candidate.name}" %>
|
||||||
|
<% end %>
|
||||||
|
<%= _("Visit this link to see the full results:") %>
|
||||||
|
|
||||||
|
<%= "#{settings.base_url}votes/#{vote.secure_id}" %>
|
||||||
|
|
@ -56,7 +56,7 @@
|
||||||
|
|
||||||
<h3><%= _("Actions for organizers") %></h2>
|
<h3><%= _("Actions for organizers") %></h2>
|
||||||
|
|
||||||
<form action="/votes/<%= @vote.secure_id %>/open" method="post">
|
<form action="/votes/<%= @vote.secure_id %>/open" method="get">
|
||||||
<% if @vote.candidates.length < 2 %>
|
<% if @vote.candidates.length < 2 %>
|
||||||
<button type="submit" disabled><%= _("Open vote to participants") %></button>
|
<button type="submit" disabled><%= _("Open vote to participants") %></button>
|
||||||
<p><%= _("Add at least 2 candidates before opening the vote to participants.") %></p>
|
<p><%= _("Add at least 2 candidates before opening the vote to participants.") %></p>
|
||||||
|
|
|
||||||
28
views/votes_open.erb
Normal file
28
views/votes_open.erb
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
<h1><%= _("Open vote") %></h1>
|
||||||
|
|
||||||
|
<p><%= _("Closing date: #{format_date(@expire_on)}") %></p>
|
||||||
|
|
||||||
|
<p><%= _("The vote will automatically close on that date and the results will
|
||||||
|
be sent to all users by email.") %></p>
|
||||||
|
|
||||||
|
<p><%= _("You won't be able to modify or delete this vote anymore after
|
||||||
|
opening it.") %></p>
|
||||||
|
|
||||||
|
<form action="/votes/<%= @vote.secure_id %>/open" method="post">
|
||||||
|
<button type="submit"><%= _("Open vote to participants") %></button>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<form action="/votes/<%= @vote.secure_id %>" method="get">
|
||||||
|
<button type="submit"><%= _("Cancel") %></button>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<h2><%= @vote.title %></h2>
|
||||||
|
|
||||||
|
<p><%= @vote.description %></p>
|
||||||
|
|
||||||
|
<h2><%= _("Candidates") %></h2>
|
||||||
|
|
||||||
|
<% @vote.candidates.each do |candidate| %>
|
||||||
|
<h3><%= candidate.name %></h3>
|
||||||
|
<p><%= candidate.description %></p>
|
||||||
|
<% end %>
|
||||||
|
|
@ -1,7 +1,13 @@
|
||||||
<h1><%= @vote.title %></h1>
|
<h1><%= @vote.title %></h1>
|
||||||
|
|
||||||
|
<% if @vote.expire_on %>
|
||||||
|
<p><%= _("Closing date: #{format_date(@vote.expire_on)}") %></p>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<p><%= @vote.description %></p>
|
<p><%= @vote.description %></p>
|
||||||
|
|
||||||
|
<% if @vote.ratings.length > 0 %>
|
||||||
|
|
||||||
<h2><%= _("All ratings") %></h2>
|
<h2><%= _("All ratings") %></h2>
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
|
|
@ -62,6 +68,14 @@ end
|
||||||
%>
|
%>
|
||||||
<%= bar_chart data, colors: colors, stacked: true, legend: 'bottom' %>
|
<%= bar_chart data, colors: colors, stacked: true, legend: 'bottom' %>
|
||||||
|
|
||||||
|
<% else %>
|
||||||
|
|
||||||
|
<h2><%= _("Results") %></h2>
|
||||||
|
|
||||||
|
<%= _("No results are available because nobody voted on this vote.") %>
|
||||||
|
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<h2><%= _("Organizers") %></h2>
|
<h2><%= _("Organizers") %></h2>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
|
|
@ -70,7 +84,7 @@ end
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<% if @vote.users.exists?(current_user.id) %>
|
<% if @vote.users.exists?(current_user.id) and @vote.expire_on.nil? %>
|
||||||
|
|
||||||
<h3><%= _("Actions for organizers") %></h3>
|
<h3><%= _("Actions for organizers") %></h3>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,9 @@
|
||||||
<h1><%= @vote.title %></h1>
|
<h1><%= @vote.title %></h1>
|
||||||
|
|
||||||
|
<% if @vote.expire_on %>
|
||||||
|
<p><%= _("Closing date: #{format_date(@vote.expire_on)}") %></p>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<p><%= @vote.description %></p>
|
<p><%= @vote.description %></p>
|
||||||
|
|
||||||
<h2><%= _("Your ratings") %></h2>
|
<h2><%= _("Your ratings") %></h2>
|
||||||
|
|
@ -39,7 +43,7 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<% if @vote.users.exists?(current_user.id) %>
|
<% if @vote.users.exists?(current_user.id) and @vote.expire_on.nil? %>
|
||||||
|
|
||||||
<h3><%= _("Actions for organizers") %></h3>
|
<h3><%= _("Actions for organizers") %></h3>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue