merge with master two
This commit is contained in:
@@ -26,7 +26,7 @@ module CommentableActions
|
||||
set_resource_instance
|
||||
load_featured_tags
|
||||
load_category_tags
|
||||
load_district_tags
|
||||
load_district_select
|
||||
end
|
||||
|
||||
def create
|
||||
@@ -36,13 +36,13 @@ module CommentableActions
|
||||
if @resource.save_with_captcha
|
||||
track_event
|
||||
load_category_tags
|
||||
load_district_tags
|
||||
load_district_select
|
||||
redirect_path = url_for(controller: controller_name, action: :show, id: @resource.id)
|
||||
redirect_to redirect_path, notice: t('flash.actions.create.notice', resource_name: "#{resource_name.capitalize}")
|
||||
else
|
||||
load_featured_tags
|
||||
load_category_tags
|
||||
load_district_tags
|
||||
load_district_select
|
||||
set_resource_instance
|
||||
render :new
|
||||
end
|
||||
@@ -51,7 +51,7 @@ module CommentableActions
|
||||
def edit
|
||||
load_featured_tags
|
||||
load_category_tags
|
||||
load_district_tags
|
||||
load_district_select
|
||||
end
|
||||
|
||||
def update
|
||||
@@ -61,7 +61,7 @@ module CommentableActions
|
||||
else
|
||||
load_featured_tags
|
||||
load_category_tags
|
||||
load_district_tags
|
||||
load_district_select
|
||||
set_resource_instance
|
||||
render :edit
|
||||
end
|
||||
@@ -85,11 +85,11 @@ module CommentableActions
|
||||
where("kind = 'category' and tags.featured = true").
|
||||
order(kind: :asc, id: :asc)
|
||||
end
|
||||
def load_district_tags
|
||||
@district_tags = ActsAsTaggableOn::Tag.select("tags.*").
|
||||
where("kind = 'district' and tags.featured = true").
|
||||
order(kind: :asc, id: :asc)
|
||||
def load_district_select
|
||||
@district_select = Geozone.select("geozones.name, geozones.id").
|
||||
order(id: :asc)
|
||||
end
|
||||
|
||||
def parse_tag_filter
|
||||
if params[:tag].present?
|
||||
@tag_filter = params[:tag] if ActsAsTaggableOn::Tag.named(params[:tag]).exists?
|
||||
|
||||
@@ -20,12 +20,10 @@
|
||||
<% @category_tags.each do |tag| %>
|
||||
<a class="js-add-tag-link"><%= tag.name %></a>
|
||||
<% end %>
|
||||
<hr widht="30%" align="left">
|
||||
<%= f.label :tag_list, t("debates.form.tag_district_label") %>
|
||||
<% @district_tags.each do |tag| %>
|
||||
<a class="js-add-tag-link"><%= tag.name %></a>
|
||||
<% @district_select.each do |g| %>
|
||||
<a class="js-add-tag-link"><%= g.name%></a>
|
||||
<% end %>
|
||||
|
||||
</span>
|
||||
<%= f.text_field :tag_list, value: @debate.tag_list.to_s, label: false, placeholder: t("debates.form.tags_placeholder"), class: 'js-tag-list' %>
|
||||
</div>
|
||||
|
||||
@@ -47,15 +47,14 @@
|
||||
<% @category_tags.each do |tag| %>
|
||||
<a class="js-add-tag-link"><%= tag.name %></a>
|
||||
<% end %>
|
||||
<hr widht="30%" align="left">
|
||||
<%= f.label :district_tag_list, t("proposals.form.tag_district_label") %>
|
||||
<% @district_tags.each do |tag| %>
|
||||
<a class="js-add-tag-link"><%= tag.name %></a>
|
||||
<% @district_select.each do |g| %>
|
||||
<a class="js-add-tag-link"><%= g.name %></a>
|
||||
<% end %>
|
||||
</span>
|
||||
<br>
|
||||
<%= f.text_field :tag_list, value: @proposal.tag_list.to_s, label: false, placeholder: t("proposals.form.tags_placeholder"), class: 'js-tag-list' %>
|
||||
</div>
|
||||
|
||||
<% if current_user.unverified? %>
|
||||
<div class="small-12 column">
|
||||
<%= f.label :responsible_name, t("proposals.form.proposal_responsible_name") %>
|
||||
|
||||
@@ -210,11 +210,11 @@ en:
|
||||
proposal_video_url_note: "You may add a link to YouTube or Vimeo"
|
||||
proposal_responsible_name: "Full name of the person submitting the proposal"
|
||||
proposal_responsible_name_note: "(individually or as representative of a collective; will not be displayed publically)"
|
||||
tags_label: "Tags"
|
||||
tags_instructions: "Tag this proposal. You can choose from Categories and Districs tags or add your own"
|
||||
tags_label: "Topics"
|
||||
tags_instructions: "Tag this proposal. You can choose from Categories and Districs suggestions or enter your own"
|
||||
tags_placeholder: "Enter the tags you would like to use, separated by commas (',')"
|
||||
tag_category_label: "Category"
|
||||
tag_district_label: "District"
|
||||
tag_category_label: "Categories"
|
||||
tag_district_label: "Districts"
|
||||
show:
|
||||
back_link: "Go back"
|
||||
author_deleted: "User deleted"
|
||||
|
||||
@@ -211,10 +211,10 @@ es:
|
||||
proposal_responsible_name: "Nombre y apellidos de la persona que hace esta propuesta"
|
||||
proposal_responsible_name_note: "(individualmente o como representante de un colectivo; no se mostrará públicamente)"
|
||||
tags_label: "Temas"
|
||||
tags_instructions: "Etiqueta esta propuesta. Puedes elegir entre nuestras sugerencias o introducir las que desees."
|
||||
tags_placeholder: "Escribe las etiquetas que desees separadas por una coma (',')"
|
||||
tag_category_label: "Categorías"
|
||||
tag_district_label: "Distritos"
|
||||
tags_instructions: "Etiqueta esta propuesta. Puedes elegir entre Categorias y Distritos propuestos o introducir las que desees"
|
||||
tags_placeholder: "Escribe las etiquetas que desees separadas por una coma (',')"
|
||||
show:
|
||||
back_link: "Volver"
|
||||
author_deleted: "Usuario eliminado"
|
||||
|
||||
@@ -231,40 +231,33 @@ Proposal.only_hidden.flagged.reorder("RANDOM()").limit(5).each(&:confirm_hide)
|
||||
puts "Creating Tags Categories"
|
||||
|
||||
ActsAsTaggableOn::Tag.create!(name: "Asociaciones", featured: true, kind: "category")
|
||||
puts " Asociaciones"
|
||||
ActsAsTaggableOn::Tag.create!(name: "Cultura", featured: true, kind: "category")
|
||||
puts " Cultura"
|
||||
ActsAsTaggableOn::Tag.create!(name: "Deportes", featured: true, kind: "category")
|
||||
ActsAsTaggableOn::Tag.create!(name: "Derechos Sociales", featured: true, kind: "category")
|
||||
puts " Deportes"
|
||||
ActsAsTaggableOn::Tag.create!(name: "Derechos SMedio Ambienteociales", featured: true, kind: "category")
|
||||
puts " Derechos Sociales"
|
||||
ActsAsTaggableOn::Tag.create!(name: "Economía", featured: true, kind: "category")
|
||||
puts " Economía"
|
||||
ActsAsTaggableOn::Tag.create!(name: "Empleo", featured: true, kind: "category")
|
||||
puts " Empleo"
|
||||
ActsAsTaggableOn::Tag.create!(name: "Equidad", featured: true, kind: "category")
|
||||
puts " Equidad"
|
||||
ActsAsTaggableOn::Tag.create!(name: "Sostenibilidad", featured: true, kind: "category")
|
||||
puts " Sostenibilidad"
|
||||
ActsAsTaggableOn::Tag.create!(name: "Participación", featured: true, kind: "category")
|
||||
puts " Participación"
|
||||
ActsAsTaggableOn::Tag.create!(name: "Movilidad", featured: true, kind: "category")
|
||||
puts " Movilidad"
|
||||
ActsAsTaggableOn::Tag.create!(name: "Medios", featured: true, kind: "category")
|
||||
puts " Medios"
|
||||
ActsAsTaggableOn::Tag.create!(name: "Salud", featured: true , kind: "category")
|
||||
puts " Salud"
|
||||
ActsAsTaggableOn::Tag.create!(name: "Transparencia", featured: true, kind: "category")
|
||||
puts " Transparencia"
|
||||
ActsAsTaggableOn::Tag.create!(name: "Seguridad y Emergencias", featured: true, kind: "category")
|
||||
puts " Seguridad y Emergencias"
|
||||
ActsAsTaggableOn::Tag.create!(name: "Medio Ambiente", featured: true, kind: "category")
|
||||
puts " Medio Ambiente"
|
||||
|
||||
puts "Creating Tags Districts"
|
||||
|
||||
ActsAsTaggableOn::Tag.create!(name: "Centro", featured: true, kind: "district")
|
||||
ActsAsTaggableOn::Tag.create!(name: "Arganzuela", featured: true, kind: "district")
|
||||
ActsAsTaggableOn::Tag.create!(name: "Retiro" , featured: true, kind: "district")
|
||||
ActsAsTaggableOn::Tag.create!(name: "Salamanca" , featured: true, kind: "district")
|
||||
ActsAsTaggableOn::Tag.create!(name: "Chamartín" , featured: true, kind: "district")
|
||||
ActsAsTaggableOn::Tag.create!(name: "Tetuán" , featured: true, kind: "district")
|
||||
ActsAsTaggableOn::Tag.create!(name: "Chamberí" , featured: true, kind: "district")
|
||||
ActsAsTaggableOn::Tag.create!(name: "Moncloa-Aravaca", featured: true, kind: "district")
|
||||
ActsAsTaggableOn::Tag.create!(name: "Latina", featured: true, kind: "district")
|
||||
ActsAsTaggableOn::Tag.create!(name: "Carabanchel", featured: true, kind: "district")
|
||||
ActsAsTaggableOn::Tag.create!(name: "Usera", featured: true, kind: "district")
|
||||
ActsAsTaggableOn::Tag.create!(name: "Puente de Vallecas", featured: true, kind: "district")
|
||||
ActsAsTaggableOn::Tag.create!(name: "Moratalaz", featured: true, kind: "district")
|
||||
ActsAsTaggableOn::Tag.create!(name: "Ciudad Lineal", featured: true, kind: "district")
|
||||
ActsAsTaggableOn::Tag.create!(name: "Hortaleza", featured: true, kind: "district")
|
||||
ActsAsTaggableOn::Tag.create!(name: "Villaverde", featured: true, kind: "district")
|
||||
ActsAsTaggableOn::Tag.create!(name: "Villa de Vallecas", featured: true, kind: "district")
|
||||
ActsAsTaggableOn::Tag.create!(name: "Vicalvaro", featured: true, kind: "district")
|
||||
ActsAsTaggableOn::Tag.create!(name: "San Blas-Canillejas", featured: true, kind: "district")
|
||||
ActsAsTaggableOn::Tag.create!(name: "Barajas", featured: true, kind: "district")
|
||||
|
||||
15
db/schema.rb
15
db/schema.rb
@@ -11,7 +11,6 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
|
||||
ActiveRecord::Schema.define(version: 20160108133501) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
@@ -200,7 +199,7 @@ ActiveRecord::Schema.define(version: 20160108133501) do
|
||||
create_table "locks", force: :cascade do |t|
|
||||
t.integer "user_id"
|
||||
t.integer "tries", default: 0
|
||||
t.datetime "locked_until", default: '2000-01-01 00:01:01', null: false
|
||||
t.datetime "locked_until", default: '2000-01-01 07:01:01', null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
end
|
||||
@@ -311,12 +310,12 @@ ActiveRecord::Schema.define(version: 20160108133501) do
|
||||
add_index "taggings", ["taggable_id", "taggable_type", "context"], name: "index_taggings_on_taggable_id_and_taggable_type_and_context", using: :btree
|
||||
|
||||
create_table "tags", force: :cascade do |t|
|
||||
t.string "name", limit: 40
|
||||
t.integer "taggings_count", default: 0
|
||||
t.boolean "featured", default: false
|
||||
t.integer "debates_count", default: 0
|
||||
t.integer "proposals_count", default: 0
|
||||
t.string "kind", limit: 40
|
||||
t.string "name", limit: 40
|
||||
t.integer "taggings_count", default: 0
|
||||
t.boolean "featured", default: false
|
||||
t.integer "debates_count", default: 0
|
||||
t.integer "proposals_count", default: 0
|
||||
t.string "kind", limit: 40
|
||||
t.integer "spending_proposals_count", default: 0
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user