Merge branch 'master' into feature/1-nav-content-blocks
This commit is contained in:
@@ -34,21 +34,12 @@ If you want to contribute code to solve an issue:
|
|||||||
* Fork the project.
|
* Fork the project.
|
||||||
* Create a topic branch based on master.
|
* Create a topic branch based on master.
|
||||||
* Commit there your code to solve the issue.
|
* Commit there your code to solve the issue.
|
||||||
* Make sure all test are passing (and add specs to test any new feature if needed).
|
* Make sure all test are passing (and add specs to test any new feature you've added).
|
||||||
* Follow these [best practices](https://github.com/styleguide/ruby)
|
* Follow these [best practices](https://github.com/styleguide/ruby)
|
||||||
* Open a *pull request* to the main repository describing what issue you are addressing.
|
* Open a *pull request* to the main repository describing what issue you are addressing.
|
||||||
|
|
||||||
**Working on your first Pull Request?** You can learn how from this *free* series [How to Contribute to an Open Source Project on GitHub](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github)
|
**Working on your first Pull Request?** You can learn how from this *free* series [How to Contribute to an Open Source Project on GitHub](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github)
|
||||||
|
|
||||||
## Cleaning up
|
|
||||||
|
|
||||||
In the rush of time sometimes things get messy, you can help us cleaning things up:
|
|
||||||
|
|
||||||
* implement [pending specs](https://travis-ci.org/consul/consul)
|
|
||||||
* increase [code coverage](https://coveralls.io/github/consul/consul?branch=master)
|
|
||||||
* improve [code quality](https://codeclimate.com/github/consul/consul)
|
|
||||||
* make [code consistent](https://github.com/bbatsov/rubocop)
|
|
||||||
|
|
||||||
## Other ways of contributing without coding
|
## Other ways of contributing without coding
|
||||||
|
|
||||||
* If you think there's a feature missing, or find a bug, create an issue (make sure it has not already been reported).
|
* If you think there's a feature missing, or find a bug, create an issue (make sure it has not already been reported).
|
||||||
|
|||||||
19
Dockerfile
19
Dockerfile
@@ -1,7 +1,11 @@
|
|||||||
|
# Use Ruby 2.3.6 as base image
|
||||||
FROM ruby:2.3.6
|
FROM ruby:2.3.6
|
||||||
|
|
||||||
|
ENV DEBIAN_FRONTEND noninteractive
|
||||||
|
|
||||||
# Install essential Linux packages
|
# Install essential Linux packages
|
||||||
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev postgresql-client nodejs imagemagick sudo
|
RUN apt-get update -qq
|
||||||
|
RUN apt-get install -y build-essential libpq-dev postgresql-client nodejs imagemagick sudo libxss1 libappindicator1 libindicator7 unzip memcached
|
||||||
|
|
||||||
# Files created inside the container repect the ownership
|
# Files created inside the container repect the ownership
|
||||||
RUN adduser --shell /bin/bash --disabled-password --gecos "" consul \
|
RUN adduser --shell /bin/bash --disabled-password --gecos "" consul \
|
||||||
@@ -34,13 +38,22 @@ COPY Gemfile_custom Gemfile_custom
|
|||||||
# Prevent bundler warnings; ensure that the bundler version executed is >= that which created Gemfile.lock
|
# Prevent bundler warnings; ensure that the bundler version executed is >= that which created Gemfile.lock
|
||||||
RUN gem install bundler
|
RUN gem install bundler
|
||||||
|
|
||||||
# Finish establishing our Ruby enviornment
|
# Finish establishing our Ruby environment
|
||||||
RUN bundle install --full-index
|
RUN bundle install --full-index
|
||||||
|
|
||||||
|
# Install Chromium and ChromeDriver for E2E integration tests
|
||||||
|
RUN apt-get update -qq && apt-get install -y chromium
|
||||||
|
RUN wget -N http://chromedriver.storage.googleapis.com/2.40/chromedriver_linux64.zip
|
||||||
|
RUN unzip chromedriver_linux64.zip
|
||||||
|
RUN chmod +x chromedriver
|
||||||
|
RUN mv -f chromedriver /usr/local/share/chromedriver
|
||||||
|
RUN ln -s /usr/local/share/chromedriver /usr/local/bin/chromedriver
|
||||||
|
RUN ln -s /usr/local/share/chromedriver /usr/bin/chromedriver
|
||||||
|
|
||||||
# Copy the Rails application into place
|
# Copy the Rails application into place
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Define the script we want run once the container boots
|
# Define the script we want run once the container boots
|
||||||
# Use the "exec" form of CMD so our script shuts down gracefully on SIGTERM (i.e. `docker stop`)
|
# Use the "exec" form of CMD so our script shuts down gracefully on SIGTERM (i.e. `docker stop`)
|
||||||
#CMD [ "config/containers/app_cmd.sh" ]
|
# CMD [ "config/containers/app_cmd.sh" ]
|
||||||
CMD ["bundle", "exec", "rails", "server", "-b", "0.0.0.0"]
|
CMD ["bundle", "exec", "rails", "server", "-b", "0.0.0.0"]
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
//= require moderator_comment
|
//= require moderator_comment
|
||||||
//= require moderator_debates
|
//= require moderator_debates
|
||||||
//= require moderator_proposals
|
//= require moderator_proposals
|
||||||
|
//= require moderator_budget_investments
|
||||||
//= require moderator_proposal_notifications
|
//= require moderator_proposal_notifications
|
||||||
//= require prevent_double_submission
|
//= require prevent_double_submission
|
||||||
//= require gettext
|
//= require gettext
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
App.ModeratorBudgetInvestments =
|
||||||
|
|
||||||
|
add_class_faded: (id) ->
|
||||||
|
$("##{id}").addClass("faded")
|
||||||
|
$("#comments").addClass("faded")
|
||||||
|
|
||||||
|
hide_moderator_actions: (id) ->
|
||||||
|
$("##{id} .js-moderator-investment-actions:first").hide()
|
||||||
@@ -46,6 +46,10 @@ $sidebar-active: #f4fcd0;
|
|||||||
|
|
||||||
.top-links {
|
.top-links {
|
||||||
background: #000;
|
background: #000;
|
||||||
|
|
||||||
|
a {
|
||||||
|
line-height: rem-calc($line-height * 1.5);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.admin-top-bar {
|
.admin-top-bar {
|
||||||
@@ -190,6 +194,11 @@ $sidebar-active: #f4fcd0;
|
|||||||
|
|
||||||
&.with-button {
|
&.with-button {
|
||||||
line-height: $line-height * 2;
|
line-height: $line-height * 2;
|
||||||
|
|
||||||
|
.button {
|
||||||
|
background: #fff;
|
||||||
|
color: $brand;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -204,6 +213,19 @@ $sidebar-active: #f4fcd0;
|
|||||||
|
|
||||||
table {
|
table {
|
||||||
|
|
||||||
|
thead {
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
th {
|
||||||
|
background: $brand;
|
||||||
|
color: #fff;
|
||||||
|
|
||||||
|
label {
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.break {
|
.break {
|
||||||
word-break: break-word;
|
word-break: break-word;
|
||||||
}
|
}
|
||||||
@@ -220,7 +242,6 @@ $sidebar-active: #f4fcd0;
|
|||||||
|
|
||||||
@include breakpoint(medium) {
|
@include breakpoint(medium) {
|
||||||
margin-left: $line-height / 2;
|
margin-left: $line-height / 2;
|
||||||
margin-right: $line-height / 2;
|
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -335,6 +356,14 @@ $sidebar-active: #f4fcd0;
|
|||||||
margin-bottom: 0 !important;
|
margin-bottom: 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.enabled {
|
||||||
|
color: $color-success;
|
||||||
|
}
|
||||||
|
|
||||||
|
.disabled {
|
||||||
|
color: $text-medium;
|
||||||
|
}
|
||||||
|
|
||||||
// 02. Sidebar
|
// 02. Sidebar
|
||||||
// -----------
|
// -----------
|
||||||
|
|
||||||
|
|||||||
@@ -878,11 +878,6 @@ footer {
|
|||||||
h1 {
|
h1 {
|
||||||
margin-top: $line-height;
|
margin-top: $line-height;
|
||||||
|
|
||||||
img {
|
|
||||||
height: rem-calc(80);
|
|
||||||
width: rem-calc(80);
|
|
||||||
}
|
|
||||||
|
|
||||||
a {
|
a {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
display: block;
|
display: block;
|
||||||
|
|||||||
@@ -0,0 +1,34 @@
|
|||||||
|
class Admin::HiddenBudgetInvestmentsController < Admin::BaseController
|
||||||
|
include FeatureFlags
|
||||||
|
|
||||||
|
has_filters %w{all with_confirmed_hide without_confirmed_hide}, only: :index
|
||||||
|
|
||||||
|
feature_flag :budgets
|
||||||
|
|
||||||
|
before_action :load_investment, only: [:confirm_hide, :restore]
|
||||||
|
|
||||||
|
def index
|
||||||
|
@investments = Budget::Investment.only_hidden.send(@current_filter)
|
||||||
|
.order(hidden_at: :desc)
|
||||||
|
.page(params[:page])
|
||||||
|
end
|
||||||
|
|
||||||
|
def confirm_hide
|
||||||
|
@investment.confirm_hide
|
||||||
|
redirect_to request.query_parameters.merge(action: :index)
|
||||||
|
end
|
||||||
|
|
||||||
|
def restore
|
||||||
|
@investment.restore
|
||||||
|
@investment.ignore_flag
|
||||||
|
Activity.log(current_user, :restore, @investment)
|
||||||
|
redirect_to request.query_parameters.merge(action: :index)
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def load_investment
|
||||||
|
@investment = Budget::Investment.with_hidden.find(params[:id])
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
@@ -0,0 +1,90 @@
|
|||||||
|
class Admin::SiteCustomization::InformationTextsController < Admin::SiteCustomization::BaseController
|
||||||
|
include Translatable
|
||||||
|
|
||||||
|
def index
|
||||||
|
fetch_existing_keys
|
||||||
|
append_or_create_keys
|
||||||
|
@content = @content[@tab.to_s]
|
||||||
|
end
|
||||||
|
|
||||||
|
def update
|
||||||
|
content_params.each do |content|
|
||||||
|
values = content[:values].slice(*translation_params(content[:values]))
|
||||||
|
|
||||||
|
unless values.empty?
|
||||||
|
values.each do |key, value|
|
||||||
|
locale = key.split("_").last
|
||||||
|
|
||||||
|
if value == t(content[:id], locale: locale) || value.match(/translation missing/)
|
||||||
|
next
|
||||||
|
else
|
||||||
|
text = I18nContent.find_or_create_by(key: content[:id])
|
||||||
|
Globalize.locale = locale
|
||||||
|
text.update(value: value)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
redirect_to admin_site_customization_information_texts_path,
|
||||||
|
notice: t('flash.actions.update.translation')
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def i18n_content_params
|
||||||
|
attributes = [:key, :value]
|
||||||
|
params.require(:information_texts).permit(*attributes, translation_params(params[:information_texts]))
|
||||||
|
end
|
||||||
|
|
||||||
|
def resource_model
|
||||||
|
I18nContent
|
||||||
|
end
|
||||||
|
|
||||||
|
def resource
|
||||||
|
resource_model.find(content_params[:id])
|
||||||
|
end
|
||||||
|
|
||||||
|
def content_params
|
||||||
|
params.require(:contents).values
|
||||||
|
end
|
||||||
|
|
||||||
|
def delete_translations
|
||||||
|
languages_to_delete = params[:delete_translations].select { |k, v| params[:delete_translations][k] == '1' }.keys
|
||||||
|
languages_to_delete.each do |locale|
|
||||||
|
I18nContentTranslation.destroy_all(locale: locale)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def fetch_existing_keys
|
||||||
|
@existing_keys = {}
|
||||||
|
@tab = params[:tab] || :debates
|
||||||
|
|
||||||
|
I18nContent.begins_with_key(@tab)
|
||||||
|
.all
|
||||||
|
.map{ |content| @existing_keys[content.key] = content }
|
||||||
|
end
|
||||||
|
|
||||||
|
def append_or_create_keys
|
||||||
|
@content = {}
|
||||||
|
I18n.backend.send(:init_translations) unless I18n.backend.initialized?
|
||||||
|
|
||||||
|
locale = params[:locale] || I18n.locale
|
||||||
|
translations = I18n.backend.send(:translations)[locale.to_sym]
|
||||||
|
|
||||||
|
translations.each do |k, v|
|
||||||
|
@content[k.to_s] = flat_hash(v).keys
|
||||||
|
.map { |s| @existing_keys["#{k.to_s}.#{s}"].nil? ?
|
||||||
|
I18nContent.new(key: "#{k.to_s}.#{s}") :
|
||||||
|
@existing_keys["#{k.to_s}.#{s}"] }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def flat_hash(h, f = nil, g = {})
|
||||||
|
return g.update({ f => h }) unless h.is_a? Hash
|
||||||
|
h.each { |k, r| flat_hash(r, [f,k].compact.join('.'), g) }
|
||||||
|
return g
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
@@ -3,18 +3,32 @@ module FlagActions
|
|||||||
|
|
||||||
def flag
|
def flag
|
||||||
Flag.flag(current_user, flaggable)
|
Flag.flag(current_user, flaggable)
|
||||||
|
|
||||||
|
if controller_name == 'investments'
|
||||||
|
respond_with flaggable, template: "budgets/#{controller_name}/_refresh_flag_actions"
|
||||||
|
else
|
||||||
respond_with flaggable, template: "#{controller_name}/_refresh_flag_actions"
|
respond_with flaggable, template: "#{controller_name}/_refresh_flag_actions"
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def unflag
|
def unflag
|
||||||
Flag.unflag(current_user, flaggable)
|
Flag.unflag(current_user, flaggable)
|
||||||
|
|
||||||
|
if controller_name == 'investments'
|
||||||
|
respond_with flaggable, template: "budgets/#{controller_name}/_refresh_flag_actions"
|
||||||
|
else
|
||||||
respond_with flaggable, template: "#{controller_name}/_refresh_flag_actions"
|
respond_with flaggable, template: "#{controller_name}/_refresh_flag_actions"
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def flaggable
|
def flaggable
|
||||||
|
if resource_model.to_s == 'Budget::Investment'
|
||||||
|
instance_variable_get("@investment")
|
||||||
|
else
|
||||||
instance_variable_get("@#{resource_model.to_s.downcase}")
|
instance_variable_get("@#{resource_model.to_s.downcase}")
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
@@ -3,8 +3,12 @@ module Polymorphic
|
|||||||
private
|
private
|
||||||
|
|
||||||
def resource
|
def resource
|
||||||
|
if resource_model.to_s == 'Budget::Investment'
|
||||||
|
@resource ||= instance_variable_get("@investment")
|
||||||
|
else
|
||||||
@resource ||= instance_variable_get("@#{resource_name}")
|
@resource ||= instance_variable_get("@#{resource_name}")
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def resource_name
|
def resource_name
|
||||||
@resource_name ||= resource_model.to_s.downcase
|
@resource_name ||= resource_model.to_s.downcase
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ class Management::BaseController < ActionController::Base
|
|||||||
|
|
||||||
helper_method :managed_user
|
helper_method :managed_user
|
||||||
helper_method :current_user
|
helper_method :current_user
|
||||||
|
helper_method :manager_logged_in
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
@@ -22,7 +23,10 @@ class Management::BaseController < ActionController::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
def managed_user
|
def managed_user
|
||||||
@managed_user ||= Verification::Management::ManagedUser.find(session[:document_type], session[:document_number])
|
@managed_user ||= Verification::Management::ManagedUser.find(
|
||||||
|
session[:document_type],
|
||||||
|
session[:document_number]
|
||||||
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
def check_verified_user(alert_msg)
|
def check_verified_user(alert_msg)
|
||||||
@@ -49,4 +53,11 @@ class Management::BaseController < ActionController::Base
|
|||||||
def clear_password
|
def clear_password
|
||||||
session[:new_password] = nil
|
session[:new_password] = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def manager_logged_in
|
||||||
|
if current_manager
|
||||||
|
@manager_logged_in = User.find_by(id: session[:manager]["login"].last(1))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
24
app/controllers/moderation/budgets/investments_controller.rb
Normal file
24
app/controllers/moderation/budgets/investments_controller.rb
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
class Moderation::Budgets::InvestmentsController < Moderation::BaseController
|
||||||
|
include FeatureFlags
|
||||||
|
include ModerateActions
|
||||||
|
|
||||||
|
has_filters %w{pending_flag_review all with_ignored_flag}, only: :index
|
||||||
|
has_orders %w{flags created_at}, only: :index
|
||||||
|
|
||||||
|
feature_flag :budgets
|
||||||
|
|
||||||
|
before_action :load_resources, only: [:index, :moderate]
|
||||||
|
|
||||||
|
load_and_authorize_resource class: 'Budget::Investment'
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def resource_name
|
||||||
|
'budget_investment'
|
||||||
|
end
|
||||||
|
|
||||||
|
def resource_model
|
||||||
|
Budget::Investment
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
@@ -14,6 +14,7 @@ class StatsController < ApplicationController
|
|||||||
@debate_votes = daily_cache('debate_votes') { Vote.where(votable_type: 'Debate').count }
|
@debate_votes = daily_cache('debate_votes') { Vote.where(votable_type: 'Debate').count }
|
||||||
@proposal_votes = daily_cache('proposal_votes') { Vote.where(votable_type: 'Proposal').count }
|
@proposal_votes = daily_cache('proposal_votes') { Vote.where(votable_type: 'Proposal').count }
|
||||||
@comment_votes = daily_cache('comment_votes') { Vote.where(votable_type: 'Comment').count }
|
@comment_votes = daily_cache('comment_votes') { Vote.where(votable_type: 'Comment').count }
|
||||||
|
@investment_votes = daily_cache('budget_investment_votes') { Vote.where(votable_type: 'Budget::Investment').count }
|
||||||
@votes = daily_cache('votes') { Vote.count }
|
@votes = daily_cache('votes') { Vote.count }
|
||||||
|
|
||||||
@verified_users = daily_cache('verified_users') { User.with_hidden.level_two_or_three_verified.count }
|
@verified_users = daily_cache('verified_users') { User.with_hidden.level_two_or_three_verified.count }
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ class Users::SessionsController < Devise::SessionsController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def after_sign_out_path_for(resource)
|
def after_sign_out_path_for(resource)
|
||||||
request.referer.present? ? request.referer : super
|
request.referer.present? && !request.referer.match("management") ? request.referer : super
|
||||||
end
|
end
|
||||||
|
|
||||||
def verifying_via_email?
|
def verifying_via_email?
|
||||||
|
|||||||
@@ -1,19 +1,31 @@
|
|||||||
module AdminHelper
|
module AdminHelper
|
||||||
|
|
||||||
def side_menu
|
def side_menu
|
||||||
|
if namespace == 'moderation/budgets'
|
||||||
|
render "/moderation/menu"
|
||||||
|
else
|
||||||
render "/#{namespace}/menu"
|
render "/#{namespace}/menu"
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def namespaced_root_path
|
def namespaced_root_path
|
||||||
|
if namespace == 'moderation/budgets'
|
||||||
|
"/moderation"
|
||||||
|
else
|
||||||
"/#{namespace}"
|
"/#{namespace}"
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def namespaced_header_title
|
def namespaced_header_title
|
||||||
|
if namespace == 'moderation/budgets'
|
||||||
|
t("moderation.header.title")
|
||||||
|
else
|
||||||
t("#{namespace}.header.title")
|
t("#{namespace}.header.title")
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def menu_moderated_content?
|
def menu_moderated_content?
|
||||||
["proposals", "debates", "comments", "hidden_users", "activity"].include?(controller_name) && controller.class.parent != Admin::Legislation
|
["proposals", "debates", "comments", "hidden_users", "activity", "hidden_budget_investments"].include?(controller_name) && controller.class.parent != Admin::Legislation
|
||||||
end
|
end
|
||||||
|
|
||||||
def menu_budget?
|
def menu_budget?
|
||||||
@@ -21,11 +33,11 @@ module AdminHelper
|
|||||||
end
|
end
|
||||||
|
|
||||||
def menu_polls?
|
def menu_polls?
|
||||||
%w[polls questions answers].include?(controller_name)
|
%w[polls questions answers recounts results].include?(controller_name)
|
||||||
end
|
end
|
||||||
|
|
||||||
def menu_booths?
|
def menu_booths?
|
||||||
%w[officers booths officer_assignments booth_assignments recounts results shifts].include?(controller_name)
|
%w[officers booths shifts booth_assignments officer_assignments].include?(controller_name)
|
||||||
end
|
end
|
||||||
|
|
||||||
def menu_profiles?
|
def menu_profiles?
|
||||||
@@ -37,7 +49,7 @@ module AdminHelper
|
|||||||
end
|
end
|
||||||
|
|
||||||
def menu_customization?
|
def menu_customization?
|
||||||
["pages", "banners"].include?(controller_name) || menu_homepage?
|
["pages", "banners", "information_texts"].include?(controller_name) || menu_homepage?
|
||||||
end
|
end
|
||||||
|
|
||||||
def menu_homepage?
|
def menu_homepage?
|
||||||
|
|||||||
5
app/helpers/site_customization_helper.rb
Normal file
5
app/helpers/site_customization_helper.rb
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
module SiteCustomizationHelper
|
||||||
|
def site_customization_display_translation?(locale)
|
||||||
|
I18nContentTranslation.existing_languages.include?(neutral_locale(locale)) || locale == I18n.locale ? "" : "display: none"
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -52,8 +52,8 @@ module UsersHelper
|
|||||||
current_user && current_user.manager?
|
current_user && current_user.manager?
|
||||||
end
|
end
|
||||||
|
|
||||||
def show_admin_menu?
|
def show_admin_menu?(user = nil)
|
||||||
current_administrator? || current_moderator? || current_valuator? || current_manager?
|
current_administrator? || current_moderator? || current_valuator? || current_manager? || (user && user.administrator?)
|
||||||
end
|
end
|
||||||
|
|
||||||
def interests_title_text(user)
|
def interests_title_text(user)
|
||||||
|
|||||||
@@ -17,6 +17,9 @@ module Abilities
|
|||||||
can :restore, Legislation::Proposal
|
can :restore, Legislation::Proposal
|
||||||
cannot :restore, Legislation::Proposal, hidden_at: nil
|
cannot :restore, Legislation::Proposal, hidden_at: nil
|
||||||
|
|
||||||
|
can :restore, Budget::Investment
|
||||||
|
cannot :restore, Budget::Investment, hidden_at: nil
|
||||||
|
|
||||||
can :restore, User
|
can :restore, User
|
||||||
cannot :restore, User, hidden_at: nil
|
cannot :restore, User, hidden_at: nil
|
||||||
|
|
||||||
@@ -32,6 +35,9 @@ module Abilities
|
|||||||
can :confirm_hide, Legislation::Proposal
|
can :confirm_hide, Legislation::Proposal
|
||||||
cannot :confirm_hide, Legislation::Proposal, hidden_at: nil
|
cannot :confirm_hide, Legislation::Proposal, hidden_at: nil
|
||||||
|
|
||||||
|
can :confirm_hide, Budget::Investment
|
||||||
|
cannot :confirm_hide, Budget::Investment, hidden_at: nil
|
||||||
|
|
||||||
can :confirm_hide, User
|
can :confirm_hide, User
|
||||||
cannot :confirm_hide, User, hidden_at: nil
|
cannot :confirm_hide, User, hidden_at: nil
|
||||||
|
|
||||||
|
|||||||
@@ -46,6 +46,9 @@ module Abilities
|
|||||||
can [:flag, :unflag], Legislation::Proposal
|
can [:flag, :unflag], Legislation::Proposal
|
||||||
cannot [:flag, :unflag], Legislation::Proposal, author_id: user.id
|
cannot [:flag, :unflag], Legislation::Proposal, author_id: user.id
|
||||||
|
|
||||||
|
can [:flag, :unflag], Budget::Investment
|
||||||
|
cannot [:flag, :unflag], Budget::Investment, author_id: user.id
|
||||||
|
|
||||||
can [:create, :destroy], Follow
|
can [:create, :destroy], Follow
|
||||||
|
|
||||||
can [:destroy], Document, documentable: { author_id: user.id }
|
can [:destroy], Document, documentable: { author_id: user.id }
|
||||||
|
|||||||
@@ -63,6 +63,15 @@ module Abilities
|
|||||||
cannot :moderate, ProposalNotification, author_id: user.id
|
cannot :moderate, ProposalNotification, author_id: user.id
|
||||||
|
|
||||||
can :index, ProposalNotification
|
can :index, ProposalNotification
|
||||||
|
|
||||||
|
can :hide, Budget::Investment, hidden_at: nil
|
||||||
|
cannot :hide, Budget::Investment, author_id: user.id
|
||||||
|
|
||||||
|
can :ignore_flag, Budget::Investment, ignored_flag_at: nil, hidden_at: nil
|
||||||
|
cannot :ignore_flag, Budget::Investment, author_id: user.id
|
||||||
|
|
||||||
|
can :moderate, Budget::Investment
|
||||||
|
cannot :moderate, Budget::Investment, author_id: user.id
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ class Budget
|
|||||||
include Relationable
|
include Relationable
|
||||||
include Notifiable
|
include Notifiable
|
||||||
include Filterable
|
include Filterable
|
||||||
|
include Flaggable
|
||||||
|
|
||||||
belongs_to :author, -> { with_hidden }, class_name: 'User', foreign_key: 'author_id'
|
belongs_to :author, -> { with_hidden }, class_name: 'User', foreign_key: 'author_id'
|
||||||
belongs_to :heading
|
belongs_to :heading
|
||||||
@@ -81,6 +82,8 @@ class Budget
|
|||||||
scope :winners, -> { selected.compatible.where(winner: true) }
|
scope :winners, -> { selected.compatible.where(winner: true) }
|
||||||
scope :unselected, -> { not_unfeasible.where(selected: false) }
|
scope :unselected, -> { not_unfeasible.where(selected: false) }
|
||||||
scope :last_week, -> { where("created_at >= ?", 7.days.ago)}
|
scope :last_week, -> { where("created_at >= ?", 7.days.ago)}
|
||||||
|
scope :sort_by_flags, -> { order(flags_count: :desc, updated_at: :desc) }
|
||||||
|
scope :sort_by_created_at, -> { reorder(created_at: :desc) }
|
||||||
|
|
||||||
scope :by_budget, ->(budget) { where(budget: budget) }
|
scope :by_budget, ->(budget) { where(budget: budget) }
|
||||||
scope :by_group, ->(group_id) { where(group_id: group_id) }
|
scope :by_group, ->(group_id) { where(group_id: group_id) }
|
||||||
|
|||||||
11
app/models/i18n_content.rb
Normal file
11
app/models/i18n_content.rb
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
class I18nContent < ActiveRecord::Base
|
||||||
|
|
||||||
|
scope :by_key, -> (key){ where(key: key) }
|
||||||
|
scope :begins_with_key, -> (key){ where("key ILIKE ?", "#{key}?%") }
|
||||||
|
|
||||||
|
validates :key, uniqueness: true
|
||||||
|
|
||||||
|
translates :value, touch: true
|
||||||
|
globalize_accessors locales: [:en, :es, :fr, :nl]
|
||||||
|
|
||||||
|
end
|
||||||
5
app/models/i18n_content_translation.rb
Normal file
5
app/models/i18n_content_translation.rb
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
class I18nContentTranslation < ActiveRecord::Base
|
||||||
|
def self.existing_languages
|
||||||
|
self.select(:locale).uniq.map{ |l| l.locale.to_sym }.to_a
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
class SiteCustomization::Image < ActiveRecord::Base
|
class SiteCustomization::Image < ActiveRecord::Base
|
||||||
VALID_IMAGES = {
|
VALID_IMAGES = {
|
||||||
"icon_home" => [330, 240],
|
"icon_home" => [330, 240],
|
||||||
"logo_header" => [80, 80],
|
"logo_header" => [260, 80],
|
||||||
"social_media_icon" => [470, 246],
|
"social_media_icon" => [470, 246],
|
||||||
"social_media_icon_twitter" => [246, 246],
|
"social_media_icon_twitter" => [246, 246],
|
||||||
"apple-touch-icon-200" => [200, 200]
|
"apple-touch-icon-200" => [200, 200]
|
||||||
|
|||||||
@@ -182,6 +182,7 @@ class User < ActiveRecord::Base
|
|||||||
debates_ids = Debate.where(author_id: id).pluck(:id)
|
debates_ids = Debate.where(author_id: id).pluck(:id)
|
||||||
comments_ids = Comment.where(user_id: id).pluck(:id)
|
comments_ids = Comment.where(user_id: id).pluck(:id)
|
||||||
proposal_ids = Proposal.where(author_id: id).pluck(:id)
|
proposal_ids = Proposal.where(author_id: id).pluck(:id)
|
||||||
|
investment_ids = Budget::Investment.where(author_id: id).pluck(:id)
|
||||||
proposal_notification_ids = ProposalNotification.where(author_id: id).pluck(:id)
|
proposal_notification_ids = ProposalNotification.where(author_id: id).pluck(:id)
|
||||||
|
|
||||||
hide
|
hide
|
||||||
@@ -189,6 +190,7 @@ class User < ActiveRecord::Base
|
|||||||
Debate.hide_all debates_ids
|
Debate.hide_all debates_ids
|
||||||
Comment.hide_all comments_ids
|
Comment.hide_all comments_ids
|
||||||
Proposal.hide_all proposal_ids
|
Proposal.hide_all proposal_ids
|
||||||
|
Budget::Investment.hide_all investment_ids
|
||||||
ProposalNotification.hide_all proposal_notification_ids
|
ProposalNotification.hide_all proposal_notification_ids
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<strong><%= t("admin.menu.title_polls") %></strong>
|
<strong><%= t("admin.menu.title_polls") %></strong>
|
||||||
</a>
|
</a>
|
||||||
<ul id="polls_menu" <%= "class=is-active" if menu_polls? || controller.class.parent == Admin::Poll::Questions::Answers %>>
|
<ul id="polls_menu" <%= "class=is-active" if menu_polls? || controller.class.parent == Admin::Poll::Questions::Answers %>>
|
||||||
<li <%= "class=is-active" if controller_name == "polls" && action_name != "booth_assignments" %>>
|
<li <%= "class=is-active" if %w(polls recounts results).include?(controller_name) %>>
|
||||||
<%= link_to t("admin.menu.polls"), admin_polls_path %>
|
<%= link_to t("admin.menu.polls"), admin_polls_path %>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
<strong><%= t("admin.menu.title_booths") %></strong>
|
<strong><%= t("admin.menu.title_booths") %></strong>
|
||||||
</a>
|
</a>
|
||||||
<ul id="booths_menu" <%= "class=is-active" if menu_booths? || controller_name == "polls" && action_name == "booth_assignments" %>>
|
<ul id="booths_menu" <%= "class=is-active" if menu_booths? || controller_name == "polls" && action_name == "booth_assignments" %>>
|
||||||
<li <%= "class=is-active" if controller_name == "officers" %>>
|
<li <%= "class=is-active" if %w(officers officer_assignments).include?(controller_name) %>>
|
||||||
<%= link_to t("admin.menu.poll_officers"), admin_officers_path %>
|
<%= link_to t("admin.menu.poll_officers"), admin_officers_path %>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
@@ -35,12 +35,12 @@
|
|||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li <%= "class=is-active" if (controller_name == "polls" && action_name == "booth_assignments") ||
|
<li <%= "class=is-active" if (controller_name == "polls" && action_name == "booth_assignments") ||
|
||||||
(controller_name == "booth_assignments" && action_name == "manage") %>>
|
controller_name == "booth_assignments" %>>
|
||||||
<%= link_to t("admin.menu.poll_booth_assignments"), booth_assignments_admin_polls_path %>
|
<%= link_to t("admin.menu.poll_booth_assignments"), booth_assignments_admin_polls_path %>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li <%= "class=is-active" if %w(shifts booths).include?(controller_name) &&
|
<li <%= "class=is-active" if %w(shifts booths).include?(controller_name) &&
|
||||||
action_name == "available" %>>
|
%w(available new).include?(action_name) %>>
|
||||||
<%= link_to t("admin.menu.poll_shifts"), available_admin_booths_path %>
|
<%= link_to t("admin.menu.poll_shifts"), available_admin_booths_path %>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -110,7 +110,7 @@
|
|||||||
<ul <%= "class=is-active" if menu_customization? &&
|
<ul <%= "class=is-active" if menu_customization? &&
|
||||||
controller.class.parent != Admin::Poll::Questions::Answers %>>
|
controller.class.parent != Admin::Poll::Questions::Answers %>>
|
||||||
|
|
||||||
<li <%= "class=active" if menu_homepage? %>>
|
<li <%= "class=is-active" if menu_homepage? %>>
|
||||||
<%= link_to t("admin.menu.site_customization.homepage"), admin_homepage_path %>
|
<%= link_to t("admin.menu.site_customization.homepage"), admin_homepage_path %>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
@@ -121,6 +121,10 @@
|
|||||||
<li <%= "class=is-active" if controller_name == "banners" %>>
|
<li <%= "class=is-active" if controller_name == "banners" %>>
|
||||||
<%= link_to t("admin.menu.banner"), admin_banners_path %>
|
<%= link_to t("admin.menu.banner"), admin_banners_path %>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
<li <%= "class=is-active" if controller_name == "information_texts" %>>
|
||||||
|
<%= link_to t("admin.menu.site_customization.information_texts"), admin_site_customization_information_texts_path %>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
@@ -151,6 +155,12 @@
|
|||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
<% if feature?(:budgets) %>
|
||||||
|
<li <%= "class=is-active" if controller_name == "hidden_budget_investments" %>>
|
||||||
|
<%= link_to t("admin.menu.hidden_budget_investments"), admin_hidden_budget_investments_path %>
|
||||||
|
</li>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<li <%= "class=is-active" if controller_name == "comments" %>>
|
<li <%= "class=is-active" if controller_name == "comments" %>>
|
||||||
<%= link_to t("admin.menu.hidden_comments"), admin_comments_path %>
|
<%= link_to t("admin.menu.hidden_comments"), admin_comments_path %>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<th><%= t("admin.admin_notifications.index.title") %></th>
|
<th><%= t("admin.admin_notifications.index.title") %></th>
|
||||||
<th><%= t("admin.admin_notifications.index.segment_recipient") %></th>
|
<th><%= t("admin.admin_notifications.index.segment_recipient") %></th>
|
||||||
<th><%= t("admin.admin_notifications.index.sent") %></th>
|
<th><%= t("admin.admin_notifications.index.sent") %></th>
|
||||||
<th class="small-5 text-right"><%= t("admin.admin_notifications.index.actions") %></th>
|
<th class="small-5"><%= t("admin.admin_notifications.index.actions") %></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@@ -28,21 +28,29 @@
|
|||||||
<%= l admin_notification.sent_at.to_date %>
|
<%= l admin_notification.sent_at.to_date %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</td>
|
</td>
|
||||||
<td class="text-right">
|
<td>
|
||||||
<% if admin_notification.draft? %>
|
<% if admin_notification.draft? %>
|
||||||
|
<div class="small-4 column">
|
||||||
<%= link_to t("admin.admin_notifications.index.edit"),
|
<%= link_to t("admin.admin_notifications.index.edit"),
|
||||||
edit_admin_admin_notification_path(admin_notification),
|
edit_admin_admin_notification_path(admin_notification),
|
||||||
method: :get, class: "button hollow" %>
|
method: :get, class: "button expanded hollow" %>
|
||||||
|
</div>
|
||||||
|
<div class="small-4 column">
|
||||||
<%= link_to t("admin.admin_notifications.index.delete"),
|
<%= link_to t("admin.admin_notifications.index.delete"),
|
||||||
admin_admin_notification_path(admin_notification),
|
admin_admin_notification_path(admin_notification),
|
||||||
method: :delete, class: "button hollow alert" %>
|
method: :delete, class: "button expanded hollow alert" %>
|
||||||
|
</div>
|
||||||
|
<div class="small-4 column">
|
||||||
<%= link_to t("admin.admin_notifications.index.preview"),
|
<%= link_to t("admin.admin_notifications.index.preview"),
|
||||||
admin_admin_notification_path(admin_notification),
|
admin_admin_notification_path(admin_notification),
|
||||||
class: "button" %>
|
class: "button expanded" %>
|
||||||
|
</div>
|
||||||
<% else %>
|
<% else %>
|
||||||
|
<div class="small-4 column">
|
||||||
<%= link_to t("admin.admin_notifications.index.view"),
|
<%= link_to t("admin.admin_notifications.index.view"),
|
||||||
admin_admin_notification_path(admin_notification),
|
admin_admin_notification_path(admin_notification),
|
||||||
class: "button" %>
|
class: "button expanded" %>
|
||||||
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -2,9 +2,7 @@
|
|||||||
|
|
||||||
<h2><%= t("admin.admin_notifications.show.section_title") %></h2>
|
<h2><%= t("admin.admin_notifications.show.section_title") %></h2>
|
||||||
|
|
||||||
<div class="small-12 column">
|
<div class="small-12 column callout highlight">
|
||||||
<div class="callout highlight">
|
|
||||||
<div class="row">
|
|
||||||
<div class="small-12 medium-6 column">
|
<div class="small-12 medium-6 column">
|
||||||
<strong><%= t("admin.admin_notifications.show.sent_at") %></strong><br>
|
<strong><%= t("admin.admin_notifications.show.sent_at") %></strong><br>
|
||||||
<% if @admin_notification.draft? %>
|
<% if @admin_notification.draft? %>
|
||||||
@@ -13,23 +11,22 @@
|
|||||||
<%= l(@admin_notification.sent_at.to_date) %>
|
<%= l(@admin_notification.sent_at.to_date) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="small-12 medium-6 column">
|
<div class="small-12 medium-6 column">
|
||||||
<strong><%= t("admin.admin_notifications.show.title") %></strong><br>
|
<strong><%= t("admin.admin_notifications.show.title") %></strong><br>
|
||||||
<%= @admin_notification.title %>
|
<%= @admin_notification.title %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
|
|
||||||
<div class="small-12 medium-6 column">
|
<div class="small-12 medium-6 column">
|
||||||
<strong><%= t("admin.admin_notifications.show.body") %></strong><br>
|
<strong><%= t("admin.admin_notifications.show.body") %></strong><br>
|
||||||
<%= @admin_notification.body %>
|
<%= @admin_notification.body %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="small-12 medium-6 column">
|
<div class="small-12 medium-6 column">
|
||||||
<strong><%= t("admin.admin_notifications.show.link") %></strong><br>
|
<strong><%= t("admin.admin_notifications.show.link") %></strong><br>
|
||||||
<%= @admin_notification.link %>
|
<%= @admin_notification.link %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<div class="small-12 column">
|
<div class="small-12 column">
|
||||||
<strong><%= t("admin.admin_notifications.show.segment_recipient") %></strong><br>
|
<strong><%= t("admin.admin_notifications.show.segment_recipient") %></strong><br>
|
||||||
<%= segment_name(@admin_notification.segment_recipient) %>
|
<%= segment_name(@admin_notification.segment_recipient) %>
|
||||||
@@ -41,18 +38,17 @@
|
|||||||
n: @admin_notification.recipients_count) %>
|
n: @admin_notification.recipients_count) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<p class="help-text" id="phase-description-help-text">
|
<p class="help-text" id="phase-description-help-text">
|
||||||
<% if @admin_notification.draft? %>
|
<% if @admin_notification.draft? %>
|
||||||
<%= t("admin.admin_notifications.show.preview_guide") %>
|
<%= t("admin.admin_notifications.show.preview_guide") %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= t("admin.admin_notifications.show.sent_guide") %>
|
<%= t("admin.admin_notifications.show.sent_guide") %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</p>
|
</p>
|
||||||
<hr>
|
<hr>
|
||||||
<div class="admin_notification-body-content">
|
<div class="admin_notification-body-content">
|
||||||
<ul class="no-bullet clear notifications-list">
|
<ul class="no-bullet clear notifications-list">
|
||||||
<li class="notification unread">
|
<li class="notification unread">
|
||||||
<% locals = { notification: nil,
|
<% locals = { notification: nil,
|
||||||
@@ -63,15 +59,17 @@
|
|||||||
<%= link_to_if @admin_notification.link.present?, link_text, @admin_notification.link %>
|
<%= link_to_if @admin_notification.link.present?, link_text, @admin_notification.link %>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
|
||||||
<hr>
|
|
||||||
</div>
|
</div>
|
||||||
|
<hr>
|
||||||
|
|
||||||
<% if @admin_notification.draft? && @admin_notification.valid_segment_recipient? %>
|
<% if @admin_notification.draft? && @admin_notification.valid_segment_recipient? %>
|
||||||
|
<div class="small-12 medium-6 large-3 column end">
|
||||||
<%= link_to t("admin.admin_notifications.show.send"),
|
<%= link_to t("admin.admin_notifications.show.send"),
|
||||||
deliver_admin_admin_notification_path(@admin_notification),
|
deliver_admin_admin_notification_path(@admin_notification),
|
||||||
"data-alert": t("admin.admin_notifications.show.send_alert",
|
"data-alert": t("admin.admin_notifications.show.send_alert",
|
||||||
n: @admin_notification.list_of_recipients_count),
|
n: @admin_notification.list_of_recipients_count),
|
||||||
method: :post,
|
method: :post,
|
||||||
id: "js-send-admin_notification-alert",
|
id: "js-send-admin_notification-alert",
|
||||||
class: "button success" %>
|
class: "button success expanded" %>
|
||||||
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<%= link_to t("admin.banners.index.create"),
|
<%= link_to t("admin.banners.index.create"),
|
||||||
new_admin_banner_path, class: "button success float-right" %>
|
new_admin_banner_path, class: "button float-right" %>
|
||||||
|
|
||||||
<h2 class="inline-block"><%= t("admin.banners.index.title") %></h2>
|
<h2 class="inline-block"><%= t("admin.banners.index.title") %></h2>
|
||||||
|
|
||||||
@@ -13,14 +13,14 @@
|
|||||||
<tr id="<%= dom_id(banner) %>">
|
<tr id="<%= dom_id(banner) %>">
|
||||||
<th scope="col"><%= t("admin.banners.banner.post_started_at")%></th>
|
<th scope="col"><%= t("admin.banners.banner.post_started_at")%></th>
|
||||||
<th scope="col"><%= t("admin.banners.banner.post_ended_at")%></th>
|
<th scope="col"><%= t("admin.banners.banner.post_ended_at")%></th>
|
||||||
<th scope="col" class="text-center"><%= t("admin.actions.actions")%></th>
|
<th scope="col" class="small-4"><%= t("admin.actions.actions")%></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td><%= banner.post_started_at %></td>
|
<td><%= banner.post_started_at %></td>
|
||||||
<td><%= banner.post_ended_at %></td>
|
<td><%= banner.post_ended_at %></td>
|
||||||
<td class="text-right">
|
<td>
|
||||||
<div class="small-12 medium-6 column">
|
<div class="small-12 medium-6 column">
|
||||||
<%= link_to t("admin.banners.index.edit"), edit_admin_banner_path(banner),
|
<%= link_to t("admin.banners.index.edit"), edit_admin_banner_path(banner),
|
||||||
class: 'button hollow expanded' %>
|
class: 'button hollow expanded' %>
|
||||||
@@ -32,11 +32,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
|
||||||
<th colspan="3" scope="col" class="text-center"><%= t("admin.banners.index.preview") %></th>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="3">
|
<td colspan="3">
|
||||||
|
<span class="help-text"><%= t("admin.banners.index.preview") %></span>
|
||||||
<div class="banner" style="background-color:<%= banner.background_color %>">
|
<div class="banner" style="background-color:<%= banner.background_color %>">
|
||||||
<%= link_to banner.target_url do %>
|
<%= link_to banner.target_url do %>
|
||||||
<h2 style="color:<%= banner.font_color %>"><%= banner.title %></h2>
|
<h2 style="color:<%= banner.font_color %>"><%= banner.title %></h2>
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
<% init_advanced_menu %>
|
<% init_advanced_menu %>
|
||||||
<%= form_tag(admin_budget_budget_investments_path(budget: @budget), method: :get, enforce_utf8: false) do %>
|
<%= form_tag(admin_budget_budget_investments_path(budget: @budget), method: :get, enforce_utf8: false) do %>
|
||||||
<div class="row">
|
<div class="small-12 column">
|
||||||
<div class="small-12 medium-8 large-12 column">
|
|
||||||
<%= link_to "#advanced_filters_content",
|
<%= link_to "#advanced_filters_content",
|
||||||
data: {toggle: "advanced_filters"},
|
data: {toggle: "advanced_filters"},
|
||||||
class: "advanced-filters float-right clear" do %>
|
class: "advanced-filters float-right clear" do %>
|
||||||
<%= t("admin.budget_investments.index.advanced_filters") %>
|
<%= t("admin.budget_investments.index.advanced_filters") %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<div id="advanced_filters" class="row advanced-filters-content <%= advanced_menu_visibility %>" data-toggler=".hide">
|
<div id="advanced_filters" class="<%= advanced_menu_visibility %>" data-toggler=".hide">
|
||||||
<div class="small-12 medium-8 large-12 column">
|
<div class="small-12 column">
|
||||||
|
<div class="advanced-filters-content">
|
||||||
<% ["feasible", "selected", "undecided", "unfeasible"].each do |option| %>
|
<% ["feasible", "selected", "undecided", "unfeasible"].each do |option| %>
|
||||||
<div class="filter">
|
<div class="filter">
|
||||||
<%= check_box_tag "advanced_filters[]", option, params[:advanced_filters].index(option), id: "advanced_filters_#{option}" %>
|
<%= check_box_tag "advanced_filters[]", option, params[:advanced_filters].index(option), id: "advanced_filters_#{option}" %>
|
||||||
@@ -22,7 +22,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row" >
|
</div>
|
||||||
|
|
||||||
<div class="small-12 medium-3 column">
|
<div class="small-12 medium-3 column">
|
||||||
<%= select_tag :administrator_id,
|
<%= select_tag :administrator_id,
|
||||||
options_for_select(admin_select_options, params[:administrator_id]),
|
options_for_select(admin_select_options, params[:administrator_id]),
|
||||||
@@ -47,15 +48,14 @@
|
|||||||
{ prompt: t("admin.budget_investments.index.tags_filter_all"),
|
{ prompt: t("admin.budget_investments.index.tags_filter_all"),
|
||||||
label: false} %>
|
label: false} %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<div class="row" >
|
|
||||||
<div class="small-12 medium-6 column">
|
<div class="small-12 medium-6 column">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<%= text_field_tag :title_or_id, params["title_or_id"], placeholder: t("admin.budget_investments.index.placeholder") %>
|
<%= text_field_tag :title_or_id, params["title_or_id"], placeholder: t("admin.budget_investments.index.placeholder") %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="small-12 medium-6 column">
|
|
||||||
|
<div class="small-12 medium-3 column end">
|
||||||
<%= submit_tag t("admin.budget_investments.index.buttons.filter"), class: "button expanded" %>
|
<%= submit_tag t("admin.budget_investments.index.buttons.filter"), class: "button expanded" %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
<%= form_for [:admin, @phase.budget, @phase] do |f| %>
|
<%= form_for [:admin, @phase.budget, @phase] do |f| %>
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="row">
|
|
||||||
<div class="small-12 medium-6 column">
|
<div class="small-12 medium-6 column">
|
||||||
<%= f.label :starts_at, t("admin.budget_phases.edit.start_date") %>
|
<%= f.label :starts_at, t("admin.budget_phases.edit.start_date") %>
|
||||||
<%= f.text_field :starts_at,
|
<%= f.text_field :starts_at,
|
||||||
@@ -18,50 +16,44 @@
|
|||||||
id: "end_date",
|
id: "end_date",
|
||||||
label: false %>
|
label: false %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row margin-top">
|
<div class="small-12 column">
|
||||||
<div class="small-12 medium-12 column">
|
|
||||||
<%= f.label :description, t("admin.budget_phases.edit.description") %>
|
<%= f.label :description, t("admin.budget_phases.edit.description") %>
|
||||||
|
|
||||||
<p class="help-text" id="phase-description-help-text">
|
<span class="help-text" id="phase-description-help-text">
|
||||||
<%= t("admin.budget_phases.edit.description_help_text") %>
|
<%= t("admin.budget_phases.edit.description_help_text") %>
|
||||||
</p>
|
</span>
|
||||||
|
|
||||||
<%= f.cktext_area :description,
|
<%= f.cktext_area :description,
|
||||||
maxlength: Budget::Phase::DESCRIPTION_MAX_LENGTH,
|
maxlength: Budget::Phase::DESCRIPTION_MAX_LENGTH,
|
||||||
ckeditor: { language: I18n.locale },
|
ckeditor: { language: I18n.locale },
|
||||||
label: false %>
|
label: false %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row margin-top">
|
<div class="small-12 column margin-top">
|
||||||
<div class="small-12 medium-12 column">
|
|
||||||
<%= f.label :summary, t("admin.budget_phases.edit.summary") %>
|
<%= f.label :summary, t("admin.budget_phases.edit.summary") %>
|
||||||
|
|
||||||
<p class="help-text" id="phase-summary-help-text">
|
<span class="help-text" id="phase-summary-help-text">
|
||||||
<%= t("admin.budget_phases.edit.summary_help_text") %>
|
<%= t("admin.budget_phases.edit.summary_help_text") %>
|
||||||
</p>
|
</span>
|
||||||
|
|
||||||
<%= f.cktext_area :summary,
|
<%= f.cktext_area :summary,
|
||||||
maxlength: Budget::Phase::SUMMARY_MAX_LENGTH,
|
maxlength: Budget::Phase::SUMMARY_MAX_LENGTH,
|
||||||
ckeditor: { language: I18n.locale },
|
ckeditor: { language: I18n.locale },
|
||||||
label: false %>
|
label: false %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row margin-top">
|
|
||||||
<div class="small-12 medium-12 column">
|
<div class="small-12 column margin-top">
|
||||||
<%= f.check_box :enabled, label: t("admin.budget_phases.edit.enabled") %>
|
<%= f.check_box :enabled, label: t("admin.budget_phases.edit.enabled") %>
|
||||||
|
|
||||||
<p class="help-text" id="phase-summary-help-text">
|
<span class="help-text" id="phase-summary-help-text">
|
||||||
<%= t("admin.budget_phases.edit.enabled_help_text") %>
|
<%= t("admin.budget_phases.edit.enabled_help_text") %>
|
||||||
</p>
|
</span>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="margin-top">
|
<div class="small-12 medium-4 large-3 column end margin-top">
|
||||||
<%= f.submit t("admin.budget_phases.edit.save_changes"), class: "button success" %>
|
<%= f.submit t("admin.budget_phases.edit.save_changes"), class: "button success expanded" %>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
<%= back_link_to edit_admin_budget_path(@phase.budget) %>
|
<%= back_link_to edit_admin_budget_path(@phase.budget) %>
|
||||||
|
|
||||||
<h2><%= t("admin.budgets.edit.title") %> - <%= t("budgets.phase.#{@phase.kind}") %></h2>
|
<div class="small-12 column">
|
||||||
|
<h2><%= t("admin.budgets.edit.title") %> - <%= t("budgets.phase.#{@phase.kind}") %></h2>
|
||||||
|
</div>
|
||||||
|
|
||||||
<%= render '/admin/budget_phases/form' %>
|
<%= render '/admin/budget_phases/form' %>
|
||||||
|
|||||||
@@ -1,18 +1,21 @@
|
|||||||
<%= form_for [:admin, @budget] do |f| %>
|
<%= form_for [:admin, @budget] do |f| %>
|
||||||
|
|
||||||
<%= f.text_field :name, maxlength: Budget.title_max_length %>
|
|
||||||
|
|
||||||
<div class="row margin-top">
|
|
||||||
<div class="small-12 medium-9 column">
|
<div class="small-12 medium-9 column">
|
||||||
|
<%= f.text_field :name, maxlength: Budget.title_max_length %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="margin-top">
|
||||||
|
<div class="small-12 medium-6 column">
|
||||||
<%= f.select :phase, budget_phases_select_options, selected: "drafting" %>
|
<%= f.select :phase, budget_phases_select_options, selected: "drafting" %>
|
||||||
</div>
|
</div>
|
||||||
<div class="small-12 medium-3 column">
|
<div class="small-12 medium-3 column end">
|
||||||
<%= f.select :currency_symbol, budget_currency_symbol_select_options %>
|
<%= f.select :currency_symbol, budget_currency_symbol_select_options %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<% if @budget.phases.present? %>
|
<% if @budget.phases.present? %>
|
||||||
<table id='budget-phases-table' class="table-for-mobile">
|
<div class="small-12 column">
|
||||||
|
<table id="budget-phases-table" class="table-for-mobile">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th><%= t("admin.budgets.edit.phase") %></th>
|
<th><%= t("admin.budgets.edit.phase") %></th>
|
||||||
@@ -45,15 +48,18 @@
|
|||||||
<td>
|
<td>
|
||||||
<%= link_to t("admin.budgets.edit.edit_phase"),
|
<%= link_to t("admin.budgets.edit.edit_phase"),
|
||||||
edit_admin_budget_budget_phase_path(@budget, phase),
|
edit_admin_budget_budget_phase_path(@budget, phase),
|
||||||
method: :get, class: "button hollow" %>
|
method: :get, class: "button hollow expanded" %>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
</table>
|
</table>
|
||||||
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<div class="margin-top">
|
<div class="small-12 column">
|
||||||
|
<div class="clear small-12 medium-4 large-3 inline-block">
|
||||||
<%= f.submit nil, class: "button success" %>
|
<%= f.submit nil, class: "button success" %>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="float-right">
|
<div class="float-right">
|
||||||
<% if @budget.balloting_process? %>
|
<% if @budget.balloting_process? %>
|
||||||
@@ -72,9 +78,9 @@
|
|||||||
<%= link_to t("admin.budgets.edit.delete"),
|
<%= link_to t("admin.budgets.edit.delete"),
|
||||||
admin_budget_path(@budget),
|
admin_budget_path(@budget),
|
||||||
method: :delete,
|
method: :delete,
|
||||||
class: "button hollow alert float-right margin-left" %>
|
class: "delete float-right margin-left" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
<%= t("admin.budgets.form.max_votable_headings")%>
|
<%= t("admin.budgets.form.max_votable_headings")%>
|
||||||
<%= content_tag(:strong,
|
<%= content_tag(:strong,
|
||||||
t('admin.budgets.form.current_of_max_headings', current: current, max: max ),
|
t("admin.budgets.form.current_of_max_headings", current: current, max: max),
|
||||||
class:"current-of-max-headings") %>
|
class: "current-of-max-headings") %>
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
<%= back_link_to admin_budgets_path %>
|
<%= back_link_to admin_budgets_path %>
|
||||||
|
|
||||||
<h2><%= t("admin.budgets.edit.title") %></h2>
|
<div class="small-12 column">
|
||||||
|
<h2><%= t("admin.budgets.edit.title") %></h2>
|
||||||
|
</div>
|
||||||
|
|
||||||
<%= render '/admin/budgets/form' %>
|
<%= render '/admin/budgets/form' %>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
<%= link_to t("admin.budgets.index.new_link"),
|
<%= link_to t("admin.budgets.index.new_link"),
|
||||||
new_admin_budget_path,
|
new_admin_budget_path,
|
||||||
class: "button float-right margin-right" %>
|
class: "button float-right" %>
|
||||||
|
|
||||||
<%= render 'shared/filter_subnav', i18n_namespace: "admin.budgets.index" %>
|
<%= render 'shared/filter_subnav', i18n_namespace: "admin.budgets.index" %>
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
<div class="row">
|
<div class="small-12 column">
|
||||||
<div class="small-12 medium-9 column">
|
|
||||||
<h2><%= t("admin.budgets.new.title") %></h2>
|
<h2><%= t("admin.budgets.new.title") %></h2>
|
||||||
|
|
||||||
<%= render '/admin/budgets/form' %>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<%= render '/admin/budgets/form' %>
|
||||||
|
|||||||
@@ -1,9 +1,3 @@
|
|||||||
<div class="float-right">
|
|
||||||
<%= link_to root_path do %>
|
|
||||||
<%= t("admin.dashboard.index.back", org: setting['org_name']) %>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<h2 class="title inline-block"><%= t("admin.dashboard.index.title") %></h2>
|
<h2 class="title inline-block"><%= t("admin.dashboard.index.title") %></h2>
|
||||||
|
|
||||||
<p><%= t("admin.dashboard.index.description", org: setting['org_name']) %></p>
|
<p><%= t("admin.dashboard.index.description", org: setting['org_name']) %></p>
|
||||||
|
|||||||
@@ -5,15 +5,13 @@
|
|||||||
method: :get,
|
method: :get,
|
||||||
id: "admin_download_emails" do %>
|
id: "admin_download_emails" do %>
|
||||||
|
|
||||||
<label><%= t('admin.emails_download.index.download_segment') %></label>
|
<label><%= t("admin.emails_download.index.download_segment") %></label>
|
||||||
<p class="help-text" id="emails-help-text">
|
<p class="help-text" id="emails-help-text">
|
||||||
<%= t('admin.emails_download.index.download_segment_help_text') %>
|
<%= t("admin.emails_download.index.download_segment_help_text") %>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<%= select_tag :users_segment, options_for_select(user_segments_options) %>
|
<%= select_tag :users_segment, options_for_select(user_segments_options) %>
|
||||||
|
|
||||||
<div class="margin-top">
|
<%= submit_tag t("admin.emails_download.index.download_emails_button"), class: "button" %>
|
||||||
<%= submit_tag t('admin.emails_download.index.download_emails_button'), class: "button" %>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
<% if @geozone.errors.any? %>
|
<% if @geozone.errors.any? %>
|
||||||
|
|
||||||
<div id="error_explanation" data-alert class="callout alert" data-closable>
|
<div id="error_explanation" data-alert class="callout alert" data-closable>
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
<%= render 'errors' %>
|
<%= render 'errors' %>
|
||||||
|
|
||||||
<div clas="row">
|
|
||||||
<div class="small-12 medium-6 large-4 column">
|
<div class="small-12 medium-6 large-4 column">
|
||||||
<%= f.label :name, t("admin.geozones.geozone.name") %>
|
<%= f.label :name, t("admin.geozones.geozone.name") %>
|
||||||
<%= f.text_field :name, label: false %>
|
<%= f.text_field :name, label: false %>
|
||||||
@@ -19,11 +18,8 @@
|
|||||||
<%= f.label :census_code, t("admin.geozones.geozone.census_code") %>
|
<%= f.label :census_code, t("admin.geozones.geozone.census_code") %>
|
||||||
<%= f.text_field :census_code, label: false %>
|
<%= f.text_field :census_code, label: false %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row">
|
<div class="small-12 large-3 medium-3 column end">
|
||||||
<div class="actions small-12 large-3 medium-3 column">
|
<%= f.submit(class: "button success expanded", value: t("admin.geozones.edit.form.submit_button")) %>
|
||||||
<%= f.submit(class: "button expanded", value: t("admin.geozones.edit.form.submit_button")) %>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
<div class="row">
|
<%= back_link_to admin_geozones_path, t("admin.geozones.edit.back") %>
|
||||||
<div class="small-12 column">
|
|
||||||
<%= back_link_to admin_geozones_path, t("admin.geozones.edit.back") %>
|
|
||||||
|
|
||||||
<h1><%= t("admin.geozones.edit.editing") %></h1>
|
<div class="small-12 column">
|
||||||
|
<h2><%= t("admin.geozones.edit.editing") %></h2>
|
||||||
<%= render "form" %>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<%= render 'form' %>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<%= link_to t("admin.geozones.index.create"),
|
<%= link_to t("admin.geozones.index.create"),
|
||||||
new_admin_geozone_path, class: "button success float-right" %>
|
new_admin_geozone_path, class: "button float-right" %>
|
||||||
|
|
||||||
<h2 class="inline-block"><%= t("admin.geozones.index.title") %></h2>
|
<h2 class="inline-block"><%= t("admin.geozones.index.title") %></h2>
|
||||||
|
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
<th><%= t("admin.geozones.geozone.external_code") %></th>
|
<th><%= t("admin.geozones.geozone.external_code") %></th>
|
||||||
<th><%= t("admin.geozones.geozone.census_code") %></th>
|
<th><%= t("admin.geozones.geozone.census_code") %></th>
|
||||||
<th><%= t("admin.geozones.geozone.coordinates") %></th>
|
<th><%= t("admin.geozones.geozone.coordinates") %></th>
|
||||||
<th colspan="2"></th>
|
<th><%= t("admin.actions.actions") %></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
@@ -22,10 +22,17 @@
|
|||||||
<td><%= geozone.census_code %></td>
|
<td><%= geozone.census_code %></td>
|
||||||
<td class="break"><%= geozone.html_map_coordinates %></td>
|
<td class="break"><%= geozone.html_map_coordinates %></td>
|
||||||
<td>
|
<td>
|
||||||
<%= link_to t("admin.geozones.index.edit"), edit_admin_geozone_path(geozone), class: 'edit-banner button hollow' %>
|
<div class="small-6 column">
|
||||||
</td>
|
<%= link_to t("admin.geozones.index.edit"),
|
||||||
<td>
|
edit_admin_geozone_path(geozone),
|
||||||
<%= link_to t("admin.geozones.index.delete"), admin_geozone_path(geozone), method: :delete, class: 'button hollow alert' %>
|
class: "button hollow expanded" %>
|
||||||
|
</div>
|
||||||
|
<div class="small-6 column">
|
||||||
|
<%= link_to t("admin.geozones.index.delete"),
|
||||||
|
admin_geozone_path(geozone),
|
||||||
|
method: :delete,
|
||||||
|
class: "button hollow alert expanded" %>
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
<div class="geozone-new row">
|
<%= back_link_to admin_geozones_path, t("admin.geozones.new.back") %>
|
||||||
<div class="small-12 column">
|
|
||||||
<%= back_link_to admin_geozones_path, t("admin.geozones.new.back") %>
|
|
||||||
|
|
||||||
<h1><%= t("admin.geozones.new.creating") %></h1>
|
<div class="small-12 column">
|
||||||
|
<h2><%= t("admin.geozones.new.creating") %></h2>
|
||||||
<%= render "form" %>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<%= render 'form' %>
|
||||||
|
|||||||
49
app/views/admin/hidden_budget_investments/index.html.erb
Normal file
49
app/views/admin/hidden_budget_investments/index.html.erb
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
<h2><%= t("admin.hidden_budget_investments.index.title") %></h2>
|
||||||
|
<p><%= t("admin.shared.moderated_content") %></p>
|
||||||
|
|
||||||
|
<%= render 'shared/filter_subnav', i18n_namespace: "admin.hidden_budget_investments.index" %>
|
||||||
|
|
||||||
|
<% if @investments.any? %>
|
||||||
|
<h3 class="margin"><%= page_entries_info @investments %></h3>
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<th scope="col"><%= t("admin.shared.title") %></th>
|
||||||
|
<th scope="col" class="small-6"><%= t("admin.shared.description") %></th>
|
||||||
|
<th scope="col" class="small-4"><%= t("admin.shared.actions") %></th>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<% @investments.each do |investment| %>
|
||||||
|
<tr id="<%= dom_id(investment) %>">
|
||||||
|
<td class="align-top">
|
||||||
|
<strong><%= investment.title %></strong>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<div class="moderation-description">
|
||||||
|
<%= investment.description %>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td class="align-top">
|
||||||
|
<%= link_to t("admin.actions.restore"),
|
||||||
|
restore_admin_hidden_budget_investment_path(investment, request.query_parameters),
|
||||||
|
method: :put,
|
||||||
|
data: { confirm: t("admin.actions.confirm") },
|
||||||
|
class: "button hollow warning" %>
|
||||||
|
<% unless investment.confirmed_hide? %>
|
||||||
|
<%= link_to t("admin.actions.confirm_hide"),
|
||||||
|
confirm_hide_admin_hidden_budget_investment_path(investment, request.query_parameters),
|
||||||
|
method: :put,
|
||||||
|
class: "button" %>
|
||||||
|
<% end %>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<% end %>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<%= paginate @investments %>
|
||||||
|
<% else %>
|
||||||
|
<div class="callout primary margin">
|
||||||
|
<%= t("admin.hidden_budget_investments.index.no_hidden_budget_investments") %>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
@@ -13,57 +13,45 @@
|
|||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<div class="row">
|
<div class="small-12 medium-9 column">
|
||||||
<div class="small-12 medium-4 column">
|
|
||||||
<%= f.label :title %>
|
<%= f.label :title %>
|
||||||
</div>
|
<%= f.text_field :title, label: false, placeholder: t("admin.legislation.draft_versions.form.title_placeholder") %>
|
||||||
<div class="small-12 medium-8 column">
|
|
||||||
<%= f.text_field :title, label: false, placeholder: t('admin.legislation.draft_versions.form.title_placeholder') %>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="small-12 medium-9 column">
|
||||||
<div class="small-12 medium-4 column">
|
|
||||||
<%= f.label :changelog %>
|
<%= f.label :changelog %>
|
||||||
<small><%= t('admin.legislation.draft_versions.form.use_markdown') %></small>
|
<span class="help-text"><%= t("admin.legislation.draft_versions.form.use_markdown") %></span>
|
||||||
</div>
|
<%= f.text_area :changelog, label: false, rows: 5, placeholder: t("admin.legislation.draft_versions.form.changelog_placeholder") %>
|
||||||
<div class="small-12 medium-8 column">
|
|
||||||
<%= f.text_area :changelog, label: false, rows: 5, placeholder: t('admin.legislation.draft_versions.form.changelog_placeholder') %>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="small-12 medium-9 column">
|
||||||
<div class="small-12 medium-4 column">
|
|
||||||
<%= f.label :status %>
|
<%= f.label :status %>
|
||||||
</div>
|
|
||||||
<div class="small-12 medium-8 column">
|
|
||||||
<% ::Legislation::DraftVersion::VALID_STATUSES.each do |status| %>
|
<% ::Legislation::DraftVersion::VALID_STATUSES.each do |status| %>
|
||||||
<%= f.radio_button :status, status, label: false %>
|
<%= f.radio_button :status, status, label: false %>
|
||||||
<%= f.label "status_#{status}", t("admin.legislation.draft_versions.statuses.#{status}") %>
|
<%= f.label "status_#{status}", t("admin.legislation.draft_versions.statuses.#{status}") %>
|
||||||
<small><%= t("admin.legislation.draft_versions.form.hints.status.#{status}") %></small>
|
<span class="help-text"><%= t("admin.legislation.draft_versions.form.hints.status.#{status}") %></span>
|
||||||
<br/>
|
<br>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row">
|
<div class="small-12 medium-9 column">
|
||||||
<div class="small-12 medium-4 column">
|
|
||||||
<%= f.label :final_version %>
|
<%= f.label :final_version %>
|
||||||
</div>
|
|
||||||
<div class="small-12 medium-8 column">
|
|
||||||
<%= f.check_box :final_version, label: false %>
|
<%= f.check_box :final_version, label: false %>
|
||||||
<small><%= t("admin.legislation.draft_versions.form.hints.final_version") %></small>
|
<span class="help-text"><%= t("admin.legislation.draft_versions.form.hints.final_version") %></span>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="small-12 medium-4 column">
|
<div class="small-12 medium-4 column">
|
||||||
<%= f.label :body %>
|
<%= f.label :body %>
|
||||||
<small><%= t('admin.legislation.draft_versions.form.use_markdown') %></small>
|
<span class="help-text"><%= t("admin.legislation.draft_versions.form.use_markdown") %></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="markdown-editor">
|
|
||||||
|
<div class="markdown-editor clear">
|
||||||
<div class="small-12 medium-8 column fullscreen-container">
|
<div class="small-12 medium-8 column fullscreen-container">
|
||||||
<div class="markdown-editor-header truncate"><%= t('admin.legislation.draft_versions.form.title_html', draft_version_title: @draft_version.title, process_title: @process.title ) %></div>
|
<div class="markdown-editor-header truncate">
|
||||||
|
<%= t("admin.legislation.draft_versions.form.title_html",
|
||||||
|
draft_version_title: @draft_version.title,
|
||||||
|
process_title: @process.title ) %>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="markdown-editor-buttons">
|
<div class="markdown-editor-buttons">
|
||||||
<%= f.submit(class: "button", value: t("admin.legislation.draft_versions.#{admin_submit_action(@draft_version)}.submit_button")) %>
|
<%= f.submit(class: "button", value: t("admin.legislation.draft_versions.#{admin_submit_action(@draft_version)}.submit_button")) %>
|
||||||
@@ -77,16 +65,14 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<div class="small-12 medium-6 column markdown-area">
|
<div class="small-12 medium-6 column markdown-area">
|
||||||
<%= f.text_area :body, label: false, placeholder: t('admin.legislation.draft_versions.form.body_placeholder') %>
|
<%= f.text_area :body, label: false, placeholder: t("admin.legislation.draft_versions.form.body_placeholder") %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="markdown-preview" class="small-12 medium-6 column markdown-preview">
|
<div id="markdown-preview" class="small-12 medium-6 column markdown-preview">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row margin-top primary-buttons">
|
<div class="small-12 medium-3 column clear end margin-top">
|
||||||
<div class="actions small-12 medium-3 column legislation-process-save">
|
<%= f.submit(class: "button success expanded", value: t("admin.legislation.draft_versions.#{admin_submit_action(@draft_version)}.submit_button")) %>
|
||||||
<%= f.submit(class: "button expanded", value: t("admin.legislation.draft_versions.#{admin_submit_action(@draft_version)}.submit_button")) %>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<% provide :title do %>
|
<% provide :title do %>
|
||||||
Admin - <%= t("admin.menu.legislation") %> - <%= @process.title %> - <%= t("admin.legislation.draft_versions.index.title") %> - <%= @draft_version.title %>
|
<%= t("admin.header.title") %> - <%= t("admin.menu.legislation") %> - <%= @process.title %> - <%= t("admin.legislation.draft_versions.index.title") %> - <%= @draft_version.title %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<div class="legislation-admin legislation-draft-versions-edit legislation-draft-versions-form row">
|
<div class="legislation-draft-versions-edit legislation-draft-versions-form">
|
||||||
<div class="small-12 column">
|
<div class="small-12 column">
|
||||||
<%= back_link_to admin_legislation_process_draft_versions_path(@process),
|
<%= back_link_to admin_legislation_process_draft_versions_path(@process),
|
||||||
t("admin.legislation.draft_versions.edit.back") %>
|
t("admin.legislation.draft_versions.edit.back") %>
|
||||||
@@ -11,17 +11,16 @@
|
|||||||
|
|
||||||
<%= render 'admin/legislation/processes/subnav', process: @process, active: 'draft_versions' %>
|
<%= render 'admin/legislation/processes/subnav', process: @process, active: 'draft_versions' %>
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="small-12 column">
|
<div class="small-12 column">
|
||||||
<div class="callout warning" style="display: none;">
|
<div class="callout warning" style="display: none;">
|
||||||
<%= t("admin.legislation.draft_versions.edit.warning") %>
|
<%= t("admin.legislation.draft_versions.edit.warning") %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="small-12 medium-9 column">
|
<div class="small-12 column">
|
||||||
<h3><%= @draft_version.title %></h3>
|
<h3 class="inline-block"><%= @draft_version.title %></h3>
|
||||||
</div>
|
|
||||||
<div class="small-12 medium-3 column legislation-question-delete">
|
<div class="float-right">
|
||||||
<%= link_to t("admin.legislation.draft_versions.index.delete"),
|
<%= link_to t("admin.legislation.draft_versions.index.delete"),
|
||||||
admin_legislation_process_draft_version_path(@process, @draft_version),
|
admin_legislation_process_draft_version_path(@process, @draft_version),
|
||||||
method: :delete,
|
method: :delete,
|
||||||
|
|||||||
@@ -1,24 +1,21 @@
|
|||||||
<% provide :title do %>
|
<% provide :title do %>
|
||||||
Admin - <%= t("admin.menu.legislation") %> - <%= @process.title %> - <%= t("admin.legislation.draft_versions.index.title") %>
|
<%= t("admin.header.title") %> - <%= t("admin.menu.legislation") %> - <%= @process.title %> - <%= t("admin.legislation.draft_versions.index.title") %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<div class="legislation-admin legislation-draft-versions-index row">
|
<div class="legislation-draft-versions-index">
|
||||||
<div class="small-12 column">
|
|
||||||
<%= back_link_to admin_legislation_processes_path, t("admin.legislation.processes.edit.back") %>
|
<%= back_link_to admin_legislation_processes_path, t("admin.legislation.processes.edit.back") %>
|
||||||
|
|
||||||
<h2><%= @process.title %></h2>
|
<h2><%= @process.title %></h2>
|
||||||
|
|
||||||
<%= render 'admin/legislation/processes/subnav', process: @process, active: 'draft_versions' %>
|
<%= render 'admin/legislation/processes/subnav', process: @process, active: 'draft_versions' %>
|
||||||
|
|
||||||
<div class="row">
|
<div class="small-12 column">
|
||||||
<div class="small-12 medium-9 column">
|
<h4 class="inline-block"><%= t("admin.legislation.draft_versions.index.title") %></h4>
|
||||||
<h4><%= t("admin.legislation.draft_versions.index.title") %></h4>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="small-12 medium-3 column legislation-process-version">
|
<div class="float-right">
|
||||||
<%= link_to t("admin.legislation.draft_versions.index.create"), new_admin_legislation_process_draft_version_path, class: "button" %>
|
<%= link_to t("admin.legislation.draft_versions.index.create"), new_admin_legislation_process_draft_version_path, class: "button" %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<% if @process.draft_versions.any? %>
|
<% if @process.draft_versions.any? %>
|
||||||
<table class="stack">
|
<table class="stack">
|
||||||
@@ -27,8 +24,8 @@
|
|||||||
<th><%= t("admin.legislation.draft_versions.table.title") %></th>
|
<th><%= t("admin.legislation.draft_versions.table.title") %></th>
|
||||||
<th><%= t("admin.legislation.draft_versions.table.created_at") %></th>
|
<th><%= t("admin.legislation.draft_versions.table.created_at") %></th>
|
||||||
<th><%= t("admin.legislation.draft_versions.table.status") %></th>
|
<th><%= t("admin.legislation.draft_versions.table.status") %></th>
|
||||||
<th><%= t("admin.legislation.draft_versions.table.comments") %></th>
|
<th class="text-center"><%= t("admin.legislation.draft_versions.table.comments") %></th>
|
||||||
<th><%= t("admin.legislation.draft_versions.table.final_version") %></th>
|
<th class="text-center"><%= t("admin.legislation.draft_versions.table.final_version") %></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@@ -46,8 +43,8 @@
|
|||||||
<%= t("admin.legislation.draft_versions.statuses.published") %>
|
<%= t("admin.legislation.draft_versions.statuses.published") %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</td>
|
</td>
|
||||||
<td><%= draft_version.total_comments %></td>
|
<td class="text-center"><%= draft_version.total_comments %></td>
|
||||||
<td>
|
<td class="text-center">
|
||||||
<% if draft_version.final_version %>
|
<% if draft_version.final_version %>
|
||||||
<span class="icon-check" title="<%= draft_version.final_version %>"></span>
|
<span class="icon-check" title="<%= draft_version.final_version %>"></span>
|
||||||
<% else %>
|
<% else %>
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<% provide :title do %>
|
<% provide :title do %>
|
||||||
Admin - <%= t("admin.menu.legislation") %> - <%= @process.title %> - <%= t("admin.legislation.draft_versions.index.title") %> - <%= t("admin.legislation.draft_versions.new.title") %>
|
<%= t("admin.header.title") %> - <%= t("admin.menu.legislation") %> - <%= @process.title %> - <%= t("admin.legislation.draft_versions.index.title") %> - <%= t("admin.legislation.draft_versions.new.title") %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<div class="legislation-admin legislation-draft-versions-new legislation-draft-versions-form row">
|
<div class="legislation-draft-versions-new legislation-draft-versions-form">
|
||||||
<div class="small-12 column">
|
<div class="small-12 column">
|
||||||
<%= back_link_to admin_legislation_process_draft_versions_path(@process),
|
<%= back_link_to admin_legislation_process_draft_versions_path(@process),
|
||||||
t("admin.legislation.draft_versions.new.back") %>
|
t("admin.legislation.draft_versions.new.back") %>
|
||||||
@@ -11,11 +11,9 @@
|
|||||||
|
|
||||||
<%= render 'admin/legislation/processes/subnav', process: @process, active: 'draft_versions' %>
|
<%= render 'admin/legislation/processes/subnav', process: @process, active: 'draft_versions' %>
|
||||||
|
|
||||||
<div class="row">
|
<div class="small-12 column">
|
||||||
<div class="small-12 medium-9 column">
|
|
||||||
<h3><%= t("admin.legislation.draft_versions.new.title") %></h3>
|
<h3><%= t("admin.legislation.draft_versions.new.title") %></h3>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<%= render 'form', url: admin_legislation_process_draft_versions_path(@process) %>
|
<%= render 'form', url: admin_legislation_process_draft_versions_path(@process) %>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -15,236 +15,197 @@
|
|||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="small-12 medium-4 column">
|
<div class="small-12 medium-4 column">
|
||||||
<label><%= t('admin.legislation.processes.form.process') %></label>
|
<label><%= t("admin.legislation.processes.form.process") %></label>
|
||||||
</div>
|
</div>
|
||||||
<div class="small-12 medium-1 column legislation-process-start">
|
|
||||||
<%= t('admin.legislation.processes.form.start') %>
|
<div class="small-12 medium-3 column">
|
||||||
</div>
|
<%= f.label :start_date, t("admin.legislation.processes.form.start") %>
|
||||||
<div class="small-12 medium-2 column">
|
|
||||||
<%= f.text_field :start_date,
|
<%= f.text_field :start_date,
|
||||||
label: false,
|
label: false,
|
||||||
value: format_date_for_calendar_form(@process.start_date),
|
value: format_date_for_calendar_form(@process.start_date),
|
||||||
class: "js-calendar-full",
|
class: "js-calendar-full",
|
||||||
id: "start_date" %>
|
id: "start_date" %>
|
||||||
</div>
|
</div>
|
||||||
<div class="small-12 medium-1 column legislation-process-end">
|
|
||||||
<%= t('admin.legislation.processes.form.end') %>
|
<div class="small-12 medium-3 column">
|
||||||
</div>
|
<%= f.label :end_date, t("admin.legislation.processes.form.end") %>
|
||||||
<div class="small-12 medium-2 column">
|
|
||||||
<%= f.text_field :end_date,
|
<%= f.text_field :end_date,
|
||||||
label: false,
|
label: false,
|
||||||
value: format_date_for_calendar_form(@process.end_date),
|
value: format_date_for_calendar_form(@process.end_date),
|
||||||
class: "js-calendar-full",
|
class: "js-calendar-full",
|
||||||
id: "end_date" %>
|
id: "end_date" %>
|
||||||
</div>
|
</div>
|
||||||
<div class="small-12 medium-2 column">
|
<div class="small-12 medium-2 column margin-top">
|
||||||
<%= f.check_box :published, checked: @process.published?, label: t('admin.legislation.processes.form.enabled') %>
|
<%= f.check_box :published, checked: @process.published?, label: t("admin.legislation.processes.form.enabled") %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="small-12 column">
|
<div class="small-12 column">
|
||||||
<hr>
|
<hr>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="small-12 medium-4 column">
|
||||||
|
<label><%= t("admin.legislation.processes.form.debate_phase") %></label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="small-12 medium-3 column">
|
||||||
<div class="small-12 medium-4 column">
|
<%= f.label :debate_start_date, t("admin.legislation.processes.form.start") %>
|
||||||
<label><%= t('admin.legislation.processes.form.debate_phase') %></label>
|
|
||||||
</div>
|
|
||||||
<div class="small-12 medium-1 column legislation-process-start">
|
|
||||||
<%= t('admin.legislation.processes.form.start') %>
|
|
||||||
</div>
|
|
||||||
<div class="small-12 medium-2 column">
|
|
||||||
<%= f.text_field :debate_start_date,
|
<%= f.text_field :debate_start_date,
|
||||||
label: false,
|
label: false,
|
||||||
value: format_date_for_calendar_form(@process.debate_start_date),
|
value: format_date_for_calendar_form(@process.debate_start_date),
|
||||||
class: "js-calendar-full",
|
class: "js-calendar-full",
|
||||||
id: "debate_start_date" %>
|
id: "debate_start_date" %>
|
||||||
</div>
|
</div>
|
||||||
<div class="small-12 medium-1 column legislation-process-end">
|
|
||||||
<%= t('admin.legislation.processes.form.end') %>
|
<div class="small-12 medium-3 column">
|
||||||
</div>
|
<%= f.label :debate_end_date, t("admin.legislation.processes.form.end") %>
|
||||||
<div class="small-12 medium-2 column">
|
|
||||||
<%= f.text_field :debate_end_date,
|
<%= f.text_field :debate_end_date,
|
||||||
label: false,
|
label: false,
|
||||||
value: format_date_for_calendar_form(@process.debate_end_date),
|
value: format_date_for_calendar_form(@process.debate_end_date),
|
||||||
class: "js-calendar-full",
|
class: "js-calendar-full",
|
||||||
id: "debate_end_date" %>
|
id: "debate_end_date" %>
|
||||||
</div>
|
</div>
|
||||||
<div class="small-12 medium-2 column">
|
<div class="small-12 medium-2 column margin-top">
|
||||||
<%= f.check_box :debate_phase_enabled, checked: @process.debate_phase.enabled?, label: t('admin.legislation.processes.form.enabled') %>
|
<%= f.check_box :debate_phase_enabled, checked: @process.debate_phase.enabled?, label: t("admin.legislation.processes.form.enabled") %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="small-12 column">
|
<div class="small-12 column">
|
||||||
<hr>
|
<hr>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="small-12 medium-4 column">
|
||||||
|
<label><%= t("admin.legislation.processes.form.proposals_phase") %></label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="small-12 medium-3 column">
|
||||||
<div class="small-12 medium-4 column">
|
<%= f.label :proposals_phase_start_date, t("admin.legislation.processes.form.start") %>
|
||||||
<label><%= t('admin.legislation.processes.form.proposals_phase') %></label>
|
|
||||||
</div>
|
|
||||||
<div class="small-12 medium-1 column legislation-process-start">
|
|
||||||
<%= t('admin.legislation.processes.form.start') %>
|
|
||||||
</div>
|
|
||||||
<div class="small-12 medium-2 column">
|
|
||||||
<%= f.text_field :proposals_phase_start_date,
|
<%= f.text_field :proposals_phase_start_date,
|
||||||
label: false,
|
label: false,
|
||||||
value: format_date_for_calendar_form(@process.proposals_phase_start_date),
|
value: format_date_for_calendar_form(@process.proposals_phase_start_date),
|
||||||
class: "js-calendar-full",
|
class: "js-calendar-full",
|
||||||
id: "proposals_phase_start_date" %>
|
id: "proposals_phase_start_date" %>
|
||||||
</div>
|
</div>
|
||||||
<div class="small-12 medium-1 column legislation-process-end">
|
|
||||||
<%= t('admin.legislation.processes.form.end') %>
|
<div class="small-12 medium-3 column">
|
||||||
</div>
|
<%= f.label :proposals_phase_end_date, t("admin.legislation.processes.form.end") %>
|
||||||
<div class="small-12 medium-2 column">
|
|
||||||
<%= f.text_field :proposals_phase_end_date,
|
<%= f.text_field :proposals_phase_end_date,
|
||||||
label: false,
|
label: false,
|
||||||
value: format_date_for_calendar_form(@process.proposals_phase_end_date),
|
value: format_date_for_calendar_form(@process.proposals_phase_end_date),
|
||||||
class: "js-calendar-full",
|
class: "js-calendar-full",
|
||||||
id: "proposals_phase_end_date" %>
|
id: "proposals_phase_end_date" %>
|
||||||
</div>
|
</div>
|
||||||
<div class="small-12 medium-2 column">
|
<div class="small-12 medium-2 column margin-top">
|
||||||
<%= f.check_box :proposals_phase_enabled, checked: @process.proposals_phase.enabled?, label: t('admin.legislation.processes.form.enabled') %>
|
<%= f.check_box :proposals_phase_enabled, checked: @process.proposals_phase.enabled?, label: t("admin.legislation.processes.form.enabled") %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="small-12 column">
|
<div class="small-12 column">
|
||||||
<hr>
|
<hr>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="small-12 medium-4 column">
|
||||||
|
<label><%= t("admin.legislation.processes.form.allegations_phase") %></label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="small-12 medium-3 column">
|
||||||
<div class="small-12 medium-4 column">
|
<%= f.label :allegations_start_date, t("admin.legislation.processes.form.start") %>
|
||||||
<label><%= t('admin.legislation.processes.form.allegations_phase') %></label>
|
|
||||||
</div>
|
|
||||||
<div class="small-12 medium-1 column legislation-process-start">
|
|
||||||
<%= t('admin.legislation.processes.form.start') %>
|
|
||||||
</div>
|
|
||||||
<div class="small-12 medium-2 column">
|
|
||||||
<%= f.text_field :allegations_start_date,
|
<%= f.text_field :allegations_start_date,
|
||||||
label: false,
|
label: false,
|
||||||
value: format_date_for_calendar_form(@process.allegations_start_date),
|
value: format_date_for_calendar_form(@process.allegations_start_date),
|
||||||
class: "js-calendar-full",
|
class: "js-calendar-full",
|
||||||
id: "allegations_start_date" %>
|
id: "allegations_start_date" %>
|
||||||
</div>
|
</div>
|
||||||
<div class="small-12 medium-1 column legislation-process-end">
|
|
||||||
<%= t('admin.legislation.processes.form.end') %>
|
<div class="small-12 medium-3 column">
|
||||||
</div>
|
<%= f.label :allegations_end_date, t("admin.legislation.processes.form.end") %>
|
||||||
<div class="small-12 medium-2 column">
|
|
||||||
<%= f.text_field :allegations_end_date,
|
<%= f.text_field :allegations_end_date,
|
||||||
label: false,
|
label: false,
|
||||||
value: format_date_for_calendar_form(@process.allegations_end_date),
|
value: format_date_for_calendar_form(@process.allegations_end_date),
|
||||||
class: "js-calendar-full",
|
class: "js-calendar-full",
|
||||||
id: "allegations_end_date" %>
|
id: "allegations_end_date" %>
|
||||||
</div>
|
</div>
|
||||||
<div class="small-12 medium-2 column">
|
<div class="small-12 medium-2 column margin-top">
|
||||||
<%= f.check_box :allegations_phase_enabled, checked: @process.allegations_phase.enabled?, label: t('admin.legislation.processes.form.enabled') %>
|
<%= f.check_box :allegations_phase_enabled, checked: @process.allegations_phase.enabled?, label: t("admin.legislation.processes.form.enabled") %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="small-12 column">
|
<div class="small-12 column">
|
||||||
<hr>
|
<hr>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row">
|
<div class="small-12 medium-3 column end">
|
||||||
<div class="small-12 medium-4 column">
|
|
||||||
<%= f.label :draft_publication_date %>
|
<%= f.label :draft_publication_date %>
|
||||||
</div>
|
|
||||||
<div class="small-12 medium-2 column end">
|
|
||||||
<%= f.text_field :draft_publication_date,
|
<%= f.text_field :draft_publication_date,
|
||||||
label: false,
|
label: false,
|
||||||
value: format_date_for_calendar_form(@process.draft_publication_date),
|
value: format_date_for_calendar_form(@process.draft_publication_date),
|
||||||
class: "js-calendar-full",
|
class: "js-calendar-full",
|
||||||
id: "draft_publication_date" %>
|
id: "draft_publication_date" %>
|
||||||
</div>
|
</div>
|
||||||
<div class="small-12 medium-2 column">
|
<div class="small-12 medium-2 column margin-top">
|
||||||
<%= f.check_box :draft_publication_enabled, checked: @process.draft_publication.enabled?, label: t('admin.legislation.processes.form.enabled') %>
|
<%= f.check_box :draft_publication_enabled, checked: @process.draft_publication.enabled?, label: t("admin.legislation.processes.form.enabled") %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="small-12 column">
|
<div class="small-12 column">
|
||||||
<hr>
|
<hr>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row">
|
<div class="small-12 medium-3 column end">
|
||||||
<div class="small-12 medium-4 column">
|
|
||||||
<%= f.label :result_publication_date %>
|
<%= f.label :result_publication_date %>
|
||||||
</div>
|
|
||||||
<div class="small-12 medium-2 column end">
|
|
||||||
<%= f.text_field :result_publication_date,
|
<%= f.text_field :result_publication_date,
|
||||||
label: false,
|
label: false,
|
||||||
value: format_date_for_calendar_form(@process.result_publication_date),
|
value: format_date_for_calendar_form(@process.result_publication_date),
|
||||||
class: "js-calendar-full",
|
class: "js-calendar-full",
|
||||||
id: "result_publication_date" %>
|
id: "result_publication_date" %>
|
||||||
</div>
|
</div>
|
||||||
<div class="small-12 medium-2 column">
|
<div class="small-12 medium-2 column margin-top">
|
||||||
<%= f.check_box :result_publication_enabled, checked: @process.result_publication.enabled?, label: t('admin.legislation.processes.form.enabled') %>
|
<%= f.check_box :result_publication_enabled, checked: @process.result_publication.enabled?, label: t("admin.legislation.processes.form.enabled") %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="small-12 column">
|
<div class="small-12 column">
|
||||||
<hr>
|
<hr>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="documents small-12 column">
|
<div class="documents small-12 column">
|
||||||
<%= render 'documents/nested_documents', documentable: @process, f: f %>
|
<%= render 'documents/nested_documents', documentable: @process, f: f %>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="small-12 column">
|
<div class="small-12 column">
|
||||||
<hr>
|
<hr>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row">
|
<div class="small-12 medium-9 column">
|
||||||
<div class="small-12 medium-4 column">
|
|
||||||
<%= f.label :title %>
|
<%= f.label :title %>
|
||||||
</div>
|
|
||||||
<div class="small-12 medium-8 column">
|
|
||||||
<%= f.text_field :title,
|
<%= f.text_field :title,
|
||||||
label: false,
|
label: false,
|
||||||
placeholder: t('admin.legislation.processes.form.title_placeholder') %>
|
placeholder: t("admin.legislation.processes.form.title_placeholder") %>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="small-12 medium-9 column">
|
||||||
<div class="small-12 medium-4 column">
|
|
||||||
<%= f.label :summary %>
|
<%= f.label :summary %>
|
||||||
<small><%= t('admin.legislation.processes.form.use_markdown') %></small>
|
<span class="help-text"><%= t("admin.legislation.processes.form.use_markdown") %></span>
|
||||||
</div>
|
|
||||||
<div class="small-12 medium-8 column">
|
|
||||||
<%= f.text_area :summary,
|
<%= f.text_area :summary,
|
||||||
label: false,
|
label: false,
|
||||||
rows: 2,
|
rows: 2,
|
||||||
placeholder: t('admin.legislation.processes.form.summary_placeholder') %>
|
placeholder: t("admin.legislation.processes.form.summary_placeholder") %>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="small-12 medium-9 column">
|
||||||
<div class="small-12 medium-4 column">
|
|
||||||
<%= f.label :description %>
|
<%= f.label :description %>
|
||||||
<small><%= t('admin.legislation.processes.form.use_markdown') %></small>
|
<span class="help-text"><%= t("admin.legislation.processes.form.use_markdown") %></span>
|
||||||
</div>
|
|
||||||
<div class="small-12 medium-8 column">
|
|
||||||
<%= f.text_area :description,
|
<%= f.text_area :description,
|
||||||
label: false,
|
label: false,
|
||||||
rows: 5,
|
rows: 5,
|
||||||
placeholder: t('admin.legislation.processes.form.description_placeholder') %>
|
placeholder: t("admin.legislation.processes.form.description_placeholder") %>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="small-12 medium-9 column">
|
||||||
<div class="small-12 medium-4 column">
|
|
||||||
<%= f.label :additional_info %>
|
<%= f.label :additional_info %>
|
||||||
<small><%= t('admin.legislation.processes.form.use_markdown') %></small>
|
<span class="help-text"><%= t("admin.legislation.processes.form.use_markdown") %></span>
|
||||||
</div>
|
|
||||||
<div class="small-12 medium-8 column">
|
|
||||||
<%= f.text_area :additional_info,
|
<%= f.text_area :additional_info,
|
||||||
label: false,
|
label: false,
|
||||||
rows: 10,
|
rows: 10,
|
||||||
placeholder: t('admin.legislation.processes.form.additional_info_placeholder') %>
|
placeholder: t("admin.legislation.processes.form.additional_info_placeholder") %>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="small-12 medium-3 column clear end">
|
||||||
<div class="actions small-12 medium-3 column legislation-process-save">
|
<%= f.submit(class: "button success expanded", value: t("admin.legislation.processes.#{admin_submit_action(@process)}.submit_button")) %>
|
||||||
<%= f.submit(class: "button expanded", value: t("admin.legislation.processes.#{admin_submit_action(@process)}.submit_button")) %>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -1,16 +1,13 @@
|
|||||||
<% provide :title do %>
|
<% provide :title do %>
|
||||||
Admin - <%= t("admin.menu.legislation") %> - <%= @process.title %>
|
<%= t("admin.header.title") %> - <%= t("admin.menu.legislation") %> - <%= @process.title %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<div class="legislation-admin legislation-process-edit row">
|
<div class="legislation-process-edit">
|
||||||
|
|
||||||
<div class="small-12 column">
|
|
||||||
<%= back_link_to admin_legislation_processes_path, t("admin.legislation.processes.edit.back") %>
|
<%= back_link_to admin_legislation_processes_path, t("admin.legislation.processes.edit.back") %>
|
||||||
|
|
||||||
<h2><%= @process.title %></h2>
|
<h2><%= @process.title %></h2>
|
||||||
|
|
||||||
<%= render 'subnav', process: @process, active: 'info' %>
|
<%= render 'subnav', process: @process, active: 'info' %>
|
||||||
|
|
||||||
<%= render "form" %>
|
<%= render 'form' %>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
<% provide :title do %>
|
<% provide :title do %>
|
||||||
Admin - <%= t("admin.menu.legislation") %> - <%= t("admin.legislation.processes.index.filters.#{@current_filter}") %>
|
<%= t("admin.header.title") %> - <%= t("admin.menu.legislation") %> - <%= t("admin.legislation.processes.index.filters.#{@current_filter}") %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<h2 class="inline-block"><%= t("admin.legislation.processes.index.title") %></h2>
|
<h2 class="inline-block"><%= t("admin.legislation.processes.index.title") %></h2>
|
||||||
|
|
||||||
<%= link_to t("admin.legislation.processes.index.create"), new_admin_legislation_process_path,
|
<%= link_to t("admin.legislation.processes.index.create"), new_admin_legislation_process_path,
|
||||||
class: "button success float-right" %>
|
class: "button float-right" %>
|
||||||
|
|
||||||
<%= render 'shared/filter_subnav', i18n_namespace: "admin.legislation.processes.index" %>
|
<%= render 'shared/filter_subnav', i18n_namespace: "admin.legislation.processes.index" %>
|
||||||
|
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
<th><%= t("admin.legislation.processes.process.title") %></th>
|
<th><%= t("admin.legislation.processes.process.title") %></th>
|
||||||
<th><%= t("admin.legislation.processes.process.status") %></th>
|
<th><%= t("admin.legislation.processes.process.status") %></th>
|
||||||
<th><%= t("admin.legislation.processes.process.creation_date") %></th>
|
<th><%= t("admin.legislation.processes.process.creation_date") %></th>
|
||||||
<th><%= t("admin.legislation.processes.process.comments") %></th>
|
<th class="text-center"><%= t("admin.legislation.processes.process.comments") %></th>
|
||||||
<th><%= t("admin.actions.actions") %></th>
|
<th><%= t("admin.actions.actions") %></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@@ -26,16 +26,16 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
<% @processes.each do |process| %>
|
<% @processes.each do |process| %>
|
||||||
<tr id="<%= dom_id(process) %>">
|
<tr id="<%= dom_id(process) %>">
|
||||||
<td class="small-12 medium-8">
|
<td class="small-12 medium-6">
|
||||||
<%= link_to process.title, edit_admin_legislation_process_path(process) %>
|
<%= link_to process.title, edit_admin_legislation_process_path(process) %>
|
||||||
</td>
|
</td>
|
||||||
<td><%= t("admin.legislation.processes.process.status_#{process.status}") %></td>
|
<td><%= t("admin.legislation.processes.process.status_#{process.status}") %></td>
|
||||||
<td><%= I18n.l process.created_at.to_date %></td>
|
<td><%= I18n.l process.created_at.to_date %></td>
|
||||||
<td><%= process.total_comments %></td>
|
<td class="text-center"><%= process.total_comments %></td>
|
||||||
<td>
|
<td>
|
||||||
<%= link_to t("admin.legislation.processes.index.delete"), admin_legislation_process_path(process),
|
<%= link_to t("admin.legislation.processes.index.delete"), admin_legislation_process_path(process),
|
||||||
method: :delete,
|
method: :delete,
|
||||||
class: 'button hollow alert' %>
|
class: 'button hollow alert expanded' %>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -1,14 +1,11 @@
|
|||||||
<% provide :title do %>
|
<% provide :title do %>
|
||||||
Admin - <%= t("admin.menu.legislation") %> - <%= t("admin.legislation.processes.new.title") %>
|
<%= t("admin.header.title") %> - <%= t("admin.menu.legislation") %> - <%= t("admin.legislation.processes.new.title") %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<div class="legislation-admin legislation-process-new row">
|
<div class="legislation-process-new">
|
||||||
|
|
||||||
<div class="small-12 column">
|
|
||||||
<%= back_link_to admin_legislation_processes_path, t("admin.legislation.processes.new.back") %>
|
<%= back_link_to admin_legislation_processes_path, t("admin.legislation.processes.new.back") %>
|
||||||
|
|
||||||
<h2><%= t("admin.legislation.processes.new.title") %></h2>
|
<h2><%= t("admin.legislation.processes.new.title") %></h2>
|
||||||
|
|
||||||
<%= render "form" %>
|
<%= render "form" %>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -15,23 +15,17 @@
|
|||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="small-12 medium-4 column">
|
|
||||||
<%= label_tag t('admin.legislation.proposals.form.custom_categories') %>
|
|
||||||
<small><%= t('admin.legislation.proposals.form.custom_categories_description') %></small>
|
|
||||||
</div>
|
|
||||||
<div class="small-12 medium-8 column">
|
<div class="small-12 medium-8 column">
|
||||||
|
<%= f.label :custom_list, t("admin.legislation.proposals.form.custom_categories") %>
|
||||||
|
<span class="help-text"><%= t("admin.legislation.proposals.form.custom_categories_description") %></span>
|
||||||
<%= f.text_field :custom_list, value: @process.tag_list_on(:customs).to_s,
|
<%= f.text_field :custom_list, value: @process.tag_list_on(:customs).to_s,
|
||||||
label: false,
|
label: false,
|
||||||
placeholder: t("proposals.form.tags_placeholder"),
|
placeholder: t("admin.legislation.proposals.form.custom_categories_placeholder"),
|
||||||
class: 'js-tag-list',
|
class: 'js-tag-list',
|
||||||
aria: {describedby: "tag-list-help-text"} %>
|
aria: {describedby: "tag-list-help-text"} %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row">
|
<div class="small-12 medium-3 column clear end">
|
||||||
<div class="actions small-12 medium-3 column legislation-process-save">
|
|
||||||
<%= f.submit(class: "button expanded", value: t("admin.legislation.processes.#{admin_submit_action(@process)}.submit_button")) %>
|
<%= f.submit(class: "button expanded", value: t("admin.legislation.processes.#{admin_submit_action(@process)}.submit_button")) %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -1,16 +1,14 @@
|
|||||||
<% provide :title do %>
|
<% provide :title do %>
|
||||||
Admin - <%= t("admin.menu.legislation") %> - <%= @process.title %> - <%= t("admin.legislation.proposals.index.title") %>
|
<%= t("admin.header.title") %> - <%= t("admin.menu.legislation") %> - <%= @process.title %> - <%= t("admin.legislation.proposals.index.title") %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<div class="legislation-admin legislation-draft-versions-index row">
|
<div class="legislation-admin legislation-draft-versions-index">
|
||||||
<div class="small-12 column">
|
|
||||||
<%= back_link_to admin_legislation_processes_path, t("admin.legislation.proposals.index.back") %>
|
<%= back_link_to admin_legislation_processes_path, t("admin.legislation.proposals.index.back") %>
|
||||||
|
|
||||||
<h2><%= @process.title %></h2>
|
<h2><%= @process.title %></h2>
|
||||||
|
|
||||||
<%= render 'admin/legislation/processes/subnav', process: @process, active: 'proposals' %>
|
<%= render 'admin/legislation/processes/subnav', process: @process, active: 'proposals' %>
|
||||||
|
|
||||||
<%= render "form" %>
|
<%= render 'form' %>
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -30,12 +30,12 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="small-12 medium-9 column margin">
|
<div class="small-12 medium-9 column">
|
||||||
<%= link_to_add_association t("admin.legislation.questions.form.add_option"),
|
<%= link_to_add_association t("admin.legislation.questions.form.add_option"),
|
||||||
f, :question_options, class: "button hollow medium" %>
|
f, :question_options, class: "button hollow" %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="small-12 medium-6 large-4 column end">
|
<div class="small-12 medium-6 large-3 clear column end margin-top">
|
||||||
<%= f.submit(class: "button expanded", value: t("admin.legislation.questions.#{admin_submit_action(@question)}.submit_button")) %>
|
<%= f.submit(class: "button success expanded", value: t("admin.legislation.questions.#{admin_submit_action(@question)}.submit_button")) %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -1,12 +1,10 @@
|
|||||||
<div class="nested-fields">
|
<div class="nested-fields">
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<div class="row">
|
|
||||||
<div class="small-12 medium-9 column">
|
<div class="small-12 medium-9 column">
|
||||||
<%= f.text_field :value, label: false, placeholder: t("admin.legislation.questions.form.value_placeholder") %>
|
<%= f.text_field :value, label: false, placeholder: t("admin.legislation.questions.form.value_placeholder") %>
|
||||||
</div>
|
</div>
|
||||||
<div class="small-12 medium-3 column">
|
<div class="small-12 medium-3 column">
|
||||||
<%= link_to_remove_association "<span class=\"icon-x\" aria-hidden=\"true\"></span> <span>#{t(".remove_option")}</span>".html_safe, f %>
|
<%= link_to_remove_association t("admin.legislation.questions.question_option_fields.remove_option"), f, class: "delete"%>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<% provide :title do %>
|
<% provide :title do %>
|
||||||
Admin - <%= t("admin.menu.legislation") %> - <%= @process.title %> - <%= t("admin.legislation.questions.index.title") %> - <%= @question.title %>
|
<%= t("admin.header.title") %> - <%= t("admin.menu.legislation") %> - <%= @process.title %> - <%= t("admin.legislation.questions.index.title") %> - <%= @question.title %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<div class="legislation-admin legislation-questions-edit legislation-questions-form row">
|
<div class="legislation-questions-edit legislation-questions-form">
|
||||||
<div class="small-12 column">
|
<div class="small-12 column">
|
||||||
<%= back_link_to admin_legislation_process_questions_path(@process), t("admin.legislation.questions.edit.back") %>
|
<%= back_link_to admin_legislation_process_questions_path(@process), t("admin.legislation.questions.edit.back") %>
|
||||||
|
|
||||||
@@ -10,11 +10,10 @@
|
|||||||
|
|
||||||
<%= render 'admin/legislation/processes/subnav', process: @process, active: 'questions' %>
|
<%= render 'admin/legislation/processes/subnav', process: @process, active: 'questions' %>
|
||||||
|
|
||||||
<div class="row">
|
<div class="small-12 column">
|
||||||
<div class="small-12 medium-9 column">
|
<h3 class="inline-block"><%= t("admin.legislation.questions.edit.title", question_title: @question.title) %></h3>
|
||||||
<h3><%= t("admin.legislation.questions.edit.title", question_title: @question.title) %></h3>
|
|
||||||
</div>
|
<div class="float-right">
|
||||||
<div class="small-12 medium-3 column legislation-question-delete">
|
|
||||||
<%= link_to t("admin.legislation.questions.index.delete"), admin_legislation_process_question_path(@process, @question),
|
<%= link_to t("admin.legislation.questions.index.delete"), admin_legislation_process_question_path(@process, @question),
|
||||||
method: :delete,
|
method: :delete,
|
||||||
class: 'button hollow alert' %>
|
class: 'button hollow alert' %>
|
||||||
|
|||||||
@@ -1,24 +1,20 @@
|
|||||||
<% provide :title do %>
|
<% provide :title do %>
|
||||||
Admin - <%= t("admin.menu.legislation") %> - <%= @process.title %> - <%= t("admin.legislation.questions.index.title") %>
|
<%= t("admin.header.title") %> - <%= t("admin.menu.legislation") %> - <%= @process.title %> - <%= t("admin.legislation.questions.index.title") %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<div class="legislation-admin legislation-draft-versions-index row">
|
<div class="legislation-draft-versions-index">
|
||||||
<div class="small-12 column">
|
|
||||||
<%= back_link_to admin_legislation_processes_path, t("admin.legislation.questions.index.back") %>
|
<%= back_link_to admin_legislation_processes_path, t("admin.legislation.questions.index.back") %>
|
||||||
|
|
||||||
<h2><%= @process.title %></h2>
|
<h2><%= @process.title %></h2>
|
||||||
|
|
||||||
<%= render 'admin/legislation/processes/subnav', process: @process, active: 'questions' %>
|
<%= render 'admin/legislation/processes/subnav', process: @process, active: 'questions' %>
|
||||||
|
|
||||||
<div class="row">
|
<div class="small-12 column">
|
||||||
<div class="small-12 medium-9 column">
|
<h4 class="inline-block"><%= t("admin.legislation.questions.index.title") %></h4>
|
||||||
<h4><%= t("admin.legislation.questions.index.title") %></h4>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="small-12 medium-3 column legislation-process-question">
|
<div class="float-right">
|
||||||
<%= link_to t("admin.legislation.questions.index.create"), new_admin_legislation_process_question_path, class: "button" %>
|
<%= link_to t("admin.legislation.questions.index.create"), new_admin_legislation_process_question_path, class: "button" %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<% if @process.questions.any? %>
|
<% if @process.questions.any? %>
|
||||||
<table class="stack">
|
<table class="stack">
|
||||||
@@ -26,8 +22,8 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th><%= t("admin.legislation.questions.table.title") %></th>
|
<th><%= t("admin.legislation.questions.table.title") %></th>
|
||||||
<th><%= t("admin.legislation.questions.table.question_options") %></th>
|
<th><%= t("admin.legislation.questions.table.question_options") %></th>
|
||||||
<th><%= t("admin.legislation.questions.table.answers_count") %></th>
|
<th class="text-center"><%= t("admin.legislation.questions.table.answers_count") %></th>
|
||||||
<th><%= t("admin.legislation.questions.table.comments_count") %></th>
|
<th class="text-center"><%= t("admin.legislation.questions.table.comments_count") %></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@@ -45,8 +41,8 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</td>
|
</td>
|
||||||
<td><%= question.answers_count %></td>
|
<td class="text-center"><%= question.answers_count %></td>
|
||||||
<td><%= link_to question.comments.count, legislation_process_question_path(@process, question, anchor: 'comments') %></td>
|
<td class="text-center"><%= link_to question.comments.count, legislation_process_question_path(@process, question, anchor: 'comments') %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
@@ -1,21 +1,18 @@
|
|||||||
<% provide :title do %>
|
<% provide :title do %>
|
||||||
Admin - <%= t("admin.menu.legislation") %> - <%= @process.title %> - <%= t("admin.legislation.questions.index.title") %> - <%= t("admin.legislation.questions.new.title") %>
|
<%= t("admin.header.title") %> - <%= t("admin.menu.legislation") %> - <%= @process.title %> - <%= t("admin.legislation.questions.index.title") %> - <%= t("admin.legislation.questions.new.title") %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<div class="legislation-admin legislation-questions-new legislation-questions-form row">
|
<div class="legislation-questions-new legislation-questions-form">
|
||||||
<div class="small-12 column">
|
|
||||||
<%= back_link_to admin_legislation_process_questions_path(@process), t("admin.legislation.questions.new.back") %>
|
<%= back_link_to admin_legislation_process_questions_path(@process), t("admin.legislation.questions.new.back") %>
|
||||||
|
|
||||||
<h2><%= @process.title %></h2>
|
<h2><%= @process.title %></h2>
|
||||||
|
|
||||||
<%= render 'admin/legislation/processes/subnav', process: @process, active: 'questions' %>
|
<%= render 'admin/legislation/processes/subnav', process: @process, active: 'questions' %>
|
||||||
|
|
||||||
<div class="row">
|
<div class="small-12 column">
|
||||||
<div class="small-12 medium-9 column">
|
|
||||||
<h3><%= t("admin.legislation.questions.new.title") %></h3>
|
<h3><%= t("admin.legislation.questions.new.title") %></h3>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<%= render 'form', url: admin_legislation_process_questions_path(@process) %>
|
<%= render 'form', url: admin_legislation_process_questions_path(@process) %>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -6,10 +6,10 @@
|
|||||||
<table id="newsletters">
|
<table id="newsletters">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th><%= t("admin.newsletters.index.subject") %></th>
|
<th class="small-2"><%= t("admin.newsletters.index.subject") %></th>
|
||||||
<th><%= t("admin.newsletters.index.segment_recipient") %></th>
|
<th><%= t("admin.newsletters.index.segment_recipient") %></th>
|
||||||
<th><%= t("admin.newsletters.index.sent") %></th>
|
<th><%= t("admin.newsletters.index.sent") %></th>
|
||||||
<th class="small-5 text-right"><%= t("admin.newsletters.index.actions") %></th>
|
<th class="small-4"><%= t("admin.newsletters.index.actions") %></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@@ -28,13 +28,19 @@
|
|||||||
<%= l newsletter.sent_at.to_date %>
|
<%= l newsletter.sent_at.to_date %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</td>
|
</td>
|
||||||
<td class="text-right">
|
<td>
|
||||||
|
<div class="small-4 column">
|
||||||
<%= link_to t("admin.newsletters.index.edit"), edit_admin_newsletter_path(newsletter),
|
<%= link_to t("admin.newsletters.index.edit"), edit_admin_newsletter_path(newsletter),
|
||||||
method: :get, class: "button hollow" %>
|
method: :get, class: "button hollow expanded" %>
|
||||||
|
</div>
|
||||||
|
<div class="small-4 column">
|
||||||
<%= link_to t("admin.newsletters.index.delete"), admin_newsletter_path(newsletter),
|
<%= link_to t("admin.newsletters.index.delete"), admin_newsletter_path(newsletter),
|
||||||
method: :delete, class: "button hollow alert" %>
|
method: :delete, class: "button hollow alert expanded" %>
|
||||||
|
</div>
|
||||||
|
<div class="small-4 column">
|
||||||
<%= link_to t("admin.newsletters.index.preview"), admin_newsletter_path(newsletter),
|
<%= link_to t("admin.newsletters.index.preview"), admin_newsletter_path(newsletter),
|
||||||
class: "button" %>
|
class: "button expanded" %>
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -4,9 +4,7 @@
|
|||||||
|
|
||||||
<% recipients_count = @newsletter.valid_segment_recipient? ? @newsletter.list_of_recipient_emails.count : 0 %>
|
<% recipients_count = @newsletter.valid_segment_recipient? ? @newsletter.list_of_recipient_emails.count : 0 %>
|
||||||
|
|
||||||
<div class="small-12 column">
|
<div class="small-12 column callout highlight">
|
||||||
<div class="callout highlight">
|
|
||||||
<div class="row">
|
|
||||||
<div class="small-12 medium-2 column">
|
<div class="small-12 medium-2 column">
|
||||||
<strong><%= t("admin.newsletters.show.sent_at") %></strong><br>
|
<strong><%= t("admin.newsletters.show.sent_at") %></strong><br>
|
||||||
<% if @newsletter.draft? %>
|
<% if @newsletter.draft? %>
|
||||||
@@ -23,20 +21,20 @@
|
|||||||
<strong><%= t("admin.newsletters.show.subject") %></strong><br>
|
<strong><%= t("admin.newsletters.show.subject") %></strong><br>
|
||||||
<%= @newsletter.subject %>
|
<%= @newsletter.subject %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<div class="row margin-top">
|
|
||||||
<div class="small-12 column">
|
<div class="small-12 column">
|
||||||
<strong><%= t("admin.newsletters.show.segment_recipient") %></strong><br>
|
<strong><%= t("admin.newsletters.show.segment_recipient") %></strong><br>
|
||||||
<%= segment_name(@newsletter.segment_recipient) %>
|
<%= segment_name(@newsletter.segment_recipient) %>
|
||||||
<%= t("admin.newsletters.show.affected_users", n: recipients_count) %>
|
<%= t("admin.newsletters.show.affected_users", n: recipients_count) %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
|
<div class="small-12 column">
|
||||||
<strong><%= t("admin.newsletters.show.body") %></strong>
|
<strong><%= t("admin.newsletters.show.body") %></strong>
|
||||||
<p class="help-text" id="phase-description-help-text">
|
<p class="help-text" id="phase-description-help-text">
|
||||||
<%= t("admin.newsletters.show.body_help_text") %>
|
<%= t("admin.newsletters.show.body_help_text") %>
|
||||||
</p>
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="newsletter-body-content">
|
<div class="newsletter-body-content">
|
||||||
<%= render file: "app/views/layouts/_mailer_header.html.erb" %>
|
<%= render file: "app/views/layouts/_mailer_header.html.erb" %>
|
||||||
|
|
||||||
|
|||||||
@@ -6,27 +6,29 @@
|
|||||||
</td>
|
</td>
|
||||||
<% if booth_assignment.present? %>
|
<% if booth_assignment.present? %>
|
||||||
<td>
|
<td>
|
||||||
<span class="verified"><%= t("admin.booth_assignments.manage.status.assigned") %></span>
|
<span class="enabled">
|
||||||
|
<strong><%= t("admin.booth_assignments.manage.status.assigned") %></strong>
|
||||||
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td class="text-right">
|
<td>
|
||||||
<%= link_to t("admin.booth_assignments.manage.actions.unassign"),
|
<%= link_to t("admin.booth_assignments.manage.actions.unassign"),
|
||||||
admin_poll_booth_assignment_path(@poll, booth_assignment, booth_id: booth.id),
|
admin_poll_booth_assignment_path(@poll, booth_assignment, booth_id: booth.id),
|
||||||
method: :delete,
|
method: :delete,
|
||||||
remote: true,
|
remote: true,
|
||||||
title: t("admin.booth_assignments.manage.actions.unassign"),
|
title: t("admin.booth_assignments.manage.actions.unassign"),
|
||||||
class: "button hollow alert",
|
class: "button hollow alert expanded",
|
||||||
data: (booth_assignment.shifts? ? {confirm: "#{t("admin.poll_booth_assignments.alert.shifts")}"} : nil) if !@poll.expired? %>
|
data: (booth_assignment.shifts? ? {confirm: "#{t("admin.poll_booth_assignments.alert.shifts")}"} : nil) if !@poll.expired? %>
|
||||||
</td>
|
</td>
|
||||||
<% else %>
|
<% else %>
|
||||||
<td>
|
<td>
|
||||||
<span class="delete"><%= t("admin.booth_assignments.manage.status.unassigned") %></span>
|
<span class="disabled"><%= t("admin.booth_assignments.manage.status.unassigned") %></span>
|
||||||
</td>
|
</td>
|
||||||
<td class="text-right">
|
<td>
|
||||||
<%= link_to t("admin.booth_assignments.manage.actions.assign"),
|
<%= link_to t("admin.booth_assignments.manage.actions.assign"),
|
||||||
admin_poll_booth_assignments_path(@poll, booth_id: booth.id),
|
admin_poll_booth_assignments_path(@poll, booth_id: booth.id),
|
||||||
method: :post,
|
method: :post,
|
||||||
remote: true,
|
remote: true,
|
||||||
title: t("admin.booth_assignments.manage.actions.assign"),
|
title: t("admin.booth_assignments.manage.actions.assign"),
|
||||||
class: "button" if !@poll.expired? %>
|
class: "button hollow expanded" if !@poll.expired? %>
|
||||||
</td>
|
</td>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
<div class="row">
|
<div class="small-12 medium-6 margin-top">
|
||||||
<div class="small-12 medium-6 column">
|
|
||||||
<%= form_tag(search_booths_admin_poll_booth_assignments_path(@poll), method: :get, remote: true) do |f| %>
|
<%= form_tag(search_booths_admin_poll_booth_assignments_path(@poll), method: :get, remote: true) do |f| %>
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<%= text_field_tag :search,
|
<%= text_field_tag :search,
|
||||||
@@ -10,7 +9,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="search-booths-results"></div>
|
<div id="search-booths-results"></div>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<%= render "/admin/poll/polls/subnav" %>
|
<%= render "/admin/poll/polls/subnav" %>
|
||||||
<%= render "search_booths" %>
|
<%= render "search_booths" %>
|
||||||
|
|
||||||
<h3><%= t("admin.poll_booth_assignments.index.booths_title") %></h3>
|
<h3 class="inline-block"><%= t("admin.poll_booth_assignments.index.booths_title") %></h3>
|
||||||
|
|
||||||
<%= link_to t("admin.booth_assignments.manage_assignments"),
|
<%= link_to t("admin.booth_assignments.manage_assignments"),
|
||||||
manage_admin_poll_booth_assignments_path(@poll),
|
manage_admin_poll_booth_assignments_path(@poll),
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
<%= link_to booth_assignments_admin_polls_path do %>
|
<%= back_link_to booth_assignments_admin_polls_path %>
|
||||||
<span class="icon-angle-left"></span> <%= t("shared.back") %>
|
|
||||||
<% end %>
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
<h2 class="inline-block"><%= t("admin.booth_assignments.manage.assignments_list", poll: @poll.name) %></h2>
|
<h2><%= t("admin.booth_assignments.manage.assignments_list", poll: @poll.name) %></h2>
|
||||||
|
|
||||||
<% if @booths.empty? %>
|
<% if @booths.empty? %>
|
||||||
<div class="callout primary">
|
<div class="callout primary">
|
||||||
@@ -15,7 +12,7 @@
|
|||||||
<th><%= t("admin.booths.index.name") %></th>
|
<th><%= t("admin.booths.index.name") %></th>
|
||||||
<th><%= t("admin.booths.index.location") %></th>
|
<th><%= t("admin.booths.index.location") %></th>
|
||||||
<th><%= t("admin.booth_assignments.manage.status.assign_status") %></th>
|
<th><%= t("admin.booth_assignments.manage.status.assign_status") %></th>
|
||||||
<th class="text-right"><%= t("admin.actions.actions") %></th>
|
<th class="small-3"><%= t("admin.actions.actions") %></th>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<% @booths.each do |booth| %>
|
<% @booths.each do |booth| %>
|
||||||
|
|||||||
@@ -1,20 +1,16 @@
|
|||||||
<div class="row">
|
<div class="small-12 medium-6 column">
|
||||||
<div class="small-12 medium-6 column">
|
|
||||||
<%= f.text_field :name,
|
<%= f.text_field :name,
|
||||||
placeholder: t('admin.booths.new.name'),
|
placeholder: t('admin.booths.new.name'),
|
||||||
label: t("admin.booths.new.name") %>
|
label: t("admin.booths.new.name") %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="small-12 column">
|
<div class="small-12 medium-6 column clear">
|
||||||
<%= f.text_field :location,
|
<%= f.text_field :location,
|
||||||
placeholder: t("admin.booths.new.location"),
|
placeholder: t("admin.booths.new.location"),
|
||||||
label: t("admin.booths.new.location") %>
|
label: t("admin.booths.new.location") %>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="small-12 medium-4 large-3 column clear end">
|
||||||
<div class="small-12 medium-4 column">
|
|
||||||
<%= f.submit t("admin.booths.#{admin_submit_action(@booth)}.submit_button"),
|
<%= f.submit t("admin.booths.#{admin_submit_action(@booth)}.submit_button"),
|
||||||
class: "button success expanded" %>
|
class: "button success expanded" %>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
<%= back_link_to admin_booths_path %>
|
<%= back_link_to admin_booths_path %>
|
||||||
|
|
||||||
<h2><%= t("admin.booths.edit.title") %></h2>
|
<div class="small-12 column">
|
||||||
|
<h2><%= t("admin.booths.edit.title") %></h2>
|
||||||
|
</div>
|
||||||
|
|
||||||
<%= form_for @booth, url: admin_booth_path(@booth) do |f| %>
|
<%= form_for @booth, url: admin_booth_path(@booth) do |f| %>
|
||||||
<%= render "form", f: f %>
|
<%= render "form", f: f %>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<h2 class="inline-block"><%= t("admin.booths.index.title") %></h2>
|
<h2 class="inline-block"><%= t("admin.booths.index.title") %></h2>
|
||||||
|
|
||||||
<% if controller_name == "booths" && action_name != "available" %>
|
<% if controller_name == "booths" && action_name != "available" %>
|
||||||
<%= link_to t("admin.booths.index.add_booth"), new_admin_booth_path, class: "button success float-right" %>
|
<%= link_to t("admin.booths.index.add_booth"), new_admin_booth_path, class: "button float-right" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% if @booths.empty? %>
|
<% if @booths.empty? %>
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
<%= back_link_to admin_booths_path %>
|
<%= back_link_to admin_booths_path %>
|
||||||
|
|
||||||
<h2><%= t("admin.booths.new.title") %></h2>
|
<div class="small-12 column">
|
||||||
|
<h2><%= t("admin.booths.new.title") %></h2>
|
||||||
|
</div>
|
||||||
|
|
||||||
<%= form_for @booth, url: admin_booths_path(@booth) do |f| %>
|
<%= form_for @booth, url: admin_booths_path(@booth) do |f| %>
|
||||||
<%= render "form", f: f %>
|
<%= render "form", f: f %>
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
<div class="row">
|
<div class="small-12 medium-6 margin-top">
|
||||||
<div class="small-12 medium-6 column">
|
|
||||||
<%= form_tag(search_officers_admin_poll_officer_assignments_path(@poll), method: :get, remote: true) do |f| %>
|
<%= form_tag(search_officers_admin_poll_officer_assignments_path(@poll), method: :get, remote: true) do |f| %>
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<%= text_field_tag :search,
|
<%= text_field_tag :search,
|
||||||
@@ -10,7 +9,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="search-officers-results"></div>
|
<div id="search-officers-results"></div>
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th><%= t('admin.poll_officers.officer.name') %></th>
|
<th><%= t("admin.poll_officers.officer.name") %></th>
|
||||||
<th colspan="2"><%= t('admin.poll_officers.officer.email') %></th>
|
<th><%= t("admin.poll_officers.officer.email") %></th>
|
||||||
|
<th class="small-3"><%= t("admin.actions.actions") %></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@@ -13,16 +14,16 @@
|
|||||||
<td>
|
<td>
|
||||||
<%= officer.email %>
|
<%= officer.email %>
|
||||||
</td>
|
</td>
|
||||||
<td class="text-right">
|
<td>
|
||||||
<% if officer.persisted? %>
|
<% if officer.persisted? %>
|
||||||
<%= link_to t('admin.poll_officers.officer.delete'),
|
<%= link_to t("admin.poll_officers.officer.delete"),
|
||||||
admin_officer_path(officer),
|
admin_officer_path(officer),
|
||||||
method: :delete,
|
method: :delete,
|
||||||
class: "button hollow alert" %>
|
class: "button hollow alert expanded" %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= link_to t('admin.poll_officers.officer.add'),{ controller: "admin/poll/officers", action: :create, user_id: officer.user_id },
|
<%= link_to t("admin.poll_officers.officer.add"),{ controller: "admin/poll/officers", action: :create, user_id: officer.user_id },
|
||||||
method: :post,
|
method: :post,
|
||||||
class: "button success" %>
|
class: "button success expanded" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -1,23 +1,22 @@
|
|||||||
<h2><%= t("admin.poll_officers.index.title") %></h2>
|
<h2><%= t("admin.poll_officers.index.title") %></h2>
|
||||||
|
|
||||||
<div class="row">
|
<div class="small-12 medium-6">
|
||||||
<div class="small-12 medium-6 column">
|
|
||||||
<%= render 'search' %>
|
<%= render 'search' %>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="search-result"></div>
|
<div id="search-result"></div>
|
||||||
|
|
||||||
<h3>
|
<h3>
|
||||||
<%= page_entries_info @officers, entry_name: t('admin.poll_officers.officer.entry_name') %>
|
<%= page_entries_info @officers, entry_name: t("admin.poll_officers.officer.entry_name") %>
|
||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
<% if @officers.any? %>
|
<% if @officers.any? %>
|
||||||
<table id="officers">
|
<table id="officers">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th><%= t('admin.poll_officers.officer.name') %></th>
|
<th><%= t("admin.poll_officers.officer.name") %></th>
|
||||||
<th colspan="2"><%= t('admin.poll_officers.officer.email') %></th>
|
<th><%= t("admin.poll_officers.officer.email") %></th>
|
||||||
|
<th class="small-3"><%= t("admin.actions.actions") %></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@@ -29,19 +28,19 @@
|
|||||||
<td>
|
<td>
|
||||||
<%= officer.email %>
|
<%= officer.email %>
|
||||||
</td>
|
</td>
|
||||||
<td class="text-right">
|
<td>
|
||||||
<% if officer.persisted? %>
|
<% if officer.persisted? %>
|
||||||
<%= link_to t('admin.poll_officers.officer.delete'),
|
<%= link_to t("admin.poll_officers.officer.delete"),
|
||||||
admin_officer_path(officer),
|
admin_officer_path(officer),
|
||||||
method: :delete,
|
method: :delete,
|
||||||
class: "button hollow alert"
|
class: "button hollow alert expanded"
|
||||||
%>
|
%>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= link_to t('admin.poll_officers.officer.add'),
|
<%= link_to t("admin.poll_officers.officer.add"),
|
||||||
{ controller: "admin/poll/officers", action: :create,
|
{ controller: "admin/poll/officers", action: :create,
|
||||||
user_id: officer.user_id },
|
user_id: officer.user_id },
|
||||||
method: :post,
|
method: :post,
|
||||||
class: "button success" %>
|
class: "button success expanded" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
<%= form_for [:admin, @poll] do |f| %>
|
<%= form_for [:admin, @poll] do |f| %>
|
||||||
<div class="row">
|
|
||||||
<div class="small-12 medium-6 column">
|
<div class="small-12 medium-6 column">
|
||||||
<%= f.text_field :name %>
|
<%= f.text_field :name %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row">
|
<div class="clear">
|
||||||
<div class="small-12 medium-6 column">
|
<div class="small-12 medium-6 column">
|
||||||
<%= f.text_field :starts_at,
|
<%= f.text_field :starts_at,
|
||||||
value: @poll.starts_at.present? ? l(@poll.starts_at.to_date) : nil,
|
value: @poll.starts_at.present? ? l(@poll.starts_at.to_date) : nil,
|
||||||
@@ -19,25 +17,19 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="small-12 column">
|
<div class="small-12 column">
|
||||||
<%=f.text_area :summary, rows: 4%>
|
<%=f.text_area :summary, rows: 4%>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="small-12 column">
|
<div class="small-12 column">
|
||||||
<%=f.text_area :description, rows: 8%>
|
<%=f.text_area :description, rows: 8%>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="small-12 column">
|
<div class="small-12 column">
|
||||||
<%= render 'images/admin_image', imageable: @poll, f: f %>
|
<%= render 'images/admin_image', imageable: @poll, f: f %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row">
|
<div class="clear">
|
||||||
<div class="small-6 medium-6 column">
|
<div class="small-6 medium-6 column">
|
||||||
<%= f.check_box :geozone_restricted, data: { checkbox_toggle: "#geozones" } %>
|
<%= f.check_box :geozone_restricted, data: { checkbox_toggle: "#geozones" } %>
|
||||||
</div>
|
</div>
|
||||||
@@ -55,10 +47,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="clear">
|
||||||
<div class="small-12 medium-4 column">
|
<div class="small-12 medium-4 large-2 column">
|
||||||
<%= f.submit t("admin.polls.#{admin_submit_action(@poll)}.submit_button"),
|
<%= f.submit t("admin.polls.#{admin_submit_action(@poll)}.submit_button"),
|
||||||
class: "button success expanded" %>
|
class: "button success expanded margin-top" %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -8,11 +8,15 @@
|
|||||||
<%= l poll.starts_at.to_date %> - <%= l poll.ends_at.to_date %>
|
<%= l poll.starts_at.to_date %> - <%= l poll.ends_at.to_date %>
|
||||||
</td>
|
</td>
|
||||||
<td class="text-right">
|
<td class="text-right">
|
||||||
|
<div class="small-6 column">
|
||||||
<%= link_to t("admin.actions.edit"),
|
<%= link_to t("admin.actions.edit"),
|
||||||
edit_admin_poll_path(poll),
|
edit_admin_poll_path(poll),
|
||||||
class: "button hollow" %>
|
class: "button hollow expanded" %>
|
||||||
|
</div>
|
||||||
|
<div class="small-6 column">
|
||||||
<%= link_to t("admin.actions.configure"),
|
<%= link_to t("admin.actions.configure"),
|
||||||
admin_poll_path(poll),
|
admin_poll_path(poll),
|
||||||
class: "button hollow" %>
|
class: "button hollow expanded" %>
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -2,13 +2,13 @@
|
|||||||
|
|
||||||
<% if @poll.questions.empty? %>
|
<% if @poll.questions.empty? %>
|
||||||
<div class="callout primary margin-top">
|
<div class="callout primary margin-top">
|
||||||
<%= t('admin.polls.show.no_questions') %>
|
<%= t("admin.polls.show.no_questions") %>
|
||||||
</div>
|
</div>
|
||||||
<% else %>
|
<% else %>
|
||||||
<table class="fixed margin">
|
<table class="fixed margin">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th><%= t('admin.polls.show.table_title') %></th>
|
<th><%= t("admin.polls.show.table_title") %></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<% @poll.questions.each do |question| %>
|
<% @poll.questions.each do |question| %>
|
||||||
|
|||||||
@@ -2,14 +2,14 @@
|
|||||||
|
|
||||||
<%= link_to t("admin.polls.index.create"),
|
<%= link_to t("admin.polls.index.create"),
|
||||||
new_admin_poll_path,
|
new_admin_poll_path,
|
||||||
class: "button success float-right" %>
|
class: "button float-right" %>
|
||||||
|
|
||||||
<% if @polls.any? %>
|
<% if @polls.any? %>
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<th class="medium-6"><%= t("admin.polls.index.name") %></th>
|
<th class="small-6"><%= t("admin.polls.index.name") %></th>
|
||||||
<th><%= t("admin.polls.index.dates") %></th>
|
<th><%= t("admin.polls.index.dates") %></th>
|
||||||
<th class="text-right"><%= t("admin.actions.actions") %></th>
|
<th><%= t("admin.actions.actions") %></th>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<%= render @polls %>
|
<%= render @polls %>
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
<%= back_link_to %>
|
<div class="small-12 column">
|
||||||
|
<%= back_link_to %>
|
||||||
|
|
||||||
<h2><%= t("admin.polls.new.title") %></h2>
|
<h2><%= t("admin.polls.new.title") %></h2>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="polls-form">
|
<div class="polls-form">
|
||||||
<%= render "form" %>
|
<%= render "form" %>
|
||||||
|
|||||||
@@ -14,8 +14,8 @@
|
|||||||
|
|
||||||
<%= f.text_field :title %>
|
<%= f.text_field :title %>
|
||||||
|
|
||||||
<div class="small-12 medium-6 large-4 margin-top">
|
<div class="small-12 medium-4 large-2 margin-top">
|
||||||
<%= f.submit(class: "button expanded", value: t("shared.save")) %>
|
<%= f.submit(class: "button success expanded", value: t("shared.save")) %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -4,23 +4,27 @@
|
|||||||
|
|
||||||
<% if @questions.count == 0 %>
|
<% if @questions.count == 0 %>
|
||||||
<div class="callout primary margin-top">
|
<div class="callout primary margin-top">
|
||||||
<%= t('admin.questions.index.no_questions') %>
|
<%= t("admin.questions.index.no_questions") %>
|
||||||
</div>
|
</div>
|
||||||
<% else %>
|
<% else %>
|
||||||
<table class="fixed">
|
<table class="fixed">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th><%= t('admin.questions.index.table_question') %></th>
|
<th class="small-8"><%= t("admin.questions.index.table_question") %></th>
|
||||||
<th class="text-right"><%= t("admin.actions.actions") %></th>
|
<th><%= t("admin.actions.actions") %></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<% @questions.each do |question| %>
|
<% @questions.each do |question| %>
|
||||||
<tr id="<%= dom_id(question) %>">
|
<tr id="<%= dom_id(question) %>">
|
||||||
<td><%= link_to question.title, admin_question_path(question) %></td>
|
<td><%= link_to question.title, admin_question_path(question) %></td>
|
||||||
<td class="text-right">
|
<td>
|
||||||
<%= link_to t('shared.edit'), edit_admin_question_path(question), class: "button hollow" %>
|
<div class="small-6 column">
|
||||||
<%= link_to t('shared.delete'), admin_question_path(question), class: "button hollow alert", method: :delete %>
|
<%= link_to t("shared.edit"), edit_admin_question_path(question), class: "button hollow expanded" %>
|
||||||
|
</div>
|
||||||
|
<div class="small-6 column">
|
||||||
|
<%= link_to t("shared.delete"), admin_question_path(question), class: "button hollow alert expanded", method: :delete %>
|
||||||
|
<div class="small-6 column">
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<table class="fixed">
|
<table class="fixed">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th><%= t('admin.questions.index.table_proposal') %></th>
|
<th class="small-9"><%= t("admin.questions.index.table_proposal") %></th>
|
||||||
<th class="text-right"><%= t("admin.actions.actions") %></th>
|
<th><%= t("admin.actions.actions") %></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<strong><%= proposal.question %></strong>
|
<strong><%= proposal.question %></strong>
|
||||||
</p>
|
</p>
|
||||||
</td>
|
</td>
|
||||||
<td class="text-right">
|
<td>
|
||||||
<%= link_to t("admin.questions.index.create_question"),
|
<%= link_to t("admin.questions.index.create_question"),
|
||||||
new_admin_question_path(proposal_id: proposal.id),
|
new_admin_question_path(proposal_id: proposal.id),
|
||||||
class: "button hollow" %>
|
class: "button hollow" %>
|
||||||
|
|||||||
@@ -12,8 +12,8 @@
|
|||||||
ckeditor: { language: I18n.locale } %>
|
ckeditor: { language: I18n.locale } %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="small-12 medium-6 large-4 margin-top">
|
<div class="small-12 medium-4 large-2 margin-top">
|
||||||
<%= f.submit(class: "button expanded", value: t("shared.save")) %>
|
<%= f.submit(class: "button success expanded", value: t("shared.save")) %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
<ul class="breadcrumbs margin-top">
|
<ul class="breadcrumbs margin-top">
|
||||||
<li><%= @answer.title %></li>
|
<li><%= @answer.title %></li>
|
||||||
<li><%= t('admin.answers.edit.title') %></li>
|
<li><%= t("admin.answers.edit.title") %></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h2 class="margin-top">
|
<h2 class="margin-top">
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
<ul class="breadcrumbs margin-top">
|
<ul class="breadcrumbs margin-top">
|
||||||
<li><%= @question.title %></li>
|
<li><%= @question.title %></li>
|
||||||
<li><%= t('admin.answers.new.title') %></li>
|
<li><%= t("admin.answers.new.title") %></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h2><%= t('admin.answers.new.title') %></h2>
|
<h2><%= t("admin.answers.new.title") %></h2>
|
||||||
|
|
||||||
<div class="poll-question-answer-form">
|
<div class="poll-question-answer-form">
|
||||||
<%= render "form", form_url: admin_question_answers_path %>
|
<%= render "form", form_url: admin_question_answers_path %>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<h2 class="inline-block"><%= t('admin.questions.index.title') %></h2>
|
<h2 class="inline-block"><%= t("admin.questions.index.title") %></h2>
|
||||||
|
|
||||||
<%= link_to t('admin.questions.index.create'), new_admin_question_path,
|
<%= link_to t("admin.questions.index.create"), new_admin_question_path,
|
||||||
class: "button success float-right" %>
|
class: "button float-right" %>
|
||||||
|
|
||||||
<div class="small-12 medium-6">
|
<div class="small-12 medium-6">
|
||||||
<%= render 'search' %>
|
<%= render 'search' %>
|
||||||
|
|||||||
@@ -29,13 +29,15 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="clear">
|
||||||
|
<%= link_to t("admin.questions.show.add_answer"), new_admin_question_answer_path(@question),
|
||||||
|
class: "button float-right" %>
|
||||||
|
</div>
|
||||||
|
|
||||||
<table class="margin-top">
|
<table class="margin-top">
|
||||||
<tr>
|
<tr>
|
||||||
<th colspan="5" scope="col" class="with-button">
|
<th colspan="5" scope="col" class="with-button">
|
||||||
<%= t('admin.questions.show.valid_answers') %>
|
<%= t('admin.questions.show.valid_answers') %>
|
||||||
<%= link_to t("admin.questions.show.add_answer"),
|
|
||||||
new_admin_question_answer_path(@question),
|
|
||||||
class: "button float-right" %>
|
|
||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
<div class="row">
|
<div class="small-12 medium-6">
|
||||||
<div class="small-12 medium-6 column">
|
|
||||||
<%= form_tag search_officers_admin_booth_shifts_path,
|
<%= form_tag search_officers_admin_booth_shifts_path,
|
||||||
method: :get, remote: true do |f| %>
|
method: :get, remote: true do |f| %>
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
@@ -13,7 +12,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="search-officers-results"></div>
|
<div id="search-officers-results"></div>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<th><%= t("admin.poll_shifts.new.date") %></th>
|
<th><%= t("admin.poll_shifts.new.date") %></th>
|
||||||
<th><%= t("admin.poll_shifts.new.officer") %></th>
|
<th><%= t("admin.poll_shifts.new.officer") %></th>
|
||||||
<th><%= t("admin.poll_shifts.new.task") %></th>
|
<th><%= t("admin.poll_shifts.new.task") %></th>
|
||||||
<th class="text-right"><%= t("admin.poll_shifts.new.shift") %></th>
|
<th class="small-3"><%= t("admin.poll_shifts.new.shift") %></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@@ -14,11 +14,11 @@
|
|||||||
<td><%= l(shift.date.to_date, format: :long) %></td>
|
<td><%= l(shift.date.to_date, format: :long) %></td>
|
||||||
<td><%= shift.officer_name %></td>
|
<td><%= shift.officer_name %></td>
|
||||||
<td><%= t("admin.poll_shifts.#{shift.task}") %></td>
|
<td><%= t("admin.poll_shifts.#{shift.task}") %></td>
|
||||||
<td class="text-right">
|
<td>
|
||||||
<%= link_to t("admin.poll_shifts.new.remove_shift"),
|
<%= link_to t("admin.poll_shifts.new.remove_shift"),
|
||||||
admin_booth_shift_path(@booth, shift),
|
admin_booth_shift_path(@booth, shift),
|
||||||
method: :delete,
|
method: :delete,
|
||||||
class: "button hollow alert" %>
|
class: "button hollow alert expanded" %>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -1,13 +1,23 @@
|
|||||||
<h2><%= t("admin.settings.index.title") %></h2>
|
<h2><%= t("admin.settings.index.title") %></h2>
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th><%= t("admin.settings.setting_name") %></th>
|
||||||
|
<th><%= t("admin.settings.setting_value") %></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<% @settings.each do |setting| %>
|
<% @settings.each do |setting| %>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="small-12 medium-4">
|
<td class="small-6">
|
||||||
<strong><%= t("settings.#{setting.key}") %></strong>
|
<strong><%= t("settings.#{setting.key}") %></strong>
|
||||||
|
<br>
|
||||||
|
<span class="small">
|
||||||
|
<%= t("settings.#{setting.key}_description", default: t("admin.settings.no_description")) %>
|
||||||
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td class="small-12 medium-8">
|
<td class="small-6">
|
||||||
<%= form_for(setting, url: admin_setting_path(setting), html: { id: "edit_#{dom_id(setting)}"}) do |f| %>
|
<%= form_for(setting, url: admin_setting_path(setting), html: { id: "edit_#{dom_id(setting)}"}) do |f| %>
|
||||||
<div class="small-12 medium-6 large-9 column">
|
<div class="small-12 medium-6 large-9 column">
|
||||||
<%= f.text_area :value, label: false, id: dom_id(setting), lines: 1 %>
|
<%= f.text_area :value, label: false, id: dom_id(setting), lines: 1 %>
|
||||||
|
|||||||
@@ -1,15 +1,36 @@
|
|||||||
<h2><%= t("admin.settings.index.feature_flags") %></h2>
|
<h2><%= t("admin.settings.index.feature_flags") %></h2>
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th><%= t("admin.settings.setting") %></th>
|
||||||
|
<th><%= t("admin.settings.setting_status") %></th>
|
||||||
|
<th><%= t("admin.settings.setting_actions") %></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<% @feature_flags.each do |feature_flag| %>
|
<% @feature_flags.each do |feature_flag| %>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td class="small-8">
|
||||||
<strong><%= t("settings.#{feature_flag.key}") %></strong>
|
<strong><%= t("settings.#{feature_flag.key}") %></strong>
|
||||||
|
<br>
|
||||||
|
<span class="small">
|
||||||
|
<%= t("settings.#{feature_flag.key}_description", default: t("admin.settings.no_description")) %>
|
||||||
|
</span>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
<%= feature_flag.enabled? ? t("admin.settings.index.features.enabled") : t("admin.settings.index.features.disabled") %>
|
<% if feature_flag.enabled? %>
|
||||||
|
<span class="enabled">
|
||||||
|
<strong>
|
||||||
|
<%= t ("admin.settings.index.features.enabled") %>
|
||||||
|
</strong>
|
||||||
|
</span>
|
||||||
|
<% else %>
|
||||||
|
<span class="disabled">
|
||||||
|
<%= t("admin.settings.index.features.disabled") %>
|
||||||
|
</span>
|
||||||
|
<% end %>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td class="text-right">
|
<td class="text-right">
|
||||||
|
|||||||
@@ -1,4 +1,10 @@
|
|||||||
<ul class="tabs" data-tabs id="settings-tabs">
|
<ul class="tabs"
|
||||||
|
id="settings-tabs"
|
||||||
|
data-deep-link="true"
|
||||||
|
data-update-history="true"
|
||||||
|
data-deep-link-smudge="true"
|
||||||
|
data-deep-link-smudge-delay="500"
|
||||||
|
data-tabs>
|
||||||
<li class="tabs-title is-active">
|
<li class="tabs-title is-active">
|
||||||
<%= link_to "#tab-configuration" do %>
|
<%= link_to "#tab-configuration" do %>
|
||||||
<%= t("admin.settings.index.title") %>
|
<%= t("admin.settings.index.title") %>
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
<div class="row">
|
|
||||||
<div class="small-12 medium-6 column">
|
<div class="small-12 medium-6 column">
|
||||||
<%= f.label :name %>
|
<%= f.label :name %>
|
||||||
<%= f.select :name, SiteCustomization::ContentBlock::VALID_BLOCKS.map { |key| [t("admin.site_customization.content_blocks.content_block.names.#{key}"), key] }, label: false %>
|
<%= f.select :name, SiteCustomization::ContentBlock::VALID_BLOCKS.map { |key| [t("admin.site_customization.content_blocks.content_block.names.#{key}"), key] }, label: false %>
|
||||||
@@ -27,10 +27,9 @@
|
|||||||
<div class="small-12 column">
|
<div class="small-12 column">
|
||||||
<%= f.label :body %>
|
<%= f.label :body %>
|
||||||
<%= f.text_area :body, label: false, rows: 10 %>
|
<%= f.text_area :body, label: false, rows: 10 %>
|
||||||
<div class="small-12 medium-6 large-4">
|
<div class="small-12 medium-6 large-3">
|
||||||
<%= f.submit class: "button success expanded" %>
|
<%= f.submit class: "button success expanded" %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -1,14 +1,16 @@
|
|||||||
<% provide :title do %>
|
<% provide :title do %>
|
||||||
Admin - <%= t("admin.menu.site_customization.content_blocks") %> - <%= @content_block.name %> (<%= @content_block.locale %>)
|
<%= t("admin.header.title") %> - <%= t("admin.menu.site_customization.content_blocks") %> - <%= @content_block.name %> (<%= @content_block.locale %>)
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<%= back_link_to admin_site_customization_content_blocks_path %>
|
<%= back_link_to admin_site_customization_content_blocks_path %>
|
||||||
|
|
||||||
<%= button_to t("admin.site_customization.content_blocks.index.delete"), admin_site_customization_content_block_path(@content_block), method: :delete, class: "button hollow alert float-right small" %>
|
<%= link_to t("admin.site_customization.content_blocks.index.delete"),
|
||||||
|
admin_site_customization_content_block_path(@content_block),
|
||||||
|
method: :delete,
|
||||||
|
class: "delete float-right" %>
|
||||||
|
|
||||||
<div class="row">
|
<div class="small-12 column">
|
||||||
<div class="small-12 column">
|
|
||||||
<h2><%= t("admin.site_customization.content_blocks.edit.title") %></h2>
|
<h2><%= t("admin.site_customization.content_blocks.edit.title") %></h2>
|
||||||
<%= render 'form' %>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<%= render 'form' %>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<% provide :title do %>
|
<% provide :title do %>
|
||||||
Admin - <%= t("admin.menu.site_customization.content_blocks") %>
|
<%= t("admin.header.title") %> - <%= t("admin.menu.site_customization.content_blocks") %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<%= link_to t("admin.site_customization.content_blocks.index.create"), new_admin_site_customization_content_block_path, class: "button float-right" %>
|
<%= link_to t("admin.site_customization.content_blocks.index.create"), new_admin_site_customization_content_block_path, class: "button float-right" %>
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
<td><%= link_to "#{content_block.name} (#{content_block.locale})", edit_admin_site_customization_content_block_path(content_block) %></td>
|
<td><%= link_to "#{content_block.name} (#{content_block.locale})", edit_admin_site_customization_content_block_path(content_block) %></td>
|
||||||
<td><%= content_block.body.html_safe %></td>
|
<td><%= content_block.body.html_safe %></td>
|
||||||
<td>
|
<td>
|
||||||
<%= button_to t("admin.site_customization.content_blocks.index.delete"),
|
<%= link_to t("admin.site_customization.content_blocks.index.delete"),
|
||||||
admin_site_customization_content_block_path(content_block),
|
admin_site_customization_content_block_path(content_block),
|
||||||
method: :delete, class: "button hollow alert" %>
|
method: :delete, class: "button hollow alert" %>
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
<% provide :title do %>
|
<% provide :title do %>
|
||||||
Admin - <%= t("admin.menu.site_customization.content_blocks") %> - <%= t("admin.site_customization.content_blocks.new.title") %>
|
<%= t("admin.header.title") %> - <%= t("admin.menu.site_customization.content_blocks") %> - <%= t("admin.site_customization.content_blocks.new.title") %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<%= back_link_to admin_site_customization_content_blocks_path %>
|
<%= back_link_to admin_site_customization_content_blocks_path %>
|
||||||
|
|
||||||
<div class="row">
|
<div class="small-12 column">
|
||||||
<div class="small-12 column">
|
|
||||||
<h2><%= t("admin.site_customization.content_blocks.new.title") %></h2>
|
<h2><%= t("admin.site_customization.content_blocks.new.title") %></h2>
|
||||||
<%= render 'form' %>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<%= render 'form' %>
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
<%= render "globalize_locales" %>
|
||||||
|
|
||||||
|
<%= form_tag admin_site_customization_information_texts_path do %>
|
||||||
|
<% I18n.available_locales.each do |l| %>
|
||||||
|
<%= hidden_field_tag "delete_translations[#{l}]", 0 %>
|
||||||
|
<% end %>
|
||||||
|
<% contents.each do |group| %>
|
||||||
|
<% group.each do |content| %>
|
||||||
|
<b><%= content.key %></b>
|
||||||
|
<% content.globalize_locales.each do |locale| %>
|
||||||
|
<%= render "form_field", content: content, locale: locale %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<%= submit_tag t("admin.menu.site_customization.buttons.save"), class: "button" %>
|
||||||
|
<% end %>
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<% globalize(locale) do %>
|
||||||
|
|
||||||
|
<% i18n_content = I18nContent.where(key: content.key).first %>
|
||||||
|
<% if i18n_content.present? %>
|
||||||
|
<% i18n_content_translation = I18nContentTranslation.where(i18n_content_id: i18n_content.id, locale: locale).first.try(:value) %>
|
||||||
|
<% else %>
|
||||||
|
<% i18n_content_translation = false %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<%= hidden_field_tag "contents[content_#{content.key}][id]", content.key %>
|
||||||
|
<%= text_area_tag "contents[content_#{content.key}]values[value_#{locale}]",
|
||||||
|
i18n_content_translation ||
|
||||||
|
t(content.key, locale: locale),
|
||||||
|
{ rows: 5,
|
||||||
|
class: "js-globalize-attribute",
|
||||||
|
style: display_translation?(locale),
|
||||||
|
data: { locale: locale }
|
||||||
|
} %>
|
||||||
|
<% end %>
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
<% I18n.available_locales.each do |locale| %>
|
||||||
|
<%= link_to t("admin.milestones.form.remove_language"), "#",
|
||||||
|
id: "delete-#{neutral_locale(locale)}",
|
||||||
|
style: show_delete?(locale),
|
||||||
|
class: 'float-right delete js-delete-language',
|
||||||
|
data: { locale: neutral_locale(locale) } %>
|
||||||
|
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<ul class="tabs" data-tabs id="globalize_locale">
|
||||||
|
<% I18n.available_locales.each do |locale| %>
|
||||||
|
<li class="tabs-title">
|
||||||
|
<%= link_to name_for_locale(locale), "#",
|
||||||
|
style: site_customization_display_translation?(locale),
|
||||||
|
class: "js-globalize-locale-link #{highlight_current?(locale)}",
|
||||||
|
data: { locale: neutral_locale(locale) },
|
||||||
|
remote: true %>
|
||||||
|
</li>
|
||||||
|
<% end %>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<div class="small-12 medium-6">
|
||||||
|
<%= select_tag :translation_locale,
|
||||||
|
options_for_locale_select,
|
||||||
|
prompt: t("admin.milestones.form.add_language"),
|
||||||
|
class: "js-globalize-locale" %>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<ul id="information-texts-tabs" class="tabs" >
|
||||||
|
<% [:debates, :community, :proposals, :polls, :layouts, :mailers, :management, :guides, :welcome].each do |tab| %>
|
||||||
|
<li class="tabs-title <%= "is-active" if tab.to_s == @tab %>">
|
||||||
|
<%= link_to t("admin.menu.site_customization.information_texts_menu.#{tab}"), admin_site_customization_information_texts_path(tab: tab) %>
|
||||||
|
</li>
|
||||||
|
<% end %>
|
||||||
|
</ul>
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
<h2><%= t("admin.menu.site_customization.information_texts") %></h2>
|
||||||
|
|
||||||
|
<div class="tabs-content" data-tabs-content="information-texts-tabs" role="tablist">
|
||||||
|
<%= render 'tabs' %>
|
||||||
|
|
||||||
|
<div class="tabs-panel is-active" role="tab">
|
||||||
|
<%= render "form", contents: [@content] %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user