Merge pull request #3569 from consul/delete_spending_proposals

Delete spending proposals
This commit is contained in:
Raimond Garcia
2019-05-31 19:11:28 +02:00
committed by GitHub
127 changed files with 115 additions and 2734 deletions

View File

@@ -49,7 +49,6 @@
//= require forms //= require forms
//= require tracks //= require tracks
//= require valuation_budget_investment_form //= require valuation_budget_investment_form
//= require valuation_spending_proposal_form
//= require embed_video //= require embed_video
//= require fixed_bar //= require fixed_bar
//= require banners //= require banners
@@ -105,7 +104,6 @@ var initialize_modules = function() {
App.Forms.initialize(); App.Forms.initialize();
App.Tracks.initialize(); App.Tracks.initialize();
App.ValuationBudgetInvestmentForm.initialize(); App.ValuationBudgetInvestmentForm.initialize();
App.ValuationSpendingProposalForm.initialize();
App.EmbedVideo.initialize(); App.EmbedVideo.initialize();
App.FixedBar.initialize(); App.FixedBar.initialize();
App.Banners.initialize(); App.Banners.initialize();

View File

@@ -1,32 +0,0 @@
App.ValuationSpendingProposalForm =
showFeasibleFields: ->
$("#valuation_spending_proposal_edit_form #not_feasible_fields").hide("down")
$("#valuation_spending_proposal_edit_form #feasible_fields").show()
showNotFeasibleFields: ->
$("#valuation_spending_proposal_edit_form #feasible_fields").hide("down")
$("#valuation_spending_proposal_edit_form #not_feasible_fields").show()
showAllFields: ->
$("#valuation_spending_proposal_edit_form #feasible_fields").show("down")
$("#valuation_spending_proposal_edit_form #not_feasible_fields").show("down")
showFeasibilityFields: ->
feasible = $("#valuation_spending_proposal_edit_form input[type=radio][name='spending_proposal[feasible]']:checked").val()
if feasible == "true"
App.ValuationSpendingProposalForm.showFeasibleFields()
else if feasible == "false"
App.ValuationSpendingProposalForm.showNotFeasibleFields()
showFeasibilityFieldsOnChange: ->
$("#valuation_spending_proposal_edit_form input[type=radio][name='spending_proposal[feasible]']").change ->
App.ValuationSpendingProposalForm.showAllFields()
App.ValuationSpendingProposalForm.showFeasibilityFields()
initialize: ->
App.ValuationSpendingProposalForm.showFeasibilityFields()
App.ValuationSpendingProposalForm.showFeasibilityFieldsOnChange()
false

View File

@@ -249,7 +249,6 @@
.debate-form, .debate-form,
.proposal-form, .proposal-form,
.budget-investment-form, .budget-investment-form,
.spending-proposal-form,
.document-form, .document-form,
.topic-new, .topic-new,
.topic-form { .topic-form {
@@ -1463,6 +1462,7 @@
border-radius: rem-calc(3); border-radius: rem-calc(3);
color: $budget; color: $budget;
font-weight: bold; font-weight: bold;
padding: $line-height / 4;
&::after { &::after {
content: "\56"; content: "\56";

View File

@@ -3,7 +3,6 @@ class Admin::Api::StatsController < Admin::Api::BaseController
def show def show
unless params[:event].present? || unless params[:event].present? ||
params[:visits].present? || params[:visits].present? ||
params[:spending_proposals].present? ||
params[:budget_investments].present? || params[:budget_investments].present? ||
params[:user_supported_budgets].present? params[:user_supported_budgets].present?
return render json: {}, status: :bad_request return render json: {}, status: :bad_request
@@ -19,10 +18,6 @@ class Admin::Api::StatsController < Admin::Api::BaseController
ds.add "Visits", Visit.group_by_day(:started_at).count ds.add "Visits", Visit.group_by_day(:started_at).count
end end
if params[:spending_proposals].present?
ds.add "Spending proposals", SpendingProposal.group_by_day(:created_at).count
end
if params[:budget_investments].present? if params[:budget_investments].present?
ds.add "Budget Investments", Budget::Investment.group_by_day(:created_at).count ds.add "Budget Investments", Budget::Investment.group_by_day(:created_at).count
end end

View File

@@ -91,7 +91,7 @@ class Admin::BudgetInvestmentsController < Admin::BaseController
end end
def load_investment def load_investment
@investment = Budget::Investment.by_budget(@budget).find(params[:id]) @investment = @budget.investments.find(params[:id])
end end
def load_admins def load_admins

View File

@@ -1,70 +0,0 @@
class Admin::SpendingProposalsController < Admin::BaseController
include FeatureFlags
before_action :load_filter_params
feature_flag :spending_proposals
has_filters %w{valuation_open without_admin managed valuating valuation_finished all}, only: :index
load_and_authorize_resource
def index
@spending_proposals = SpendingProposal.scoped_filter(filter_params, @current_filter)
.order(cached_votes_up: :desc, created_at: :desc)
.page(params[:page])
end
def show
end
def edit
load_admins
load_valuators
load_tags
end
def update
if @spending_proposal.update(spending_proposal_params)
redirect_to admin_spending_proposal_path(@spending_proposal, filter_params),
notice: t("flash.actions.update.spending_proposal")
else
load_admins
load_valuators
load_tags
render :edit
end
end
def summary
@spending_proposals = SpendingProposal.group(:geozone).sum(:price).sort_by{|geozone, count| geozone.present? ? geozone.name : "z"}
@spending_proposals_with_supports = SpendingProposal.with_supports.group(:geozone).sum(:price)
.sort_by{|geozone, count| geozone.present? ? geozone.name : "z"}
end
private
def spending_proposal_params
params.require(:spending_proposal).permit(:title, :description, :external_url, :geozone_id, :association_name,
:administrator_id, :tag_list, valuator_ids: [])
end
def filter_params
params.permit(:geozone_id, :administrator_id, :tag_name, :valuator_id)
end
def load_filter_params
@filter_params ||= filter_params
end
def load_admins
@admins = Administrator.includes(:user).all
end
def load_valuators
@valuators = Valuator.includes(:user).all.order("description ASC").order("users.email ASC")
end
def load_tags
@tags = ActsAsTaggableOn::Tag.spending_proposal_tags
end
end

View File

@@ -11,6 +11,7 @@ class Admin::StatsController < Admin::BaseController
@debate_votes = Vote.where(votable_type: "Debate").count @debate_votes = Vote.where(votable_type: "Debate").count
@proposal_votes = Vote.where(votable_type: "Proposal").count @proposal_votes = Vote.where(votable_type: "Proposal").count
@comment_votes = Vote.where(votable_type: "Comment").count @comment_votes = Vote.where(votable_type: "Comment").count
@votes = Vote.count @votes = Vote.count
@user_level_two = User.active.level_two_verified.count @user_level_two = User.active.level_two_verified.count
@@ -24,8 +25,6 @@ class Admin::StatsController < Admin::BaseController
.count(:voter_id) .count(:voter_id)
@user_ids_who_didnt_vote_proposals = @verified_users - @user_ids_who_voted_proposals @user_ids_who_didnt_vote_proposals = @verified_users - @user_ids_who_voted_proposals
@spending_proposals = SpendingProposal.count
budgets_ids = Budget.where.not(phase: "finished").pluck(:id) budgets_ids = Budget.where.not(phase: "finished").pluck(:id)
@budgets = budgets_ids.size @budgets = budgets_ids.size
@investments = Budget::Investment.where(budget_id: budgets_ids).count @investments = Budget::Investment.where(budget_id: budgets_ids).count
@@ -52,7 +51,6 @@ class Admin::StatsController < Admin::BaseController
@users_who_have_sent_message = DirectMessage.select(:sender_id).distinct.count @users_who_have_sent_message = DirectMessage.select(:sender_id).distinct.count
end end
def budgets def budgets
@budgets = Budget.all @budgets = Budget.all
end end

View File

@@ -43,10 +43,6 @@ class Admin::ValuatorsController < Admin::BaseController
redirect_to admin_valuators_path redirect_to admin_valuators_path
end end
def summary
@valuators = Valuator.order(spending_proposals_count: :desc)
end
private private
def valuator_params def valuator_params

View File

@@ -73,10 +73,6 @@ class ApplicationController < ActionController::Base
@proposal_votes = current_user ? current_user.proposal_votes(proposals) : {} @proposal_votes = current_user ? current_user.proposal_votes(proposals) : {}
end end
def set_spending_proposal_votes(spending_proposals)
@spending_proposal_votes = current_user ? current_user.spending_proposal_votes(spending_proposals) : {}
end
def set_comment_flags(comments) def set_comment_flags(comments)
@comment_flags = current_user ? current_user.comment_flags(comments) : {} @comment_flags = current_user ? current_user.comment_flags(comments) : {}
end end

View File

@@ -1,79 +0,0 @@
class Management::SpendingProposalsController < Management::BaseController
before_action :only_verified_users, except: :print
before_action :set_spending_proposal, only: [:vote, :show]
def index
@spending_proposals = apply_filters_and_search(SpendingProposal).order(cached_votes_up: :desc).page(params[:page]).for_render
set_spending_proposal_votes(@spending_proposals)
end
def new
@spending_proposal = SpendingProposal.new
end
def create
@spending_proposal = SpendingProposal.new(spending_proposal_params)
@spending_proposal.author = managed_user
if @spending_proposal.save
notice = t("flash.actions.create.notice", resource_name: t("activerecord.models.spending_proposal", count: 1))
redirect_to management_spending_proposal_path(@spending_proposal), notice: notice
else
render :new
end
end
def show
set_spending_proposal_votes(@spending_proposal)
end
def vote
@spending_proposal.register_vote(managed_user, "yes")
set_spending_proposal_votes(@spending_proposal)
end
def print
params[:geozone] ||= "all"
@spending_proposals = apply_filters_and_search(SpendingProposal).order(cached_votes_up: :desc).for_render.limit(15)
set_spending_proposal_votes(@spending_proposals)
end
private
def set_spending_proposal
@spending_proposal = SpendingProposal.find(params[:id])
end
def spending_proposal_params
params.require(:spending_proposal).permit(:title, :description, :external_url, :geozone_id, :terms_of_service)
end
def only_verified_users
check_verified_user t("management.spending_proposals.alert.unverified_user")
end
# This should not be necessary. Maybe we could create a specific show view for managers.
def set_spending_proposal_votes(spending_proposals)
@spending_proposal_votes = managed_user ? managed_user.spending_proposal_votes(spending_proposals) : {}
end
def set_geozone_name
if params[:geozone] == "all"
@geozone_name = t("geozones.none")
else
@geozone_name = Geozone.find(params[:geozone]).name
end
end
def apply_filters_and_search(target)
target = params[:unfeasible].present? ? target.unfeasible : target.not_unfeasible
if params[:geozone].present?
target = target.by_geozone(params[:geozone])
set_geozone_name
end
target = target.search(params[:search]) if params[:search].present?
target
end
end

View File

@@ -1,76 +0,0 @@
class SpendingProposalsController < ApplicationController
include FeatureFlags
before_action :authenticate_user!, except: [:index, :show]
before_action -> { flash.now[:notice] = flash[:notice].html_safe if flash[:html_safe] && flash[:notice] }
load_and_authorize_resource
feature_flag :spending_proposals
invisible_captcha only: [:create, :update], honeypot: :subtitle
respond_to :html, :js
def index
@spending_proposals = apply_filters_and_search(SpendingProposal).page(params[:page]).for_render
set_spending_proposal_votes(@spending_proposals)
end
def new
@spending_proposal = SpendingProposal.new
end
def show
set_spending_proposal_votes(@spending_proposal)
end
def create
@spending_proposal = SpendingProposal.new(spending_proposal_params)
@spending_proposal.author = current_user
if @spending_proposal.save
activity = "<a href='#{user_path(current_user, filter: :spending_proposals)}'>#{t('layouts.header.my_activity_link')}</a>"
notice = t("flash.actions.create.spending_proposal", activity: activity)
redirect_to @spending_proposal, notice: notice, flash: { html_safe: true }
else
render :new
end
end
def destroy
spending_proposal = SpendingProposal.find(params[:id])
spending_proposal.destroy
redirect_to user_path(current_user, filter: "spending_proposals"), notice: t("flash.actions.destroy.spending_proposal")
end
def vote
@spending_proposal.register_vote(current_user, "yes")
set_spending_proposal_votes(@spending_proposal)
end
private
def spending_proposal_params
params.require(:spending_proposal).permit(:title, :description, :external_url, :geozone_id, :association_name, :terms_of_service)
end
def set_geozone_name
if params[:geozone] == "all"
@geozone_name = t("geozones.none")
else
@geozone_name = Geozone.find(params[:geozone]).name
end
end
def apply_filters_and_search(target)
target = params[:unfeasible].present? ? target.unfeasible : target.not_unfeasible
if params[:geozone].present?
target = target.by_geozone(params[:geozone])
set_geozone_name
end
target = target.search(params[:search]) if params[:search].present?
target
end
end

View File

@@ -1,85 +0,0 @@
class Valuation::SpendingProposalsController < Valuation::BaseController
include FeatureFlags
feature_flag :spending_proposals
before_action :restrict_access_to_assigned_items, only: [:show, :edit, :valuate]
has_filters %w{valuating valuation_finished}, only: :index
load_and_authorize_resource
def index
@geozone_filters = geozone_filters
@spending_proposals = if current_user.valuator?
SpendingProposal.scoped_filter(params_for_current_valuator, @current_filter)
.order(cached_votes_up: :desc)
.page(params[:page])
else
SpendingProposal.none.page(params[:page])
end
end
def valuate
if valid_price_params? && @spending_proposal.update(valuation_params)
if @spending_proposal.unfeasible_email_pending?
@spending_proposal.send_unfeasible_email
end
redirect_to valuation_spending_proposal_path(@spending_proposal), notice: t("valuation.spending_proposals.notice.valuate")
else
render action: :edit
end
end
private
def geozone_filters
spending_proposals = SpendingProposal.by_valuator(current_user.valuator.try(:id)).valuation_open.all.to_a
[ { name: t("valuation.spending_proposals.index.geozone_filter_all"),
id: nil,
pending_count: spending_proposals.size
},
{ name: t("geozones.none"),
id: "all",
pending_count: spending_proposals.count{|x| x.geozone_id.nil?}
}
] + Geozone.all.order(name: :asc).collect do |g|
{ name: g.name,
id: g.id,
pending_count: spending_proposals.count{|x| x.geozone_id == g.id}
}
end.select{ |x| x[:pending_count] > 0 }
end
def valuation_params
params[:spending_proposal][:feasible] = nil if params[:spending_proposal][:feasible] == "nil"
params.require(:spending_proposal).permit(:price, :price_first_year, :price_explanation, :feasible, :feasible_explanation,
:time_scope, :valuation_finished, :internal_comments)
end
def params_for_current_valuator
params.merge(valuator_id: current_user.valuator.id)
end
def restrict_access_to_assigned_items
return if current_user.administrator? ||
ValuationAssignment.exists?(spending_proposal_id: params[:id], valuator_id: current_user.valuator.id)
raise ActionController::RoutingError.new("Not Found")
end
def valid_price_params?
if /\D/.match params[:spending_proposal][:price]
@spending_proposal.errors.add(:price, I18n.t("spending_proposals.wrong_price_format"))
end
if /\D/.match params[:spending_proposal][:price_first_year]
@spending_proposal.errors.add(:price_first_year, I18n.t("spending_proposals.wrong_price_format"))
end
@spending_proposal.errors.empty?
end
end

View File

@@ -33,10 +33,6 @@ module AdminHelper
controller_name.starts_with?("budget") controller_name.starts_with?("budget")
end end
def menu_budget?
["spending_proposals"].include?(controller_name)
end
def menu_polls? def menu_polls?
%w[polls active_polls recounts results questions answers].include?(controller_name) || %w[polls active_polls recounts results questions answers].include?(controller_name) ||
controller.class.parent == Admin::Poll::Questions::Answers controller.class.parent == Admin::Poll::Questions::Answers

View File

@@ -8,9 +8,4 @@ module GeozonesHelper
Geozone.all.order(name: :asc).collect { |g| [ g.name, g.id ] } Geozone.all.order(name: :asc).collect { |g| [ g.name, g.id ] }
end end
def geozone_name_from_id(g_id)
@all_geozones ||= Geozone.all.collect{ |g| [ g.id, g.name ] }.to_h
@all_geozones[g_id] || t("geozones.none")
end
end end

View File

@@ -1,25 +0,0 @@
module SpendingProposalsHelper
def spending_proposal_tags_select_options
ActsAsTaggableOn::Tag.spending_proposal_tags.pluck(:name)
end
def namespaced_spending_proposal_path(spending_proposal, options = {})
@namespace_spending_proposal_path ||= namespace
case @namespace_spending_proposal_path
when "management"
management_spending_proposal_path(spending_proposal, options)
else
spending_proposal_path(spending_proposal, options)
end
end
def spending_proposal_count_for_geozone(scope, geozone, second_scope)
if geozone.present?
geozone.spending_proposals.send(scope).send(second_scope).count
else
SpendingProposal.where(geozone: nil).send(scope).send(second_scope).count
end
end
end

View File

@@ -37,16 +37,6 @@ class Mailer < ApplicationMailer
end end
end end
def unfeasible_spending_proposal(spending_proposal)
@spending_proposal = spending_proposal
@author = spending_proposal.author
@email_to = @author.email
with_user(@author) do
mail(to: @email_to, subject: t("mailers.unfeasible_spending_proposal.subject", code: @spending_proposal.code))
end
end
def direct_message_for_receiver(direct_message) def direct_message_for_receiver(direct_message)
@direct_message = direct_message @direct_message = direct_message
@receiver = @direct_message.receiver @receiver = @direct_message.receiver

View File

@@ -59,7 +59,6 @@ module Abilities
can :manage, Dashboard::Action can :manage, Dashboard::Action
can [:read, :update, :valuate, :destroy, :summary], SpendingProposal
can [:index, :read, :new, :create, :update, :destroy, :calculate_winners], Budget can [:index, :read, :new, :create, :update, :destroy, :calculate_winners], Budget
can [:read, :create, :update, :destroy], Budget::Group can [:read, :create, :update, :destroy], Budget::Group
can [:read, :create, :update, :destroy], Budget::Heading can [:read, :create, :update, :destroy], Budget::Heading

View File

@@ -89,8 +89,6 @@ module Abilities
proposal.published? proposal.published?
end end
can :vote_featured, Proposal can :vote_featured, Proposal
can :vote, SpendingProposal
can :create, SpendingProposal
can :vote, Legislation::Proposal can :vote, Legislation::Proposal
can :vote_featured, Legislation::Proposal can :vote_featured, Legislation::Proposal

View File

@@ -14,9 +14,8 @@ module Abilities
poll.expired? && poll.stats_enabled? poll.expired? && poll.stats_enabled?
end end
can :read, Poll::Question can :read, Poll::Question
can [:read, :welcome], Budget
can :read, SpendingProposal
can :read, User can :read, User
can [:read, :welcome], Budget
can [:read], Budget can [:read], Budget
can [:read], Budget::Group can [:read], Budget::Group
can [:read, :print, :json_data], Budget::Investment can [:read, :print, :json_data], Budget::Investment

View File

@@ -5,7 +5,6 @@ module Abilities
def initialize(user) def initialize(user)
valuator = user.valuator valuator = user.valuator
can [:read, :update, :valuate], SpendingProposal
can [:read, :update, :comment_valuation], Budget::Investment, id: valuator.assigned_investment_ids can [:read, :update, :comment_valuation], Budget::Investment, id: valuator.assigned_investment_ids
can [:valuate], Budget::Investment, { id: valuator.assigned_investment_ids, valuation_finished: false } can [:valuate], Budget::Investment, { id: valuator.assigned_investment_ids, valuation_finished: false }
cannot [:update, :valuate, :comment_valuation], Budget::Investment, budget: { phase: "finished" } cannot [:update, :valuate, :comment_valuation], Budget::Investment, budget: { phase: "finished" }

View File

@@ -3,7 +3,6 @@ class Geozone < ApplicationRecord
include Graphqlable include Graphqlable
has_many :proposals has_many :proposals
has_many :spending_proposals
has_many :debates has_many :debates
has_many :users has_many :users
validates :name, presence: true validates :name, presence: true

View File

@@ -2,7 +2,7 @@ class SignatureSheet < ApplicationRecord
belongs_to :signable, polymorphic: true belongs_to :signable, polymorphic: true
belongs_to :author, class_name: "User", foreign_key: "author_id" belongs_to :author, class_name: "User", foreign_key: "author_id"
VALID_SIGNABLES = %w(Proposal Budget::Investment SpendingProposal) VALID_SIGNABLES = %w(Proposal Budget::Investment)
has_many :signatures has_many :signatures

View File

@@ -1,146 +0,0 @@
class SpendingProposal < ApplicationRecord
include Measurable
include Sanitizable
include Taggable
include Searchable
acts_as_votable
belongs_to :author, -> { with_hidden }, class_name: "User", foreign_key: "author_id"
belongs_to :geozone
belongs_to :administrator
has_many :valuation_assignments, dependent: :destroy
has_many :valuators, through: :valuation_assignments
validates :title, presence: true
validates :author, presence: true
validates :description, presence: true
validates :feasible_explanation, presence: { if: :feasible_explanation_required? }
validates :title, length: { in: 4..SpendingProposal.title_max_length }
validates :description, length: { maximum: SpendingProposal.description_max_length }
validates :terms_of_service, acceptance: { allow_nil: false }, on: :create
scope :valuation_open, -> { where(valuation_finished: false) }
scope :without_admin, -> { valuation_open.where(administrator_id: nil) }
scope :managed, -> { valuation_open.where(valuation_assignments_count: 0).where("administrator_id IS NOT ?", nil) }
scope :valuating, -> { valuation_open.where("valuation_assignments_count > 0 AND valuation_finished = ?", false) }
scope :valuation_finished, -> { where(valuation_finished: true) }
scope :feasible, -> { where(feasible: true) }
scope :unfeasible, -> { where(feasible: false) }
scope :not_unfeasible, -> { where("feasible IS ? OR feasible = ?", nil, true) }
scope :with_supports, -> { where("cached_votes_up > 0") }
scope :by_admin, ->(admin) { where(administrator_id: admin.presence) }
scope :by_tag, ->(tag_name) { tagged_with(tag_name) }
scope :by_valuator, ->(valuator) { where("valuation_assignments.valuator_id = ?", valuator.presence).joins(:valuation_assignments) }
scope :for_render, -> { includes(:geozone) }
before_validation :set_responsible_name
def description
super.try :html_safe
end
def self.scoped_filter(params, current_filter)
results = self
results = results.by_geozone(params[:geozone_id]) if params[:geozone_id].present?
results = results.by_admin(params[:administrator_id]) if params[:administrator_id].present?
results = results.by_tag(params[:tag_name]) if params[:tag_name].present?
results = results.by_valuator(params[:valuator_id]) if params[:valuator_id].present?
results = results.send(current_filter) if current_filter.present?
results.includes(:geozone, administrator: :user, valuators: :user)
end
def searchable_values
{ title => "A",
author.username => "B",
geozone.try(:name) => "B",
description => "C"
}
end
def self.search(terms)
pg_search(terms)
end
def self.by_geozone(geozone)
if geozone == "all"
where(geozone_id: nil)
else
where(geozone_id: geozone.presence)
end
end
def feasibility
case feasible
when true
"feasible"
when false
"not_feasible"
else
"undefined"
end
end
def unfeasible_email_pending?
unfeasible_email_sent_at.blank? && unfeasible? && valuation_finished?
end
def unfeasible?
feasible == false
end
def valuation_finished?
valuation_finished
end
def feasible_explanation_required?
valuation_finished? && unfeasible?
end
def total_votes
cached_votes_up + physical_votes
end
def code
"#{created_at.strftime("%Y")}-#{id}" + (administrator.present? ? "-A#{administrator.id}" : "")
end
def send_unfeasible_email
Mailer.unfeasible_spending_proposal(self).deliver_later
update(unfeasible_email_sent_at: Time.current)
end
def reason_for_not_being_votable_by(user)
return :not_voting_allowed if Setting["feature.spending_proposal_features.voting_allowed"].blank?
return :not_logged_in unless user
return :not_verified unless user.can?(:vote, SpendingProposal)
return :unfeasible if unfeasible?
return :organization if user.organization?
end
def votable_by?(user)
reason_for_not_being_votable_by(user).blank?
end
def register_vote(user, vote_value)
if votable_by?(user)
vote_by(voter: user, vote: vote_value)
end
end
def set_responsible_name
self.responsible_name = author.try(:document_number) if author.try(:document_number).present?
end
def self.finished_and_feasible
valuation_finished.feasible
end
def self.finished_and_unfeasible
valuation_finished.unfeasible
end
end

View File

@@ -25,7 +25,6 @@ class User < ApplicationRecord
has_many :proposals, -> { with_hidden }, foreign_key: :author_id has_many :proposals, -> { with_hidden }, foreign_key: :author_id
has_many :budget_investments, -> { with_hidden }, foreign_key: :author_id, class_name: "Budget::Investment" has_many :budget_investments, -> { with_hidden }, foreign_key: :author_id, class_name: "Budget::Investment"
has_many :comments, -> { with_hidden } has_many :comments, -> { with_hidden }
has_many :spending_proposals, foreign_key: :author_id
has_many :failed_census_calls has_many :failed_census_calls
has_many :notifications has_many :notifications
has_many :direct_messages_sent, class_name: "DirectMessage", foreign_key: :sender_id has_many :direct_messages_sent, class_name: "DirectMessage", foreign_key: :sender_id
@@ -117,11 +116,6 @@ class User < ApplicationRecord
voted.each_with_object({}) { |v, h| h[v.votable_id] = v.value } voted.each_with_object({}) { |v, h| h[v.votable_id] = v.value }
end end
def spending_proposal_votes(spending_proposals)
voted = votes.for_spending_proposals(spending_proposals)
voted.each_with_object({}) { |v, h| h[v.votable_id] = v.value }
end
def budget_investment_votes(budget_investments) def budget_investment_votes(budget_investments)
voted = votes.for_budget_investments(budget_investments) voted = votes.for_budget_investments(budget_investments)
voted.each_with_object({}) { |v, h| h[v.votable_id] = v.value } voted.each_with_object({}) { |v, h| h[v.votable_id] = v.value }

View File

@@ -1,4 +0,0 @@
class ValuationAssignment < ApplicationRecord
belongs_to :valuator, counter_cache: :spending_proposals_count
belongs_to :spending_proposal, counter_cache: true
end

View File

@@ -4,8 +4,6 @@ class Valuator < ApplicationRecord
delegate :name, :email, :name_and_email, to: :user delegate :name, :email, :name_and_email, to: :user
has_many :valuation_assignments, dependent: :destroy
has_many :spending_proposals, through: :valuation_assignments
has_many :valuator_assignments, dependent: :destroy, class_name: "Budget::ValuatorAssignment" has_many :valuator_assignments, dependent: :destroy, class_name: "Budget::ValuatorAssignment"
has_many :investments, through: :valuator_assignments, class_name: "Budget::Investment" has_many :investments, through: :valuator_assignments, class_name: "Budget::Investment"

View File

@@ -74,20 +74,6 @@
</li> </li>
<% end %> <% end %>
<% if feature?(:spending_proposals) %>
<li class="section-title">
<a href="#">
<span class="icon-budget"></span>
<strong><%= t("admin.menu.title_budgets") %></strong>
</a>
<ul <%= "class=is-active" if menu_budget? %>>
<li <%= "class=is-active" if controller_name == "spending_proposals" %>>
<%= link_to t("admin.menu.spending_proposals"), admin_spending_proposals_path %>
</li>
</ul>
</li>
<% end %>
<% messages_sections = %w(newsletters emails_download admin_notifications system_emails) %> <% messages_sections = %w(newsletters emails_download admin_notifications system_emails) %>
<% messages_menu_active = messages_sections.include?(controller_name) %> <% messages_menu_active = messages_sections.include?(controller_name) %>
<li class="section-title" <%= "class=is-active" if messages_menu_active %>> <li class="section-title" <%= "class=is-active" if messages_menu_active %>>

View File

@@ -11,11 +11,14 @@
<div class="row expanded"> <div class="row expanded">
<div class="small-12 column"> <div class="small-12 column">
<%= f.text_field :title, maxlength: Budget::Investment.title_max_length %> <%= f.text_field :title,
maxlength: Budget::Investment.title_max_length %>
</div> </div>
<div class="ckeditor small-12 column"> <div class="ckeditor small-12 column">
<%= f.cktext_area :description, maxlength: Budget::Investment.description_max_length, ckeditor: { language: I18n.locale } %> <%= f.cktext_area :description,
maxlength: Budget::Investment.description_max_length,
ckeditor: { language: I18n.locale } %>
</div> </div>
<div class="small-12 column"> <div class="small-12 column">

View File

@@ -1,10 +0,0 @@
<%= form_for(SpendingProposal.new, url: url, as: :spending_proposal, method: :get) do |f| %>
<div class="row">
<div class="small-12 medium-6 column">
<%= text_field_tag :search, "", placeholder: t("admin.shared.spending_proposal_search.placeholder") %>
</div>
<div class="form-inline small-12 medium-3 column end">
<%= f.submit t("admin.shared.spending_proposal_search.button"), class: "button" %>
</div>
</div>
<% end %>

View File

@@ -1,9 +0,0 @@
<ul>
<% @spending_proposal.valuators.each do |valuator| %>
<li><%= valuator.name %> (<%= valuator.email %>)</li>
<% end %>
<% if @spending_proposal.valuators.empty? %>
<li><%= t("admin.spending_proposals.show.undefined") %></li>
<% end %>
</ul>

View File

@@ -1,35 +0,0 @@
<table id="spending_proposals" class="investment-projects-summary">
<th><%= t("admin.spending_proposals.summary.geozone_name") %></th>
<th><%= t("admin.spending_proposals.summary.finished_and_feasible_count") %></th>
<th><%= t("admin.spending_proposals.summary.finished_and_unfeasible_count") %></th>
<th><%= t("admin.spending_proposals.summary.finished_count") %></th>
<th><%= t("admin.spending_proposals.summary.in_evaluation_count") %></th>
<th><%= t("admin.spending_proposals.summary.total_count") %></th>
<th><%= t("admin.spending_proposals.summary.cost_for_geozone") %></th>
<% spending_proposals.each do |geozone, price| %>
<tr id="<%= geozone.present? ? dom_id(geozone) : "geozone_all_city" %>">
<td class="name">
<%= geozone.present? ? geozone.name : t("geozones.none") %>
</td>
<td class="finished-and-feasible-count">
<%= spending_proposal_count_for_geozone("finished_and_feasible", geozone, second_scope) %>
</td>
<td class="finished-and-unfeasible-count">
<%= spending_proposal_count_for_geozone("finished_and_unfeasible", geozone, second_scope) %>
</td>
<td class="finished-count">
<%= spending_proposal_count_for_geozone("valuation_finished", geozone, second_scope) %>
</td>
<td class="in-evaluation-count">
<%= spending_proposal_count_for_geozone("valuating", geozone, second_scope) %>
</td>
<td class="total-count">
<%= spending_proposal_count_for_geozone("all", geozone, second_scope) %>
</td>
<td class="total-price text-center">
<%= number_to_currency(price) %>
</td>
</tr>
<% end %>
</table>

View File

@@ -1,42 +0,0 @@
<div class="callout primary float-right">
<%= t "admin.spending_proposals.show.heading", id: @spending_proposal.id %>
</div>
<br>
<h1 class="inline-block"><%= @spending_proposal.title %></h1>
<div class="row small-collapse spending-proposal-info">
<div class="small-12 medium-4 column">
<p>
<strong><%= t("admin.spending_proposals.show.geozone") %>:</strong>
<%= geozone_name(@spending_proposal) %>
</p>
</div>
<div class="small-12 medium-4 column">
<p>
<strong><%= t("admin.spending_proposals.show.by") %>:</strong>
<%= link_to @spending_proposal.author.name, admin_hidden_user_path(@spending_proposal.author) %>
</p>
</div>
<div class="small-12 medium-4 column">
<p>
<strong><%= t("admin.spending_proposals.show.sent") %>:</strong>
<%= l @spending_proposal.created_at, format: :datetime %>
</p>
</div>
</div>
<% if @spending_proposal.association_name.present? %>
<p><strong><%= t("admin.spending_proposals.show.association_name") %>:</strong>
<%= @spending_proposal.association_name %>
</p>
<% end %>
<% if @spending_proposal.external_url.present? %>
<p><%= text_with_links @spending_proposal.external_url %>&nbsp;<span class="icon-external small"></span></p>
<% end %>
<%= safe_html_with_links @spending_proposal.description %>

View File

@@ -1,75 +0,0 @@
<%= link_to admin_spending_proposal_path(@spending_proposal, @filter_params.to_h), class: 'back' do %>
<span class="icon-angle-left"></span> <%= t("admin.spending_proposals.show.back") %>
<% end %>
<%= form_for @spending_proposal,
url: admin_spending_proposal_path(@spending_proposal) do |f| %>
<% @filter_params.to_h.each do |filter_name, filter_value| %>
<%= hidden_field_tag filter_name, filter_value %>
<% end %>
<div class="row">
<div class="small-12 column">
<%= f.text_field :title, maxlength: SpendingProposal.title_max_length %>
</div>
<div class="ckeditor small-12 column">
<%= f.cktext_area :description,
maxlength: SpendingProposal.description_max_length,
ckeditor: { language: I18n.locale } %>
</div>
<div class="small-12 column">
<%= f.text_field :external_url %>
</div>
<div class="small-12 column">
<%= f.select :geozone_id, geozone_select_options, include_blank: t("geozones.none") %>
</div>
<div class="small-12 column">
<%= f.text_field :association_name, placeholder: t("spending_proposals.form.association_name") %>
</div>
</div>
<h2 id="classification"><%= t("admin.spending_proposals.edit.classification") %></h2>
<div class="row">
<div class="small-12 column">
<%= f.select(:administrator_id,
@admins.collect{ |a| [a.name_and_email, a.id ] },
{ include_blank: t("admin.spending_proposals.edit.undefined") }) %>
</div>
<div class="small-12 column">
<%= f.label :tag_list, t("admin.spending_proposals.edit.tags") %>
<div class="tags">
<% @tags.each do |tag| %>
<a class="js-add-tag-link"><%= tag.name %></a>
<% end %>
</div>
<%= f.text_field :tag_list, value: @spending_proposal.tag_list.to_s,
label: false,
placeholder: t("admin.spending_proposals.edit.tags_placeholder"),
class: "js-tag-list" %>
</div>
<div class="small-12 column">
<%= f.label :valuator_ids, t("admin.spending_proposals.edit.assigned_valuators") %>
<%= f.collection_check_boxes :valuator_ids, @valuators, :id, :email do |b| %>
<%= b.label(title: valuator_label(b.object)) { b.check_box + truncate(b.object.description_or_email, length: 60) } %>
<% end %>
</div>
</div>
<p class="clear">
<%= f.submit(class: "button", value: t("admin.spending_proposals.edit.submit_button")) %>
</p>
<% end %>
<hr>
<%= render "valuation/spending_proposals/written_by_valuators" %>

View File

@@ -1,85 +0,0 @@
<%= link_to t("admin.spending_proposals.index.summary_link"),
summary_admin_spending_proposals_path,
class: "button float-right" %>
<%= link_to t("admin.spending_proposals.index.valuator_summary_link"),
summary_admin_valuators_path,
class: "button float-right margin-right" %>
<h2 class="inline-block"><%= t("admin.spending_proposals.index.title") %></h2>
<div class="row margin">
<%= form_tag admin_spending_proposals_path, method: :get, enforce_utf8: false do %>
<div class="small-12 medium-3 column">
<%= select_tag :administrator_id,
options_for_select(admin_select_options, params[:administrator_id]),
{ prompt: t("admin.spending_proposals.index.administrator_filter_all"),
label: false,
class: "js-submit-on-change" } %>
</div>
<div class="small-12 medium-3 column">
<%= select_tag :valuator_id,
options_for_select(valuator_select_options, params[:valuator_id]),
{ prompt: t("admin.spending_proposals.index.valuator_filter_all"),
label: false,
class: "js-submit-on-change" } %>
</div>
<div class="small-12 medium-3 column">
<%= select_tag :geozone_id,
options_for_select(geozone_select_options.unshift([t("geozones.none"), "all"]), params[:geozone_id]),
{ prompt: t("admin.spending_proposals.index.geozone_filter_all"),
label: false,
class: "js-submit-on-change" } %>
</div>
<div class="small-12 medium-3 column">
<%= select_tag :tag_name,
options_for_select(spending_proposal_tags_select_options, params[:tag_name]),
{ prompt: t("admin.spending_proposals.index.tags_filter_all"),
label: false,
class: "js-submit-on-change" } %>
</div>
<% end %>
</div>
<%= render "shared/filter_subnav", i18n_namespace: "admin.spending_proposals.index" %>
<h3><%= page_entries_info @spending_proposals %></h3>
<table>
<% @spending_proposals.each do |spending_proposal| %>
<tr id="<%= dom_id(spending_proposal) %>" class="spending_proposal">
<td>
<strong><%= spending_proposal.id %></strong>
</td>
<td>
<%= link_to spending_proposal.title,
admin_spending_proposal_path(spending_proposal, @filter_params.to_h) %>
</td>
<td class="small">
<% if spending_proposal.administrator.present? %>
<span title="<%= t("admin.spending_proposals.index.assigned_admin") %>"><%= spending_proposal.administrator.name %></span>
<% else %>
<%= t("admin.spending_proposals.index.no_admin_assigned") %>
<% end %>
</td>
<td class="small">
<% if spending_proposal.valuators.size == 0 %>
<%= t("admin.spending_proposals.index.no_valuators_assigned") %>
<% else %>
<%= spending_proposal.valuators.collect(&:description_or_name).join(", ") %>
<% end %>
</td>
<td class="small">
<%= geozone_name(spending_proposal) %>
</td>
<td class="small">
<%= t("admin.spending_proposals.index.feasibility.#{spending_proposal.feasibility}", price: spending_proposal.price) %>
</td>
</tr>
<% end %>
</table>
<%= paginate @spending_proposals %>

View File

@@ -1,50 +0,0 @@
<%= link_to admin_spending_proposals_path(@filter_params.to_h), data: {no_turbolink: true} do %>
<span class="icon-angle-left"></span> <%= t("admin.spending_proposals.show.back") %>
<% end %>
<%= render "written_by_author" %>
<%= link_to t("admin.spending_proposals.show.edit"),
edit_admin_spending_proposal_path(@spending_proposal,
@filter_params.to_h) %>
<hr>
<h2 id="classification"><%= t("admin.spending_proposals.show.classification") %></h2>
<p><strong><%= t("admin.spending_proposals.show.assigned_admin") %>:</strong>
<%= @spending_proposal.administrator.try(:name_and_email) || t("admin.spending_proposals.show.undefined") %>
</p>
<p id="tags">
<strong><%= t("admin.spending_proposals.show.tags") %>:</strong>
<%= @spending_proposal.tags.pluck(:name).join(", ") %>
</p>
<p id="assigned_valuators">
<strong><%= t("admin.spending_proposals.show.assigned_valuators") %>:</strong>
<% if @spending_proposal.valuators.any? %>
<%= @spending_proposal.valuators.collect(&:name_and_email).join(", ") %>
<% else %>
<%= t("admin.spending_proposals.show.undefined") %>
<% end %>
</p>
<p>
<%= link_to t("admin.spending_proposals.show.edit_classification"),
edit_admin_spending_proposal_path(@spending_proposal,
{anchor: 'classification'}.merge(@filter_params.to_h)) %>
</p>
<hr>
<h2><%= t("admin.spending_proposals.show.dossier") %></h2>
<%= render "valuation/spending_proposals/written_by_valuators" %>
<p>
<%= link_to t("admin.spending_proposals.show.edit_dossier"),
edit_valuation_spending_proposal_path(@spending_proposal) %>
</p>

View File

@@ -1,18 +0,0 @@
<%= link_to admin_spending_proposals_path, class: "back" do %>
<span class="icon-angle-left"></span>
<%= t("shared.back") %>
<% end %>
<h2><%= t("admin.spending_proposals.summary.title") %></h2>
<div id="all-proposals">
<%= render "summary_table",
spending_proposals: @spending_proposals,
second_scope: "all" %>
</div>
<div id="proposals-with-votes">
<h2><%= t("admin.spending_proposals.summary.title_proposals_with_supports") %></h2>
<%= render "summary_table",
spending_proposals: @spending_proposals_with_supports,
second_scope: "with_supports" %>
</div>

View File

@@ -25,7 +25,6 @@
graph_admin_stats_path(id: "visits", count: @visits) %> <br> graph_admin_stats_path(id: "visits", count: @visits) %> <br>
<span class="number"><%= number_with_delimiter(@visits) %></span> <span class="number"><%= number_with_delimiter(@visits) %></span>
</p> </p>
<p> <p>
<%= t "admin.stats.show.summary.debates" %> <br> <%= t "admin.stats.show.summary.debates" %> <br>
<span class="number"><%= number_with_delimiter(@debates) %></span> <span class="number"><%= number_with_delimiter(@debates) %></span>
@@ -55,7 +54,6 @@
<%= t "admin.stats.show.summary.proposal_votes" %> <br> <%= t "admin.stats.show.summary.proposal_votes" %> <br>
<span class="number"><%= number_with_delimiter(@proposal_votes) %> <br></span> <span class="number"><%= number_with_delimiter(@proposal_votes) %> <br></span>
</p> </p>
<p> <p>
<%= t "admin.stats.show.summary.debate_votes" %> <br> <%= t "admin.stats.show.summary.debate_votes" %> <br>
<span class="number"><%= number_with_delimiter(@debate_votes) %></span> <span class="number"><%= number_with_delimiter(@debate_votes) %></span>
@@ -108,14 +106,6 @@
</p> </p>
</div> </div>
<% if feature?(:spending_proposals) %>
<div class="small-12 medium-3 column">
<p class="featured">
<%= t "admin.stats.show.summary.spending_proposals" %> <br>
<span class="number"><%= number_with_delimiter(@spending_proposals) %></span>
</p>
</div>
<% end %>
</div> </div>
<div class="small-12 column"> <div class="small-12 column">

View File

@@ -1,39 +0,0 @@
<%= back_link_to %>
<h2><%= t("admin.valuators.summary.title") %></h2>
<table id="spending_proposals" class="investment-projects-summary">
<th><%= t("admin.valuators.summary.valuator_name") %></th>
<th><%= t("admin.valuators.summary.finished_and_feasible_count") %></th>
<th><%= t("admin.valuators.summary.finished_and_unfeasible_count") %></th>
<th><%= t("admin.valuators.summary.finished_count") %></th>
<th><%= t("admin.valuators.summary.in_evaluation_count") %></th>
<th><%= t("admin.valuators.summary.total_count") %></th>
<th><%= t("admin.valuators.summary.cost") %></th>
<% @valuators.each do |valuator| %>
<tr id="<%= dom_id(valuator) %>">
<td class="name">
<%= valuator.description_or_email %>
</td>
<td class="finished-and-feasible-count">
<%= valuator.spending_proposals.finished_and_feasible.count %>
</td>
<td class="finished-and-unfeasible-count">
<%= valuator.spending_proposals.finished_and_unfeasible.count %>
</td>
<td class="finished-count">
<%= valuator.spending_proposals.valuation_finished.count %>
</td>
<td class="in-evaluation-count">
<%= valuator.spending_proposals.valuating.count %>
</td>
<td class="total-count">
<%= valuator.spending_proposals.count %>
</td>
<td class="total-price text-center">
<%= number_to_currency(valuator.spending_proposals.sum(:price)) %>
</td>
</tr>
<% end %>
</table>

View File

@@ -1,2 +0,0 @@
$("#<%= dom_id(@spending_proposal) %>_ballot").html("<%= j render("spending_proposals/ballot", spending_proposal: @spending_proposal) %>");
$(".no-supports-allowed").show();

View File

@@ -7,14 +7,20 @@
</div> </div>
<div class="small-12 column"> <div class="small-12 column">
<%= f.text_field :title, maxlength: SpendingProposal.title_max_length, data: { js_suggest_result: "js_suggest_result", js_suggest: "#js-suggest", js_url: suggest_budget_investments_path(@budget) }%> <%= f.text_field :title,
maxlength: Budget::Investment.title_max_length,
data: { js_suggest_result: "js_suggest_result",
js_suggest: "#js-suggest",
js_url: suggest_budget_investments_path(@budget) } %>
</div> </div>
<div id="js-suggest"></div> <div id="js-suggest"></div>
<%= f.invisible_captcha :subtitle %> <%= f.invisible_captcha :subtitle %>
<div class="ckeditor small-12 column"> <div class="ckeditor small-12 column">
<%= f.cktext_area :description, maxlength: SpendingProposal.description_max_length, ckeditor: { language: I18n.locale } %> <%= f.cktext_area :description,
maxlength: Budget::Investment.description_max_length,
ckeditor: { language: I18n.locale } %>
</div> </div>
<% if feature?(:allow_images) %> <% if feature?(:allow_images) %>

View File

@@ -8,7 +8,7 @@
<thead> <thead>
<tr> <tr>
<th scope="col"> <th scope="col">
<%= t("budgets.results.spending_proposal") %> <%= t("budgets.results.investment_title") %>
</th> </th>
<th scope="col" class="text-center"> <th scope="col" class="text-center">
<%= t("budgets.results.ballot_lines_count") %> <%= t("budgets.results.ballot_lines_count") %>

View File

@@ -56,7 +56,7 @@
<td class="border-left"> <td class="border-left">
<strong><%= heading.name %></strong> <strong><%= heading.name %></strong>
</td> </td>
<td id="total_spending_proposals_heading_<%= heading.id %>" <td id="total_investments_heading_<%= heading.id %>"
class="text-center border-left border-right"> class="text-center border-left border-right">
<%= stats.headings[heading.id][:total_investments_count] %> <%= stats.headings[heading.id][:total_investments_count] %>
</td> </td>

View File

@@ -1,24 +0,0 @@
<td style="padding-bottom: 20px; padding-left: 10px;">
<p style="font-family: 'Open Sans','Helvetica Neue',arial,sans-serif;font-size: 14px;font-weight: normal;line-height: 24px;">
<%= t("mailers.unfeasible_spending_proposal.hi") %>
</p>
<p style="font-family: 'Open Sans','Helvetica Neue',arial,sans-serif;font-size: 14px;font-weight: normal;line-height: 24px; padding-left: 12px; border-left: 2px solid #ccc;">
<%= @spending_proposal.feasible_explanation %>
</p>
<p style="font-family: 'Open Sans','Helvetica Neue',arial,sans-serif;font-size: 14px;font-weight: normal;line-height: 24px;">
<%= t("mailers.unfeasible_spending_proposal.new_html",
url: link_to(t("mailers.unfeasible_spending_proposal.new_href"),
new_spending_proposal_url, style: "color: #2895F1; text-decoration: underline;")) %>
</p>
<p style="font-family: 'Open Sans','Helvetica Neue',arial,sans-serif;font-size: 14px;font-weight: normal;line-height: 24px;">
<%= t("mailers.unfeasible_spending_proposal.sorry") %>
</p>
<p style="font-family: 'Open Sans','Helvetica Neue',arial,sans-serif;font-size: 14px;font-weight: normal;line-height: 24px;">
<%= t("mailers.unfeasible_spending_proposal.sincerely") %>
</p>
</td>

View File

@@ -64,29 +64,5 @@
<%= t("management.menu.user_invites") %> <%= t("management.menu.user_invites") %>
<% end %> <% end %>
</li> </li>
<%# temporarily commenting until obsolete spending_proposals is removed %>
<% if false %>
<li <%= "class=is-active" if controller_name == "spending_proposals" && action_name == "new" %>>
<%= link_to new_management_spending_proposal_path do %>
<span class="icon-budget"></span>
<%= t("management.menu.create_spending_proposal") %>
<% end %>
</li>
<li <%= "class=is-active" if controller_name == "spending_proposals" && action_name == "index" %>>
<%= link_to management_spending_proposals_path do %>
<span class="icon-like"></span>
<%= t("management.menu.support_spending_proposals") %>
<% end %>
</li>
<li <%= "class=is-active" if controller_name == "spending_proposals" && action_name == "print" %>>
<%= link_to print_management_spending_proposals_path do %>
<span class="icon-print"></span>
<%= t("management.menu.print_spending_proposals") %>
<% end %>
</li>
<% end %>
</ul> </ul>
</div> </div>

View File

@@ -1 +0,0 @@
<%= render partial: "spending_proposals/spending_proposal", locals: {spending_proposal: spending_proposal} %>

View File

@@ -1,2 +0,0 @@
<%= render "spending_proposals/votes",
{ spending_proposal: spending_proposal, vote_url: vote_management_spending_proposal_path(spending_proposal, value: "yes") } %>

View File

@@ -1,25 +0,0 @@
<main>
<span class="not-print">
<%= render "admin/shared/spending_proposal_search", url: management_spending_proposals_path %>
</span>
<div class="row">
<div id="investment-projects" class="investment-projects-list small-12 medium-9 column">
<div class="small-12 search-results">
<%= content_tag(:h2, t("management.spending_proposals.filters.unfeasible")) if params[:unfeasible].present? %>
<%= content_tag(:h2, t("management.spending_proposals.filters.by_geozone", geozone: @geozone_name)) if @geozone_name.present? %>
<% if params[:search].present? %>
<h2>
<%= page_entries_info @spending_proposals %>
<%= t("management.spending_proposals.search_results", count: @spending_proposals.size, search_term: params[:search]) %>
</h2>
<% end %>
</div>
<%= render @spending_proposals %>
<%= paginate @spending_proposals %>
</div>
</div>
</main>

View File

@@ -1,12 +0,0 @@
<div class="spending-proposal-form">
<div class="clear float-right">
<%= render "/shared/print" %>
</div>
<div class="small-12 medium-9 column end">
<h1 class=""><%= t("management.spending_proposals.create") %></h1>
<%= render "spending_proposals/form", form_url: management_spending_proposals_url %>
</div>
</div>

View File

@@ -1,33 +0,0 @@
<main>
<div class="row">
<div id="investment-projects" class="investment-projects-list small-12 column">
<div class="not-print">
<%= form_tag print_management_spending_proposals_path, method: :get, enforce_utf8: false do %>
<div class="small-12 medium-4 column float-left">
<%= select_tag :geozone,
options_for_select(geozone_select_options.unshift([t("geozones.none"), "all"]), params[:geozone]),
{ label: false,
class: "js-submit-on-change" } %>
</div>
<% end %>
<a id="print_link" href="javascript:window.print();" class="button warning float-right">
<%= t("management.spending_proposals.print.print_button") %>
</a>
</div>
<div class="small-12 search-results">
<%= content_tag(:h2, t("management.spending_proposals.filters.unfeasible"), class: "inline-block") if params[:unfeasible].present? %>
<%= content_tag(:h2, t("management.spending_proposals.filters.by_geozone", geozone: @geozone_name), class: "inline-block") if @geozone_name.present? %>
<%= content_tag(:h2, t("management.spending_proposals.search_results", count: @spending_proposals.size, search_term: params[:search]), class: "inline-block") if params[:search].present? %>
</div>
<%= render @spending_proposals %>
<div class="for-print-only">
<p><strong><%= t("management.print.spending_proposals_info") %></strong></p>
</div>
</div>
</div>
</main>

View File

@@ -1,3 +0,0 @@
<%= render "/shared/print" %>
<%= render template: "spending_proposals/show" %>

View File

@@ -1 +0,0 @@
<%= render template: "spending_proposals/vote" %>

View File

@@ -14,7 +14,7 @@
</li> </li>
<% end %> <% end %>
<% if (feature?(:spending_proposals) || feature?(:budgets)) && <% if feature?(:budgets) &&
(current_user.administrator? || current_user.valuator?) %> (current_user.administrator? || current_user.valuator?) %>
<li> <li>
<%= link_to t("layouts.header.valuation"), valuation_root_path %> <%= link_to t("layouts.header.valuation"), valuation_root_path %>

View File

@@ -37,14 +37,6 @@
accesskey: "4" %> accesskey: "4" %>
</li> </li>
<% end %> <% end %>
<% if feature?(:spending_proposals) %>
<li>
<%= layout_menu_link_to t("layouts.header.spending_proposals"),
spending_proposals_path,
controller_name == "spending_proposals",
accesskey: "s" %>
</li>
<% end %>
<% if feature?(:budgets) %> <% if feature?(:budgets) %>
<li> <li>
<%= layout_menu_link_to t("layouts.header.budgets"), <%= layout_menu_link_to t("layouts.header.budgets"),

View File

@@ -1,49 +0,0 @@
<%= form_for(@spending_proposal, url: form_url) do |f| %>
<%= render "shared/errors", resource: @spending_proposal %>
<div class="row">
<div class="small-12 column">
<%= f.label :title, t("spending_proposals.form.title") %>
<%= f.text_field :title, maxlength: SpendingProposal.title_max_length, placeholder: t("spending_proposals.form.title"), label: false %>
</div>
<%= f.invisible_captcha :subtitle %>
<div class="ckeditor small-12 column">
<%= f.label :description, t("spending_proposals.form.description") %>
<%= f.cktext_area :description, maxlength: SpendingProposal.description_max_length, ckeditor: { language: I18n.locale }, label: false %>
</div>
<div class="small-12 column">
<%= f.label :external_url, t("spending_proposals.form.external_url") %>
<%= f.text_field :external_url, placeholder: t("spending_proposals.form.external_url"), label: false %>
</div>
<div class="small-12 column">
<%= f.label :geozone_id, t("spending_proposals.form.geozone") %>
<%= f.select :geozone_id, geozone_select_options, {include_blank: t("geozones.none"), label: false} %>
</div>
<div class="small-12 column">
<%= f.label :association_name, t("spending_proposals.form.association_name_label") %>
<%= f.text_field :association_name, placeholder: t("spending_proposals.form.association_name"), label: false %>
</div>
<div class="small-12 column">
<% if @spending_proposal.new_record? %>
<%= f.label :terms_of_service do %>
<%= f.check_box :terms_of_service, title: t("form.accept_terms_title"), label: false %>
<span class="checkbox">
<%= t("form.accept_terms",
policy: link_to(t("form.policy"), "/privacy", target: "blank"),
conditions: link_to(t("form.conditions"), "/conditions", target: "blank")).html_safe %>
</span>
<% end %>
<% end %>
</div>
<div class="actions small-12 column">
<%= f.submit(class: "button", value: t("spending_proposals.form.submit_buttons.#{action_name}")) %>
</div>
</div>
<% end %>

View File

@@ -1,15 +0,0 @@
<div class="sidebar-divider"></div>
<h2 class="sidebar-title"><%= t("spending_proposals.index.sidebar.geozones") %></h2>
<br>
<div class="geozone">
<%= link_to t("geozones.all"), spending_proposals_path(geozone: nil) %>
<%= link_to t("geozones.none"), spending_proposals_path(geozone: "all") %>
<% Geozone.all.each do |geozone| %>
<%= link_to geozone.name, spending_proposals_path(geozone: geozone.id) %>
<% end %>
</div>
<div class="sidebar-divider"></div>
<h2 class="sidebar-title"><%= t("spending_proposals.index.sidebar.feasibility") %></h2>
<br>
<%= link_to t("spending_proposals.index.sidebar.unfeasible"), spending_proposals_path(unfeasible: "1") %>

View File

@@ -1,59 +0,0 @@
<div id="<%= dom_id(spending_proposal) %>" class="investment-project clear">
<div class="panel">
<div class="row">
<div class="small-12 medium-9 column">
<div class="investment-project-content">
<% cache [locale_and_user_status(spending_proposal), "index", spending_proposal, spending_proposal.author] do %>
<span class="label-investment-project float-left"><%= t("spending_proposals.spending_proposal.spending_proposal") %></span>
<span class="icon-budget"></span>
<h3><%= link_to spending_proposal.title, namespaced_spending_proposal_path(spending_proposal) %></h3>
<p class="investment-project-info">
<%= l spending_proposal.created_at.to_date %>
<% if spending_proposal.author.hidden? || spending_proposal.author.erased? %>
<span class="bullet">&nbsp;&bull;&nbsp;</span>
<span class="author">
<%= t("spending_proposals.show.author_deleted") %>
</span>
<% else %>
<span class="bullet">&nbsp;&bull;&nbsp;</span>
<span class="author">
<%= spending_proposal.author.name %>
</span>
<% if spending_proposal.author.display_official_position_badge? %>
<span class="bullet">&nbsp;&bull;&nbsp;</span>
<span class="label round level-<%= spending_proposal.author.official_level %>">
<%= spending_proposal.author.official_position %>
</span>
<% end %>
<% end %>
<% if spending_proposal.author.verified_organization? %>
<span class="bullet">&nbsp;&bull;&nbsp;</span>
<span class="label round is-association">
<%= t("shared.collective") %>
</span>
<% end %>
<span class="bullet">&nbsp;&bull;&nbsp;</span>
<%= geozone_name(spending_proposal) %>
</p>
<div class="investment-project-description">
<p><%= link_to spending_proposal.description, namespaced_spending_proposal_path(spending_proposal) %></p>
<div class="truncate"></div>
</div>
<% end %>
</div>
</div>
<div id="<%= dom_id(spending_proposal) %>_votes" class="small-12 medium-3 column supports-container">
<%= render "votes",
{ spending_proposal: spending_proposal, vote_url: vote_spending_proposal_path(spending_proposal, value: "yes") } %>
</div>
</div>
</div>
</div>

View File

@@ -1,45 +0,0 @@
<div class="supports text-center">
<% reason = spending_proposal.reason_for_not_being_votable_by(current_user) %>
<% voting_allowed = true unless reason.presence == :not_voting_allowed %>
<% user_voted_for = voted_for?(@spending_proposal_votes, spending_proposal) %>
<span class="total-supports <%= "no-button" unless voting_allowed || user_voted_for %>">
<%= t("spending_proposals.spending_proposal.supports", count: spending_proposal.total_votes) %>
</span>
<div class="in-favor">
<% if user_voted_for %>
<div class="supported callout success">
<%= t("spending_proposals.spending_proposal.already_supported") %>
</div>
<% elsif voting_allowed %>
<%= link_to vote_url,
class: "button button-support small expanded",
title: t("spending_proposals.spending_proposal.support_title"), method: "post", remote: true,
"aria-hidden" => css_for_aria_hidden(reason) do %>
<%= t("spending_proposals.spending_proposal.support") %>
<% end %>
<% end %>
</div>
<% if reason.present? && !user_voted_for %>
<div class="participation-not-allowed" style="display:none" aria-hidden="false">
<p>
<%= t("votes.spending_proposals.#{reason}",
verify_account: link_to(t("votes.verify_account"), verification_path),
signin: link_to(t("votes.signin"), new_user_session_path),
signup: link_to(t("votes.signup"), new_user_registration_path)
).html_safe %>
</p>
</div>
<% end %>
<% if user_voted_for && setting["twitter_handle"] %>
<%= render partial: "shared/social_share", locals: {
title: spending_proposal.title,
url: spending_proposal_url(spending_proposal),
description: spending_proposal.title
} %>
<% end %>
</div>

View File

@@ -1,39 +0,0 @@
<% provide :title do %><%= t("spending_proposals.index.title") %><% end %>
<% content_for :header_addon do %>
<%= render "shared/search_form",
search_path: spending_proposals_path(page: 1),
i18n_namespace: "spending_proposals.index.search_form" %>
<% end %>
<main>
<h1 class="show-for-sr"><%= t("shared.outline.budget") %></h1>
<div class="row">
<div id="investment-projects" class="investment-projects-list small-12 medium-9 column">
<div class="small-12 search-results">
<%= content_tag(:h2, t("spending_proposals.index.unfeasible")) if params[:unfeasible].present? %>
<%= content_tag(:h2, t("spending_proposals.index.by_geozone", geozone: @geozone_name)) if @geozone_name.present? %>
<% if params[:search].present? %>
<h2>
<%= page_entries_info @spending_proposals %>
<%= t("spending_proposals.index.search_results", count: @spending_proposals.size, search_term: params[:search]) %>
</h2>
<% end %>
</div>
<div class="show-for-small-only">
<%= link_to t("spending_proposals.index.start_spending_proposal"), new_spending_proposal_path, class: "button expanded" %>
</div>
<%= render partial: "spending_proposals/spending_proposal", collection: @spending_proposals %>
<%= paginate @spending_proposals %>
</div>
<div class="small-12 medium-3 column">
<aside id="sidebar" class="margin-bottom">
<%= render "sidebar" %>
</aside>
</div>
</div>
</main>

View File

@@ -1,25 +0,0 @@
<div class="spending-proposal-form row margin-top">
<div class="small-12 medium-9 column">
<%= back_link_to %>
<h1><%= t("spending_proposals.new.start_new") %></h1>
<div data-alert class="callout primary">
<%= link_to "/spending_proposals_info", title: t("shared.target_blank_html"), target: "_blank" do %>
<%= t("spending_proposals.new.more_info")%>
<% end %>
</div>
<%= render "spending_proposals/form", form_url: spending_proposals_url %>
</div>
<div class="small-12 medium-3 column">
<span class="icon-budget float-right"></span>
<h2><%= t("spending_proposals.new.recommendations_title") %></h2>
<ul class="recommendations">
<li><%= t("spending_proposals.new.recommendation_one") %></li>
<li><%= t("spending_proposals.new.recommendation_two") %></li>
<li><%= t("spending_proposals.new.recommendation_three") %></li>
</ul>
</div>
</div>

View File

@@ -1,52 +0,0 @@
<% provide :title do %><%= @spending_proposal.title %><% end %>
<section class="investment-project-show">
<div id="<%= dom_id(@spending_proposal) %>" class="row">
<div class="small-12 medium-9 column">
<h1><%= @spending_proposal.title %></h1>
<div class="investment-project-info">
<%= render "/shared/author_info", resource: @spending_proposal %>
<span class="bullet">&nbsp;&bull;&nbsp;</span>
<%= l @spending_proposal.created_at.to_date %>
<span class="bullet">&nbsp;&bull;&nbsp;</span>
<%= geozone_name(@spending_proposal) %>
</div>
<br>
<p id="spending_proposal_code">
<%= t("spending_proposals.show.code") %>
<strong><%= @spending_proposal.id %></strong>
</p>
<%= safe_html_with_links @spending_proposal.description.html_safe %>
<% if @spending_proposal.external_url.present? %>
<div class="document-link">
<%= text_with_links @spending_proposal.external_url %>
</div>
<% end %>
</div>
<aside class="small-12 medium-3 column">
<div class="sidebar-divider"></div>
<h3><%= t("votes.supports") %></h3>
<div class="text-center">
<div id="<%= dom_id(@spending_proposal) %>_votes">
<%= render "votes",
{ spending_proposal: @spending_proposal, vote_url: vote_spending_proposal_path(@spending_proposal, value: "yes") } %>
</div>
</div>
<%= render partial: "shared/social_share", locals: {
share_title: t("spending_proposals.show.share"),
title: @spending_proposal.title,
url: spending_proposal_url(@spending_proposal),
description: @spending_proposal.title
} %>
</aside>
</div>
</section>

View File

@@ -1 +0,0 @@
$("#<%= dom_id(@spending_proposal) %>_votes").html("<%= j render("spending_proposals/votes", spending_proposal: @spending_proposal, vote_url: vote_spending_proposal_path(@spending_proposal, value: "yes")) %>");

View File

@@ -4,15 +4,6 @@
<%= link_to t("valuation.menu.title"), valuation_root_path %> <%= link_to t("valuation.menu.title"), valuation_root_path %>
</li> </li>
<% if feature?(:spending_proposals) %>
<li <%= "class=is-active" if controller_name == "spending_proposals" %>>
<%= link_to valuation_spending_proposals_path do %>
<span class="icon-budget"></span>
<%= t("valuation.menu.spending_proposals") %>
<% end %>
</li>
<% end %>
<% if feature?(:budgets) %> <% if feature?(:budgets) %>
<li <%= "class=is-active" if controller_name == "budget_investments" %>> <li <%= "class=is-active" if controller_name == "budget_investments" %>>
<%= link_to valuation_budgets_path do %> <%= link_to valuation_budgets_path do %>

View File

@@ -1,53 +0,0 @@
<p id="price">
<strong>
<%= t("valuation.spending_proposals.show.price") %>
(<%= t("valuation.spending_proposals.show.currency") %>):
</strong>
<% if @spending_proposal.price.present? %>
<%= @spending_proposal.price %>
<% else %>
<%= t("valuation.spending_proposals.show.undefined") %>
<% end %>
</p>
<p id="price_first_year">
<strong>
<%= t("valuation.spending_proposals.show.price_first_year") %>
(<%= t("valuation.spending_proposals.show.currency") %>):
</strong>
<% if @spending_proposal.price_first_year.present? %>
<%= @spending_proposal.price_first_year %>
<% else %>
<%= t("valuation.spending_proposals.show.undefined") %>
<% end %>
</p>
<%= explanation_field @spending_proposal.price_explanation %>
<p id="time_scope">
<strong><%= t("valuation.spending_proposals.show.time_scope") %>:</strong>
<% if @spending_proposal.time_scope.present? %>
<%= @spending_proposal.time_scope %>
<% else %>
<%= t("valuation.spending_proposals.show.undefined") %>
<% end %>
</p>
<p id="feasibility">
<strong><%= t("valuation.spending_proposals.show.feasibility") %>:</strong>
<%= t("valuation.spending_proposals.show.#{@spending_proposal.feasibility}") %>
</p>
<%= explanation_field @spending_proposal.feasible_explanation %>
<% if @spending_proposal.valuation_finished %>
<p id="valuation">
<strong><%= t("valuation.spending_proposals.show.valuation_finished") %></strong>
</p>
<% end %>
<% if @spending_proposal.internal_comments.present? %>
<h2><%= t("valuation.spending_proposals.show.internal_comments") %></h2>
<%= explanation_field @spending_proposal.internal_comments %>
<% end %>

View File

@@ -1,147 +0,0 @@
<%= link_to "#{t("valuation.spending_proposals.show.heading")} #{@spending_proposal.id}", valuation_spending_proposal_path(@spending_proposal), class: "back" %>
<h2><%= t("valuation.spending_proposals.edit.dossier") %></h2>
<%= form_for(@spending_proposal, url: valuate_valuation_spending_proposal_path(@spending_proposal), html: {id: "valuation_spending_proposal_edit_form"}) do |f| %>
<%= render "shared/errors", resource: @spending_proposal %>
<div class="row">
<div class="small-12 medium-8 column">
<fieldset class="fieldset">
<legend><%= t("valuation.spending_proposals.edit.feasibility") %></legend>
<div class="small-4 column">
<span class="radio">
<%= f.radio_button :feasible, :nil, label: false, checked: @spending_proposal.feasible.nil? %>
<%= f.label :feasible_nil, t("valuation.spending_proposals.edit.undefined_feasible") %>
</span>
</div>
<div class="small-4 column">
<span class="radio">
<%= f.radio_button :feasible, true, value: true, label: false %>
<%= f.label :feasible_true, t("valuation.spending_proposals.edit.feasible") %>
</span>
</div>
<div class="small-4 column">
<span class="radio">
<%= f.radio_button :feasible, false, value: false, label: false %>
<%= f.label :feasible_false, t("valuation.spending_proposals.edit.not_feasible") %>
</span>
</div>
</fieldset>
</div>
</div>
<div id="not_feasible_fields" >
<div class="row">
<div class="small-12 medium-8 column">
<%= f.label :feasible_explanation, t("valuation.spending_proposals.edit.feasible_explanation_html") %>
<%= f.text_area :feasible_explanation, label: false, rows: 3 %>
</div>
</div>
</div>
<div id="feasible_fields">
<div class="row">
<div class="small-12 medium-4 column">
<%= f.label :price, "#{t("valuation.spending_proposals.edit.price_html", currency: t("valuation.spending_proposals.edit.currency"))}" %>
<%= f.number_field :price, label: false, max: 1000000000000000 %>
</div>
<div class="small-12 medium-4 column end">
<%= f.label :price_first_year, "#{t("valuation.spending_proposals.edit.price_first_year_html", currency: t("valuation.spending_proposals.edit.currency"))}" %>
<%= f.number_field :price_first_year, label: false, max: 1000000000000000 %>
</div>
</div>
<div class="row">
<div class="small-12 medium-8 column">
<%= f.label :price_explanation, t("valuation.spending_proposals.edit.price_explanation_html") %>
<%= f.text_area :price_explanation, label: false, rows: 3 %>
</div>
</div>
<div class="row">
<div class="small-12 medium-8 column">
<%= f.label :time_scope, t("valuation.spending_proposals.edit.time_scope_html") %>
<%= f.text_field :time_scope, label: false %>
</div>
</div>
</div>
<div class="row">
<div class="small-12 medium-8 column">
<%= f.label :valuation_finished do %>
<%= f.check_box :valuation_finished, title: t("valuation.spending_proposals.edit.valuation_finished"), label: false %>
<span class="checkbox"><%= t("valuation.spending_proposals.edit.valuation_finished") %></span>
<% end %>
</div>
</div>
<div class="row">
<div class="small-12 medium-8 column">
<%= f.label :internal_comments, t("valuation.spending_proposals.edit.internal_comments_html") %>
<%= f.text_area :internal_comments, label: false, rows: 3 %>
</div>
</div>
<div class="row">
<div class="actions small-12 medium-4 column">
<%= f.submit(class: "button expanded large", value: t("valuation.spending_proposals.edit.save")) %>
</div>
</div>
<% end %>
<h1><%= @spending_proposal.title %></h1>
<%= safe_html_with_links @spending_proposal.description %>
<% if @spending_proposal.external_url.present? %>
<p><%= text_with_links @spending_proposal.external_url %></p>
<% end %>
<h2><%= t("valuation.spending_proposals.show.info") %></h2>
<p><strong><%= t("valuation.spending_proposals.show.by") %>:</strong>
<%= link_to @spending_proposal.author.name, user_path(@spending_proposal.author) %>
</p>
<% if @spending_proposal.association_name.present? %>
<p><strong><%= t("valuation.spending_proposals.show.association_name") %>:</strong>
<%= @spending_proposal.association_name %>
</p>
<% end %>
<p><strong><%= t("valuation.spending_proposals.show.geozone") %>:</strong>
<%= geozone_name(@spending_proposal) %>
</p>
<p><strong><%= t("valuation.spending_proposals.show.sent") %>:</strong>
<%= l @spending_proposal.created_at, format: :datetime %>
</p>
<h2><%= t("valuation.spending_proposals.show.responsibles") %></h2>
<p><strong><%= t("valuation.spending_proposals.show.assigned_admin") %>:</strong>
<% if @spending_proposal.administrator.present? %>
<%= @spending_proposal.administrator.name %> (<%= @spending_proposal.administrator.email %>)
<% else %>
<%= t("valuation.spending_proposals.show.undefined") %>
<% end %>
</p>
<p><strong><%= t("valuation.spending_proposals.show.assigned_valuators") %>:</strong></p>
<div id="assigned_valuators">
<ul>
<% @spending_proposal.valuators.each do |valuator| %>
<li><%= valuator.name %> (<%= valuator.email %>)</li>
<% end %>
<% if @spending_proposal.valuators.empty? %>
<li><%= t("valuation.spending_proposals.show.undefined") %></li>
<% end %>
</ul>
</div>

View File

@@ -1,42 +0,0 @@
<h2><%= t("valuation.spending_proposals.index.title") %></h2>
<div class="row collapse">
<% @geozone_filters.each_slice(8) do |slice| %>
<div class="small-12 medium-4 column select-geozone">
<% slice.each do |filter| %>
<%= link_to valuation_spending_proposals_path(geozone_id: filter[:id]),
class: "#{"is-active" if params[:geozone_id].to_s == filter[:id].to_s}" do %>
<%= filter[:name] %>&nbsp;(<%= filter[:pending_count] %>)
<% end %>
<% end %>
</div>
<% end %>
</div>
<%= render "shared/filter_subnav", i18n_namespace: "valuation.spending_proposals.index" %>
<h3><%= page_entries_info @spending_proposals %></h3>
<table>
<% @spending_proposals.each do |spending_proposal| %>
<tr id="<%= dom_id(spending_proposal) %>">
<td>
<strong><%= spending_proposal.id %></strong>
</td>
<td>
<%= link_to spending_proposal.title, valuation_spending_proposal_path(spending_proposal) %>
</td>
<td class="small">
<%= link_to t("valuation.spending_proposals.index.edit"), edit_valuation_spending_proposal_path(spending_proposal) %>
</td>
<td class="small">
<%= assigned_valuators_info(spending_proposal.valuators) %>
</td>
<td class="small">
<%= geozone_name(spending_proposal) %>
</td>
</tr>
<% end %>
</table>
<%= paginate @spending_proposals %>

View File

@@ -1,61 +0,0 @@
<%= back_link_to %>
<h2><%= t("valuation.spending_proposals.show.heading") %> <%= @spending_proposal.id %> </h2>
<h1><%= @spending_proposal.title %></h1>
<%= safe_html_with_links @spending_proposal.description %>
<% if @spending_proposal.external_url.present? %>
<p><%= text_with_links @spending_proposal.external_url %></p>
<% end %>
<h2><%= t("valuation.spending_proposals.show.info") %></h2>
<p><strong><%= t("valuation.spending_proposals.show.by") %>:</strong>
<%= link_to @spending_proposal.author.name, user_path(@spending_proposal.author) %>
</p>
<% if @spending_proposal.association_name.present? %>
<p><strong><%= t("valuation.spending_proposals.show.association_name") %>:</strong>
<%= @spending_proposal.association_name %>
</p>
<% end %>
<p><strong><%= t("valuation.spending_proposals.show.geozone") %>:</strong>
<%= geozone_name(@spending_proposal) %>
</p>
<p><strong><%= t("valuation.spending_proposals.show.sent") %>:</strong>
<%= l @spending_proposal.created_at, format: :datetime %>
</p>
<h2><%= t("valuation.spending_proposals.show.responsibles") %></h2>
<p><strong><%= t("valuation.spending_proposals.show.assigned_admin") %>:</strong>
<% if @spending_proposal.administrator.present? %>
<%= @spending_proposal.administrator.name_and_email %>
<% else %>
<%= t("valuation.spending_proposals.show.undefined") %>
<% end %>
</p>
<p><strong><%= t("valuation.spending_proposals.show.assigned_valuators") %>:</strong></p>
<div id="assigned_valuators">
<ul>
<% @spending_proposal.valuators.each do |valuator| %>
<li><%= valuator.name_and_email %></li>
<% end %>
<% if @spending_proposal.valuators.empty? %>
<li><%= t("valuation.spending_proposals.show.undefined") %></li>
<% end %>
</ul>
</div>
<h2><%= t("valuation.spending_proposals.show.dossier") %></h2>
<p>
<%= link_to t("valuation.spending_proposals.show.edit_dossier"), edit_valuation_spending_proposal_path(@spending_proposal) %>
</p>
<%= render "written_by_valuators" %>

View File

@@ -111,7 +111,6 @@ search:
ignore_missing: ignore_missing:
- "unauthorized.*" - "unauthorized.*"
- "activerecord.models.proposal" - "activerecord.models.proposal"
- "activerecord.models.spending_proposal"
- "activerecord.errors.models.proposal_notification.*" - "activerecord.errors.models.proposal_notification.*"
- "activerecord.errors.models.direct_message.*" - "activerecord.errors.models.direct_message.*"
- "errors.messages.blank" - "errors.messages.blank"
@@ -138,7 +137,6 @@ ignore_unused:
- "admin.proposal_notifications.index.filter*" - "admin.proposal_notifications.index.filter*"
- "admin.budgets.index.filter*" - "admin.budgets.index.filter*"
- "admin.budget_investments.index.filter*" - "admin.budget_investments.index.filter*"
- "admin.spending_proposals.index.filter*"
- "admin.organizations.index.filter*" - "admin.organizations.index.filter*"
- "admin.hidden_users.index.filter*" - "admin.hidden_users.index.filter*"
- "admin.hidden_budget_investments.index.filter*" - "admin.hidden_budget_investments.index.filter*"
@@ -168,7 +166,6 @@ ignore_unused:
- "moderation.budget_investments.index.order*" - "moderation.budget_investments.index.order*"
- "moderation.proposal_notifications.index.filter*" - "moderation.proposal_notifications.index.filter*"
- "moderation.proposal_notifications.index.order*" - "moderation.proposal_notifications.index.order*"
- "valuation.spending_proposals.index.filter*"
- "valuation.budgets.index.filter*" - "valuation.budgets.index.filter*"
- "valuation.budget_investments.index.filter*" - "valuation.budget_investments.index.filter*"
- "users.show.filters.*" - "users.show.filters.*"
@@ -182,7 +179,6 @@ ignore_unused:
- "proposals.index.select_order" - "proposals.index.select_order"
- "proposals.index.orders.*" - "proposals.index.orders.*"
- "proposals.index.section_header.*" - "proposals.index.section_header.*"
- "spending_proposals.index.search_form.*"
- "*.index.search_form.*" - "*.index.search_form.*"
- "notifications.notification.action.*" - "notifications.notification.action.*"
- "legislation.processes.index.filter*" - "legislation.processes.index.filter*"
@@ -202,9 +198,6 @@ ignore_unused:
# - "simple_form.{yes,no}" # - "simple_form.{yes,no}"
# - "simple_form.{placeholders,hints,labels}.*" # - "simple_form.{placeholders,hints,labels}.*"
# - "simple_form.{error_notification,required}.:" # - "simple_form.{error_notification,required}.:"
#### Review unused keys after merge with Budgest (both en and es)
- users.show.confirm_deletion_spending_proposal
- users.show.delete_spending_proposal
- verification.letter.create.flash.offices_url - verification.letter.create.flash.offices_url
- verification.letter.new.offices_url - verification.letter.new.offices_url
- votes.budget_investments.different_heading_assigned* - votes.budget_investments.different_heading_assigned*

View File

@@ -73,13 +73,6 @@ module ActsAsTaggableOn
Tag.category.pluck(:name) Tag.category.pluck(:name)
end end
def self.spending_proposal_tags
ActsAsTaggableOn::Tag.where("taggings.taggable_type" => "SpendingProposal")
.includes(:taggings)
.order(:name)
.distinct
end
def self.graphql_field_name def self.graphql_field_name
:tag :tag
end end
@@ -97,6 +90,6 @@ module ActsAsTaggableOn
def custom_counter_field_name_for(taggable_type) def custom_counter_field_name_for(taggable_type)
"#{taggable_type.underscore.pluralize}_count" "#{taggable_type.underscore.pluralize}_count"
end end
end
end
end end

View File

@@ -25,10 +25,6 @@ ActsAsVotable::Vote.class_eval do
where(votable_type: "Legislation::Proposal", votable_id: proposals) where(votable_type: "Legislation::Proposal", votable_id: proposals)
end end
def self.for_spending_proposals(spending_proposals)
where(votable_type: "SpendingProposal", votable_id: spending_proposals)
end
def self.for_budget_investments(budget_investments=Budget::Investment.all) def self.for_budget_investments(budget_investments=Budget::Investment.all)
where(votable_type: "Budget::Investment", votable_id: budget_investments) where(votable_type: "Budget::Investment", votable_id: budget_investments)
end end

View File

@@ -71,9 +71,6 @@ en:
proposal: proposal:
one: "Citizen proposal" one: "Citizen proposal"
other: "Citizen proposals" other: "Citizen proposals"
spending_proposal:
one: "Investment project"
other: "Investment projects"
site_customization/page: site_customization/page:
one: Custom page one: Custom page
other: Custom pages other: Custom pages
@@ -203,13 +200,6 @@ en:
organization: organization:
name: "Name of organisation" name: "Name of organisation"
responsible_name: "Person responsible for the group" responsible_name: "Person responsible for the group"
spending_proposal:
administrator_id: "Administrator"
association_name: "Association name"
description: "Description"
external_url: "Link to additional documentation"
geozone_id: "Scope of operation"
title: "Title"
poll: poll:
name: "Name" name: "Name"
starts_at: "Start Date" starts_at: "Start Date"

View File

@@ -690,7 +690,6 @@ en:
officials: Officials officials: Officials
organizations: Organisations organizations: Organisations
settings: Global settings settings: Global settings
spending_proposals: Spending proposals
stats: Statistics stats: Statistics
signature_sheets: Signature Sheets signature_sheets: Signature Sheets
site_customization: site_customization:
@@ -715,7 +714,6 @@ en:
content_block: content_block:
update: "Update Block" update: "Update Block"
title_moderated_content: Moderated content title_moderated_content: Moderated content
title_budgets: Budgets
title_profiles: Profiles title_profiles: Profiles
title_settings: Settings title_settings: Settings
title_site_customization: Site content title_site_customization: Site content
@@ -906,15 +904,6 @@ en:
delete: Delete delete: Delete
search: search:
title: "Valuators: User search" title: "Valuators: User search"
summary:
title: Valuator summary for investment projects
valuator_name: Valuator
finished_and_feasible_count: Finished and feasible
finished_and_unfeasible_count: Finished and unfeasible
finished_count: Finished
in_evaluation_count: In evaluation
total_count: Total
cost: Cost
form: form:
edit_title: "Valuators: Edit valuator" edit_title: "Valuators: Edit valuator"
update: "Update valuator" update: "Update valuator"
@@ -1309,9 +1298,6 @@ en:
proposal_search: proposal_search:
button: Search button: Search
placeholder: Search proposals by title, code, description or question placeholder: Search proposals by title, code, description or question
spending_proposal_search:
button: Search
placeholder: Search spending proposals by title or description
user_search: user_search:
button: Search button: Search
placeholder: Search user by name or email placeholder: Search user by name or email
@@ -1332,62 +1318,6 @@ en:
color_help: Hexadecimal format color_help: Hexadecimal format
show_results_and_stats: "Show results and stats" show_results_and_stats: "Show results and stats"
results_and_stats_reminder: "Marking these checkboxes the results and/or stats will be publicly available and every user will see them." results_and_stats_reminder: "Marking these checkboxes the results and/or stats will be publicly available and every user will see them."
spending_proposals:
index:
geozone_filter_all: All zones
administrator_filter_all: All administrators
valuator_filter_all: All valuators
tags_filter_all: All tags
filters:
valuation_open: Open
without_admin: Without assigned admin
managed: Managed
valuating: Under valuation
valuation_finished: Valuation finished
all: All
title: Investment projects for participatory budgeting
assigned_admin: Assigned administrator
no_admin_assigned: No admin assigned
no_valuators_assigned: No valuators assigned
summary_link: "Investment project summary"
valuator_summary_link: "Valuator summary"
feasibility:
feasible: "Feasible (%{price})"
not_feasible: "Not feasible"
undefined: "Undefined"
show:
assigned_admin: Assigned administrator
assigned_valuators: Assigned valuators
back: Back
classification: Classification
heading: "Investment project %{id}"
edit: Edit
edit_classification: Edit classification
association_name: Association
by: By
sent: Sent
geozone: Scope
dossier: Dossier
edit_dossier: Edit dossier
tags: Tags
undefined: Undefined
edit:
classification: Classification
assigned_valuators: Valuators
submit_button: Update
tags: Tags
tags_placeholder: "Write the tags you want separated by commas (,)"
undefined: Undefined
summary:
title: Summary for investment projects
title_proposals_with_supports: Summary for investment projects with supports
geozone_name: Scope
finished_and_feasible_count: Finished and feasible
finished_and_unfeasible_count: Finished and unfeasible
finished_count: Finished
in_evaluation_count: In evaluation
total_count: Total
cost_for_geozone: Cost
geozones: geozones:
index: index:
title: Geozone title: Geozone
@@ -1458,7 +1388,6 @@ en:
proposals: Proposals proposals: Proposals
budgets: Open budgets budgets: Open budgets
budget_investments: Investment projects budget_investments: Investment projects
spending_proposals: Spending Proposals
unverified_users: Unverified users unverified_users: Unverified users
user_level_three: Level three users user_level_three: Level three users
user_level_two: Level two users user_level_two: Level two users
@@ -1475,7 +1404,6 @@ en:
polls: Polls polls: Polls
graph: graph:
debate_created: Debates debate_created: Debates
spending_proposals: Investment projects
visit: Visits visit: Visits
level_2_user: Level 2 users level_2_user: Level 2 users
proposal_created: Citizen proposals proposal_created: Citizen proposals

View File

@@ -165,15 +165,15 @@ en:
page_title: "%{budget} - Results" page_title: "%{budget} - Results"
heading: "Participatory budget results" heading: "Participatory budget results"
heading_selection_title: "By district" heading_selection_title: "By district"
spending_proposal: Proposal title
ballot_lines_count: Votes ballot_lines_count: Votes
hide_discarded_link: Hide discarded hide_discarded_link: Hide discarded
show_all_link: Show all show_all_link: Show all
price: Price price: Price
amount_available: Available budget amount_available: Available budget
accepted: "Accepted spending proposal: " accepted: "Accepted investment: "
discarded: "Discarded spending proposal: " discarded: "Discarded investment: "
incompatibles: Incompatibles incompatibles: Incompatibles
investment_title: Project title
investment_proyects: List of all investment projects investment_proyects: List of all investment projects
unfeasible_investment_proyects: List of all unfeasible investment projects unfeasible_investment_proyects: List of all unfeasible investment projects
not_selected_investment_proyects: List of all investment projects not selected for balloting not_selected_investment_proyects: List of all investment projects not selected for balloting

View File

@@ -179,7 +179,6 @@ en:
policy: Privacy Policy policy: Privacy Policy
proposal: Proposal proposal: Proposal
proposal_notification: "Notification" proposal_notification: "Notification"
spending_proposal: Spending proposal
budget/investment: Investment budget/investment: Investment
budget/group: Budget Group budget/group: Budget Group
budget/heading: Budget Heading budget/heading: Budget Heading
@@ -193,7 +192,6 @@ en:
image: Image image: Image
geozones: geozones:
none: All city none: All city
all: All scopes
layouts: layouts:
application: application:
chrome: Google Chrome chrome: Google Chrome
@@ -248,7 +246,6 @@ en:
proposals: Proposals proposals: Proposals
poll_questions: Voting poll_questions: Voting
budgets: Participatory budgeting budgets: Participatory budgeting
spending_proposals: Spending Proposals
notification_item: notification_item:
new_notifications: new_notifications:
one: You have a new notification one: You have a new notification
@@ -764,7 +761,6 @@ en:
unflag: Unflag unflag: Unflag
unfollow_entity: "Unfollow %{entity}" unfollow_entity: "Unfollow %{entity}"
outline: outline:
budget: Participatory budget
searcher: Searcher searcher: Searcher
go_to_page: "Go to page of " go_to_page: "Go to page of "
share: Share share: Share
@@ -787,54 +783,6 @@ en:
whatsapp: WhatsApp whatsapp: WhatsApp
telegram: "%{org} Telegram" telegram: "%{org} Telegram"
instagram: "%{org} Instagram" instagram: "%{org} Instagram"
spending_proposals:
form:
association_name_label: "If you propose in name of an assocation or collective add the name here"
association_name: "Association name"
description: Description
external_url: Link to additional documentation
geozone: Scope of operation
submit_buttons:
create: Create
new: Create
title: Spending proposal title
index:
title: Participatory budgeting
unfeasible: Unfeasible investment projects
by_geozone: "Investment projects with scope: %{geozone}"
search_form:
button: Search
placeholder: Investment projects...
title: Search
search_results:
one: " containing the term '%{search_term}'"
other: " containing the term '%{search_term}'"
sidebar:
geozones: Scope of operation
feasibility: Feasibility
unfeasible: Unfeasible
start_spending_proposal: Create an investment project
new:
more_info: How do participatory budgeting works?
recommendation_one: It's mandatory that the proposal makes reference to a budgetable action.
recommendation_three: Try to go into details when describing your spending proposal so the reviewing team undertands your points.
recommendation_two: Any proposal or comment suggesting illegal action will be deleted.
recommendations_title: How to create a spending proposal
start_new: Create spending proposal
show:
author_deleted: User deleted
code: "Proposal code:"
share: Share
wrong_price_format: Only integer numbers
spending_proposal:
spending_proposal: Investment project
already_supported: You have already supported this. Share it!
support: Support
support_title: Support this project
supports:
one: 1 support
other: "%{count} supports"
zero: No supports
stats: stats:
index: index:
visits: Visits visits: Visits
@@ -917,12 +865,6 @@ en:
unauthenticated: You must %{signin} or %{signup} to continue. unauthenticated: You must %{signin} or %{signup} to continue.
verified_only: Only verified users can vote on proposals; %{verify_account}. verified_only: Only verified users can vote on proposals; %{verify_account}.
verify_account: verify your account verify_account: verify your account
spending_proposals:
not_logged_in: You must %{signin} or %{signup} to continue.
not_verified: Only verified users can vote on proposals; %{verify_account}.
organization: Organizations are not permitted to vote
unfeasible: Unfeasible investment projects can not be supported
not_voting_allowed: Voting phase is closed
budget_investments: budget_investments:
not_logged_in: You must %{signin} or %{signup} to continue. not_logged_in: You must %{signin} or %{signup} to continue.
not_verified: Only verified users can vote on investment projects; %{verify_account}. not_verified: Only verified users can vote on investment projects; %{verify_account}.

View File

@@ -20,13 +20,6 @@ en:
new_reply_by_html: There is a new response from <b>%{commenter}</b> to your comment on new_reply_by_html: There is a new response from <b>%{commenter}</b> to your comment on
subject: Someone has responded to your comment subject: Someone has responded to your comment
title: New response to your comment title: New response to your comment
unfeasible_spending_proposal:
hi: "Dear user,"
new_html: "For all these, we invite you to elaborate a <strong>new proposal</strong> that adjusts to the conditions of this process. You can do it following this link: %{url}."
new_href: "new investment project"
sincerely: "Sincerely"
sorry: "Sorry for the inconvenience and we again thank you for your invaluable participation."
subject: "Your investment project '%{code}' has been marked as unfeasible"
proposal_notification_digest: proposal_notification_digest:
info: "Here are the new notifications that have been published by authors of the proposals that you have supported in %{org_name}." info: "Here are the new notifications that have been published by authors of the proposals that you have supported in %{org_name}."
title: "Proposal notifications in %{org_name}" title: "Proposal notifications in %{org_name}"

View File

@@ -62,9 +62,6 @@ en:
create_proposal: Create proposal create_proposal: Create proposal
print_proposals: Print proposals print_proposals: Print proposals
support_proposals: Support proposals support_proposals: Support proposals
create_spending_proposal: Create spending proposal
print_spending_proposals: Print spending proposals
support_spending_proposals: Support spending proposals
create_budget_investment: Create budget investment create_budget_investment: Create budget investment
print_budget_investments: Print budget investments print_budget_investments: Print budget investments
support_budget_investments: Support budget investments support_budget_investments: Support budget investments
@@ -79,7 +76,6 @@ en:
print: print:
proposals_info: Create your proposal on http://url.consul proposals_info: Create your proposal on http://url.consul
proposals_title: "Proposals:" proposals_title: "Proposals:"
spending_proposals_info: Participate at http://url.consul
budget_investments_info: Participate at http://url.consul budget_investments_info: Participate at http://url.consul
print_info: Print this info print_info: Print this info
proposals: proposals:
@@ -110,18 +106,6 @@ en:
search_results: search_results:
one: " containing the term '%{search_term}'" one: " containing the term '%{search_term}'"
other: " containing the term '%{search_term}'" other: " containing the term '%{search_term}'"
spending_proposals:
alert:
unverified_user: User is not verified
create: Create spending proposal
filters:
unfeasible: Unfeasible investment projects
by_geozone: "Investment projects with scope: %{geozone}"
print:
print_button: Print
search_results:
one: " containing the term '%{search_term}'"
other: " containing the term '%{search_term}'"
sessions: sessions:
signed_out: Signed out successfully. signed_out: Signed out successfully.
signed_out_managed_user: User session signed out successfully. signed_out_managed_user: User session signed out successfully.

View File

@@ -12,7 +12,6 @@ en:
poll_question_answer_image: "Image uploaded successfully" poll_question_answer_image: "Image uploaded successfully"
proposal: "Proposal created successfully." proposal: "Proposal created successfully."
proposal_notification: "Your message has been sent correctly." proposal_notification: "Your message has been sent correctly."
spending_proposal: "Spending proposal created successfully. You can access it from %{activity}"
budget_investment: "Budget Investment created successfully." budget_investment: "Budget Investment created successfully."
signature_sheet: "Signature sheet created successfully" signature_sheet: "Signature sheet created successfully"
topic: "Topic created successfully." topic: "Topic created successfully."
@@ -26,13 +25,11 @@ en:
poll_booth: "Booth updated successfully." poll_booth: "Booth updated successfully."
active_poll: "Polls description updated successfully." active_poll: "Polls description updated successfully."
proposal: "Proposal updated successfully." proposal: "Proposal updated successfully."
spending_proposal: "Investment project updated succesfully."
budget_investment: "Investment project updated succesfully." budget_investment: "Investment project updated succesfully."
topic: "Topic updated successfully." topic: "Topic updated successfully."
valuator_group: "Valuator group updated successfully" valuator_group: "Valuator group updated successfully"
translation: "Translation updated successfully" translation: "Translation updated successfully"
destroy: destroy:
spending_proposal: "Spending proposal deleted succesfully."
budget_investment: "Investment project deleted succesfully." budget_investment: "Investment project deleted succesfully."
error: "Could not delete" error: "Could not delete"
topic: "Topic deleted successfully." topic: "Topic deleted successfully."

View File

@@ -93,11 +93,6 @@ en:
featured_proposals_description: "Shows featured proposals on index proposals page" featured_proposals_description: "Shows featured proposals on index proposals page"
signature_sheets: "Signature sheets" signature_sheets: "Signature sheets"
signature_sheets_description: "It allows adding from the Administration panel signatures collected on-site to Proposals and investment projects of the Participative Budgets" signature_sheets_description: "It allows adding from the Administration panel signatures collected on-site to Proposals and investment projects of the Participative Budgets"
spending_proposals: "Spending proposals"
spending_proposals_description: "⚠️ NOTE: This functionality has been replaced by Participatory Budgeting and will disappear in new versions"
spending_proposal_features:
voting_allowed: Voting on investment projects - Preselection phase
voting_allowed_description: "⚠️ NOTE: This functionality has been replaced by Participatory Budgeting and will disappear in new versions"
user: user:
recommendations: "Recommendations" recommendations: "Recommendations"
recommendations_description: "Shows users recommendations on the homepage based on the tags of the following items" recommendations_description: "Shows users recommendations on the homepage based on the tags of the following items"

View File

@@ -5,7 +5,6 @@ en:
menu: menu:
title: Valuation title: Valuation
budgets: Participatory budgets budgets: Participatory budgets
spending_proposals: Spending proposals
budgets: budgets:
index: index:
title: Participatory budgets title: Participatory budgets
@@ -77,52 +76,3 @@ en:
valuate: "Dossier updated" valuate: "Dossier updated"
valuation_comments: Valuation comments valuation_comments: Valuation comments
not_in_valuating_phase: Investments can only be valuated when Budget is in valuating phase not_in_valuating_phase: Investments can only be valuated when Budget is in valuating phase
spending_proposals:
index:
geozone_filter_all: All zones
filters:
valuation_open: Open
valuating: Under valuation
valuation_finished: Valuation finished
title: Investment projects for participatory budgeting
edit: Edit
show:
back: Back
heading: Investment project
info: Author info
association_name: Association
by: Sent by
sent: Sent at
geozone: Scope
dossier: Dossier
edit_dossier: Edit dossier
price: Price
price_first_year: Cost during the first year
currency: "€"
feasibility: Feasibility
feasible: Feasible
not_feasible: Not feasible
undefined: Undefined
valuation_finished: Valuation finished
time_scope: Time scope
internal_comments: Internal comments
responsibles: Responsibles
assigned_admin: Assigned admin
assigned_valuators: Assigned valuators
edit:
dossier: Dossier
price_html: "Price (%{currency})"
price_first_year_html: "Cost during the first year (%{currency})"
currency: "€"
price_explanation_html: Price explanation
feasibility: Feasibility
feasible: Feasible
not_feasible: Not feasible
undefined_feasible: Pending
feasible_explanation_html: Feasibility explanation
valuation_finished: Valuation finished
time_scope_html: Time scope
internal_comments_html: Internal comments
save: Save changes
notice:
valuate: "Dossier updated"

View File

@@ -71,9 +71,6 @@ es:
proposal: proposal:
one: "Propuesta ciudadana" one: "Propuesta ciudadana"
other: "Propuestas ciudadanas" other: "Propuestas ciudadanas"
spending_proposal:
one: "Propuesta de inversión"
other: "Proyectos de gasto"
site_customization/page: site_customization/page:
one: Página one: Página
other: Páginas other: Páginas
@@ -203,13 +200,6 @@ es:
organization: organization:
name: "Nombre de la organización" name: "Nombre de la organización"
responsible_name: "Persona responsable del colectivo" responsible_name: "Persona responsable del colectivo"
spending_proposal:
administrator_id: "Administrador"
association_name: "Nombre de la asociación"
description: "Descripción"
external_url: "Enlace a documentación adicional"
geozone_id: "Ámbito de actuación"
title: "Título"
poll: poll:
name: "Nombre" name: "Nombre"
starts_at: "Fecha de apertura" starts_at: "Fecha de apertura"

View File

@@ -689,7 +689,6 @@ es:
officials: Cargos públicos officials: Cargos públicos
organizations: Organizaciones organizations: Organizaciones
settings: Configuración global settings: Configuración global
spending_proposals: Propuestas de inversión
stats: Estadísticas stats: Estadísticas
signature_sheets: Hojas de firmas signature_sheets: Hojas de firmas
site_customization: site_customization:
@@ -714,7 +713,6 @@ es:
content_block: content_block:
update: "Actualizar Bloque" update: "Actualizar Bloque"
title_moderated_content: Contenido moderado title_moderated_content: Contenido moderado
title_budgets: Presupuestos
title_profiles: Perfiles title_profiles: Perfiles
title_settings: Configuración title_settings: Configuración
title_site_customization: Contenido del sitio title_site_customization: Contenido del sitio
@@ -905,15 +903,6 @@ es:
delete: Borrar delete: Borrar
search: search:
title: "Evaluadores: Búsqueda de usuarios" title: "Evaluadores: Búsqueda de usuarios"
summary:
title: Resumen de evaluación de proyectos de gasto
valuator_name: Evaluador
finished_and_feasible_count: Finalizadas viables
finished_and_unfeasible_count: Finalizadas inviables
finished_count: Finalizadas
in_evaluation_count: En evaluación
total_count: Total
cost: Coste total
form: form:
edit_title: "Evaluadores: Editar evaluador" edit_title: "Evaluadores: Editar evaluador"
update: "Actualizar evaluador" update: "Actualizar evaluador"
@@ -1308,9 +1297,6 @@ es:
proposal_search: proposal_search:
button: Buscar button: Buscar
placeholder: Buscar propuestas por título, código, descripción o pregunta placeholder: Buscar propuestas por título, código, descripción o pregunta
spending_proposal_search:
button: Buscar
placeholder: Buscar propuestas por título o descripción
user_search: user_search:
button: Buscar button: Buscar
placeholder: Buscar usuario por nombre o email placeholder: Buscar usuario por nombre o email
@@ -1331,62 +1317,6 @@ es:
color_help: Formato hexadecimal color_help: Formato hexadecimal
show_results_and_stats: "Mostrar resultados y estadísticas" show_results_and_stats: "Mostrar resultados y estadísticas"
results_and_stats_reminder: "Si marcas estas casillas los resultados y/o estadísticas serán públicos y podrán verlos todos los usuarios." results_and_stats_reminder: "Si marcas estas casillas los resultados y/o estadísticas serán públicos y podrán verlos todos los usuarios."
spending_proposals:
index:
geozone_filter_all: Todos los ámbitos de actuación
administrator_filter_all: Todos los administradores
valuator_filter_all: Todos los evaluadores
tags_filter_all: Todas las etiquetas
filters:
valuation_open: Abiertas
without_admin: Sin administrador
managed: Gestionando
valuating: En evaluación
valuation_finished: Evaluación finalizada
all: Todas
title: Propuestas de inversión para presupuestos participativos
assigned_admin: Administrador asignado
no_admin_assigned: Sin admin asignado
no_valuators_assigned: Sin evaluador
summary_link: "Resumen de propuestas"
valuator_summary_link: "Resumen de evaluadores"
feasibility:
feasible: "Viable (%{price})"
not_feasible: "Inviable"
undefined: "Sin definir"
show:
assigned_admin: Administrador asignado
assigned_valuators: Evaluadores asignados
back: Volver
classification: Clasificación
heading: "Propuesta de inversión %{id}"
edit: Editar
edit_classification: Editar clasificación
association_name: Asociación
by: Autor
sent: Fecha
geozone: Ámbito
dossier: Informe
edit_dossier: Editar informe
tags: Etiquetas
undefined: Sin definir
edit:
classification: Clasificación
assigned_valuators: Evaluadores
submit_button: Actualizar
tags: Etiquetas
tags_placeholder: "Escribe las etiquetas que desees separadas por comas (,)"
undefined: Sin definir
summary:
title: Resumen de propuestas de inversión
title_proposals_with_supports: Resumen para propuestas que han superado la fase de apoyos
geozone_name: Ámbito de ciudad
finished_and_feasible_count: Finalizadas viables
finished_and_unfeasible_count: Finalizadas inviables
finished_count: Finalizadas
in_evaluation_count: En evaluación
total_count: Total
cost_for_geozone: Coste total
geozones: geozones:
index: index:
title: Zonas title: Zonas
@@ -1457,7 +1387,6 @@ es:
proposals: Propuestas proposals: Propuestas
budgets: Presupuestos abiertos budgets: Presupuestos abiertos
budget_investments: Proyectos de gasto budget_investments: Proyectos de gasto
spending_proposals: Propuestas de inversión
unverified_users: Usuarios sin verificar unverified_users: Usuarios sin verificar
user_level_three: Usuarios de nivel tres user_level_three: Usuarios de nivel tres
user_level_two: Usuarios de nivel dos user_level_two: Usuarios de nivel dos
@@ -1474,7 +1403,6 @@ es:
polls: Votaciones polls: Votaciones
graph: graph:
debate_created: Debates debate_created: Debates
spending_proposals: Propuestas de inversión
visit: Visitas visit: Visitas
level_2_user: Usuarios nivel 2 level_2_user: Usuarios nivel 2
proposal_created: Propuestas Ciudadanas proposal_created: Propuestas Ciudadanas

View File

@@ -165,7 +165,6 @@ es:
page_title: "%{budget} - Resultados" page_title: "%{budget} - Resultados"
heading: "Resultados presupuestos participativos" heading: "Resultados presupuestos participativos"
heading_selection_title: "Ámbito de actuación" heading_selection_title: "Ámbito de actuación"
spending_proposal: Título de la propuesta
ballot_lines_count: Votos ballot_lines_count: Votos
hide_discarded_link: Ocultar descartados hide_discarded_link: Ocultar descartados
show_all_link: Mostrar todos show_all_link: Mostrar todos
@@ -174,6 +173,7 @@ es:
accepted: "Proyecto de gasto aceptado: " accepted: "Proyecto de gasto aceptado: "
discarded: "Proyecto de gasto descartado: " discarded: "Proyecto de gasto descartado: "
incompatibles: Incompatibles incompatibles: Incompatibles
investment_title: Título del proyecto de gasto
investment_proyects: Ver lista completa de proyectos de gasto investment_proyects: Ver lista completa de proyectos de gasto
unfeasible_investment_proyects: Ver lista de proyectos de gasto inviables unfeasible_investment_proyects: Ver lista de proyectos de gasto inviables
not_selected_investment_proyects: Ver lista de proyectos de gasto no seleccionados para la votación final not_selected_investment_proyects: Ver lista de proyectos de gasto no seleccionados para la votación final

View File

@@ -179,7 +179,6 @@ es:
policy: Política de privacidad policy: Política de privacidad
proposal: la propuesta proposal: la propuesta
proposal_notification: "la notificación" proposal_notification: "la notificación"
spending_proposal: la propuesta de gasto
budget/investment: el proyecto de gasto budget/investment: el proyecto de gasto
budget/group: el grupo de partidas presupuestarias budget/group: el grupo de partidas presupuestarias
budget/heading: la partida presupuestaria budget/heading: la partida presupuestaria
@@ -193,7 +192,6 @@ es:
image: Imagen image: Imagen
geozones: geozones:
none: Toda la ciudad none: Toda la ciudad
all: Todos los ámbitos de actuación
layouts: layouts:
application: application:
chrome: Google Chrome chrome: Google Chrome
@@ -248,7 +246,6 @@ es:
proposals: Propuestas proposals: Propuestas
poll_questions: Votaciones poll_questions: Votaciones
budgets: Presupuestos participativos budgets: Presupuestos participativos
spending_proposals: Propuestas de inversión
notification_item: notification_item:
new_notifications: new_notifications:
one: Tienes una nueva notificación one: Tienes una nueva notificación
@@ -762,7 +759,6 @@ es:
unflag: Deshacer denuncia unflag: Deshacer denuncia
unfollow_entity: "Dejar de seguir %{entity}" unfollow_entity: "Dejar de seguir %{entity}"
outline: outline:
budget: Presupuestos participativos
searcher: Buscador searcher: Buscador
go_to_page: "Ir a la página de " go_to_page: "Ir a la página de "
share: Compartir share: Compartir
@@ -785,54 +781,6 @@ es:
whatsapp: WhatsApp whatsapp: WhatsApp
telegram: "Telegram de %{org}" telegram: "Telegram de %{org}"
instagram: "Instagram de %{org}" instagram: "Instagram de %{org}"
spending_proposals:
form:
association_name_label: "Si propones en nombre de una asociación o colectivo añade el nombre aquí"
association_name: "Nombre de la asociación"
description: Descripción detallada
external_url: Enlace a documentación adicional
geozone: Ámbito de actuación
submit_buttons:
create: Crear
new: Crear
title: Título de la propuesta de gasto
index:
title: Presupuestos participativos
unfeasible: Propuestas de inversión no viables
by_geozone: "Propuestas de inversión con ámbito: %{geozone}"
search_form:
button: Buscar
placeholder: Propuestas de inversión...
title: Buscar
search_results:
one: " que contiene '%{search_term}'"
other: " que contienen '%{search_term}'"
sidebar:
geozones: Ámbitos de actuación
feasibility: Viabilidad
unfeasible: No viables
start_spending_proposal: Crea una propuesta de inversión
new:
more_info: '¿Cómo funcionan los presupuestos participativos?'
recommendation_one: Es fundamental que haga referencia a una actuación presupuestable.
recommendation_three: Intenta detallar lo máximo posible la propuesta para que el equipo de gobierno encargado de estudiarla tenga las menor dudas posibles.
recommendation_two: Cualquier propuesta o comentario que implique acciones ilegales será eliminada.
recommendations_title: Cómo crear una propuesta de gasto
start_new: Crear una propuesta de gasto
show:
author_deleted: Usuario eliminado
code: "Código de la propuesta:"
share: Compartir
wrong_price_format: Solo puede incluir caracteres numéricos
spending_proposal:
spending_proposal: Propuesta de inversión
already_supported: Ya has apoyado este proyecto. ¡Compártelo!
support: Apoyar
support_title: Apoyar este proyecto
supports:
zero: Sin apoyos
one: 1 apoyo
other: "%{count} apoyos"
stats: stats:
index: index:
visits: Visitas visits: Visitas
@@ -915,12 +863,6 @@ es:
unauthenticated: Necesitas %{signin} o %{signup} para continuar. unauthenticated: Necesitas %{signin} o %{signup} para continuar.
verified_only: Las propuestas sólo pueden ser votadas por usuarios verificados, %{verify_account}. verified_only: Las propuestas sólo pueden ser votadas por usuarios verificados, %{verify_account}.
verify_account: verifica tu cuenta verify_account: verifica tu cuenta
spending_proposals:
not_logged_in: Necesitas %{signin} o %{signup} para continuar.
not_verified: Las propuestas de inversión sólo pueden ser apoyadas por usuarios verificados, %{verify_account}.
organization: Las organizaciones no pueden votar.
unfeasible: No se pueden votar propuestas inviables.
not_voting_allowed: El periodo de votación está cerrado.
budget_investments: budget_investments:
not_logged_in: Necesitas %{signin} o %{signup} para continuar. not_logged_in: Necesitas %{signin} o %{signup} para continuar.
not_verified: Los proyectos de gasto sólo pueden ser apoyadas por usuarios verificados, %{verify_account}. not_verified: Los proyectos de gasto sólo pueden ser apoyadas por usuarios verificados, %{verify_account}.

View File

@@ -20,13 +20,6 @@ es:
new_reply_by_html: Hay una nueva respuesta de <b>%{commenter}</b> a tu comentario en new_reply_by_html: Hay una nueva respuesta de <b>%{commenter}</b> a tu comentario en
subject: Alguien ha respondido a tu comentario subject: Alguien ha respondido a tu comentario
title: Nueva respuesta a tu comentario title: Nueva respuesta a tu comentario
unfeasible_spending_proposal:
hi: "Estimado/a usuario/a"
new_html: "Por todo ello, te invitamos a que elabores una <strong>nueva propuesta</strong> que se ajuste a las condiciones de este proceso. Esto lo puedes hacer en este enlace: %{url}."
new_href: "nueva propuesta de inversión"
sincerely: "Atentamente"
sorry: "Sentimos las molestias ocasionadas y volvemos a darte las gracias por tu inestimable participación."
subject: "Tu propuesta de inversión '%{code}' ha sido marcada como inviable"
proposal_notification_digest: proposal_notification_digest:
info: "A continuación te mostramos las nuevas notificaciones que han publicado los autores de las propuestas que estás apoyando en %{org_name}." info: "A continuación te mostramos las nuevas notificaciones que han publicado los autores de las propuestas que estás apoyando en %{org_name}."
title: "Notificaciones de propuestas en %{org_name}" title: "Notificaciones de propuestas en %{org_name}"

View File

@@ -62,9 +62,6 @@ es:
create_proposal: Crear propuesta create_proposal: Crear propuesta
print_proposals: Imprimir propuestas print_proposals: Imprimir propuestas
support_proposals: Apoyar propuestas support_proposals: Apoyar propuestas
create_spending_proposal: Crear una propuesta de gasto
print_spending_proposals: Imprimir propts. de inversión
support_spending_proposals: Apoyar propts. de inversión
create_budget_investment: Crear proyectos de gasto create_budget_investment: Crear proyectos de gasto
print_budget_investments: Imprimir proyectos de gasto print_budget_investments: Imprimir proyectos de gasto
support_budget_investments: Apoyar proyectos de gasto support_budget_investments: Apoyar proyectos de gasto
@@ -79,7 +76,6 @@ es:
print: print:
proposals_info: Haz tu propuesta en http://url.consul proposals_info: Haz tu propuesta en http://url.consul
proposals_title: "Propuestas:" proposals_title: "Propuestas:"
spending_proposals_info: Participa en http://url.consul
budget_investments_info: Participa en http://url.consul budget_investments_info: Participa en http://url.consul
print_info: Imprimir esta información print_info: Imprimir esta información
proposals: proposals:
@@ -110,18 +106,6 @@ es:
search_results: search_results:
one: " que contiene '%{search_term}'" one: " que contiene '%{search_term}'"
other: " que contienen '%{search_term}'" other: " que contienen '%{search_term}'"
spending_proposals:
alert:
unverified_user: Usuario no verificado
create: Crear una propuesta de gasto
filters:
unfeasible: Propuestas de inversión no viables
by_geozone: "Propuestas de inversión con ámbito: %{geozone}"
print:
print_button: Imprimir
search_results:
one: " que contiene '%{search_term}'"
other: " que contienen '%{search_term}'"
sessions: sessions:
signed_out: Has cerrado la sesión correctamente. signed_out: Has cerrado la sesión correctamente.
signed_out_managed_user: Se ha cerrado correctamente la sesión del usuario. signed_out_managed_user: Se ha cerrado correctamente la sesión del usuario.

View File

@@ -12,7 +12,6 @@ es:
poll_question_answer_image: "Imagen cargada correctamente" poll_question_answer_image: "Imagen cargada correctamente"
proposal: "Propuesta creada correctamente." proposal: "Propuesta creada correctamente."
proposal_notification: "Tu mensaje ha sido enviado correctamente." proposal_notification: "Tu mensaje ha sido enviado correctamente."
spending_proposal: "Propuesta de inversión creada correctamente. Puedes acceder a ella desde %{activity}"
budget_investment: "Proyecto de gasto creado correctamente." budget_investment: "Proyecto de gasto creado correctamente."
signature_sheet: "Hoja de firmas creada correctamente" signature_sheet: "Hoja de firmas creada correctamente"
topic: "Tema creado correctamente." topic: "Tema creado correctamente."
@@ -26,13 +25,11 @@ es:
poll_booth: "Urna actualizada correctamente." poll_booth: "Urna actualizada correctamente."
active_poll: "Descripción general de votaciones actualizada correctamente." active_poll: "Descripción general de votaciones actualizada correctamente."
proposal: "Propuesta actualizada correctamente." proposal: "Propuesta actualizada correctamente."
spending_proposal: "Propuesta de inversión actualizada correctamente."
budget_investment: "Proyecto de gasto actualizado correctamente" budget_investment: "Proyecto de gasto actualizado correctamente"
topic: "Tema actualizado correctamente." topic: "Tema actualizado correctamente."
valuator_group: "Grupo de evaluadores actualizado correctamente" valuator_group: "Grupo de evaluadores actualizado correctamente"
translation: "Traducción actualizada correctamente" translation: "Traducción actualizada correctamente"
destroy: destroy:
spending_proposal: "Propuesta de inversión eliminada."
budget_investment: "Proyecto de gasto eliminado." budget_investment: "Proyecto de gasto eliminado."
error: "No se pudo borrar" error: "No se pudo borrar"
topic: "Tema eliminado." topic: "Tema eliminado."

View File

@@ -93,11 +93,6 @@ es:
featured_proposals_description: "Muestra propuestas destacadas en la página principal de propuestas" featured_proposals_description: "Muestra propuestas destacadas en la página principal de propuestas"
signature_sheets: "Hojas de firmas" signature_sheets: "Hojas de firmas"
signature_sheets_description: "Permite añadir desde el panel de Administración firmas recogidas de forma presencial a Propuestas y proyectos de gasto de los Presupuestos participativos" signature_sheets_description: "Permite añadir desde el panel de Administración firmas recogidas de forma presencial a Propuestas y proyectos de gasto de los Presupuestos participativos"
spending_proposals: "Propuestas de inversión"
spending_proposals_description: "⚠️ NOTA: Esta funcionalidad ha sido sustituida por Pesupuestos Participativos y desaparecerá en nuevas versiones"
spending_proposal_features:
voting_allowed: Votaciones de preselección sobre propuestas de inversión.
voting_allowed_description: "⚠️ NOTA: Esta funcionalidad ha sido sustituida por Pesupuestos Participativos y desaparecerá en nuevas versiones"
user: user:
recommendations: "Recomendaciones" recommendations: "Recomendaciones"
recommendations_description: "Muestra a los usuarios recomendaciones en la homepage basado en las etiquetas de los elementos que sigue" recommendations_description: "Muestra a los usuarios recomendaciones en la homepage basado en las etiquetas de los elementos que sigue"

View File

@@ -5,7 +5,6 @@ es:
menu: menu:
title: Evaluación title: Evaluación
budgets: Presupuestos participativos budgets: Presupuestos participativos
spending_proposals: Propuestas de inversión
budgets: budgets:
index: index:
title: Presupuestos participativos title: Presupuestos participativos
@@ -77,52 +76,3 @@ es:
valuate: "Dossier actualizado" valuate: "Dossier actualizado"
valuation_comments: Comentarios de evaluación valuation_comments: Comentarios de evaluación
not_in_valuating_phase: Los proyectos sólo pueden ser evaluados cuando el Presupuesto esté en fase de evaluación not_in_valuating_phase: Los proyectos sólo pueden ser evaluados cuando el Presupuesto esté en fase de evaluación
spending_proposals:
index:
geozone_filter_all: Todos los ámbitos de actuación
filters:
valuation_open: Abiertas
valuating: En evaluación
valuation_finished: Evaluación finalizada
title: Propuestas de inversión para presupuestos participativos
edit: Editar
show:
back: Volver
heading: Propuesta de inversión
info: Datos de envío
association_name: Asociación
by: Enviada por
sent: Fecha de creación
geozone: Ámbito de actuación
dossier: Informe
edit_dossier: Editar informe
price: Coste
price_first_year: Coste en el primer año
currency: "€"
feasibility: Viabilidad
feasible: Viable
not_feasible: No viable
undefined: Sin definir
valuation_finished: Informe finalizado
time_scope: Plazo de ejecución
internal_comments: Comentarios internos
responsibles: Responsables
assigned_admin: Administrador asignado
assigned_valuators: Evaluadores asignados
edit:
dossier: Informe
price_html: "Coste (%{currency}) <small>(dato público)</small>"
price_first_year_html: "Coste en el primer año (%{currency}) <small>(opcional, privado)</small>"
currency: "€"
price_explanation_html: Informe de coste <small>(opcional, dato público)</small>
feasibility: Viabilidad
feasible: Viable
not_feasible: Inviable
undefined_feasible: Sin decidir
feasible_explanation_html: Informe de inviabilidad <small>(en caso de que lo sea, dato público)</small>
valuation_finished: Informe finalizado
time_scope_html: Plazo de ejecución <small>(opcional, dato no público)</small>
internal_comments_html: Comentarios y observaciones <small>(para responsables internos, dato no público)</small>
save: Guardar cambios
notice:
valuate: "Informe actualizado"

View File

@@ -42,15 +42,6 @@ namespace :admin do
end end
end end
resources :spending_proposals, only: [:index, :show, :edit, :update] do
member do
patch :assign_admin
patch :assign_valuators
end
get :summary, on: :collection
end
resources :proposal_notifications, only: :index do resources :proposal_notifications, only: :index do
member do member do
put :restore put :restore

View File

@@ -19,11 +19,5 @@ resources :budgets, only: [:show, :index] do
resource :executions, only: :show, controller: "budgets/executions" resource :executions, only: :show, controller: "budgets/executions"
end end
scope "/participatory_budget" do
resources :spending_proposals, only: [:index, :new, :create, :show, :destroy], path: "investment_projects" do
post :vote, on: :member
end
end
get "investments/:id/json_data", action: :json_data, controller: "budgets/investments" get "investments/:id/json_data", action: :json_data, controller: "budgets/investments"
get "/budgets/:budget_id/investments/:id/json_data", action: :json_data, controller: "budgets/investments" get "/budgets/:budget_id/investments/:id/json_data", action: :json_data, controller: "budgets/investments"

View File

@@ -31,11 +31,6 @@ namespace :management do
get :print, on: :collection get :print, on: :collection
end end
resources :spending_proposals, only: [:index, :new, :create, :show] do
post :vote, on: :member
get :print, on: :collection
end
resources :budgets, only: :index do resources :budgets, only: :index do
collection do collection do
get :create_investments get :create_investments

View File

@@ -1,10 +1,6 @@
namespace :valuation do namespace :valuation do
root to: "budgets#index" root to: "budgets#index"
resources :spending_proposals, only: [:index, :show, :edit] do
patch :valuate, on: :member
end
resources :budgets, only: :index do resources :budgets, only: :index do
resources :budget_investments, only: [:index, :show, :edit] do resources :budget_investments, only: [:index, :show, :edit] do
patch :valuate, on: :member patch :valuate, on: :member

View File

@@ -26,7 +26,6 @@ require_relative "dev_seeds/tags_categories"
require_relative "dev_seeds/debates" require_relative "dev_seeds/debates"
require_relative "dev_seeds/proposals" require_relative "dev_seeds/proposals"
require_relative "dev_seeds/budgets" require_relative "dev_seeds/budgets"
require_relative "dev_seeds/spending_proposals"
require_relative "dev_seeds/comments" require_relative "dev_seeds/comments"
require_relative "dev_seeds/votes" require_relative "dev_seeds/votes"
require_relative "dev_seeds/flags" require_relative "dev_seeds/flags"

View File

@@ -33,8 +33,6 @@ section "Creating Settings" do
Setting.create(key: "process.legislation", value: "true") Setting.create(key: "process.legislation", value: "true")
Setting.create(key: "feature.featured_proposals", value: "true") Setting.create(key: "feature.featured_proposals", value: "true")
Setting.create(key: "feature.spending_proposals", value: nil)
Setting.create(key: "feature.spending_proposal_features.voting_allowed", value: nil)
Setting.create(key: "feature.twitter_login", value: "true") Setting.create(key: "feature.twitter_login", value: "true")
Setting.create(key: "feature.facebook_login", value: "true") Setting.create(key: "feature.facebook_login", value: "true")
@@ -65,6 +63,7 @@ section "Creating Settings" do
Setting.create(key: "map.latitude", value: 40.4332002) Setting.create(key: "map.latitude", value: 40.4332002)
Setting.create(key: "map.longitude", value: -3.7009591) Setting.create(key: "map.longitude", value: -3.7009591)
Setting.create(key: "map.zoom", value: 10) Setting.create(key: "map.zoom", value: 10)
Setting.create(key: "featured_proposals_number", value: 3) Setting.create(key: "featured_proposals_number", value: 3)
Setting.create(key: "proposal_notification_minimum_interval_in_days", value: 0) Setting.create(key: "proposal_notification_minimum_interval_in_days", value: 0)
Setting.create(key: "direct_message_max_per_day", value: 3) Setting.create(key: "direct_message_max_per_day", value: 3)

View File

@@ -1,30 +0,0 @@
section "Creating Spending Proposals" do
tags = Faker::Lorem.words(10)
60.times do
geozone = Geozone.all.sample
author = User.all.sample
description = "<p>#{Faker::Lorem.paragraphs.join("</p><p>")}</p>"
feasible_explanation = "<p>#{Faker::Lorem.paragraphs.join("</p><p>")}</p>"
valuation_finished = [true, false].sample
feasible = [true, false].sample
created_at = rand((Time.current - 1.week)..Time.current)
spending_proposal = SpendingProposal.create!(author: author,
title: Faker::Lorem.sentence(3).truncate(60),
external_url: Faker::Internet.url,
description: description,
created_at: created_at,
geozone: [geozone, nil].sample,
feasible: feasible,
feasible_explanation: feasible_explanation,
valuation_finished: valuation_finished,
tag_list: tags.sample(3).join(","),
price: rand(1000000),
terms_of_service: "1")
end
end
section "Creating Valuation Assignments" do
(1..17).to_a.sample.times do
SpendingProposal.all.sample.valuators << Valuator.first
end
end

View File

@@ -0,0 +1,5 @@
class DestroySpendingProposals < ActiveRecord::Migration[4.2]
def change
drop_table :spending_proposals
end
end

View File

@@ -0,0 +1,5 @@
class DestroySpendingProposalValuations < ActiveRecord::Migration[4.2]
def change
drop_table :valuation_assignments
end
end

View File

@@ -0,0 +1,6 @@
class DestroySpendingProposalAssociations < ActiveRecord::Migration[4.2]
def change
remove_column :tags, :spending_proposals_count
remove_column :valuators, :spending_proposals_count
end
end

View File

@@ -1316,36 +1316,6 @@ ActiveRecord::Schema.define(version: 20190429125842) do
t.string "locale" t.string "locale"
end end
create_table "spending_proposals", force: :cascade do |t|
t.string "title"
t.text "description"
t.integer "author_id"
t.string "external_url"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "geozone_id"
t.bigint "price"
t.boolean "feasible"
t.string "association_name"
t.text "price_explanation"
t.text "feasible_explanation"
t.text "internal_comments"
t.boolean "valuation_finished", default: false
t.text "explanations_log"
t.integer "administrator_id"
t.integer "valuation_assignments_count", default: 0
t.bigint "price_first_year"
t.string "time_scope"
t.datetime "unfeasible_email_sent_at"
t.integer "cached_votes_up", default: 0
t.tsvector "tsv"
t.string "responsible_name", limit: 60
t.integer "physical_votes", default: 0
t.index ["author_id"], name: "index_spending_proposals_on_author_id", using: :btree
t.index ["geozone_id"], name: "index_spending_proposals_on_geozone_id", using: :btree
t.index ["tsv"], name: "index_spending_proposals_on_tsv", using: :gin
end
create_table "stats_versions", force: :cascade do |t| create_table "stats_versions", force: :cascade do |t|
t.string "process_type" t.string "process_type"
t.integer "process_id" t.integer "process_id"
@@ -1371,7 +1341,6 @@ ActiveRecord::Schema.define(version: 20190429125842) do
t.integer "taggings_count", default: 0 t.integer "taggings_count", default: 0
t.integer "debates_count", default: 0 t.integer "debates_count", default: 0
t.integer "proposals_count", default: 0 t.integer "proposals_count", default: 0
t.integer "spending_proposals_count", default: 0
t.string "kind" t.string "kind"
t.integer "budget/investments_count", default: 0 t.integer "budget/investments_count", default: 0
t.integer "legislation/proposals_count", default: 0 t.integer "legislation/proposals_count", default: 0
@@ -1381,7 +1350,6 @@ ActiveRecord::Schema.define(version: 20190429125842) do
t.index ["legislation/proposals_count"], name: "index_tags_on_legislation/proposals_count", using: :btree t.index ["legislation/proposals_count"], name: "index_tags_on_legislation/proposals_count", using: :btree
t.index ["name"], name: "index_tags_on_name", unique: true, using: :btree t.index ["name"], name: "index_tags_on_name", unique: true, using: :btree
t.index ["proposals_count"], name: "index_tags_on_proposals_count", using: :btree t.index ["proposals_count"], name: "index_tags_on_proposals_count", using: :btree
t.index ["spending_proposals_count"], name: "index_tags_on_spending_proposals_count", using: :btree
end end
create_table "topics", force: :cascade do |t| create_table "topics", force: :cascade do |t|
@@ -1467,13 +1435,6 @@ ActiveRecord::Schema.define(version: 20190429125842) do
t.index ["username"], name: "index_users_on_username", using: :btree t.index ["username"], name: "index_users_on_username", using: :btree
end end
create_table "valuation_assignments", force: :cascade do |t|
t.integer "valuator_id"
t.integer "spending_proposal_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "valuator_groups", force: :cascade do |t| create_table "valuator_groups", force: :cascade do |t|
t.string "name" t.string "name"
t.integer "budget_investments_count", default: 0 t.integer "budget_investments_count", default: 0
@@ -1482,7 +1443,6 @@ ActiveRecord::Schema.define(version: 20190429125842) do
create_table "valuators", force: :cascade do |t| create_table "valuators", force: :cascade do |t|
t.integer "user_id" t.integer "user_id"
t.string "description" t.string "description"
t.integer "spending_proposals_count", default: 0
t.integer "budget_investments_count", default: 0 t.integer "budget_investments_count", default: 0
t.integer "valuator_group_id" t.integer "valuator_group_id"
t.index ["user_id"], name: "index_valuators_on_user_id", using: :btree t.index ["user_id"], name: "index_valuators_on_user_id", using: :btree

View File

@@ -74,7 +74,6 @@ Setting["process.legislation"] = true
# Feature flags # Feature flags
Setting["feature.featured_proposals"] = nil Setting["feature.featured_proposals"] = nil
Setting["feature.spending_proposals"] = nil
Setting["feature.twitter_login"] = true Setting["feature.twitter_login"] = true
Setting["feature.facebook_login"] = true Setting["feature.facebook_login"] = true
Setting["feature.google_login"] = true Setting["feature.google_login"] = true
@@ -90,9 +89,6 @@ Setting["feature.allow_images"] = true
Setting["feature.allow_attached_documents"] = true Setting["feature.allow_attached_documents"] = true
Setting["feature.help_page"] = true Setting["feature.help_page"] = true
# Spending proposals feature flags
Setting["feature.spending_proposal_features.voting_allowed"] = nil
# Proposal notifications # Proposal notifications
Setting["proposal_notification_minimum_interval_in_days"] = 3 Setting["proposal_notification_minimum_interval_in_days"] = 3
Setting["direct_message_max_per_day"] = 3 Setting["direct_message_max_per_day"] = 3

View File

@@ -1,70 +0,0 @@
class MigrateSpendingProposalsToInvestments
def import(sp)
budget = Budget.last || Budget.create!(name: Date.current.year.to_s, currency_symbol: "")
group = nil
heading = nil
if sp.geozone_id.present?
group = budget.groups.find_or_create_by!(name: "Barrios")
heading = group.headings.find_or_create_by!(name: sp.geozone.name, price: 10000000,
latitude: "40.416775", longitude: "-3.703790")
else
group = budget.groups.find_or_create_by!(name: "Toda la ciudad")
heading = group.headings.find_or_create_by!(name: "Toda la ciudad", price: 10000000,
latitude: "40.416775", longitude: "-3.703790")
end
feasibility = case sp.feasible
when FalseClass
"unfeasible"
when TrueClass
"feasible"
else
"undecided"
end
investment = Budget::Investment.create!(
heading_id: heading.id,
author_id: sp.author_id,
administrator_id: sp.administrator_id,
title: sp.title,
description: sp.description,
external_url: sp.external_url,
price: sp.price,
price_explanation: sp.price_explanation,
duration: sp.time_scope,
feasibility: feasibility,
unfeasibility_explanation: sp.feasible_explanation,
valuation_finished: sp.valuation_finished,
price_first_year: sp.price_first_year,
cached_votes_up: sp.cached_votes_up,
physical_votes: sp.physical_votes,
created_at: sp.created_at,
updated_at: sp.updated_at,
responsible_name: sp.responsible_name,
terms_of_service: "1"
)
investment.valuators = sp.valuation_assignments.map(&:valuator)
votes = ActsAsVotable::Vote.where(votable_type: "SpendingProposal", votable_id: sp.id)
votes.each {|v| investment.vote_by(voter: v.voter, vote: "yes") }
# Spending proposals are not commentable in Consul so we can not test this
#
# Comment.where(commentable_type: "SpendingProposal", commentable_id: sp.id).update_all(
# commentable_type: "Budget::Investment", commentable_id: investment.id
# )
# Budget::Investment.reset_counters(investment.id, :comments)
# Spending proposals have ballot_lines in Madrid, but not in consul, so we
# can not test this either
investment
end
end

Some files were not shown because too many files have changed in this diff Show More