Merge branch 'master' into feature/1-nav-content-blocks

This commit is contained in:
Alberto
2018-09-05 12:41:07 +02:00
committed by GitHub
192 changed files with 2816 additions and 1581 deletions

View File

@@ -34,21 +34,12 @@ If you want to contribute code to solve an issue:
* Fork the project.
* Create a topic branch based on master.
* 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)
* 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)
## 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
* If you think there's a feature missing, or find a bug, create an issue (make sure it has not already been reported).

View File

@@ -1,7 +1,11 @@
# Use Ruby 2.3.6 as base image
FROM ruby:2.3.6
ENV DEBIAN_FRONTEND noninteractive
# 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
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
RUN gem install bundler
# Finish establishing our Ruby enviornment
# Finish establishing our Ruby environment
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 . .
# 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`)
#CMD [ "config/containers/app_cmd.sh" ]
# CMD [ "config/containers/app_cmd.sh" ]
CMD ["bundle", "exec", "rails", "server", "-b", "0.0.0.0"]

View File

@@ -33,6 +33,7 @@
//= require moderator_comment
//= require moderator_debates
//= require moderator_proposals
//= require moderator_budget_investments
//= require moderator_proposal_notifications
//= require prevent_double_submission
//= require gettext

View File

@@ -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()

View File

@@ -46,6 +46,10 @@ $sidebar-active: #f4fcd0;
.top-links {
background: #000;
a {
line-height: rem-calc($line-height * 1.5);
}
}
.admin-top-bar {
@@ -190,6 +194,11 @@ $sidebar-active: #f4fcd0;
&.with-button {
line-height: $line-height * 2;
.button {
background: #fff;
color: $brand;
}
}
}
@@ -204,6 +213,19 @@ $sidebar-active: #f4fcd0;
table {
thead {
color: #fff;
}
th {
background: $brand;
color: #fff;
label {
color: #fff;
}
}
.break {
word-break: break-word;
}
@@ -220,7 +242,6 @@ $sidebar-active: #f4fcd0;
@include breakpoint(medium) {
margin-left: $line-height / 2;
margin-right: $line-height / 2;
margin-top: 0;
}
}
@@ -335,6 +356,14 @@ $sidebar-active: #f4fcd0;
margin-bottom: 0 !important;
}
.enabled {
color: $color-success;
}
.disabled {
color: $text-medium;
}
// 02. Sidebar
// -----------

View File

