Removes guide feature

This commit is contained in:
decabeza
2018-09-28 17:55:01 +02:00
parent 74925a7022
commit dbf41421ed
18 changed files with 9 additions and 298 deletions

View File

@@ -9,7 +9,6 @@
// 07. Proposals successful
// 08. Polls
// 09. Polls results and stats
// 10. Guides
//
// 01. Votes and supports
@@ -2095,94 +2094,3 @@
line-height: rem-calc(60);
}
}
// 10. Guides
// ----------------------
.guides {
h2 {
margin: $line-height 0 $line-height * 2;
}
.guide-budget,
.guide-proposal {
border-radius: rem-calc(3);
margin: $line-height 0;
padding: $line-height;
position: relative;
.button {
color: $text;
font-weight: bold;
}
&::before {
border-radius: 100%;
color: #fff;
font-family: "icons" !important;
height: rem-calc(80);
left: 50%;
line-height: rem-calc(80);
margin-left: rem-calc(-40);
position: absolute;
text-align: center;
top: -40px;
width: rem-calc(80);
z-index: 99;
}
}
.guide-budget {
border: 1px solid $budget;
&::before {
background: $budget;
content: '\53';
font-size: rem-calc(40);
}
.button {
background: #f8f5f9;
border: 1px solid $budget;
}
}
.guide-proposal {
border: 1px solid $proposals;
&::before {
background: $proposals;
content: '\68';
font-size: rem-calc(40);
}
.button {
background: #fffaf4;
border: 1px solid $proposals;
}
}
ul {
@include breakpoint(medium) {
min-height: $line-height * 14;
}
li {
margin-bottom: $line-height;
padding-left: $line-height;
position: relative;
&::before {
color: #37af65;
content: '\56';
font-family: "icons" !important;
font-size: $small-font-size;
left: 0;
position: absolute;
top: 1px;
}
}
}
}

View File

@@ -1,8 +0,0 @@
class GuidesController < ApplicationController
skip_authorization_check
def new
end
end

View File

@@ -1,19 +0,0 @@
module GuidesHelper
def new_proposal_guide
if feature?('guides') && Budget.current&.accepting?
new_guide_path
else
new_proposal_path
end
end
def new_budget_investment_guide
if feature?('guides')
new_guide_path
else
new_budget_investment_path(current_budget)
end
end
end

View File

@@ -1,5 +1,5 @@
<ul id="information-texts-tabs" class="tabs" >
<% [:debates, :community, :proposals, :polls, :layouts, :mailers, :management, :guides, :welcome].each do |tab| %>
<% [:debates, :community, :proposals, :polls, :layouts, :mailers, :management, :welcome].each do |tab| %>
<li class="tabs-title">
<% if tab.to_s == @tab %>
<%= link_to t("admin.menu.site_customization.information_texts_menu.#{tab}"), admin_site_customization_information_texts_path(tab: tab), :class => 'is-active' %>

View File

@@ -33,7 +33,7 @@
<% if current_user %>
<% if current_user.level_two_or_three_verified? %>
<%= link_to t("budgets.investments.index.sidebar.create"),
new_budget_investment_guide,
new_budget_investment_path(@budget),
class: "button margin-top expanded" %>
<% else %>
<div class="callout warning margin-top">

View File

@@ -1,58 +0,0 @@
<div class="guides">
<div class="row margin">
<div class="small-12 column text-center">
<h1><%= t("guides.title", org: setting['org_name']) %></h1>
<p class="lead"><%= t("guides.subtitle") %></p>
</div>
</div>
<div class="row" data-equalizer data-equalize-on="medium">
<div class="small-12 medium-5 medium-offset-1 column">
<div class="guide-budget" data-equalizer-watch>
<h2 class="text-center">
<%= t("guides.budget_investment.title") %>
</h2>
<ul class="no-bullet">
<li><%= t("guides.budget_investment.feature_1_html") %></li>
<li><%= t("guides.budget_investment.feature_2_html") %></li>
<li><%= t("guides.budget_investment.feature_3_html") %></li>
<li><%= t("guides.budget_investment.feature_4_html") %></li>
</ul>
<% if current_budget %>
<div class="small-12 medium-9 small-centered">
<%= link_to t("guides.budget_investment.new_button"),
new_budget_investment_path(current_budget),
class: "button expanded" %>
</div>
<% end %>
</div>
</div>
<div class="small-12 medium-5 column end">
<div class="guide-proposal" data-equalizer-watch>
<h2 class="text-center">
<%= t("guides.proposal.title") %>
</h2>
<ul class="no-bullet">
<li><%= t("guides.proposal.feature_1_html") %></li>
<li>
<%= t("guides.proposal.feature_2_html",
votes: setting["votes_for_proposal_success"],
org: setting['org_name']) %>
</li>
<li><%= t("guides.proposal.feature_3_html") %></li>
<li><%= t("guides.proposal.feature_4_html") %></li>
</ul>
<div class="small-12 medium-9 small-centered">
<%= link_to t("guides.proposal.new_button"),
new_proposal_path,
class: "button expanded" %>
</div>
</div>
</div>
</div>
</div>

View File

@@ -76,7 +76,7 @@
<% if @proposals.any? %>
<div class="show-for-small-only">
<%= link_to t("proposals.index.start_proposal"),
new_proposal_guide,
new_proposal_path,
class: 'button expanded' %>
</div>
<% end %>
@@ -109,7 +109,7 @@
<div class="small-12 medium-3 column">
<aside class="margin-bottom">
<%= link_to t("proposals.index.start_proposal"),
new_proposal_guide,
new_proposal_path,
class: 'button expanded' %>
<% if params[:retired].blank? %>
<%= render 'categories' %>

