diff --git a/app/assets/javascripts/new_debate_map.js b/app/assets/javascripts/new_debate_map.js
deleted file mode 100644
index c71567783..000000000
--- a/app/assets/javascripts/new_debate_map.js
+++ /dev/null
@@ -1,5 +0,0 @@
-function call_function()
-{
-
- location.href = "/new_debate_map/" + $('#district-selector-participation').val() ;
-}
\ No newline at end of file
diff --git a/app/assets/javascripts/new_proposal_map.js b/app/assets/javascripts/new_proposal_map.js
deleted file mode 100644
index e539c457c..000000000
--- a/app/assets/javascripts/new_proposal_map.js
+++ /dev/null
@@ -1,5 +0,0 @@
-function call_function()
-{
-
- location.href = "/new_proposal_map/" + $('#district-selector-participation').val() ;
-}
\ No newline at end of file
diff --git a/app/controllers/admin/tags_controller.rb b/app/controllers/admin/tags_controller.rb
index e3530876d..5655b0f8a 100644
--- a/app/controllers/admin/tags_controller.rb
+++ b/app/controllers/admin/tags_controller.rb
@@ -4,23 +4,13 @@ class Admin::TagsController < Admin::BaseController
respond_to :html, :js
def index
- @tags = ActsAsTaggableOn::Tag.order(kind: :asc, id: :asc).page(params[:page])
+ @tags = ActsAsTaggableOn::Tag.order(featured: :desc).page(params[:page])
@tag = ActsAsTaggableOn::Tag.new
end
def create
- @paramTag = params[:tag]
- if @paramTag[:name] == ""
- redirect_to admin_tags_path, notice: t("admin.tags.message")
- else
- search_tag
- if @tag.present?
- redirect_to admin_tags_path, notice: t("admin.tags.message_find")
- else
- ActsAsTaggableOn::Tag.create(tag_params)
- redirect_to admin_tags_path
- end
- end
+ ActsAsTaggableOn::Tag.create(tag_params)
+ redirect_to admin_tags_path
end
def update
@@ -36,16 +26,11 @@ class Admin::TagsController < Admin::BaseController
private
def tag_params
- params.require(:tag).permit(:featured, :name, :kind)
+ params.require(:tag).permit(:featured, :name)
end
def find_tag
@tag = ActsAsTaggableOn::Tag.find(params[:id])
end
- def search_tag
- # @tag = ActsAsTaggableOn::Tag.where("name = '#{@paramTag[:name]}' and
- # kind = '#{@paramTag[:kind]}'")
-
- @tag = ActsAsTaggableOn::Tag.where("upper(name) = upper('#{@paramTag[:name]}')")
- end
+
end
diff --git a/app/controllers/management/proposals_controller.rb b/app/controllers/management/proposals_controller.rb
index 4d96af093..b80864bba 100644
--- a/app/controllers/management/proposals_controller.rb
+++ b/app/controllers/management/proposals_controller.rb
@@ -5,6 +5,8 @@ class Management::ProposalsController < Management::BaseController
before_action :check_verified_user, except: :print
before_action :set_proposal, only: [:vote, :show]
before_action :parse_search_terms, only: :index
+ before_action :load_categories, only: [:new, :edit]
+ before_action :load_geozones, only: [:edit]
has_orders %w{confidence_score hot_score created_at most_commented random}, only: [:index, :print]
has_orders %w{most_voted newest}, only: :show
@@ -43,7 +45,7 @@ class Management::ProposalsController < Management::BaseController
managed_user
end
- ### Duplicated in application_controller. Move to a concenrn.
+ ### Duplicated in application_controller. Move to a concern.
def set_proposal_votes(proposals)
@proposal_votes = current_user ? current_user.proposal_votes(proposals) : {}
end
diff --git a/app/views/admin/dashboard/index.html.erb b/app/views/admin/dashboard/index.html.erb
index bb3c71e0a..da64cba15 100644
--- a/app/views/admin/dashboard/index.html.erb
+++ b/app/views/admin/dashboard/index.html.erb
@@ -3,7 +3,7 @@
Desde aquí puedes administrar el sistema, a través de las siguientes acciones:
-
Temas de debate o propuesta
+
Temas de debate
Los temas (también llamadas tags, o etiquetas) de debate son palabras que definen los usuarios al crear debates, para catalogarlos (ej: sanidad, movilidad, arganzuela, ...). Aquí se pueden eliminar temas inapropiados, o marcarlos para ser propuestos al crear debates (cada usuario puede definir los que quiera, pero se le sugieren algunos que nos parecen útiles como catalogación por defecto; aquí se puede cambiar cuáles se sugieren)
+
<% tag_cloud @tag_cloud, %w[s m l] do |tag, css_class| %>
<%= link_to taggable_path(taggable, tag.name), class: css_class do %>
<%= tag.name %>
(<%= tag.send(taggable_counter_field(taggable)) %>)
<% end %>
<% end %>
-
-
-
<%= t("shared.tags_cloud.categorys") %>
-
- <% tag_cloud @category_cloud, %w[s m l] do |tag, css_class| %>
- <%= link_to taggable_path(taggable, tag.name), class: css_class do %>
- <%= tag.name %>
- <%= tag.send(taggable_counter_field(taggable)) %>
- <% end %>
- <% end %>
-
-
-
-
<%= t("shared.tags_cloud.districts") %>
-
-
- <%= image_tag("Distritos_Madrid.jpg") %>
-
+
diff --git a/app/views/shared/_tags.html.erb b/app/views/shared/_tags.html.erb
index 17f158d8a..8640a4d0c 100644
--- a/app/views/shared/_tags.html.erb
+++ b/app/views/shared/_tags.html.erb
@@ -1,7 +1,7 @@
<%- limit ||= nil %>
<% if taggable.tags.any? %>
-
+
<% taggable.tag_list_with_limit(limit).each do |tag| %>
<%= link_to sanitize(tag.name), send("#{taggable.class.to_s.downcase.pluralize}_path", tag: tag.name) %>
<% end %>
diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb
index 650bfc786..a13ed5320 100644
--- a/config/initializers/assets.rb
+++ b/config/initializers/assets.rb
@@ -13,5 +13,3 @@ Rails.application.config.assets.precompile += %w( ckeditor/* )
Rails.application.config.assets.precompile += %w( ie_lt9.js )
Rails.application.config.assets.precompile += %w( stat_graphs.js )
Rails.application.config.assets.precompile += %w( print.css )
-Rails.application.config.assets.precompile += %w( new_proposal_map.js )
-Rails.application.config.assets.precompile += %w( new_debate_map.js )
diff --git a/config/routes.rb b/config/routes.rb
index f2d81ec8b..37578ed20 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -27,10 +27,6 @@ Rails.application.routes.draw do
patch :do_finish_signup, to: 'users/registrations#do_finish_signup'
end
- # The priority is based upon order of creation: first created -> highest priority.
- # See how all your routes lay out with "rake routes".
-
- # You can have the root of your site routed with "root"
root 'welcome#index'
get '/welcome', to: 'welcome#welcome'
get '/highlights', to: 'welcome#highlights', as: :highlights
@@ -237,55 +233,6 @@ Rails.application.routes.draw do
resources :spending_proposals, only: [:new, :create, :show]
end
- # Example of regular route:
- # get 'products/:id' => 'catalog#view'
-
- # Example of named route that can be invoked with purchase_url(id: product.id)
- # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase
-
- # Example resource route (maps HTTP verbs to controller actions automatically):
- # resources :products
-
- # Example resource route with options:
- # resources :products do
- # member do
- # get 'short'
- # post 'toggle'
- # end
- #
- # collection do
- # get 'sold'
- # end
- # end
-
- # Example resource route with sub-resources:
- # resources :products do
- # resources :comments, :sales
- # resource :seller
- # end
-
- # Example resource route with more complex sub-resources:
- # resources :products do
- # resources :comments
- # resources :sales do
- # get 'recent', on: :collection
- # end
- # end
-
- # Example resource route with concerns:
- # concern :toggleable do
- # post 'toggle'
- # end
- # resources :posts, concerns: :toggleable
- # resources :photos, concerns: :toggleable
-
- # Example resource route within a namespace:
- # namespace :admin do
- # # Directs /admin/products/* to Admin::ProductsController
- # # (app/controllers/admin/products_controller.rb)
- # resources :products
- # end
-
if Rails.env.development?
mount LetterOpenerWeb::Engine, at: "/letter_opener"
end
@@ -293,12 +240,6 @@ Rails.application.routes.draw do
mount Tolk::Engine => '/translate', :as => 'tolk'
# static pages
-
- get '/map', to: 'proposals#map_district'
- get '/new_proposal_map/:district', to: 'proposals#new', as: 'new_proposal_map'
- get '/mad', to: 'debates#map_district'
- get '/new_debate_map/:district', to: 'debates#new', as: 'new_debate_map'
get '/blog' => redirect("http://diario.madrid.es/participa/")
resources :pages, path: '/', only: [:show]
-
-end
+end
\ No newline at end of file
diff --git a/db/migrate/20160108101736_add_kind_to_tags.rb b/db/migrate/20160108101736_add_kind_to_tags.rb
deleted file mode 100644
index 661099fd2..000000000
--- a/db/migrate/20160108101736_add_kind_to_tags.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-class AddKindToTags < ActiveRecord::Migration
- def change
- add_column :tags, :kind, :string, limit: 40
- end
-end
diff --git a/spec/factories.rb b/spec/factories.rb
index 1791b2b6e..70ed26a1d 100644
--- a/spec/factories.rb
+++ b/spec/factories.rb
@@ -267,7 +267,6 @@ FactoryGirl.define do
factory :tag, class: 'ActsAsTaggableOn::Tag' do
sequence(:name) { |n| "Tag #{n} name" }
- kind 'category'
trait :featured do
featured true
diff --git a/spec/features/admin/tags_spec.rb b/spec/features/admin/tags_spec.rb
index 6689aad03..74579c1b8 100644
--- a/spec/features/admin/tags_spec.rb
+++ b/spec/features/admin/tags_spec.rb
@@ -17,6 +17,7 @@ feature 'Admin tags' do
scenario 'Create' do
visit admin_tags_path
+
expect(page).to_not have_content 'important issues'
within("form.new_tag") do
@@ -25,6 +26,7 @@ feature 'Admin tags' do
end
visit admin_tags_path
+
expect(page).to have_content 'important issues'
end
@@ -79,48 +81,4 @@ feature 'Admin tags' do
expect(page).to_not have_content tag2.name
end
- scenario 'validate add new tags' do
- visit admin_tags_path
- expect(page).to_not have_content 'important issues'
-
- within("form.new_tag") do
- fill_in "tag_name", with: 'important issues'
- click_button 'Create Topic'
- end
-
- visit admin_tags_path
-
- within("form.new_tag") do
- fill_in "tag_name", with: 'important issues'
- click_button 'Create Topic'
- end
- expect(page).to have_content 'name of the topic already exists'
- end
-
- scenario 'validate uppercase name add new tags' do
- visit admin_tags_path
- expect(page).to_not have_content 'important issues'
-
- within("form.new_tag") do
- fill_in "tag_name", with: 'important issues'
- click_button 'Create Topic'
- end
-
- visit admin_tags_path
-
- within("form.new_tag") do
- fill_in "tag_name", with: 'IMPORTANT ISSUES'
- click_button 'Create Topic'
- end
- expect(page).to have_content 'name of the topic already exists'
- end
-
-scenario 'validate name new tags' do
- visit admin_tags_path
-
- within("form.new_tag") do
- click_button 'Create Topic'
- end
- expect(page).to have_content 'The name of the topic is mandatory filling'
- end
end
\ No newline at end of file
diff --git a/spec/lib/acts_as_taggable_on_spec.rb b/spec/lib/acts_as_taggable_on_spec.rb
index 2362e8745..dbf76d52b 100644
--- a/spec/lib/acts_as_taggable_on_spec.rb
+++ b/spec/lib/acts_as_taggable_on_spec.rb
@@ -66,7 +66,4 @@ describe 'ActsAsTaggableOn' do
end
end
-
-
-
end