@@ -878,11 +878,6 @@ footer {
h1 {
margin-top: $line-height;
img {
height: rem-calc(80);
width: rem-calc(80);
}
a {
color: #fff;
display: block;

View File

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

View File

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

View File

@@ -3,18 +3,32 @@ module FlagActions
def flag
Flag.flag(current_user, flaggable)
respond_with flaggable, template: "#{controller_name}/_refresh_flag_actions"
if controller_name == 'investments'
respond_with flaggable, template: "budgets/#{controller_name}/_refresh_flag_actions"
else
respond_with flaggable, template: "#{controller_name}/_refresh_flag_actions"
end
end
def unflag
Flag.unflag(current_user, flaggable)
respond_with flaggable, template: "#{controller_name}/_refresh_flag_actions"
if controller_name == 'investments'
respond_with flaggable, template: "budgets/#{controller_name}/_refresh_flag_actions"
else
respond_with flaggable, template: "#{controller_name}/_refresh_flag_actions"
end
end
private
def flaggable
instance_variable_get("@#{resource_model.to_s.downcase}")
if resource_model.to_s == 'Budget::Investment'
instance_variable_get("@investment")
else
instance_variable_get("@#{resource_model.to_s.downcase}")
end
end
end
end

View File

@@ -3,7 +3,11 @@ module Polymorphic
private
def resource
@resource ||= instance_variable_get("@#{resource_name}")
if resource_model.to_s == 'Budget::Investment'
@resource ||= instance_variable_get("@investment")
else
@resource ||= instance_variable_get("@#{resource_name}")
end
end
def resource_name

View File

@@ -6,6 +6,7 @@ class Management::BaseController < ActionController::Base
helper_method :managed_user
helper_method :current_user
helper_method :manager_logged_in
private
@@ -22,7 +23,10 @@ class Management::BaseController < ActionController::Base
end
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
def check_verified_user(alert_msg)
@@ -49,4 +53,11 @@ class Management::BaseController < ActionController::Base
def clear_password
session[:new_password] = nil
end
def manager_logged_in
if current_manager
@manager_logged_in = User.find_by(id: session[:manager]["login"].last(1))
end
end
end

View 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

View File

@@ -14,6 +14,7 @@ class StatsController < ApplicationController
@debate_votes = daily_cache('debate_votes') { Vote.where(votable_type: 'Debate').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 }
@investment_votes = daily_cache('budget_investment_votes') { Vote.where(votable_type: 'Budget::Investment').count }
@votes = daily_cache('votes') { Vote.count }
@verified_users = daily_cache('verified_users') { User.with_hidden.level_two_or_three_verified.count }

View File

@@ -11,7 +11,7 @@ class Users::SessionsController < Devise::SessionsController
end
def after_sign_out_path_for(resource)
request.referer.present? ? request.referer : super
request.referer.present? && !request.referer.match("management") ? request.referer : super
end
def verifying_via_email?

View File

@@ -1,19 +1,31 @@
module AdminHelper
def side_menu
render "/#{namespace}/menu"
if namespace == 'moderation/budgets'
render "/moderation/menu"
else
render "/#{namespace}/menu"
end
end
def namespaced_root_path
"/#{namespace}"
if namespace == 'moderation/budgets'
"/moderation"
else
"/#{namespace}"
end
end
def namespaced_header_title
t("#{namespace}.header.title")
if namespace == 'moderation/budgets'
t("moderation.header.title")
else
t("#{namespace}.header.title")
end
end
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
def menu_budget?
@@ -21,11 +33,11 @@ module AdminHelper
end
def menu_polls?
%w[polls questions answers].include?(controller_name)
%w[polls questions answers recounts results].include?(controller_name)
end
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
def menu_profiles?
@@ -37,7 +49,7 @@ module AdminHelper
end
def menu_customization?
["pages", "banners"].include?(controller_name) || menu_homepage?
["pages", "banners", "information_texts"].include?(controller_name) || menu_homepage?
end
def menu_homepage?

View 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

View File

@@ -52,8 +52,8 @@ module UsersHelper
current_user && current_user.manager?
end
def show_admin_menu?
current_administrator? || current_moderator? || current_valuator? || current_manager?
def show_admin_menu?(user = nil)
current_administrator? || current_moderator? || current_valuator? || current_manager? || (user && user.administrator?)
end
def interests_title_text(user)

View File

@@ -17,6 +17,9 @@ module Abilities
can :restore, Legislation::Proposal
cannot :restore, Legislation::Proposal, hidden_at: nil
can :restore, Budget::Investment
cannot :restore, Budget::Investment, hidden_at: nil
can :restore, User
cannot :restore, User, hidden_at: nil
@@ -32,6 +35,9 @@ module Abilities
can :confirm_hide, Legislation::Proposal
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
cannot :confirm_hide, User, hidden_at: nil

View File

@@ -46,6 +46,9 @@ module Abilities
can [:flag, :unflag], Legislation::Proposal
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 [:destroy], Document, documentable: { author_id: user.id }

View File

@@ -63,6 +63,15 @@ module Abilities
cannot :moderate, ProposalNotification, author_id: user.id
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

View File

@@ -23,6 +23,7 @@ class Budget
include Relationable
include Notifiable
include Filterable
include Flaggable
belongs_to :author, -> { with_hidden }, class_name: 'User', foreign_key: 'author_id'
belongs_to :heading
@@ -81,6 +82,8 @@ class Budget
scope :winners, -> { selected.compatible.where(winner: true) }
scope :unselected, -> { not_unfeasible.where(selected: false) }
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_group, ->(group_id) { where(group_id: group_id) }

View 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

View 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

View File

@@ -1,7 +1,7 @@
class SiteCustomization::Image < ActiveRecord::Base
VALID_IMAGES = {
"icon_home" => [330, 240],
"logo_header" => [80, 80],
"logo_header" => [260, 80],
"social_media_icon" => [470, 246],
"social_media_icon_twitter" => [246, 246],
"apple-touch-icon-200" => [200, 200]

View File

@@ -182,6 +182,7 @@ class User < ActiveRecord::Base
debates_ids = Debate.where(author_id: id).pluck(:id)
comments_ids = Comment.where(user_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)
hide
@@ -189,6 +190,7 @@ class User < ActiveRecord::Base
Debate.hide_all debates_ids
Comment.hide_all comments_ids
Proposal.hide_all proposal_ids
Budget::Investment.hide_all investment_ids
ProposalNotification.hide_all proposal_notification_ids
end

View File

@@ -7,7 +7,7 @@
<strong><%= t("admin.menu.title_polls") %></strong>
</a>
<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 %>
</li>
@@ -25,7 +25,7 @@
<strong><%= t("admin.menu.title_booths") %></strong>
</a>
<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 %>
</li>
@@ -35,12 +35,12 @@
</li>
<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 %>
</li>
<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 %>
</li>
</ul>
@@ -110,7 +110,7 @@
<ul <%= "class=is-active" if menu_customization? &&
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 %>
</li>
@@ -121,6 +121,10 @@
<li <%= "class=is-active" if controller_name == "banners" %>>
<%= link_to t("admin.menu.banner"), admin_banners_path %>
</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>
</li>
@@ -151,6 +155,12 @@
</li>
<% 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" %>>
<%= link_to t("admin.menu.hidden_comments"), admin_comments_path %>
</li>

View File

@@ -9,7 +9,7 @@
<th><%= t("admin.admin_notifications.index.title") %></th>
<th><%= t("admin.admin_notifications.index.segment_recipient") %></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>
</thead>
<tbody>
@@ -28,21 +28,29 @@
<%= l admin_notification.sent_at.to_date %>
<% end %>
</td>
<td class="text-right">
<td>
<% if admin_notification.draft? %>
<%= link_to t("admin.admin_notifications.index.edit"),
edit_admin_admin_notification_path(admin_notification),
method: :get, class: "button hollow" %>
<%= link_to t("admin.admin_notifications.index.delete"),
admin_admin_notification_path(admin_notification),
method: :delete, class: "button hollow alert" %>
<%= link_to t("admin.admin_notifications.index.preview"),
admin_admin_notification_path(admin_notification),
class: "button" %>
<div class="small-4 column">
<%= link_to t("admin.admin_notifications.index.edit"),
edit_admin_admin_notification_path(admin_notification),
method: :get, class: "button expanded hollow" %>
</div>
<div class="small-4 column">
<%= link_to t("admin.admin_notifications.index.delete"),
admin_admin_notification_path(admin_notification),
method: :delete, class: "button expanded hollow alert" %>
</div>
<div class="small-4 column">
<%= link_to t("admin.admin_notifications.index.preview"),
admin_admin_notification_path(admin_notification),
class: "button expanded" %>
</div>
<% else %>
<%= link_to t("admin.admin_notifications.index.view"),
admin_admin_notification_path(admin_notification),
class: "button" %>
<div class="small-4 column">
<%= link_to t("admin.admin_notifications.index.view"),
admin_admin_notification_path(admin_notification),
class: "button expanded" %>
</div>
<% end %>
</td>
</tr>

View File

@@ -2,76 +2,74 @@
<h2><%= t("admin.admin_notifications.show.section_title") %></h2>
<div class="small-12 column">
<div class="callout highlight">
<div class="row">
<div class="small-12 medium-6 column">
<strong><%= t("admin.admin_notifications.show.sent_at") %></strong><br>
<% if @admin_notification.draft? %>
<%= t("admin.admin_notifications.index.draft") %>
<% else %>
<%= l(@admin_notification.sent_at.to_date) %>
<% end %>
</div>
<div class="small-12 medium-6 column">
<strong><%= t("admin.admin_notifications.show.title") %></strong><br>
<%= @admin_notification.title %>
</div>
</div>
<div class="row">
<div class="small-12 medium-6 column">
<strong><%= t("admin.admin_notifications.show.body") %></strong><br>
<%= @admin_notification.body %>
</div>
<div class="small-12 medium-6 column">
<strong><%= t("admin.admin_notifications.show.link") %></strong><br>
<%= @admin_notification.link %>
</div>
</div>
<div class="row">
<div class="small-12 column">
<strong><%= t("admin.admin_notifications.show.segment_recipient") %></strong><br>
<%= segment_name(@admin_notification.segment_recipient) %>
<% if @admin_notification.draft? %>
<%= t("admin.admin_notifications.show.will_get_notified",
n: @admin_notification.list_of_recipients_count) %>
<% else %>
<%= t("admin.admin_notifications.show.got_notified",
n: @admin_notification.recipients_count) %>
<% end %>
</div>
</div>
</div>
<p class="help-text" id="phase-description-help-text">
<div class="small-12 column callout highlight">
<div class="small-12 medium-6 column">
<strong><%= t("admin.admin_notifications.show.sent_at") %></strong><br>
<% if @admin_notification.draft? %>
<%= t("admin.admin_notifications.show.preview_guide") %>
<%= t("admin.admin_notifications.index.draft") %>
<% else %>
<%= t("admin.admin_notifications.show.sent_guide") %>
<%= l(@admin_notification.sent_at.to_date) %>
<% end %>
</div>
<div class="small-12 medium-6 column">
<strong><%= t("admin.admin_notifications.show.title") %></strong><br>
<%= @admin_notification.title %>
</div>
<div class="small-12 medium-6 column">
<strong><%= t("admin.admin_notifications.show.body") %></strong><br>
<%= @admin_notification.body %>
</div>
<div class="small-12 medium-6 column">
<strong><%= t("admin.admin_notifications.show.link") %></strong><br>
<%= @admin_notification.link %>
</div>
<div class="small-12 column">
<strong><%= t("admin.admin_notifications.show.segment_recipient") %></strong><br>
<%= segment_name(@admin_notification.segment_recipient) %>
<% if @admin_notification.draft? %>
<%= t("admin.admin_notifications.show.will_get_notified",
n: @admin_notification.list_of_recipients_count) %>
<% else %>
<%= t("admin.admin_notifications.show.got_notified",
n: @admin_notification.recipients_count) %>
<% end %>
</p>
<hr>
<div class="admin_notification-body-content">
<ul class="no-bullet clear notifications-list">
<li class="notification unread">
<% locals = { notification: nil,
title: @admin_notification.title,
body: @admin_notification.body,
timestamp: Time.current } %>
<% link_text = render partial: '/notifications/notification_body', locals: locals %>
<%= link_to_if @admin_notification.link.present?, link_text, @admin_notification.link %>
</li>
</ul>
</div>
<hr>
</div>
<p class="help-text" id="phase-description-help-text">
<% if @admin_notification.draft? %>
<%= t("admin.admin_notifications.show.preview_guide") %>
<% else %>
<%= t("admin.admin_notifications.show.sent_guide") %>
<% end %>
</p>
<hr>
<div class="admin_notification-body-content">
<ul class="no-bullet clear notifications-list">
<li class="notification unread">
<% locals = { notification: nil,
title: @admin_notification.title,
body: @admin_notification.body,
timestamp: Time.current } %>
<% link_text = render partial: '/notifications/notification_body', locals: locals %>
<%= link_to_if @admin_notification.link.present?, link_text, @admin_notification.link %>
</li>
</ul>
</div>
<hr>
<% if @admin_notification.draft? && @admin_notification.valid_segment_recipient? %>
<%= link_to t("admin.admin_notifications.show.send"),
deliver_admin_admin_notification_path(@admin_notification),
"data-alert": t("admin.admin_notifications.show.send_alert",
n: @admin_notification.list_of_recipients_count),
method: :post,
id: "js-send-admin_notification-alert",
class: "button success" %>
<div class="small-12 medium-6 large-3 column end">
<%= link_to t("admin.admin_notifications.show.send"),
deliver_admin_admin_notification_path(@admin_notification),
"data-alert": t("admin.admin_notifications.show.send_alert",
n: @admin_notification.list_of_recipients_count),
method: :post,
id: "js-send-admin_notification-alert",
class: "button success expanded" %>
</div>
<% end %>

View File

@@ -1,5 +1,5 @@
<%= 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>
@@ -13,14 +13,14 @@
<tr id="<%= dom_id(banner) %>">
<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" class="text-center"><%= t("admin.actions.actions")%></th>
<th scope="col" class="small-4"><%= t("admin.actions.actions")%></th>
</tr>
</thead>
<tbody>
<tr>
<td><%= banner.post_started_at %></td>
<td><%= banner.post_ended_at %></td>
<td class="text-right">
<td>
<div class="small-12 medium-6 column">
<%= link_to t("admin.banners.index.edit"), edit_admin_banner_path(banner),
class: 'button hollow expanded' %>
@@ -32,11 +32,9 @@
</div>
</td>
</tr>
<tr>
<th colspan="3" scope="col" class="text-center"><%= t("admin.banners.index.preview") %></th>
</tr>
<tr>
<td colspan="3">
<span class="help-text"><%= t("admin.banners.index.preview") %></span>
<div class="banner" style="background-color:<%= banner.background_color %>">
<%= link_to banner.target_url do %>
<h2 style="color:<%= banner.font_color %>"><%= banner.title %></h2>

View File

@@ -1,61 +1,61 @@
<% init_advanced_menu %>
<%= form_tag(admin_budget_budget_investments_path(budget: @budget), method: :get, enforce_utf8: false) do %>
<div class="row">
<div class="small-12 medium-8 large-12 column">
<%= link_to "#advanced_filters_content",
data: {toggle: "advanced_filters"},
class: "advanced-filters float-right clear" do %>
<%= t("admin.budget_investments.index.advanced_filters") %>
<% end %>
</div>
<div class="small-12 column">
<%= link_to "#advanced_filters_content",
data: {toggle: "advanced_filters"},
class: "advanced-filters float-right clear" do %>
<%= t("admin.budget_investments.index.advanced_filters") %>
<% end %>
</div>
<div id="advanced_filters" class="row advanced-filters-content <%= advanced_menu_visibility %>" data-toggler=".hide">
<div class="small-12 medium-8 large-12 column">
<% ["feasible", "selected", "undecided", "unfeasible"].each do |option| %>
<div id="advanced_filters" class="<%= advanced_menu_visibility %>" data-toggler=".hide">
<div class="small-12 column">
<div class="advanced-filters-content">
<% ["feasible", "selected", "undecided", "unfeasible"].each do |option| %>
<div class="filter">
<%= check_box_tag "advanced_filters[]", option, params[:advanced_filters].index(option), id: "advanced_filters_#{option}" %>
<%= t("admin.budget_investments.index.filters.#{option}") %>
</div>
<% end %>
<div class="filter">
<%= check_box_tag "advanced_filters[]", option, params[:advanced_filters].index(option), id: "advanced_filters_#{option}" %>
<%= t("admin.budget_investments.index.filters.#{option}") %>
<%= text_field_tag :min_total_supports, params["min_total_supports"], placeholder: t("admin.budget_investments.index.filters.min_total_supports") %>
</div>
<% end %>
<div class="filter">
<%= text_field_tag :min_total_supports, params["min_total_supports"], placeholder: t("admin.budget_investments.index.filters.min_total_supports") %>
</div>
</div>
</div>
<div class="row" >
<div class="small-12 medium-3 column">
<%= select_tag :administrator_id,
options_for_select(admin_select_options, params[:administrator_id]),
{ prompt: t("admin.budget_investments.index.administrator_filter_all"),
label: false} %>
</div>
<div class="small-12 medium-3 column">
<%= select_tag :valuator_or_group_id,
options_for_select(valuator_or_group_select_options, params[:valuator_or_group_id]),
{ prompt: t("admin.budget_investments.index.valuator_filter_all"),
label: false} %>
</div>
<div class="small-12 medium-3 column">
<%= select_tag :heading_id,
options_for_select(budget_heading_select_options(@budget), params[:heading_id]),
{ prompt: t("admin.budget_investments.index.heading_filter_all"),
label: false} %>
</div>
<div class="small-12 medium-3 column">
<%= select_tag :tag_name,
options_for_select(investment_tags_select_options(@budget), params[:tag_name]),
{ prompt: t("admin.budget_investments.index.tags_filter_all"),
label: false} %>
<div class="small-12 medium-3 column">
<%= select_tag :administrator_id,
options_for_select(admin_select_options, params[:administrator_id]),
{ prompt: t("admin.budget_investments.index.administrator_filter_all"),
label: false} %>
</div>
<div class="small-12 medium-3 column">
<%= select_tag :valuator_or_group_id,
options_for_select(valuator_or_group_select_options, params[:valuator_or_group_id]),
{ prompt: t("admin.budget_investments.index.valuator_filter_all"),
label: false} %>
</div>
<div class="small-12 medium-3 column">
<%= select_tag :heading_id,
options_for_select(budget_heading_select_options(@budget), params[:heading_id]),
{ prompt: t("admin.budget_investments.index.heading_filter_all"),
label: false} %>
</div>
<div class="small-12 medium-3 column">
<%= select_tag :tag_name,
options_for_select(investment_tags_select_options(@budget), params[:tag_name]),
{ prompt: t("admin.budget_investments.index.tags_filter_all"),
label: false} %>
</div>
<div class="small-12 medium-6 column">
<div class="input-group">
<%= text_field_tag :title_or_id, params["title_or_id"], placeholder: t("admin.budget_investments.index.placeholder") %>
</div>
</div>
<div class="row" >
<div class="small-12 medium-6 column">
<div class="input-group">
<%= text_field_tag :title_or_id, params["title_or_id"], placeholder: t("admin.budget_investments.index.placeholder") %>
</div>
</div>
<div class="small-12 medium-6 column">
<%= submit_tag t("admin.budget_investments.index.buttons.filter"), class: "button expanded" %>
</div>
<div class="small-12 medium-3 column end">
<%= submit_tag t("admin.budget_investments.index.buttons.filter"), class: "button expanded" %>
</div>
<% end %>

View File

@@ -1,67 +1,59 @@
<%= form_for [:admin, @phase.budget, @phase] do |f| %>
<div class="row">
<div class="row">
<div class="small-12 medium-6 column">
<%= f.label :starts_at, t("admin.budget_phases.edit.start_date") %>
<%= f.text_field :starts_at,
value: format_date_for_calendar_form(@phase.starts_at),
class: "js-calendar-full",
id: "start_date",
label: false %>
</div>
<div class="small-12 medium-6 column">
<%= f.label :ends_at, t("admin.budget_phases.edit.end_date") %>
<%= f.text_field :ends_at,
value: format_date_for_calendar_form(@phase.ends_at),
class: "js-calendar-full",
id: "end_date",
label: false %>
</div>
</div>
<div class="row margin-top">
<div class="small-12 medium-12 column">
<%= f.label :description, t("admin.budget_phases.edit.description") %>
<p class="help-text" id="phase-description-help-text">
<%= t("admin.budget_phases.edit.description_help_text") %>
</p>
<%= f.cktext_area :description,
maxlength: Budget::Phase::DESCRIPTION_MAX_LENGTH,
ckeditor: { language: I18n.locale },
label: false %>
</div>
</div>
<div class="row margin-top">
<div class="small-12 medium-12 column">
<%= f.label :summary, t("admin.budget_phases.edit.summary") %>
<p class="help-text" id="phase-summary-help-text">
<%= t("admin.budget_phases.edit.summary_help_text") %>
</p>
<%= f.cktext_area :summary,
maxlength: Budget::Phase::SUMMARY_MAX_LENGTH,
ckeditor: { language: I18n.locale },
label: false %>
</div>
</div>
<div class="row margin-top">
<div class="small-12 medium-12 column">
<%= f.check_box :enabled, label: t("admin.budget_phases.edit.enabled") %>
<p class="help-text" id="phase-summary-help-text">
<%= t("admin.budget_phases.edit.enabled_help_text") %>
</p>
</div>
</div>
<div class="margin-top">
<%= f.submit t("admin.budget_phases.edit.save_changes"), class: "button success" %>
</div>
<div class="small-12 medium-6 column">
<%= f.label :starts_at, t("admin.budget_phases.edit.start_date") %>
<%= f.text_field :starts_at,
value: format_date_for_calendar_form(@phase.starts_at),
class: "js-calendar-full",
id: "start_date",
label: false %>
</div>
<div class="small-12 medium-6 column">
<%= f.label :ends_at, t("admin.budget_phases.edit.end_date") %>
<%= f.text_field :ends_at,
value: format_date_for_calendar_form(@phase.ends_at),
class: "js-calendar-full",
id: "end_date",
label: false %>
</div>
<div class="small-12 column">
<%= f.label :description, t("admin.budget_phases.edit.description") %>
<span class="help-text" id="phase-description-help-text">
<%= t("admin.budget_phases.edit.description_help_text") %>
</span>
<%= f.cktext_area :description,
maxlength: Budget::Phase::DESCRIPTION_MAX_LENGTH,
ckeditor: { language: I18n.locale },
label: false %>
</div>
<div class="small-12 column margin-top">
<%= f.label :summary, t("admin.budget_phases.edit.summary") %>
<span class="help-text" id="phase-summary-help-text">
<%= t("admin.budget_phases.edit.summary_help_text") %>
</span>
<%= f.cktext_area :summary,
maxlength: Budget::Phase::SUMMARY_MAX_LENGTH,
ckeditor: { language: I18n.locale },
label: false %>
</div>
<div class="small-12 column margin-top">
<%= f.check_box :enabled, label: t("admin.budget_phases.edit.enabled") %>
<span class="help-text" id="phase-summary-help-text">
<%= t("admin.budget_phases.edit.enabled_help_text") %>
</span>
</div>
<div class="small-12 medium-4 large-3 column end margin-top">
<%= f.submit t("admin.budget_phases.edit.save_changes"), class: "button success expanded" %>
</div>
<% end %>

View File

@@ -1,5 +1,7 @@
<%= 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' %>

View File

@@ -1,59 +1,65 @@
<%= form_for [:admin, @budget] do |f| %>
<%= f.text_field :name, maxlength: Budget.title_max_length %>
<div class="small-12 medium-9 column">
<%= f.text_field :name, maxlength: Budget.title_max_length %>
</div>
<div class="row margin-top">
<div class="small-12 medium-9 column">
<div class="margin-top">
<div class="small-12 medium-6 column">
<%= f.select :phase, budget_phases_select_options, selected: "drafting" %>
</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 %>
</div>
</div>
<% if @budget.phases.present? %>
<table id='budget-phases-table' class="table-for-mobile">
<thead>
<tr>
<th><%= t("admin.budgets.edit.phase") %></th>
<th><%= t("admin.budgets.edit.dates") %></th>
<th class="text-center"><%= t("admin.budgets.edit.enabled") %></th>
<th><%= t("admin.budgets.edit.actions") %></th>
</tr>
</thead>
<div class="small-12 column">
<table id="budget-phases-table" class="table-for-mobile">
<thead>
<tr>
<th><%= t("admin.budgets.edit.phase") %></th>
<th><%= t("admin.budgets.edit.dates") %></th>
<th class="text-center"><%= t("admin.budgets.edit.enabled") %></th>
<th><%= t("admin.budgets.edit.actions") %></th>
</tr>
</thead>
<% @budget.phases.order(:id).each do |phase| %>
<tr id="<%= dom_id(phase) %>" class="phase">
<td>
<%= t("budgets.phase.#{phase.kind}") %>
<% if @budget.current_phase == phase %>
<span class="label success"><strong><%= t("admin.budgets.edit.active") %></strong></span>
<% end %>
</td>
<td>
<% if phase.starts_at.present? || phase.ends_at.present? %>
<%= l(phase.starts_at.to_date) if phase.starts_at.present? %>
-
<%= l(phase.ends_at.to_date) if phase.ends_at.present? %>
<% else %>
<em><%= t("admin.budgets.edit.blank_dates") %></em>
<% end %>
</td>
<td class="text-center">
<span class="budget-phase-enabled <%= phase.enabled? ? 'enabled' : 'disabled' %>"></span>
</td>
<td>
<%= link_to t("admin.budgets.edit.edit_phase"),
edit_admin_budget_budget_phase_path(@budget, phase),
method: :get, class: "button hollow" %>
</td>
</tr>
<% end %>
</table>
<% @budget.phases.order(:id).each do |phase| %>
<tr id="<%= dom_id(phase) %>" class="phase">
<td>
<%= t("budgets.phase.#{phase.kind}") %>
<% if @budget.current_phase == phase %>
<span class="label success"><strong><%= t("admin.budgets.edit.active") %></strong></span>
<% end %>
</td>
<td>
<% if phase.starts_at.present? || phase.ends_at.present? %>
<%= l(phase.starts_at.to_date) if phase.starts_at.present? %>
-
<%= l(phase.ends_at.to_date) if phase.ends_at.present? %>
<% else %>
<em><%= t("admin.budgets.edit.blank_dates") %></em>
<% end %>
</td>
<td class="text-center">
<span class="budget-phase-enabled <%= phase.enabled? ? 'enabled' : 'disabled' %>"></span>
</td>
<td>
<%= link_to t("admin.budgets.edit.edit_phase"),
edit_admin_budget_budget_phase_path(@budget, phase),
method: :get, class: "button hollow expanded" %>
</td>
</tr>
<% end %>
</table>
</div>
<% end %>
<div class="margin-top">
<%= f.submit nil, class: "button success" %>
<div class="small-12 column">
<div class="clear small-12 medium-4 large-3 inline-block">
<%= f.submit nil, class: "button success" %>
</div>
<div class="float-right">
<% if @budget.balloting_process? %>
@@ -72,9 +78,9 @@
<%= link_to t("admin.budgets.edit.delete"),
admin_budget_path(@budget),
method: :delete,
class: "button hollow alert float-right margin-left" %>
class: "delete float-right margin-left" %>
<% end %>
</div>
</div>
<% end %>

View File

@@ -1,5 +1,4 @@
<%= t("admin.budgets.form.max_votable_headings")%>
<%= content_tag(:strong,
t('admin.budgets.form.current_of_max_headings', current: current, max: max ),
class:"current-of-max-headings") %>
t("admin.budgets.form.current_of_max_headings", current: current, max: max),
class: "current-of-max-headings") %>

View File

@@ -1,5 +1,7 @@
<%= 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' %>

View File

@@ -2,7 +2,7 @@
<%= link_to t("admin.budgets.index.new_link"),
new_admin_budget_path,
class: "button float-right margin-right" %>
class: "button float-right" %>
<%= render 'shared/filter_subnav', i18n_namespace: "admin.budgets.index" %>

View File

@@ -1,7 +1,5 @@
<div class="row">
<div class="small-12 medium-9 column">
<h2><%= t("admin.budgets.new.title") %></h2>
<%= render '/admin/budgets/form' %>
</div>
<div class="small-12 column">
<h2><%= t("admin.budgets.new.title") %></h2>
</div>
<%= render '/admin/budgets/form' %>

View File

@@ -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>
<p><%= t("admin.dashboard.index.description", org: setting['org_name']) %></p>

View File

@@ -5,15 +5,13 @@
method: :get,
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">
<%= t('admin.emails_download.index.download_segment_help_text') %>
<%= t("admin.emails_download.index.download_segment_help_text") %>
</p>
<%= 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" %>
</div>
<%= submit_tag t("admin.emails_download.index.download_emails_button"), class: "button" %>
<% end %>
</div>

View File

@@ -1,4 +1,3 @@
<% if @geozone.errors.any? %>
<div id="error_explanation" data-alert class="callout alert" data-closable>

View File

@@ -2,28 +2,24 @@
<%= render 'errors' %>
<div clas="row">
<div class="small-12 medium-6 large-4 column">
<%= f.label :name, t("admin.geozones.geozone.name") %>
<%= f.text_field :name, label: false %>
</div>
<div class="small-12 medium-6 large-4 column">
<%= f.label :html_map_coordinates, t("admin.geozones.geozone.coordinates") %>
<%= f.text_field :html_map_coordinates, label: false %>
</div>
<div class="small-12 medium-6 large-2 column">
<%= f.label :external_code, t("admin.geozones.geozone.external_code") %>
<%= f.text_field :external_code, label: false %>
</div>
<div class="small-12 medium-6 large-2 column">
<%= f.label :census_code, t("admin.geozones.geozone.census_code") %>
<%= f.text_field :census_code, label: false %>
</div>
<div class="small-12 medium-6 large-4 column">
<%= f.label :name, t("admin.geozones.geozone.name") %>
<%= f.text_field :name, label: false %>
</div>
<div class="small-12 medium-6 large-4 column">
<%= f.label :html_map_coordinates, t("admin.geozones.geozone.coordinates") %>
<%= f.text_field :html_map_coordinates, label: false %>
</div>
<div class="small-12 medium-6 large-2 column">
<%= f.label :external_code, t("admin.geozones.geozone.external_code") %>
<%= f.text_field :external_code, label: false %>
</div>
<div class="small-12 medium-6 large-2 column">
<%= f.label :census_code, t("admin.geozones.geozone.census_code") %>
<%= f.text_field :census_code, label: false %>
</div>
<div class="row">
<div class="actions small-12 large-3 medium-3 column">
<%= f.submit(class: "button expanded", value: t("admin.geozones.edit.form.submit_button")) %>
</div>
<div class="small-12 large-3 medium-3 column end">
<%= f.submit(class: "button success expanded", value: t("admin.geozones.edit.form.submit_button")) %>
</div>
<% end %>

View File

@@ -1,9 +1,7 @@
<div class="row">
<div class="small-12 column">
<%= back_link_to admin_geozones_path, t("admin.geozones.edit.back") %>
<%= back_link_to admin_geozones_path, t("admin.geozones.edit.back") %>
<h1><%= t("admin.geozones.edit.editing") %></h1>
<%= render "form" %>
</div>
<div class="small-12 column">
<h2><%= t("admin.geozones.edit.editing") %></h2>
</div>
<%= render 'form' %>

View File

@@ -1,5 +1,5 @@
<%= 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>
@@ -10,7 +10,7 @@
<th><%= t("admin.geozones.geozone.external_code") %></th>
<th><%= t("admin.geozones.geozone.census_code") %></th>
<th><%= t("admin.geozones.geozone.coordinates") %></th>
<th colspan="2"></th>
<th><%= t("admin.actions.actions") %></th>
</tr>
</thead>
@@ -22,10 +22,17 @@
<td><%= geozone.census_code %></td>
<td class="break"><%= geozone.html_map_coordinates %></td>
<td>
<%= link_to t("admin.geozones.index.edit"), edit_admin_geozone_path(geozone), class: 'edit-banner button hollow' %>
</td>
<td>
<%= link_to t("admin.geozones.index.delete"), admin_geozone_path(geozone), method: :delete, class: 'button hollow alert' %>
<div class="small-6 column">
<%= link_to t("admin.geozones.index.edit"),
edit_admin_geozone_path(geozone),
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>
</tr>
<% end %>

View File

@@ -1,9 +1,7 @@
<div class="geozone-new row">
<div class="small-12 column">
<%= back_link_to admin_geozones_path, t("admin.geozones.new.back") %>
<%= back_link_to admin_geozones_path, t("admin.geozones.new.back") %>
<h1><%= t("admin.geozones.new.creating") %></h1>
<%= render "form" %>
</div>
<div class="small-12 column">
<h2><%= t("admin.geozones.new.creating") %></h2>
</div>
<%= render 'form' %>

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

View File

@@ -13,80 +13,66 @@
</div>
<% end %>
<div class="row">
<div class="small-12 medium-4 column">
<%= f.label :title %>
</div>
<div class="small-12 medium-8 column">
<%= f.text_field :title, label: false, placeholder: t('admin.legislation.draft_versions.form.title_placeholder') %>
</div>
<div class="small-12 medium-9 column">
<%= f.label :title %>
<%= f.text_field :title, label: false, placeholder: t("admin.legislation.draft_versions.form.title_placeholder") %>
</div>
<div class="row">
<div class="small-12 medium-4 column">
<%= f.label :changelog %>
<small><%= t('admin.legislation.draft_versions.form.use_markdown') %></small>
</div>
<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 class="small-12 medium-9 column">
<%= f.label :changelog %>
<span class="help-text"><%= t("admin.legislation.draft_versions.form.use_markdown") %></span>
<%= f.text_area :changelog, label: false, rows: 5, placeholder: t("admin.legislation.draft_versions.form.changelog_placeholder") %>
</div>
<div class="row">
<div class="small-12 medium-4 column">
<%= f.label :status %>
</div>
<div class="small-12 medium-8 column">
<% ::Legislation::DraftVersion::VALID_STATUSES.each do |status| %>
<%= f.radio_button :status, status, label: false %>
<%= f.label "status_#{status}", t("admin.legislation.draft_versions.statuses.#{status}") %>
<small><%= t("admin.legislation.draft_versions.form.hints.status.#{status}") %></small>
<br/>
<div class="small-12 medium-9 column">
<%= f.label :status %>
<% ::Legislation::DraftVersion::VALID_STATUSES.each do |status| %>
<%= f.radio_button :status, status, label: false %>
<%= f.label "status_#{status}", t("admin.legislation.draft_versions.statuses.#{status}") %>
<span class="help-text"><%= t("admin.legislation.draft_versions.form.hints.status.#{status}") %></span>
<br>
<% end %>
</div>
<div class="small-12 medium-9 column">
<%= f.label :final_version %>
<%= f.check_box :final_version, label: false %>
<span class="help-text"><%= t("admin.legislation.draft_versions.form.hints.final_version") %></span>
</div>
<div class="small-12 medium-4 column">
<%= f.label :body %>
<span class="help-text"><%= t("admin.legislation.draft_versions.form.use_markdown") %></span>
</div>
<div class="markdown-editor clear">
<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-buttons">
<%= f.submit(class: "button", value: t("admin.legislation.draft_versions.#{admin_submit_action(@draft_version)}.submit_button")) %>
</div>
<%= link_to "#", class: 'fullscreen-toggle' do %>
<span data-closed-text="<%= t("admin.legislation.draft_versions.form.launch_text_editor")%>"
data-open-text="<%= t("admin.legislation.draft_versions.form.close_text_editor")%>">
<strong><%= t("admin.legislation.draft_versions.form.launch_text_editor")%></strong>
</span>
<% end %>
</div>
</div>
<div class="row">
<div class="small-12 medium-4 column">
<%= f.label :final_version %>
<div class="small-12 medium-6 column markdown-area">
<%= f.text_area :body, label: false, placeholder: t("admin.legislation.draft_versions.form.body_placeholder") %>
</div>
<div class="small-12 medium-8 column">
<%= f.check_box :final_version, label: false %>
<small><%= t("admin.legislation.draft_versions.form.hints.final_version") %></small>
<div id="markdown-preview" class="small-12 medium-6 column markdown-preview">
</div>
</div>
<div class="row">
<div class="small-12 medium-4 column">
<%= f.label :body %>
<small><%= t('admin.legislation.draft_versions.form.use_markdown') %></small>
</div>
<div class="markdown-editor">
<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-buttons">
<%= f.submit(class: "button", value: t("admin.legislation.draft_versions.#{admin_submit_action(@draft_version)}.submit_button")) %>
</div>
<%= link_to "#", class: 'fullscreen-toggle' do %>
<span data-closed-text="<%= t("admin.legislation.draft_versions.form.launch_text_editor")%>"
data-open-text="<%= t("admin.legislation.draft_versions.form.close_text_editor")%>">
<strong><%= t("admin.legislation.draft_versions.form.launch_text_editor")%></strong>
</span>
<% end %>
</div>
<div class="small-12 medium-6 column markdown-area">
<%= f.text_area :body, label: false, placeholder: t('admin.legislation.draft_versions.form.body_placeholder') %>
</div>
<div id="markdown-preview" class="small-12 medium-6 column markdown-preview">
</div>
</div>
</div>
<div class="row margin-top primary-buttons">
<div class="actions small-12 medium-3 column legislation-process-save">
<%= f.submit(class: "button expanded", value: t("admin.legislation.draft_versions.#{admin_submit_action(@draft_version)}.submit_button")) %>
</div>
<div class="small-12 medium-3 column clear end margin-top">
<%= f.submit(class: "button success expanded", value: t("admin.legislation.draft_versions.#{admin_submit_action(@draft_version)}.submit_button")) %>
</div>
<% end %>

View File

@@ -1,8 +1,8 @@
<% 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 %>
<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">
<%= back_link_to admin_legislation_process_draft_versions_path(@process),
t("admin.legislation.draft_versions.edit.back") %>
@@ -11,17 +11,16 @@
<%= render 'admin/legislation/processes/subnav', process: @process, active: 'draft_versions' %>
<div class="row">
<div class="small-12 column">
<div class="callout warning" style="display: none;">
<%= t("admin.legislation.draft_versions.edit.warning") %>
</div>
<div class="small-12 column">
<div class="callout warning" style="display: none;">
<%= t("admin.legislation.draft_versions.edit.warning") %>
</div>
</div>
<div class="small-12 medium-9 column">
<h3><%= @draft_version.title %></h3>
</div>
<div class="small-12 medium-3 column legislation-question-delete">
<div class="small-12 column">
<h3 class="inline-block"><%= @draft_version.title %></h3>
<div class="float-right">
<%= link_to t("admin.legislation.draft_versions.index.delete"),
admin_legislation_process_draft_version_path(@process, @draft_version),
method: :delete,

View File

@@ -1,23 +1,20 @@
<% 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 %>
<div class="legislation-admin legislation-draft-versions-index row">
<div class="legislation-draft-versions-index">
<%= back_link_to admin_legislation_processes_path, t("admin.legislation.processes.edit.back") %>
<h2><%= @process.title %></h2>
<%= render 'admin/legislation/processes/subnav', process: @process, active: 'draft_versions' %>
<div class="small-12 column">
<%= back_link_to admin_legislation_processes_path, t("admin.legislation.processes.edit.back") %>
<h4 class="inline-block"><%= t("admin.legislation.draft_versions.index.title") %></h4>
<h2><%= @process.title %></h2>
<%= render 'admin/legislation/processes/subnav', process: @process, active: 'draft_versions' %>
<div class="row">
<div class="small-12 medium-9 column">
<h4><%= t("admin.legislation.draft_versions.index.title") %></h4>
</div>
<div class="small-12 medium-3 column legislation-process-version">
<%= link_to t("admin.legislation.draft_versions.index.create"), new_admin_legislation_process_draft_version_path, class: "button" %>
</div>
<div class="float-right">
<%= link_to t("admin.legislation.draft_versions.index.create"), new_admin_legislation_process_draft_version_path, class: "button" %>
</div>
<% if @process.draft_versions.any? %>
@@ -27,8 +24,8 @@
<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.status") %></th>
<th><%= 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.comments") %></th>
<th class="text-center"><%= t("admin.legislation.draft_versions.table.final_version") %></th>
</tr>
</thead>
<tbody>
@@ -46,8 +43,8 @@
<%= t("admin.legislation.draft_versions.statuses.published") %>
<% end %>
</td>
<td><%= draft_version.total_comments %></td>
<td>
<td class="text-center"><%= draft_version.total_comments %></td>
<td class="text-center">
<% if draft_version.final_version %>
<span class="icon-check" title="<%= draft_version.final_version %>"></span>
<% else %>

View File

@@ -1,8 +1,8 @@
<% 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 %>
<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">
<%= back_link_to admin_legislation_process_draft_versions_path(@process),
t("admin.legislation.draft_versions.new.back") %>
@@ -11,10 +11,8 @@
<%= render 'admin/legislation/processes/subnav', process: @process, active: 'draft_versions' %>
<div class="row">
<div class="small-12 medium-9 column">
<h3><%= t("admin.legislation.draft_versions.new.title") %></h3>
</div>
<div class="small-12 column">
<h3><%= t("admin.legislation.draft_versions.new.title") %></h3>
</div>
<%= render 'form', url: admin_legislation_process_draft_versions_path(@process) %>

View File

@@ -15,236 +15,197 @@
<% end %>
<div class="row">
<div class="small-12 medium-4 column">
<label><%= t('admin.legislation.processes.form.process') %></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 :start_date,
label: false,
value: format_date_for_calendar_form(@process.start_date),
class: "js-calendar-full",
id: "start_date" %>
</div>
<div class="small-12 medium-1 column legislation-process-end">
<%= t('admin.legislation.processes.form.end') %>
</div>
<div class="small-12 medium-2 column">
<%= f.text_field :end_date,
label: false,
value: format_date_for_calendar_form(@process.end_date),
class: "js-calendar-full",
id: "end_date" %>
</div>
<div class="small-12 medium-2 column">
<%= f.check_box :published, checked: @process.published?, label: t('admin.legislation.processes.form.enabled') %>
</div>
<div class="small-12 column">
<hr>
</div>
<div class="small-12 medium-4 column">
<label><%= t("admin.legislation.processes.form.process") %></label>
</div>
<div class="row">
<div class="small-12 medium-4 column">
<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,
label: false,
value: format_date_for_calendar_form(@process.debate_start_date),
class: "js-calendar-full",
id: "debate_start_date" %>
</div>
<div class="small-12 medium-1 column legislation-process-end">
<%= t('admin.legislation.processes.form.end') %>
</div>
<div class="small-12 medium-2 column">
<%= f.text_field :debate_end_date,
label: false,
value: format_date_for_calendar_form(@process.debate_end_date),
class: "js-calendar-full",
id: "debate_end_date" %>
</div>
<div class="small-12 medium-2 column">
<%= f.check_box :debate_phase_enabled, checked: @process.debate_phase.enabled?, label: t('admin.legislation.processes.form.enabled') %>
</div>
<div class="small-12 column">
<hr>
</div>
<div class="small-12 medium-3 column">
<%= f.label :start_date, t("admin.legislation.processes.form.start") %>
<%= f.text_field :start_date,
label: false,
value: format_date_for_calendar_form(@process.start_date),
class: "js-calendar-full",
id: "start_date" %>
</div>
<div class="row">
<div class="small-12 medium-4 column">
<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,
label: false,
value: format_date_for_calendar_form(@process.proposals_phase_start_date),
class: "js-calendar-full",
id: "proposals_phase_start_date" %>
</div>
<div class="small-12 medium-1 column legislation-process-end">
<%= t('admin.legislation.processes.form.end') %>
</div>
<div class="small-12 medium-2 column">
<%= f.text_field :proposals_phase_end_date,
label: false,
value: format_date_for_calendar_form(@process.proposals_phase_end_date),
class: "js-calendar-full",
id: "proposals_phase_end_date" %>
</div>
<div class="small-12 medium-2 column">
<%= f.check_box :proposals_phase_enabled, checked: @process.proposals_phase.enabled?, label: t('admin.legislation.processes.form.enabled') %>
</div>
<div class="small-12 column">
<hr>
</div>
<div class="small-12 medium-3 column">
<%= f.label :end_date, t("admin.legislation.processes.form.end") %>
<%= f.text_field :end_date,
label: false,
value: format_date_for_calendar_form(@process.end_date),
class: "js-calendar-full",
id: "end_date" %>
</div>
<div class="small-12 medium-2 column margin-top">
<%= f.check_box :published, checked: @process.published?, label: t("admin.legislation.processes.form.enabled") %>
</div>
<div class="row">
<div class="small-12 medium-4 column">
<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,
label: false,
value: format_date_for_calendar_form(@process.allegations_start_date),
class: "js-calendar-full",
id: "allegations_start_date" %>
</div>
<div class="small-12 medium-1 column legislation-process-end">
<%= t('admin.legislation.processes.form.end') %>
</div>
<div class="small-12 medium-2 column">
<%= f.text_field :allegations_end_date,
label: false,
value: format_date_for_calendar_form(@process.allegations_end_date),
class: "js-calendar-full",
id: "allegations_end_date" %>
</div>
<div class="small-12 medium-2 column">
<%= f.check_box :allegations_phase_enabled, checked: @process.allegations_phase.enabled?, label: t('admin.legislation.processes.form.enabled') %>
</div>
<div class="small-12 column">
<hr>
</div>
<div class="small-12 column">
<hr>
</div>
<div class="row">
<div class="small-12 medium-4 column">
<%= f.label :draft_publication_date %>
</div>
<div class="small-12 medium-2 column end">
<%= f.text_field :draft_publication_date,
label: false,
value: format_date_for_calendar_form(@process.draft_publication_date),
class: "js-calendar-full",
id: "draft_publication_date" %>
</div>
<div class="small-12 medium-2 column">
<%= f.check_box :draft_publication_enabled, checked: @process.draft_publication.enabled?, label: t('admin.legislation.processes.form.enabled') %>
</div>
<div class="small-12 column">
<hr>
</div>
<div class="small-12 medium-4 column">
<label><%= t("admin.legislation.processes.form.debate_phase") %></label>
</div>
<div class="row">
<div class="small-12 medium-4 column">
<%= f.label :result_publication_date %>
</div>
<div class="small-12 medium-2 column end">
<%= f.text_field :result_publication_date,
label: false,
value: format_date_for_calendar_form(@process.result_publication_date),
class: "js-calendar-full",
id: "result_publication_date" %>
</div>
<div class="small-12 medium-2 column">
<%= f.check_box :result_publication_enabled, checked: @process.result_publication.enabled?, label: t('admin.legislation.processes.form.enabled') %>
</div>
<div class="small-12 column">
<hr>
</div>
<div class="small-12 medium-3 column">
<%= f.label :debate_start_date, t("admin.legislation.processes.form.start") %>
<%= f.text_field :debate_start_date,
label: false,
value: format_date_for_calendar_form(@process.debate_start_date),
class: "js-calendar-full",
id: "debate_start_date" %>
</div>
<div class="small-12 medium-3 column">
<%= f.label :debate_end_date, t("admin.legislation.processes.form.end") %>
<%= f.text_field :debate_end_date,
label: false,
value: format_date_for_calendar_form(@process.debate_end_date),
class: "js-calendar-full",
id: "debate_end_date" %>
</div>
<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") %>
</div>
<div class="small-12 column">
<hr>
</div>
<div class="small-12 medium-4 column">
<label><%= t("admin.legislation.processes.form.proposals_phase") %></label>
</div>
<div class="small-12 medium-3 column">
<%= f.label :proposals_phase_start_date, t("admin.legislation.processes.form.start") %>
<%= f.text_field :proposals_phase_start_date,
label: false,
value: format_date_for_calendar_form(@process.proposals_phase_start_date),
class: "js-calendar-full",
id: "proposals_phase_start_date" %>
</div>
<div class="small-12 medium-3 column">
<%= f.label :proposals_phase_end_date, t("admin.legislation.processes.form.end") %>
<%= f.text_field :proposals_phase_end_date,
label: false,
value: format_date_for_calendar_form(@process.proposals_phase_end_date),
class: "js-calendar-full",
id: "proposals_phase_end_date" %>
</div>
<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") %>
</div>
<div class="small-12 column">
<hr>
</div>
<div class="small-12 medium-4 column">
<label><%= t("admin.legislation.processes.form.allegations_phase") %></label>
</div>
<div class="small-12 medium-3 column">
<%= f.label :allegations_start_date, t("admin.legislation.processes.form.start") %>
<%= f.text_field :allegations_start_date,
label: false,
value: format_date_for_calendar_form(@process.allegations_start_date),
class: "js-calendar-full",
id: "allegations_start_date" %>
</div>
<div class="small-12 medium-3 column">
<%= f.label :allegations_end_date, t("admin.legislation.processes.form.end") %>
<%= f.text_field :allegations_end_date,
label: false,
value: format_date_for_calendar_form(@process.allegations_end_date),
class: "js-calendar-full",
id: "allegations_end_date" %>
</div>
<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") %>
</div>
<div class="small-12 column">
<hr>
</div>
<div class="small-12 medium-3 column end">
<%= f.label :draft_publication_date %>
<%= f.text_field :draft_publication_date,
label: false,
value: format_date_for_calendar_form(@process.draft_publication_date),
class: "js-calendar-full",
id: "draft_publication_date" %>
</div>
<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") %>
</div>
<div class="small-12 column">
<hr>
</div>
<div class="small-12 medium-3 column end">
<%= f.label :result_publication_date %>
<%= f.text_field :result_publication_date,
label: false,
value: format_date_for_calendar_form(@process.result_publication_date),
class: "js-calendar-full",
id: "result_publication_date" %>
</div>
<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") %>
</div>
<div class="small-12 column">
<hr>
</div>
<div class="documents small-12 column">
<%= render 'documents/nested_documents', documentable: @process, f: f %>
<div class="small-12 column">
<hr>
</div>
</div>
<div class="row">
<div class="small-12 medium-4 column">
<%= f.label :title %>
</div>
<div class="small-12 medium-8 column">
<%= f.text_field :title,
label: false,
placeholder: t('admin.legislation.processes.form.title_placeholder') %>
</div>
<div class="small-12 column">
<hr>
</div>
<div class="row">
<div class="small-12 medium-4 column">
<%= f.label :summary %>
<small><%= t('admin.legislation.processes.form.use_markdown') %></small>
</div>
<div class="small-12 medium-8 column">
<%= f.text_area :summary,
label: false,
rows: 2,
placeholder: t('admin.legislation.processes.form.summary_placeholder') %>
</div>
<div class="small-12 medium-9 column">
<%= f.label :title %>
<%= f.text_field :title,
label: false,
placeholder: t("admin.legislation.processes.form.title_placeholder") %>
</div>
<div class="row">
<div class="small-12 medium-4 column">
<%= f.label :description %>
<small><%= t('admin.legislation.processes.form.use_markdown') %></small>
</div>
<div class="small-12 medium-8 column">
<%= f.text_area :description,
label: false,
rows: 5,
placeholder: t('admin.legislation.processes.form.description_placeholder') %>
</div>
<div class="small-12 medium-9 column">
<%= f.label :summary %>
<span class="help-text"><%= t("admin.legislation.processes.form.use_markdown") %></span>
<%= f.text_area :summary,
label: false,
rows: 2,
placeholder: t("admin.legislation.processes.form.summary_placeholder") %>
</div>
<div class="row">
<div class="small-12 medium-4 column">
<%= f.label :additional_info %>
<small><%= t('admin.legislation.processes.form.use_markdown') %></small>
</div>
<div class="small-12 medium-8 column">
<%= f.text_area :additional_info,
label: false,
rows: 10,
placeholder: t('admin.legislation.processes.form.additional_info_placeholder') %>
</div>
<div class="small-12 medium-9 column">
<%= f.label :description %>
<span class="help-text"><%= t("admin.legislation.processes.form.use_markdown") %></span>
<%= f.text_area :description,
label: false,
rows: 5,
placeholder: t("admin.legislation.processes.form.description_placeholder") %>
</div>
<div class="row">
<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")) %>
</div>
<div class="small-12 medium-9 column">
<%= f.label :additional_info %>
<span class="help-text"><%= t("admin.legislation.processes.form.use_markdown") %></span>
<%= f.text_area :additional_info,
label: false,
rows: 10,
placeholder: t("admin.legislation.processes.form.additional_info_placeholder") %>
</div>
<div class="small-12 medium-3 column clear end">
<%= f.submit(class: "button success expanded", value: t("admin.legislation.processes.#{admin_submit_action(@process)}.submit_button")) %>
</div>
<% end %>

View File

@@ -1,16 +1,13 @@
<% provide :title do %>
Admin - <%= t("admin.menu.legislation") %> - <%= @process.title %>
<%= t("admin.header.title") %> - <%= t("admin.menu.legislation") %> - <%= @process.title %>
<% end %>
<div class="legislation-admin legislation-process-edit row">
<div class="legislation-process-edit">
<%= back_link_to admin_legislation_processes_path, t("admin.legislation.processes.edit.back") %>
<div class="small-12 column">
<%= 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" %>
</div>
<%= render 'form' %>
</div>

View File

@@ -1,11 +1,11 @@
<% 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 %>
<h2 class="inline-block"><%= t("admin.legislation.processes.index.title") %></h2>
<%= 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" %>
@@ -18,7 +18,7 @@
<th><%= t("admin.legislation.processes.process.title") %></th>
<th><%= t("admin.legislation.processes.process.status") %></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>
</tr>
</thead>
@@ -26,16 +26,16 @@
<tbody>
<% @processes.each do |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) %>
</td>
<td><%= t("admin.legislation.processes.process.status_#{process.status}") %></td>
<td><%= I18n.l process.created_at.to_date %></td>
<td><%= process.total_comments %></td>
<td class="text-center"><%= process.total_comments %></td>
<td>
<%= link_to t("admin.legislation.processes.index.delete"), admin_legislation_process_path(process),
method: :delete,
class: 'button hollow alert' %>
class: 'button hollow alert expanded' %>
</td>
</tr>
<% end %>

View File

@@ -1,14 +1,11 @@
<% 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 %>
<div class="legislation-admin legislation-process-new row">
<div class="legislation-process-new">
<%= back_link_to admin_legislation_processes_path, t("admin.legislation.processes.new.back") %>
<div class="small-12 column">
<%= 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" %>
</div>
<%= render "form" %>
</div>

View File

@@ -15,23 +15,17 @@
<% 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">
<%= f.text_field :custom_list, value: @process.tag_list_on(:customs).to_s,
label: false,
placeholder: t("proposals.form.tags_placeholder"),
class: 'js-tag-list',
aria: {describedby: "tag-list-help-text"} %>
</div>
<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,
label: false,
placeholder: t("admin.legislation.proposals.form.custom_categories_placeholder"),
class: 'js-tag-list',
aria: {describedby: "tag-list-help-text"} %>
</div>
<div class="row">
<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")) %>
</div>
<div class="small-12 medium-3 column clear end">
<%= f.submit(class: "button expanded", value: t("admin.legislation.processes.#{admin_submit_action(@process)}.submit_button")) %>
</div>
<% end %>

View File

@@ -1,16 +1,14 @@
<% 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 %>
<div class="legislation-admin legislation-draft-versions-index row">
<div class="small-12 column">
<%= back_link_to admin_legislation_processes_path, t("admin.legislation.proposals.index.back") %>
<div class="legislation-admin legislation-draft-versions-index">
<h2><%= @process.title %></h2>
<%= back_link_to admin_legislation_processes_path, t("admin.legislation.proposals.index.back") %>
<%= render 'admin/legislation/processes/subnav', process: @process, active: 'proposals' %>
<h2><%= @process.title %></h2>
<%= render "form" %>
<%= render 'admin/legislation/processes/subnav', process: @process, active: 'proposals' %>
</div>
<%= render 'form' %>
</div>

View File

@@ -30,12 +30,12 @@
<% end %>
</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"),
f, :question_options, class: "button hollow medium" %>
f, :question_options, class: "button hollow" %>
</div>
<div class="small-12 medium-6 large-4 column end">
<%= f.submit(class: "button expanded", value: t("admin.legislation.questions.#{admin_submit_action(@question)}.submit_button")) %>
<div class="small-12 medium-6 large-3 clear column end margin-top">
<%= f.submit(class: "button success expanded", value: t("admin.legislation.questions.#{admin_submit_action(@question)}.submit_button")) %>
</div>
<% end %>

View File

@@ -1,12 +1,10 @@
<div class="nested-fields">
<div class="field">
<div class="row">
<div class="small-12 medium-9 column">
<%= f.text_field :value, label: false, placeholder: t("admin.legislation.questions.form.value_placeholder") %>
</div>
<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 %>
</div>
<div class="small-12 medium-9 column">
<%= f.text_field :value, label: false, placeholder: t("admin.legislation.questions.form.value_placeholder") %>
</div>
<div class="small-12 medium-3 column">
<%= link_to_remove_association t("admin.legislation.questions.question_option_fields.remove_option"), f, class: "delete"%>
</div>
</div>
</div>

View File

@@ -1,8 +1,8 @@
<% 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 %>
<div class="legislation-admin legislation-questions-edit legislation-questions-form row">
<div class="legislation-questions-edit legislation-questions-form">
<div class="small-12 column">
<%= 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' %>
<div class="row">
<div class="small-12 medium-9 column">
<h3><%= t("admin.legislation.questions.edit.title", question_title: @question.title) %></h3>
</div>
<div class="small-12 medium-3 column legislation-question-delete">
<div class="small-12 column">
<h3 class="inline-block"><%= t("admin.legislation.questions.edit.title", question_title: @question.title) %></h3>
<div class="float-right">
<%= link_to t("admin.legislation.questions.index.delete"), admin_legislation_process_question_path(@process, @question),
method: :delete,
class: 'button hollow alert' %>

View File

@@ -1,23 +1,19 @@
<% 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 %>
<div class="legislation-admin legislation-draft-versions-index row">
<div class="legislation-draft-versions-index">
<%= back_link_to admin_legislation_processes_path, t("admin.legislation.questions.index.back") %>
<h2><%= @process.title %></h2>
<%= render 'admin/legislation/processes/subnav', process: @process, active: 'questions' %>
<div class="small-12 column">
<%= back_link_to admin_legislation_processes_path, t("admin.legislation.questions.index.back") %>
<h4 class="inline-block"><%= t("admin.legislation.questions.index.title") %></h4>
<h2><%= @process.title %></h2>
<%= render 'admin/legislation/processes/subnav', process: @process, active: 'questions' %>
<div class="row">
<div class="small-12 medium-9 column">
<h4><%= t("admin.legislation.questions.index.title") %></h4>
</div>
<div class="small-12 medium-3 column legislation-process-question">
<%= link_to t("admin.legislation.questions.index.create"), new_admin_legislation_process_question_path, class: "button" %>
</div>
<div class="float-right">
<%= link_to t("admin.legislation.questions.index.create"), new_admin_legislation_process_question_path, class: "button" %>
</div>
<% if @process.questions.any? %>
@@ -26,8 +22,8 @@
<tr>
<th><%= t("admin.legislation.questions.table.title") %></th>
<th><%= t("admin.legislation.questions.table.question_options") %></th>
<th><%= 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.answers_count") %></th>
<th class="text-center"><%= t("admin.legislation.questions.table.comments_count") %></th>
</tr>
</thead>
<tbody>
@@ -45,8 +41,8 @@
<% end %>
<% end %>
</td>
<td><%= question.answers_count %></td>
<td><%= link_to question.comments.count, legislation_process_question_path(@process, question, anchor: 'comments') %></td>
<td class="text-center"><%= question.answers_count %></td>
<td class="text-center"><%= link_to question.comments.count, legislation_process_question_path(@process, question, anchor: 'comments') %></td>
</tr>
<% end %>
</tbody>

View File

@@ -1,21 +1,18 @@
<% 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 %>
<div class="legislation-admin legislation-questions-new legislation-questions-form row">
<div class="legislation-questions-new legislation-questions-form">
<%= back_link_to admin_legislation_process_questions_path(@process), t("admin.legislation.questions.new.back") %>
<h2><%= @process.title %></h2>
<%= render 'admin/legislation/processes/subnav', process: @process, active: 'questions' %>
<div class="small-12 column">
<%= back_link_to admin_legislation_process_questions_path(@process), t("admin.legislation.questions.new.back") %>
<h2><%= @process.title %></h2>
<%= render 'admin/legislation/processes/subnav', process: @process, active: 'questions' %>
<div class="row">
<div class="small-12 medium-9 column">
<h3><%= t("admin.legislation.questions.new.title") %></h3>
</div>
</div>
<%= render 'form', url: admin_legislation_process_questions_path(@process) %>
<h3><%= t("admin.legislation.questions.new.title") %></h3>
</div>
<%= render 'form', url: admin_legislation_process_questions_path(@process) %>
</div>

View File

@@ -6,10 +6,10 @@
<table id="newsletters">
<thead>
<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.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>
</thead>
<tbody>
@@ -28,13 +28,19 @@
<%= l newsletter.sent_at.to_date %>
<% end %>
</td>
<td class="text-right">
<td>
<div class="small-4 column">
<%= 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),
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),
class: "button" %>
class: "button expanded" %>
</div>
</td>
</tr>
<% end %>

