adds view placeholders for officing polls
This commit is contained in:
16
app/controllers/admin/poll/booths_controller.rb
Normal file
16
app/controllers/admin/poll/booths_controller.rb
Normal file
@@ -0,0 +1,16 @@
|
||||
class Admin::Poll::BoothsController < Admin::BaseController
|
||||
skip_authorization_check
|
||||
|
||||
def index
|
||||
end
|
||||
|
||||
def show
|
||||
end
|
||||
|
||||
def new
|
||||
end
|
||||
|
||||
def edit
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,5 +1,5 @@
|
||||
class Admin::Poll::OfficersController < Admin::BaseController
|
||||
load_and_authorize_resource :officer, class: "Poll::Officer"
|
||||
load_and_authorize_resource :officer, class: "Poll::Officer", except: [:edit, :show]
|
||||
|
||||
def index
|
||||
@officers = @officers.page(params[:page])
|
||||
@@ -29,4 +29,11 @@ class Admin::Poll::OfficersController < Admin::BaseController
|
||||
@officer.destroy
|
||||
redirect_to admin_poll_officers_path
|
||||
end
|
||||
|
||||
def show
|
||||
end
|
||||
|
||||
def edit
|
||||
end
|
||||
|
||||
end
|
||||
16
app/controllers/admin/poll/polls_controller.rb
Normal file
16
app/controllers/admin/poll/polls_controller.rb
Normal file
@@ -0,0 +1,16 @@
|
||||
class Admin::Poll::PollsController < Admin::BaseController
|
||||
skip_authorization_check
|
||||
|
||||
def index
|
||||
end
|
||||
|
||||
def show
|
||||
end
|
||||
|
||||
def new
|
||||
end
|
||||
|
||||
def edit
|
||||
end
|
||||
|
||||
end
|
||||
18
app/controllers/officing/base_controller.rb
Normal file
18
app/controllers/officing/base_controller.rb
Normal file
@@ -0,0 +1,18 @@
|
||||
class Officing::BaseController < ActionController::Base
|
||||
layout 'admin'
|
||||
|
||||
#before_action :verify_officer
|
||||
before_action :set_locale
|
||||
|
||||
private
|
||||
|
||||
def set_locale
|
||||
if params[:locale] && I18n.available_locales.include?(params[:locale].to_sym)
|
||||
session[:locale] = params[:locale]
|
||||
end
|
||||
|
||||
session[:locale] ||= I18n.default_locale
|
||||
|
||||
I18n.locale = session[:locale]
|
||||
end
|
||||
end
|
||||
6
app/controllers/officing/dashboard_controller.rb
Normal file
6
app/controllers/officing/dashboard_controller.rb
Normal file
@@ -0,0 +1,6 @@
|
||||
class Officing::DashboardController < Officing::BaseController
|
||||
|
||||
def index
|
||||
end
|
||||
|
||||
end
|
||||
15
app/controllers/officing/results_controller.rb
Normal file
15
app/controllers/officing/results_controller.rb
Normal file
@@ -0,0 +1,15 @@
|
||||
class Officing::ResultsController < Officing::BaseController
|
||||
layout 'admin'
|
||||
|
||||
before_action :authenticate_user!
|
||||
|
||||
def index
|
||||
end
|
||||
|
||||
def show
|
||||
end
|
||||
|
||||
def new
|
||||
end
|
||||
|
||||
end
|
||||
9
app/controllers/officing/voters_controller.rb
Normal file
9
app/controllers/officing/voters_controller.rb
Normal file
@@ -0,0 +1,9 @@
|
||||
class Officing::VotersController < Officing::BaseController
|
||||
layout 'admin'
|
||||
|
||||
before_action :authenticate_user!
|
||||
|
||||
def new
|
||||
end
|
||||
|
||||
end
|
||||
@@ -83,12 +83,24 @@
|
||||
<% end %>
|
||||
</li>
|
||||
|
||||
<li <%= 'class=active' if controller_name == 'officers_controller' %>>
|
||||
<%= link_to admin_poll_officers_path do %>
|
||||
<li <%= 'class=active' if controller_name == 'officers' %>>
|
||||
<%= link_to admin_poll_officers_path(Poll.last) do %>
|
||||
<span class="icon-user"></span><%= t('admin.menu.poll_officers') %>
|
||||
<% end %>
|
||||
</li>
|
||||
|
||||
<li <%= 'class=active' if controller_name == 'polls' %>>
|
||||
<%= link_to admin_polls_path do %>
|
||||
<span class="icon-user"></span><%= t('admin.menu.polls') %>
|
||||
<% end %>
|
||||
</li>
|
||||
|
||||
<li <%= 'class=active' if controller_name == 'booths' %>>
|
||||
<%= link_to admin_poll_booths_url(Poll.last) do %>
|
||||
<span class="icon-user"></span><%= t('admin.menu.booths') %>
|
||||
<% end %>
|
||||
</li>
|
||||
|
||||
<li <%= 'class=active' if controller_name == 'activity' %>>
|
||||
<%= link_to admin_activity_path do %>
|
||||
<span class="icon-eye"></span><%= t('admin.menu.activity') %>
|
||||
|
||||
1
app/views/admin/poll/booths/edit.html.erb
Normal file
1
app/views/admin/poll/booths/edit.html.erb
Normal file
@@ -0,0 +1 @@
|
||||
booth edit
|
||||
1
app/views/admin/poll/booths/index.html.erb
Normal file
1
app/views/admin/poll/booths/index.html.erb
Normal file
@@ -0,0 +1 @@
|
||||
booth index
|
||||
1
app/views/admin/poll/booths/new.html.erb
Normal file
1
app/views/admin/poll/booths/new.html.erb
Normal file
@@ -0,0 +1 @@
|
||||
booth new
|
||||
1
app/views/admin/poll/booths/show.html.erb
Normal file
1
app/views/admin/poll/booths/show.html.erb
Normal file
@@ -0,0 +1 @@
|
||||
booth show
|
||||
1
app/views/admin/poll/officers/edit.html.erb
Normal file
1
app/views/admin/poll/officers/edit.html.erb
Normal file
@@ -0,0 +1 @@
|
||||
officer edit
|
||||
1
app/views/admin/poll/officers/show.html.erb
Normal file
1
app/views/admin/poll/officers/show.html.erb
Normal file
@@ -0,0 +1 @@
|
||||
officer show
|
||||
1
app/views/admin/poll/polls/edit.html.erb
Normal file
1
app/views/admin/poll/polls/edit.html.erb
Normal file
@@ -0,0 +1 @@
|
||||
poll edit
|
||||
1
app/views/admin/poll/polls/index.html.erb
Normal file
1
app/views/admin/poll/polls/index.html.erb
Normal file
@@ -0,0 +1 @@
|
||||
polls index
|
||||
1
app/views/admin/poll/polls/new.html.erb
Normal file
1
app/views/admin/poll/polls/new.html.erb
Normal file
@@ -0,0 +1 @@
|
||||
poll new
|
||||
1
app/views/admin/poll/polls/show.html.erb
Normal file
1
app/views/admin/poll/polls/show.html.erb
Normal file
@@ -0,0 +1 @@
|
||||
poll show
|
||||
18
app/views/officing/_menu.html.erb
Normal file
18
app/views/officing/_menu.html.erb
Normal file
@@ -0,0 +1,18 @@
|
||||
<div class="admin-sidebar">
|
||||
<ul id="admin_menu">
|
||||
|
||||
<li <%= "class=active" if controller_name == "voters" %>>
|
||||
<%= link_to new_officing_poll_voter_path(Poll.last) do %>
|
||||
<span class="icon-user"></span>
|
||||
<%= t("officing.menu.voters") %>
|
||||
<% end %>
|
||||
</li>
|
||||
|
||||
<li <%= "class=active" if controller_name == "results" %>>
|
||||
<%= link_to new_officing_poll_result_path(Poll.last) do %>
|
||||
<span class="icon-user"></span>
|
||||
<%= t("officing.menu.results") %>
|
||||
<% end %>
|
||||
</li>
|
||||
|
||||
</div>
|
||||
6
app/views/officing/dashboard/index.html.erb
Normal file
6
app/views/officing/dashboard/index.html.erb
Normal file
@@ -0,0 +1,6 @@
|
||||
<div class="dashboard">
|
||||
<h2><%= t("officing.dashboard.index.title") %></h2>
|
||||
|
||||
<p><%= t("officing.dashboard.index.info") %></p>
|
||||
|
||||
</div>
|
||||
1
app/views/officing/results/index.html.erb
Normal file
1
app/views/officing/results/index.html.erb
Normal file
@@ -0,0 +1 @@
|
||||
results index
|
||||
1
app/views/officing/results/new.html.erb
Normal file
1
app/views/officing/results/new.html.erb
Normal file
@@ -0,0 +1 @@
|
||||
results new
|
||||
1
app/views/officing/results/show.html.erb
Normal file
1
app/views/officing/results/show.html.erb
Normal file
@@ -0,0 +1 @@
|
||||
results show
|
||||
1
app/views/officing/voters/new.html.erb
Normal file
1
app/views/officing/voters/new.html.erb
Normal file
@@ -0,0 +1 @@
|
||||
voters new
|
||||
1
app/views/officing/voters/show.html.erb
Normal file
1
app/views/officing/voters/show.html.erb
Normal file
@@ -0,0 +1 @@
|
||||
voters show
|
||||
1
app/views/poll/voters/new.html.erb
Normal file
1
app/views/poll/voters/new.html.erb
Normal file
@@ -0,0 +1 @@
|
||||
new.html.erb
|
||||
@@ -22,4 +22,10 @@
|
||||
<%= link_to t("layouts.header.management"), management_sign_in_path %>
|
||||
</li>
|
||||
<% end %>
|
||||
|
||||
<%# if current_user.administrator? || current_user.officer? %>
|
||||
<li>
|
||||
<%= link_to t("layouts.header.officing"), officing_root_path %>
|
||||
</li>
|
||||
<%# end %>
|
||||
<% end %>
|
||||
|
||||
@@ -106,6 +106,8 @@ en:
|
||||
moderators: Moderators
|
||||
valuators: Valuators
|
||||
poll_officers: Poll officers
|
||||
polls: Polls
|
||||
booths: Booths
|
||||
officials: Officials
|
||||
organizations: Organisations
|
||||
settings: Configuration settings
|
||||
|
||||
@@ -104,6 +104,8 @@ es:
|
||||
moderators: Moderadores
|
||||
valuators: Evaluadores
|
||||
poll_officers: Presidentes de mesa
|
||||
polls: Votaciones
|
||||
booths: Urnas
|
||||
officials: Cargos públicos
|
||||
organizations: Organizaciones
|
||||
settings: Configuración global
|
||||
|
||||
@@ -195,6 +195,7 @@ en:
|
||||
management: Management
|
||||
moderation: Moderation
|
||||
valuation: Valuation
|
||||
officing: Polling officers
|
||||
more_information: More information
|
||||
my_account_link: My account
|
||||
my_activity_link: My activity
|
||||
|
||||
@@ -195,6 +195,7 @@ es:
|
||||
management: Gestión
|
||||
moderation: Moderar
|
||||
valuation: Evaluación
|
||||
officing: Presidentes de mesa
|
||||
more_information: Más información
|
||||
my_account_link: Mi cuenta
|
||||
my_activity_link: Mi actividad
|
||||
|
||||
10
config/locales/officing.en.yml
Normal file
10
config/locales/officing.en.yml
Normal file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
en:
|
||||
officing:
|
||||
dashboard:
|
||||
index:
|
||||
title: Poll officing
|
||||
info: Here you can validate user documents and store voting results
|
||||
menu:
|
||||
voters: Validate citizen document
|
||||
results: Store voting results
|
||||
10
config/locales/officing.es.yml
Normal file
10
config/locales/officing.es.yml
Normal file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
es:
|
||||
officing:
|
||||
dashboard:
|
||||
index:
|
||||
title: Presidir mesa de votaciones
|
||||
info: Aquí puedes validar documentos de ciudadanos y guardar los resultados de las urnas
|
||||
menu:
|
||||
voters: Validar documento de identidad
|
||||
results: Guardar resultados de la votación
|
||||
@@ -179,9 +179,12 @@ Rails.application.routes.draw do
|
||||
get :search, on: :collection
|
||||
end
|
||||
|
||||
namespace :poll do
|
||||
resources :officers, only: [:index, :create, :destroy] do
|
||||
get :search, on: :collection
|
||||
scope module: 'poll' do
|
||||
resources :polls do
|
||||
resources :booths
|
||||
resources :officers do
|
||||
get :search, on: :collection
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -268,6 +271,14 @@ Rails.application.routes.draw do
|
||||
end
|
||||
end
|
||||
|
||||
namespace :officing do
|
||||
resources :polls do
|
||||
resources :voters, only: [:new, :show]
|
||||
resources :results, only: [:new, :index, :show]
|
||||
end
|
||||
root to: "dashboard#index"
|
||||
end
|
||||
|
||||
if Rails.env.development?
|
||||
mount LetterOpenerWeb::Engine, at: "/letter_opener"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user