adds view placeholders for officing polls

This commit is contained in:
rgarcia
2016-09-16 13:06:30 +02:00
committed by kikito
parent 08fbe745a8
commit 503338e47b
34 changed files with 188 additions and 6 deletions

View 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

View File

@@ -1,5 +1,5 @@
class Admin::Poll::OfficersController < Admin::BaseController 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 def index
@officers = @officers.page(params[:page]) @officers = @officers.page(params[:page])
@@ -29,4 +29,11 @@ class Admin::Poll::OfficersController < Admin::BaseController
@officer.destroy @officer.destroy
redirect_to admin_poll_officers_path redirect_to admin_poll_officers_path
end end
def show
end
def edit
end
end end

View 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

View 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

View File

@@ -0,0 +1,6 @@
class Officing::DashboardController < Officing::BaseController
def index
end
end

View 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

View File

@@ -0,0 +1,9 @@
class Officing::VotersController < Officing::BaseController
layout 'admin'
before_action :authenticate_user!
def new
end
end

View File

@@ -83,12 +83,24 @@
<% end %> <% end %>
</li> </li>
<li <%= 'class=active' if controller_name == 'officers_controller' %>> <li <%= 'class=active' if controller_name == 'officers' %>>
<%= link_to admin_poll_officers_path do %> <%= link_to admin_poll_officers_path(Poll.last) do %>
<span class="icon-user"></span><%= t('admin.menu.poll_officers') %> <span class="icon-user"></span><%= t('admin.menu.poll_officers') %>
<% end %> <% end %>
</li> </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' %>> <li <%= 'class=active' if controller_name == 'activity' %>>
<%= link_to admin_activity_path do %> <%= link_to admin_activity_path do %>
<span class="icon-eye"></span><%= t('admin.menu.activity') %> <span class="icon-eye"></span><%= t('admin.menu.activity') %>

View File

@@ -0,0 +1 @@
booth edit

View File

@@ -0,0 +1 @@
booth index

View File

@@ -0,0 +1 @@
booth new

View File

@@ -0,0 +1 @@
booth show

View File

@@ -0,0 +1 @@
officer edit

View File

@@ -0,0 +1 @@
officer show

View File

@@ -0,0 +1 @@
poll edit

View File

@@ -0,0 +1 @@
polls index

View File

@@ -0,0 +1 @@
poll new

View File

@@ -0,0 +1 @@
poll show

View 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>

View File

@@ -0,0 +1,6 @@
<div class="dashboard">
<h2><%= t("officing.dashboard.index.title") %></h2>
<p><%= t("officing.dashboard.index.info") %></p>
</div>

View File

@@ -0,0 +1 @@
results index

View File

@@ -0,0 +1 @@
results new

View File

@@ -0,0 +1 @@
results show

View File

@@ -0,0 +1 @@
voters new

View File

@@ -0,0 +1 @@
voters show

View File

@@ -0,0 +1 @@
new.html.erb

View File

@@ -22,4 +22,10 @@
<%= link_to t("layouts.header.management"), management_sign_in_path %> <%= link_to t("layouts.header.management"), management_sign_in_path %>
</li> </li>
<% end %> <% end %>
<%# if current_user.administrator? || current_user.officer? %>
<li>
<%= link_to t("layouts.header.officing"), officing_root_path %>
</li>
<%# end %>
<% end %> <% end %>

View File

@@ -106,6 +106,8 @@ en:
moderators: Moderators moderators: Moderators
valuators: Valuators valuators: Valuators
poll_officers: Poll officers poll_officers: Poll officers
polls: Polls
booths: Booths
officials: Officials officials: Officials
organizations: Organisations organizations: Organisations
settings: Configuration settings settings: Configuration settings

View File

@@ -104,6 +104,8 @@ es:
moderators: Moderadores moderators: Moderadores
valuators: Evaluadores valuators: Evaluadores
poll_officers: Presidentes de mesa poll_officers: Presidentes de mesa
polls: Votaciones
booths: Urnas
officials: Cargos públicos officials: Cargos públicos
organizations: Organizaciones organizations: Organizaciones
settings: Configuración global settings: Configuración global

View File

@@ -195,6 +195,7 @@ en:
management: Management management: Management
moderation: Moderation moderation: Moderation
valuation: Valuation valuation: Valuation
officing: Polling officers
more_information: More information more_information: More information
my_account_link: My account my_account_link: My account
my_activity_link: My activity my_activity_link: My activity

View File

@@ -195,6 +195,7 @@ es:
management: Gestión management: Gestión
moderation: Moderar moderation: Moderar
valuation: Evaluación valuation: Evaluación
officing: Presidentes de mesa
more_information: Más información more_information: Más información
my_account_link: Mi cuenta my_account_link: Mi cuenta
my_activity_link: Mi actividad my_activity_link: Mi actividad

View 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

View 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

View File

@@ -179,9 +179,12 @@ Rails.application.routes.draw do
get :search, on: :collection get :search, on: :collection
end end
namespace :poll do scope module: 'poll' do
resources :officers, only: [:index, :create, :destroy] do resources :polls do
get :search, on: :collection resources :booths
resources :officers do
get :search, on: :collection
end
end end
end end
@@ -268,6 +271,14 @@ Rails.application.routes.draw do
end end
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? if Rails.env.development?
mount LetterOpenerWeb::Engine, at: "/letter_opener" mount LetterOpenerWeb::Engine, at: "/letter_opener"
end end