View File

@@ -4,39 +4,37 @@
<% recipients_count = @newsletter.valid_segment_recipient? ? @newsletter.list_of_recipient_emails.count : 0 %>
<div class="small-12 column">
<div class="callout highlight">
<div class="row">
<div class="small-12 medium-2 column">
<strong><%= t("admin.newsletters.show.sent_at") %></strong><br>
<% if @newsletter.draft? %>
<%= t("admin.newsletters.index.draft") %>
<% else %>
<%= l @newsletter.sent_at.to_date %>
<% end %>
</div>
<div class="small-12 medium-6 column">
<strong><%= t("admin.newsletters.show.from") %></strong><br>
<%= @newsletter.from %>
</div>
<div class="small-12 medium-4 column">
<strong><%= t("admin.newsletters.show.subject") %></strong><br>
<%= @newsletter.subject %>
</div>
<div class="small-12 column callout highlight">
<div class="small-12 medium-2 column">
<strong><%= t("admin.newsletters.show.sent_at") %></strong><br>
<% if @newsletter.draft? %>
<%= t("admin.newsletters.index.draft") %>
<% else %>
<%= l @newsletter.sent_at.to_date %>
<% end %>
</div>
<div class="row margin-top">
<div class="small-12 column">
<strong><%= t("admin.newsletters.show.segment_recipient") %></strong><br>
<%= segment_name(@newsletter.segment_recipient) %>
<%= t("admin.newsletters.show.affected_users", n: recipients_count) %>
</div>
<div class="small-12 medium-6 column">
<strong><%= t("admin.newsletters.show.from") %></strong><br>
<%= @newsletter.from %>
</div>
<div class="small-12 medium-4 column">
<strong><%= t("admin.newsletters.show.subject") %></strong><br>
<%= @newsletter.subject %>
</div>
<div class="small-12 column">
<strong><%= t("admin.newsletters.show.segment_recipient") %></strong><br>
<%= segment_name(@newsletter.segment_recipient) %>
<%= t("admin.newsletters.show.affected_users", n: recipients_count) %>
</div>
</div>
<strong><%= t("admin.newsletters.show.body") %></strong>
<p class="help-text" id="phase-description-help-text">
<%= t("admin.newsletters.show.body_help_text") %>
</p>
<div class="small-12 column">
<strong><%= t("admin.newsletters.show.body") %></strong>
<p class="help-text" id="phase-description-help-text">
<%= t("admin.newsletters.show.body_help_text") %>
</p>
</div>
<div class="newsletter-body-content">
<%= render file: "app/views/layouts/_mailer_header.html.erb" %>

