merge with master two
This commit is contained in:
@@ -26,7 +26,7 @@ module CommentableActions
|
|||||||
set_resource_instance
|
set_resource_instance
|
||||||
load_featured_tags
|
load_featured_tags
|
||||||
load_category_tags
|
load_category_tags
|
||||||
load_district_tags
|
load_district_select
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
@@ -36,13 +36,13 @@ module CommentableActions
|
|||||||
if @resource.save_with_captcha
|
if @resource.save_with_captcha
|
||||||
track_event
|
track_event
|
||||||
load_category_tags
|
load_category_tags
|
||||||
load_district_tags
|
load_district_select
|
||||||
redirect_path = url_for(controller: controller_name, action: :show, id: @resource.id)
|
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}")
|
redirect_to redirect_path, notice: t('flash.actions.create.notice', resource_name: "#{resource_name.capitalize}")
|
||||||
else
|
else
|
||||||
load_featured_tags
|
load_featured_tags
|
||||||
load_category_tags
|
load_category_tags
|
||||||
load_district_tags
|
load_district_select
|
||||||
set_resource_instance
|
set_resource_instance
|
||||||
render :new
|
render :new
|
||||||
end
|
end
|
||||||
@@ -51,7 +51,7 @@ module CommentableActions
|
|||||||
def edit
|
def edit
|
||||||
load_featured_tags
|
load_featured_tags
|
||||||
load_category_tags
|
load_category_tags
|
||||||
load_district_tags
|
load_district_select
|
||||||
end
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
@@ -61,7 +61,7 @@ module CommentableActions
|
|||||||
else
|
else
|
||||||
load_featured_tags
|
load_featured_tags
|
||||||
load_category_tags
|
load_category_tags
|
||||||
load_district_tags
|
load_district_select
|
||||||
set_resource_instance
|
set_resource_instance
|
||||||
render :edit
|
render :edit
|
||||||
end
|
end
|
||||||
@@ -85,11 +85,11 @@ module CommentableActions
|
|||||||
where("kind = 'category' and tags.featured = true").
|
where("kind = 'category' and tags.featured = true").
|
||||||
order(kind: :asc, id: :asc)
|
order(kind: :asc, id: :asc)
|
||||||
end
|
end
|
||||||
def load_district_tags
|
def load_district_select
|
||||||
@district_tags = ActsAsTaggableOn::Tag.select("tags.*").
|
@district_select = Geozone.select("geozones.name, geozones.id").
|
||||||
where("kind = 'district' and tags.featured = true").
|
order(id: :asc)
|
||||||
order(kind: :asc, id: :asc)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def parse_tag_filter
|
def parse_tag_filter
|
||||||
if params[:tag].present?
|
if params[:tag].present?
|
||||||
@tag_filter = params[:tag] if ActsAsTaggableOn::Tag.named(params[:tag]).exists?
|
@tag_filter = params[:tag] if ActsAsTaggableOn::Tag.named(params[:tag]).exists?
|
||||||
|
|||||||
@@ -20,12 +20,10 @@
|
|||||||
<% @category_tags.each do |tag| %>
|
<% @category_tags.each do |tag| %>
|
||||||
<a class="js-add-tag-link"><%= tag.name %></a>
|
<a class="js-add-tag-link"><%= tag.name %></a>
|
||||||
<% end %>
|
<% end %>
|
||||||
<hr widht="30%" align="left">
|
|
||||||
<%= f.label :tag_list, t("debates.form.tag_district_label") %>
|
<%= f.label :tag_list, t("debates.form.tag_district_label") %>
|
||||||
<% @district_tags.each do |tag| %>
|
<% @district_select.each do |g| %>
|
||||||
<a class="js-add-tag-link"><%= tag.name %></a>
|
<a class="js-add-tag-link"><%= g.name%></a>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
</span>
|
</span>
|
||||||
<%= f.text_field :tag_list, value: @debate.tag_list.to_s, label: false, placeholder: t("debates.form.tags_placeholder"), class: 'js-tag-list' %>
|
<%= f.text_field :tag_list, value: @debate.tag_list.to_s, label: false, placeholder: t("debates.form.tags_placeholder"), class: 'js-tag-list' %>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -47,15 +47,14 @@
|
|||||||
<% @category_tags.each do |tag| %>
|
<% @category_tags.each do |tag| %>
|
||||||
<a class="js-add-tag-link"><%= tag.name %></a>
|
<a class="js-add-tag-link"><%= tag.name %></a>
|
||||||
<% end %>
|
<% end %>
|
||||||
<hr widht="30%" align="left">
|
|
||||||
<%= f.label :district_tag_list, t("proposals.form.tag_district_label") %>
|
<%= f.label :district_tag_list, t("proposals.form.tag_district_label") %>
|
||||||
<% @district_tags.each do |tag| %>
|
<% @district_select.each do |g| %>
|
||||||
<a class="js-add-tag-link"><%= tag.name %></a>
|
<a class="js-add-tag-link"><%= g.name %></a>
|
||||||
<% end %>
|
<% end %>
|
||||||
</span>
|
</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' %>
|
<%= f.text_field :tag_list, value: @proposal.tag_list.to_s, label: false, placeholder: t("proposals.form.tags_placeholder"), class: 'js-tag-list' %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<% if current_user.unverified? %>
|
<% if current_user.unverified? %>
|
||||||
<div class="small-12 column">
|
<div class="small-12 column">
|
||||||
<%= f.label :responsible_name, t("proposals.form.proposal_responsible_name") %>
|
<%= 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_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: "Full name of the person submitting the proposal"
|
||||||
proposal_responsible_name_note: "(individually or as representative of a collective; will not be displayed publically)"
|
proposal_responsible_name_note: "(individually or as representative of a collective; will not be displayed publically)"
|
||||||
tags_label: "Tags"
|
tags_label: "Topics"
|
||||||
tags_instructions: "Tag this proposal. You can choose from Categories and Districs tags or add your own"
|
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 (',')"
|
tags_placeholder: "Enter the tags you would like to use, separated by commas (',')"
|
||||||
tag_category_label: "Category"
|
tag_category_label: "Categories"
|
||||||
tag_district_label: "District"
|
tag_district_label: "Districts"
|
||||||
show:
|
show:
|
||||||
back_link: "Go back"
|
back_link: "Go back"
|
||||||
author_deleted: "User deleted"
|
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: "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)"
|
proposal_responsible_name_note: "(individualmente o como representante de un colectivo; no se mostrará públicamente)"
|
||||||
tags_label: "Temas"
|
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_category_label: "Categorías"
|
||||||
tag_district_label: "Distritos"
|
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:
|
show:
|
||||||
back_link: "Volver"
|
back_link: "Volver"
|
||||||
author_deleted: "Usuario eliminado"
|
author_deleted: "Usuario eliminado"
|
||||||
|
|||||||
@@ -231,40 +231,33 @@ Proposal.only_hidden.flagged.reorder("RANDOM()").limit(5).each(&:confirm_hide)
|
|||||||
puts "Creating Tags Categories"
|
puts "Creating Tags Categories"
|
||||||
|
|
||||||
ActsAsTaggableOn::Tag.create!(name: "Asociaciones", featured: true, kind: "category")
|
ActsAsTaggableOn::Tag.create!(name: "Asociaciones", featured: true, kind: "category")
|
||||||
|
puts " Asociaciones"
|
||||||
ActsAsTaggableOn::Tag.create!(name: "Cultura", featured: true, kind: "category")
|
ActsAsTaggableOn::Tag.create!(name: "Cultura", featured: true, kind: "category")
|
||||||
|
puts " Cultura"
|
||||||
ActsAsTaggableOn::Tag.create!(name: "Deportes", featured: true, kind: "category")
|
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")
|
ActsAsTaggableOn::Tag.create!(name: "Economía", featured: true, kind: "category")
|
||||||
|
puts " Economía"
|
||||||
ActsAsTaggableOn::Tag.create!(name: "Empleo", featured: true, kind: "category")
|
ActsAsTaggableOn::Tag.create!(name: "Empleo", featured: true, kind: "category")
|
||||||
|
puts " Empleo"
|
||||||
ActsAsTaggableOn::Tag.create!(name: "Equidad", featured: true, kind: "category")
|
ActsAsTaggableOn::Tag.create!(name: "Equidad", featured: true, kind: "category")
|
||||||
|
puts " Equidad"
|
||||||
ActsAsTaggableOn::Tag.create!(name: "Sostenibilidad", featured: true, kind: "category")
|
ActsAsTaggableOn::Tag.create!(name: "Sostenibilidad", featured: true, kind: "category")
|
||||||
|
puts " Sostenibilidad"
|
||||||
ActsAsTaggableOn::Tag.create!(name: "Participación", featured: true, kind: "category")
|
ActsAsTaggableOn::Tag.create!(name: "Participación", featured: true, kind: "category")
|
||||||
|
puts " Participación"
|
||||||
ActsAsTaggableOn::Tag.create!(name: "Movilidad", featured: true, kind: "category")
|
ActsAsTaggableOn::Tag.create!(name: "Movilidad", featured: true, kind: "category")
|
||||||
|
puts " Movilidad"
|
||||||
ActsAsTaggableOn::Tag.create!(name: "Medios", featured: true, kind: "category")
|
ActsAsTaggableOn::Tag.create!(name: "Medios", featured: true, kind: "category")
|
||||||
|
puts " Medios"
|
||||||
ActsAsTaggableOn::Tag.create!(name: "Salud", featured: true , kind: "category")
|
ActsAsTaggableOn::Tag.create!(name: "Salud", featured: true , kind: "category")
|
||||||
|
puts " Salud"
|
||||||
ActsAsTaggableOn::Tag.create!(name: "Transparencia", featured: true, kind: "category")
|
ActsAsTaggableOn::Tag.create!(name: "Transparencia", featured: true, kind: "category")
|
||||||
|
puts " Transparencia"
|
||||||
ActsAsTaggableOn::Tag.create!(name: "Seguridad y Emergencias", featured: true, kind: "category")
|
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")
|
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")
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@
|
|||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# It's strongly recommended that you check this file into your version control system.
|
||||||
|
|
||||||
|
|
||||||
ActiveRecord::Schema.define(version: 20160108133501) do
|
ActiveRecord::Schema.define(version: 20160108133501) do
|
||||||
|
|
||||||
# These are extensions that must be enabled in order to support this database
|
# 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|
|
create_table "locks", force: :cascade do |t|
|
||||||
t.integer "user_id"
|
t.integer "user_id"
|
||||||
t.integer "tries", default: 0
|
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 "created_at", null: false
|
||||||
t.datetime "updated_at", null: false
|
t.datetime "updated_at", null: false
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user