View File

@@ -41,7 +41,6 @@ data:
- config/locales/%{locale}/community.yml
- config/locales/%{locale}/documents.yml
- config/locales/%{locale}/images.yml
- config/locales/%{locale}/guides.yml
- config/locales/%{locale}/user_groups.yml
- config/locales/%{locale}/i18n.yml

View File

@@ -570,7 +570,6 @@ en:
layouts: "Layouts"
mailers: "Emails"
management: "Management"
guides: "Guides"
welcome: "Welcome"
buttons:
save: "Save"

View File

@@ -1,18 +0,0 @@
en:
guides:
title: "Do you have an idea for %{org}?"
subtitle: "Choose what you want to create"
budget_investment:
title: "An investment project"
feature_1_html: "Ideas of how to spend part of the <strong>municipal budget</strong>"
feature_2_html: "Investment projects are accepted <strong>between January and March</strong>"
feature_3_html: "If it receives supports, it's viable and municipal competence, it goes to voting phase"
feature_4_html: "If the citizens approve the projects, they become a reality"
new_button: I want to create a budget investment
proposal:
title: "A citizen proposal"
feature_1_html: "Ideas about any action the City Council can take"
feature_2_html: "Need <strong>%{votes} supports</strong> in %{org} for go to voting"
feature_3_html: "Activate at any time, you have <strong>a year</strong> to get the supports"
feature_4_html: "If approved in a vote, the City Council accepts the proposal"
new_button: I want to create a proposal

View File

@@ -563,7 +563,6 @@ es:
community: "Comunidad"
proposals: "Propuestas"
polls: "Votaciones"
layouts: "Plantillas"
mailers: "Correos"
management: "Gestión"
guides: "Guías"

View File

@@ -1,18 +0,0 @@
es:
guides:
title: "¿Tienes una idea para %{org}?"
subtitle: "Elige qué quieres crear"
budget_investment:
title: "Un proyecto de gasto"
feature_1_html: "Son ideas de cómo gastar parte del <strong>presupuesto municipal</strong>"
feature_2_html: "Los proyectos de gasto se plantean <strong>entre enero y marzo</strong>"
feature_3_html: "Si recibe apoyos, es viable y competencia municipal, pasa a votación"
feature_4_html: "Si la ciudadanía aprueba los proyectos, se hacen realidad"
new_button: Quiero crear un proyecto de gasto
proposal:
title: "Una propuesta ciudadana"
feature_1_html: "Son ideas sobre cualquier acción que pueda realizar el Ayuntamiento"
feature_2_html: "Necesitan <strong>%{votes} apoyos</strong> en %{org} para pasar a votación"
feature_3_html: "Se activan en cualquier momento; tienes <strong>un año</strong> para reunir los apoyos"
feature_4_html: "De aprobarse en votación, el Ayuntamiento asume la propuesta"
new_button: Quiero crear una propuesta

View File

@@ -20,7 +20,6 @@ Rails.application.routes.draw do
draw :direct_upload
draw :document
draw :graphql
draw :guide
draw :legislation
draw :management
draw :moderation

View File

@@ -1 +0,0 @@
resources :guides, only: :new

View File

@@ -47,7 +47,6 @@ section "Creating Settings" do
Setting.create(key: 'feature.allow_images', value: "true")
Setting.create(key: 'feature.allow_attached_documents', value: "true")
Setting.create(key: 'feature.public_stats', value: "true")
Setting.create(key: 'feature.guides', value: nil)
Setting.create(key: 'feature.user.skip_verification', value: "true")
Setting.create(key: 'feature.help_page', value: "true")

View File

@@ -88,7 +88,6 @@ Setting['feature.community'] = true
Setting['feature.map'] = nil
Setting['feature.allow_images'] = true
Setting['feature.allow_attached_documents'] = true
Setting['feature.guides'] = nil
Setting['feature.help_page'] = true
# Spending proposals feature flags

View File

@@ -42,9 +42,6 @@ feature "Admin custom information texts" do
expect(page).to have_content 'This user account is already verified.'
click_link 'Guides'
expect(page).to have_content 'Choose what you want to create'
click_link 'Welcome'
expect(page).to have_content 'See all debates'
end

View File

@@ -1,66 +0,0 @@
require 'rails_helper'
feature 'Guide the user to create the correct resource' do
let(:user) { create(:user, :verified)}
let!(:budget) { create(:budget, :accepting) }
background do
Setting['feature.guides'] = true
end
after do
Setting['feature.guides'] = nil
end
context "Proposals" do
scenario "Proposal creation" do
login_as(user)
visit proposals_path
click_link "Create a proposal"
click_link "I want to create a proposal"
expect(page).to have_current_path(new_proposal_path)
end
scenario "Proposal creation when Budget is not accepting" do
budget.update_attribute(:phase, :reviewing)
login_as(user)
visit proposals_path
click_link "Create a proposal"
expect(page).to have_current_path(new_proposal_path)
end
end
scenario "Budget Investment" do
login_as(user)
visit budgets_path
click_link "Create a budget investment"
click_link "I want to create a budget investment"
expect(page).to have_current_path(new_budget_investment_path(budget))
end
scenario "Feature deactivated" do
Setting['feature.guides'] = nil
login_as(user)
visit proposals_path
click_link "Create a proposal"
expect(page).not_to have_link "I want to create a proposal"
expect(page).to have_current_path(new_proposal_path)
visit budgets_path
click_link "Create a budget investment"
expect(page).not_to have_link "I want to create a new budget investment"
expect(page).to have_current_path(new_budget_investment_path(budget))
end
end