View File

@@ -6,27 +6,29 @@
</td>
<% if booth_assignment.present? %>
<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 class="text-right">
<td>
<%= link_to t("admin.booth_assignments.manage.actions.unassign"),
admin_poll_booth_assignment_path(@poll, booth_assignment, booth_id: booth.id),
method: :delete,
remote: true,
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? %>
</td>
<% else %>
<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 class="text-right">
<td>
<%= link_to t("admin.booth_assignments.manage.actions.assign"),
admin_poll_booth_assignments_path(@poll, booth_id: booth.id),
method: :post,
remote: true,
title: t("admin.booth_assignments.manage.actions.assign"),
class: "button" if !@poll.expired? %>
class: "button hollow expanded" if !@poll.expired? %>
</td>
<% end %>

View File

@@ -1,16 +1,14 @@
<div class="row">
<div class="small-12 medium-6 column">
<%= form_tag(search_booths_admin_poll_booth_assignments_path(@poll), method: :get, remote: true) do |f| %>
<div class="input-group">
<%= text_field_tag :search,
@search,
placeholder: t("admin.shared.booths_search.placeholder"), id: "search-booths" %>
<div class="input-group-button">
<%= submit_tag t("admin.shared.booths_search.button"), class: "button" %>
</div>
<div class="small-12 medium-6 margin-top">
<%= form_tag(search_booths_admin_poll_booth_assignments_path(@poll), method: :get, remote: true) do |f| %>
<div class="input-group">
<%= text_field_tag :search,
@search,
placeholder: t("admin.shared.booths_search.placeholder"), id: "search-booths" %>
<div class="input-group-button">
<%= submit_tag t("admin.shared.booths_search.button"), class: "button" %>
</div>
<% end %>
</div>
</div>
<% end %>
</div>
<div id="search-booths-results"></div>

View File

@@ -4,7 +4,7 @@
<%= render "/admin/poll/polls/subnav" %>
<%= 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"),
manage_admin_poll_booth_assignments_path(@poll),

View File

@@ -1,9 +1,6 @@
<%= link_to booth_assignments_admin_polls_path do %>
<span class="icon-angle-left"></span> <%= t("shared.back") %>
<% end %>
<hr>
<%= back_link_to booth_assignments_admin_polls_path %>
<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? %>
<div class="callout primary">
@@ -15,7 +12,7 @@
<th><%= t("admin.booths.index.name") %></th>
<th><%= t("admin.booths.index.location") %></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>
<tbody>
<% @booths.each do |booth| %>

View File

@@ -1,20 +1,16 @@
<div class="row">
<div class="small-12 medium-6 column">
<%= f.text_field :name,
placeholder: t('admin.booths.new.name'),
label: t("admin.booths.new.name") %>
</div>
<div class="small-12 column">
<%= f.text_field :location,
placeholder: t("admin.booths.new.location"),
label: t("admin.booths.new.location") %>
</div>
<div class="small-12 medium-6 column">
<%= f.text_field :name,
placeholder: t('admin.booths.new.name'),
label: t("admin.booths.new.name") %>
</div>
<div class="row">
<div class="small-12 medium-4 column">
<%= f.submit t("admin.booths.#{admin_submit_action(@booth)}.submit_button"),
class: "button success expanded" %>
</div>
</div>
<div class="small-12 medium-6 column clear">
<%= f.text_field :location,
placeholder: t("admin.booths.new.location"),
label: t("admin.booths.new.location") %>
</div>
<div class="small-12 medium-4 large-3 column clear end">
<%= f.submit t("admin.booths.#{admin_submit_action(@booth)}.submit_button"),
class: "button success expanded" %>
</div>

View File

@@ -1,6 +1,8 @@
<%= 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| %>
<%= render "form", f: f %>

View File

@@ -1,7 +1,7 @@
<h2 class="inline-block"><%= t("admin.booths.index.title") %></h2>
<% 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 %>
<% if @booths.empty? %>

View File

@@ -1,6 +1,8 @@
<%= 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| %>
<%= render "form", f: f %>

View File

@@ -1,16 +1,14 @@
<div class="row">
<div class="small-12 medium-6 column">
<%= form_tag(search_officers_admin_poll_officer_assignments_path(@poll), method: :get, remote: true) do |f| %>
<div class="input-group">
<%= text_field_tag :search,
@search,
placeholder: t("admin.shared.poll_officers_search.placeholder"), id: "search-officers" %>
<div class="input-group-button">
<%= submit_tag t("admin.shared.poll_officers_search.button"), class: "button" %>
</div>
<div class="small-12 medium-6 margin-top">
<%= form_tag(search_officers_admin_poll_officer_assignments_path(@poll), method: :get, remote: true) do |f| %>
<div class="input-group">
<%= text_field_tag :search,
@search,
placeholder: t("admin.shared.poll_officers_search.placeholder"), id: "search-officers" %>
<div class="input-group-button">
<%= submit_tag t("admin.shared.poll_officers_search.button"), class: "button" %>
</div>
<% end %>
</div>
</div>
<% end %>
</div>
<div id="search-officers-results"></div>

View File

@@ -1,8 +1,9 @@
<table>
<thead>
<tr>
<th><%= t('admin.poll_officers.officer.name') %></th>
<th colspan="2"><%= t('admin.poll_officers.officer.email') %></th>
<th><%= t("admin.poll_officers.officer.name") %></th>
<th><%= t("admin.poll_officers.officer.email") %></th>
<th class="small-3"><%= t("admin.actions.actions") %></th>
</tr>
</thead>
<tbody>
@@ -13,16 +14,16 @@
<td>
<%= officer.email %>
</td>
<td class="text-right">
<td>
<% if officer.persisted? %>
<%= link_to t('admin.poll_officers.officer.delete'),
<%= link_to t("admin.poll_officers.officer.delete"),
admin_officer_path(officer),
method: :delete,
class: "button hollow alert" %>
class: "button hollow alert expanded" %>
<% 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,
class: "button success" %>
class: "button success expanded" %>
<% end %>
</td>
</tr>

View File

@@ -1,23 +1,22 @@
<h2><%= t("admin.poll_officers.index.title") %></h2>
<div class="row">
<div class="small-12 medium-6 column">
<%= render 'search' %>
</div>
<div class="small-12 medium-6">
<%= render 'search' %>
</div>
<div id="search-result"></div>
<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>
<% if @officers.any? %>
<table id="officers">
<thead>
<tr>
<th><%= t('admin.poll_officers.officer.name') %></th>
<th colspan="2"><%= t('admin.poll_officers.officer.email') %></th>
<th><%= t("admin.poll_officers.officer.name") %></th>
<th><%= t("admin.poll_officers.officer.email") %></th>
<th class="small-3"><%= t("admin.actions.actions") %></th>
</tr>
</thead>
<tbody>
@@ -29,19 +28,19 @@
<td>
<%= officer.email %>
</td>
<td class="text-right">
<td>
<% if officer.persisted? %>
<%= link_to t('admin.poll_officers.officer.delete'),
<%= link_to t("admin.poll_officers.officer.delete"),
admin_officer_path(officer),
method: :delete,
class: "button hollow alert"
class: "button hollow alert expanded"
%>
<% else %>
<%= link_to t('admin.poll_officers.officer.add'),
<%= link_to t("admin.poll_officers.officer.add"),
{ controller: "admin/poll/officers", action: :create,
user_id: officer.user_id },
method: :post,
class: "button success" %>
class: "button success expanded" %>
<% end %>
</td>
</tr>

View File

@@ -1,11 +1,9 @@
<%= form_for [:admin, @poll] do |f| %>
<div class="row">
<div class="small-12 medium-6 column">
<%= f.text_field :name %>
</div>
<div class="small-12 medium-6 column">
<%= f.text_field :name %>
</div>
<div class="row">
<div class="clear">
<div class="small-12 medium-6 column">
<%= f.text_field :starts_at,
value: @poll.starts_at.present? ? l(@poll.starts_at.to_date) : nil,
@@ -19,25 +17,19 @@
</div>
</div>
<div class="row">
<div class="small-12 column">
<%=f.text_area :summary, rows: 4%>
</div>
<div class="small-12 column">
<%=f.text_area :summary, rows: 4%>
</div>
<div class="row">
<div class="small-12 column">
<%=f.text_area :description, rows: 8%>
</div>
<div class="small-12 column">
<%=f.text_area :description, rows: 8%>
</div>
<div class="row">
<div class="small-12 column">
<%= render 'images/admin_image', imageable: @poll, f: f %>
</div>
<div class="small-12 column">
<%= render 'images/admin_image', imageable: @poll, f: f %>
</div>
<div class="row">
<div class="clear">
<div class="small-6 medium-6 column">
<%= f.check_box :geozone_restricted, data: { checkbox_toggle: "#geozones" } %>
</div>
@@ -55,10 +47,10 @@
</div>
</div>
<div class="row">
<div class="small-12 medium-4 column">
<div class="clear">
<div class="small-12 medium-4 large-2 column">
<%= f.submit t("admin.polls.#{admin_submit_action(@poll)}.submit_button"),
class: "button success expanded" %>
class: "button success expanded margin-top" %>
</div>
</div>
<% end %>

View File

@@ -8,11 +8,15 @@
<%= l poll.starts_at.to_date %> - <%= l poll.ends_at.to_date %>
</td>
<td class="text-right">
<div class="small-6 column">
<%= link_to t("admin.actions.edit"),
edit_admin_poll_path(poll),
class: "button hollow" %>
class: "button hollow expanded" %>
</div>
<div class="small-6 column">
<%= link_to t("admin.actions.configure"),
admin_poll_path(poll),
class: "button hollow" %>
class: "button hollow expanded" %>
</div>
</td>
</tr>

View File

@@ -2,13 +2,13 @@
<% if @poll.questions.empty? %>
<div class="callout primary margin-top">
<%= t('admin.polls.show.no_questions') %>
<%= t("admin.polls.show.no_questions") %>
</div>
<% else %>
<table class="fixed margin">
<thead>
<tr>
<th><%= t('admin.polls.show.table_title') %></th>
<th><%= t("admin.polls.show.table_title") %></th>
</tr>
</thead>
<% @poll.questions.each do |question| %>

View File

@@ -2,14 +2,14 @@
<%= link_to t("admin.polls.index.create"),
new_admin_poll_path,
class: "button success float-right" %>
class: "button float-right" %>
<% if @polls.any? %>
<table>
<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 class="text-right"><%= t("admin.actions.actions") %></th>
<th><%= t("admin.actions.actions") %></th>
</thead>
<tbody>
<%= render @polls %>

View File

@@ -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">
<%= render "form" %>

View File

@@ -14,8 +14,8 @@
<%= f.text_field :title %>
<div class="small-12 medium-6 large-4 margin-top">
<%= f.submit(class: "button expanded", value: t("shared.save")) %>
<div class="small-12 medium-4 large-2 margin-top">
<%= f.submit(class: "button success expanded", value: t("shared.save")) %>
</div>
</div>

View File

@@ -4,23 +4,27 @@
<% if @questions.count == 0 %>
<div class="callout primary margin-top">
<%= t('admin.questions.index.no_questions') %>
<%= t("admin.questions.index.no_questions") %>
</div>
<% else %>
<table class="fixed">
<thead>
<tr>
<th><%= t('admin.questions.index.table_question') %></th>
<th class="text-right"><%= t("admin.actions.actions") %></th>
<th class="small-8"><%= t("admin.questions.index.table_question") %></th>
<th><%= t("admin.actions.actions") %></th>
</tr>
</thead>
<tbody>
<% @questions.each do |question| %>
<tr id="<%= dom_id(question) %>">
<td><%= link_to question.title, admin_question_path(question) %></td>
<td class="text-right">
<%= link_to t('shared.edit'), edit_admin_question_path(question), class: "button hollow" %>
<%= link_to t('shared.delete'), admin_question_path(question), class: "button hollow alert", method: :delete %>
<td>
<div class="small-6 column">
<%= 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>
</tr>
<% end %>

View File

@@ -1,8 +1,8 @@
<table class="fixed">
<thead>
<tr>
<th><%= t('admin.questions.index.table_proposal') %></th>
<th class="text-right"><%= t("admin.actions.actions") %></th>
<th class="small-9"><%= t("admin.questions.index.table_proposal") %></th>
<th><%= t("admin.actions.actions") %></th>
</tr>
</thead>
<tbody>
@@ -15,7 +15,7 @@
<strong><%= proposal.question %></strong>
</p>
</td>
<td class="text-right">
<td>
<%= link_to t("admin.questions.index.create_question"),
new_admin_question_path(proposal_id: proposal.id),
class: "button hollow" %>

View File

@@ -12,8 +12,8 @@
ckeditor: { language: I18n.locale } %>
</div>
<div class="small-12 medium-6 large-4 margin-top">
<%= f.submit(class: "button expanded", value: t("shared.save")) %>
<div class="small-12 medium-4 large-2 margin-top">
<%= f.submit(class: "button success expanded", value: t("shared.save")) %>
</div>
<% end %>

View File

@@ -2,7 +2,7 @@
<ul class="breadcrumbs margin-top">
<li><%= @answer.title %></li>
<li><%= t('admin.answers.edit.title') %></li>
<li><%= t("admin.answers.edit.title") %></li>
</ul>
<h2 class="margin-top">

View File

@@ -2,10 +2,10 @@
<ul class="breadcrumbs margin-top">
<li><%= @question.title %></li>
<li><%= t('admin.answers.new.title') %></li>
<li><%= t("admin.answers.new.title") %></li>
</ul>
<h2><%= t('admin.answers.new.title') %></h2>
<h2><%= t("admin.answers.new.title") %></h2>
<div class="poll-question-answer-form">
<%= render "form", form_url: admin_question_answers_path %>

View File

@@ -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,
class: "button success float-right" %>
<%= link_to t("admin.questions.index.create"), new_admin_question_path,
class: "button float-right" %>
<div class="small-12 medium-6">
<%= render 'search' %>

View File

@@ -29,13 +29,15 @@
</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">
<tr>
<th colspan="5" scope="col" class="with-button">
<%= 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>
</tr>

View File

@@ -1,19 +1,17 @@
<div class="row">
<div class="small-12 medium-6 column">
<%= form_tag search_officers_admin_booth_shifts_path,
method: :get, remote: true do |f| %>
<div class="input-group">
<%= text_field_tag :search,
@search,
placeholder: t("admin.poll_shifts.new.search_officer_placeholder"),
id: "search-officers" %>
<div class="input-group-button">
<%= submit_tag t("admin.poll_shifts.new.search_officer_button"),
class: "button" %>
</div>
<div class="small-12 medium-6">
<%= form_tag search_officers_admin_booth_shifts_path,
method: :get, remote: true do |f| %>
<div class="input-group">
<%= text_field_tag :search,
@search,
placeholder: t("admin.poll_shifts.new.search_officer_placeholder"),
id: "search-officers" %>
<div class="input-group-button">
<%= submit_tag t("admin.poll_shifts.new.search_officer_button"),
class: "button" %>
</div>
<% end %>
</div>
</div>
<% end %>
</div>
<div id="search-officers-results"></div>

View File

@@ -5,7 +5,7 @@
<th><%= t("admin.poll_shifts.new.date") %></th>
<th><%= t("admin.poll_shifts.new.officer") %></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>
</thead>
<tbody>
@@ -14,11 +14,11 @@
<td><%= l(shift.date.to_date, format: :long) %></td>
<td><%= shift.officer_name %></td>
<td><%= t("admin.poll_shifts.#{shift.task}") %></td>
<td class="text-right">
<td>
<%= link_to t("admin.poll_shifts.new.remove_shift"),
admin_booth_shift_path(@booth, shift),
method: :delete,
class: "button hollow alert" %>
class: "button hollow alert expanded" %>
</td>
</tr>
<% end %>

View File

@@ -1,13 +1,23 @@
<h2><%= t("admin.settings.index.title") %></h2>
<table>
<thead>
<tr>
<th><%= t("admin.settings.setting_name") %></th>
<th><%= t("admin.settings.setting_value") %></th>
</tr>
</thead>
<tbody>
<% @settings.each do |setting| %>
<tr>
<td class="small-12 medium-4">
<td class="small-6">
<strong><%= t("settings.#{setting.key}") %></strong>
<br>
<span class="small">
<%= t("settings.#{setting.key}_description", default: t("admin.settings.no_description")) %>
</span>
</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| %>
<div class="small-12 medium-6 large-9 column">
<%= f.text_area :value, label: false, id: dom_id(setting), lines: 1 %>

View File

@@ -1,15 +1,36 @@
<h2><%= t("admin.settings.index.feature_flags") %></h2>
<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>
<% @feature_flags.each do |feature_flag| %>
<tr>
<td>
<td class="small-8">
<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>
<%= 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 class="text-right">

View File

@@ -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">
<%= link_to "#tab-configuration" do %>
<%= t("admin.settings.index.title") %>

View File

@@ -14,22 +14,21 @@
</div>
<% end %>
<div class="row">
<div class="small-12 medium-6 column">
<%= 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 %>
</div>
<div class="small-12 medium-6 column">
<%= f.label :locale %>
<%= f.select :locale, I18n.available_locales, label: false %>
</div>
<div class="small-12 column">
<%= f.label :body %>
<%= f.text_area :body, label: false, rows: 10 %>
<div class="small-12 medium-6 large-4">
<%= f.submit class: "button success expanded" %>
</div>
<div class="small-12 medium-6 column">
<%= 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 %>
</div>
<div class="small-12 medium-6 column">
<%= f.label :locale %>
<%= f.select :locale, I18n.available_locales, label: false %>
</div>
<div class="small-12 column">
<%= f.label :body %>
<%= f.text_area :body, label: false, rows: 10 %>
<div class="small-12 medium-6 large-3">
<%= f.submit class: "button success expanded" %>
</div>
</div>

View File

@@ -1,14 +1,16 @@
<% 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 %>
<%= 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">
<h2><%= t("admin.site_customization.content_blocks.edit.title") %></h2>
<%= render 'form' %>
</div>
<div class="small-12 column">
<h2><%= t("admin.site_customization.content_blocks.edit.title") %></h2>
</div>
<%= render 'form' %>

View File

@@ -1,5 +1,5 @@
<% provide :title do %>
Admin - <%= t("admin.menu.site_customization.content_blocks") %>
<%= t("admin.header.title") %> - <%= t("admin.menu.site_customization.content_blocks") %>
<% end %>
<%= 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><%= content_block.body.html_safe %></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),
method: :delete, class: "button hollow alert" %>
</td>

View File

@@ -1,12 +1,11 @@
<% 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 %>
<%= back_link_to admin_site_customization_content_blocks_path %>
<div class="row">
<div class="small-12 column">
<h2><%= t("admin.site_customization.content_blocks.new.title") %></h2>
<%= render 'form' %>
</div>
<div class="small-12 column">
<h2><%= t("admin.site_customization.content_blocks.new.title") %></h2>
</div>
<%= render 'form' %>

View File

@@ -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 %>

View File

@@ -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 %>

View File

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

View File

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

View File

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