Merge pull request #3464 from consul/cleanup_rails5_dashboard
Cleanup Rails5 dashboard
This commit is contained in:
3
Gemfile
3
Gemfile
@@ -7,7 +7,6 @@ gem "acts_as_votable", "~> 0.11.1"
|
|||||||
gem "ahoy_matey", "~> 1.6.0"
|
gem "ahoy_matey", "~> 1.6.0"
|
||||||
gem "ancestry", "~> 3.0.2"
|
gem "ancestry", "~> 3.0.2"
|
||||||
gem "autoprefixer-rails", "~> 8.2.0"
|
gem "autoprefixer-rails", "~> 8.2.0"
|
||||||
gem "best_in_place", "~> 3.0.1"
|
|
||||||
gem "browser", "~> 2.5.3"
|
gem "browser", "~> 2.5.3"
|
||||||
gem "cancancan", "~> 2.3.0"
|
gem "cancancan", "~> 2.3.0"
|
||||||
gem "ckeditor", "~> 4.2.3"
|
gem "ckeditor", "~> 4.2.3"
|
||||||
@@ -41,7 +40,6 @@ gem "paperclip", "~> 5.2.1"
|
|||||||
gem "paranoia", "~> 2.4.1"
|
gem "paranoia", "~> 2.4.1"
|
||||||
gem "pg", "~> 0.21.0"
|
gem "pg", "~> 0.21.0"
|
||||||
gem "pg_search", "~> 2.0.1"
|
gem "pg_search", "~> 2.0.1"
|
||||||
gem "record_tag_helper", "~> 1.0"
|
|
||||||
gem "redcarpet", "~> 3.4.0"
|
gem "redcarpet", "~> 3.4.0"
|
||||||
gem "responders", "~> 2.4.0"
|
gem "responders", "~> 2.4.0"
|
||||||
gem "rinku", "~> 2.0.2", require: "rails_rinku"
|
gem "rinku", "~> 2.0.2", require: "rails_rinku"
|
||||||
@@ -74,6 +72,7 @@ group :development, :test do
|
|||||||
gem "knapsack_pro", "~> 1.1.0"
|
gem "knapsack_pro", "~> 1.1.0"
|
||||||
gem "launchy", "~> 2.4.3"
|
gem "launchy", "~> 2.4.3"
|
||||||
gem "letter_opener_web", "~> 1.3.4"
|
gem "letter_opener_web", "~> 1.3.4"
|
||||||
|
gem "puma", "~> 3.12.1"
|
||||||
gem "spring", "~> 2.0.1"
|
gem "spring", "~> 2.0.1"
|
||||||
gem "spring-commands-rspec", "~> 1.0.4"
|
gem "spring-commands-rspec", "~> 1.0.4"
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -79,9 +79,6 @@ GEM
|
|||||||
babel-source (>= 4.0, < 6)
|
babel-source (>= 4.0, < 6)
|
||||||
execjs (~> 2.0)
|
execjs (~> 2.0)
|
||||||
bcrypt (3.1.12)
|
bcrypt (3.1.12)
|
||||||
best_in_place (3.0.3)
|
|
||||||
actionpack (>= 3.2)
|
|
||||||
railties (>= 3.2)
|
|
||||||
better_html (1.0.13)
|
better_html (1.0.13)
|
||||||
actionview (>= 4.0)
|
actionview (>= 4.0)
|
||||||
activesupport (>= 4.0)
|
activesupport (>= 4.0)
|
||||||
@@ -348,6 +345,7 @@ GEM
|
|||||||
arel (>= 6)
|
arel (>= 6)
|
||||||
powerpack (0.1.2)
|
powerpack (0.1.2)
|
||||||
public_suffix (3.0.3)
|
public_suffix (3.0.3)
|
||||||
|
puma (3.12.1)
|
||||||
rack (2.0.6)
|
rack (2.0.6)
|
||||||
rack-accept (0.4.5)
|
rack-accept (0.4.5)
|
||||||
rack (>= 0.4)
|
rack (>= 0.4)
|
||||||
@@ -385,8 +383,6 @@ GEM
|
|||||||
rake (12.3.2)
|
rake (12.3.2)
|
||||||
recipient_interceptor (0.2.0)
|
recipient_interceptor (0.2.0)
|
||||||
mail
|
mail
|
||||||
record_tag_helper (1.0.0)
|
|
||||||
actionview (~> 5.x)
|
|
||||||
redcarpet (3.4.0)
|
redcarpet (3.4.0)
|
||||||
referer-parser (0.3.0)
|
referer-parser (0.3.0)
|
||||||
request_store (1.4.0)
|
request_store (1.4.0)
|
||||||
@@ -535,7 +531,6 @@ DEPENDENCIES
|
|||||||
ahoy_matey (~> 1.6.0)
|
ahoy_matey (~> 1.6.0)
|
||||||
ancestry (~> 3.0.2)
|
ancestry (~> 3.0.2)
|
||||||
autoprefixer-rails (~> 8.2.0)
|
autoprefixer-rails (~> 8.2.0)
|
||||||
best_in_place (~> 3.0.1)
|
|
||||||
browser (~> 2.5.3)
|
browser (~> 2.5.3)
|
||||||
bullet (~> 5.7.0)
|
bullet (~> 5.7.0)
|
||||||
byebug (~> 10.0.0)
|
byebug (~> 10.0.0)
|
||||||
@@ -587,11 +582,11 @@ DEPENDENCIES
|
|||||||
paranoia (~> 2.4.1)
|
paranoia (~> 2.4.1)
|
||||||
pg (~> 0.21.0)
|
pg (~> 0.21.0)
|
||||||
pg_search (~> 2.0.1)
|
pg_search (~> 2.0.1)
|
||||||
|
puma (~> 3.12.1)
|
||||||
rails (= 5.0.7.2)
|
rails (= 5.0.7.2)
|
||||||
rails-assets-leaflet!
|
rails-assets-leaflet!
|
||||||
rails-assets-markdown-it (~> 8.2.1)!
|
rails-assets-markdown-it (~> 8.2.1)!
|
||||||
recipient_interceptor (~> 0.2.0)
|
recipient_interceptor (~> 0.2.0)
|
||||||
record_tag_helper (~> 1.0)
|
|
||||||
redcarpet (~> 3.4.0)
|
redcarpet (~> 3.4.0)
|
||||||
responders (~> 2.4.0)
|
responders (~> 2.4.0)
|
||||||
rinku (~> 2.0.2)
|
rinku (~> 2.0.2)
|
||||||
|
|||||||
@@ -17,7 +17,6 @@
|
|||||||
//= require jquery-ui/widgets/autocomplete
|
//= require jquery-ui/widgets/autocomplete
|
||||||
//= require jquery-ui/widgets/sortable
|
//= require jquery-ui/widgets/sortable
|
||||||
//= require jquery-fileupload/basic
|
//= require jquery-fileupload/basic
|
||||||
//= require best_in_place
|
|
||||||
//= require foundation
|
//= require foundation
|
||||||
//= require turbolinks
|
//= require turbolinks
|
||||||
//= require ckeditor/loader
|
//= require ckeditor/loader
|
||||||
@@ -83,7 +82,6 @@
|
|||||||
//= require send_newsletter_alert
|
//= require send_newsletter_alert
|
||||||
//= require managers
|
//= require managers
|
||||||
//= require globalize
|
//= require globalize
|
||||||
//= require best_in_place_initialize
|
|
||||||
//= require send_admin_notification_alert
|
//= require send_admin_notification_alert
|
||||||
//= require settings
|
//= require settings
|
||||||
|
|
||||||
@@ -133,7 +131,6 @@ var initialize_modules = function() {
|
|||||||
App.SendNewsletterAlert.initialize();
|
App.SendNewsletterAlert.initialize();
|
||||||
App.Managers.initialize();
|
App.Managers.initialize();
|
||||||
App.Globalize.initialize();
|
App.Globalize.initialize();
|
||||||
App.BestInPlace.initialize();
|
|
||||||
App.SendAdminNotificationAlert.initialize();
|
App.SendAdminNotificationAlert.initialize();
|
||||||
App.Settings.initialize();
|
App.Settings.initialize();
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
App.BestInPlace =
|
|
||||||
initialize: ->
|
|
||||||
$(".best_in_place").best_in_place()
|
|
||||||
@@ -26,10 +26,10 @@ module MapLocationsHelper
|
|||||||
|
|
||||||
def render_map(map_location, parent_class, editable, remove_marker_label, investments_coordinates=nil)
|
def render_map(map_location, parent_class, editable, remove_marker_label, investments_coordinates=nil)
|
||||||
map_location = MapLocation.new if map_location.nil?
|
map_location = MapLocation.new if map_location.nil?
|
||||||
map = content_tag_for :div,
|
map = content_tag :div, "",
|
||||||
map_location,
|
id: dom_id(map_location),
|
||||||
class: "map",
|
class: "map_location map",
|
||||||
data: prepare_map_settings(map_location, editable, parent_class, investments_coordinates)
|
data: prepare_map_settings(map_location, editable, parent_class, investments_coordinates)
|
||||||
map += map_location_remove_marker(map_location, remove_marker_label) if editable
|
map += map_location_remove_marker(map_location, remove_marker_label) if editable
|
||||||
map
|
map
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class AdministratorTask < ActiveRecord::Base
|
class AdministratorTask < ApplicationRecord
|
||||||
belongs_to :source, polymorphic: true
|
belongs_to :source, polymorphic: true
|
||||||
belongs_to :user
|
belongs_to :user
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class Dashboard::Action < ActiveRecord::Base
|
class Dashboard::Action < ApplicationRecord
|
||||||
include Documentable
|
include Documentable
|
||||||
documentable max_documents_allowed: 3,
|
documentable max_documents_allowed: 3,
|
||||||
max_file_size: 3.megabytes,
|
max_file_size: 3.megabytes,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class Dashboard::AdministratorTask < ActiveRecord::Base
|
class Dashboard::AdministratorTask < ApplicationRecord
|
||||||
belongs_to :source, polymorphic: true
|
belongs_to :source, polymorphic: true
|
||||||
belongs_to :user
|
belongs_to :user
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class Dashboard::ExecutedAction < ActiveRecord::Base
|
class Dashboard::ExecutedAction < ApplicationRecord
|
||||||
belongs_to :proposal
|
belongs_to :proposal
|
||||||
belongs_to :action, class_name: "Dashboard::Action"
|
belongs_to :action, class_name: "Dashboard::Action"
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class Link < ActiveRecord::Base
|
class Link < ApplicationRecord
|
||||||
belongs_to :linkable, polymorphic: true
|
belongs_to :linkable, polymorphic: true
|
||||||
|
|
||||||
validates :label, presence: true
|
validates :label, presence: true
|
||||||
|
|||||||
@@ -24,15 +24,12 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<%= best_in_place poll,
|
<%= form_for poll, remote: true, data: { type: :json },
|
||||||
:results_enabled,
|
url: proposal_dashboard_poll_path(proposal, poll) do |f| %>
|
||||||
as: :checkbox,
|
<%= f.check_box :results_enabled,
|
||||||
url: proposal_dashboard_poll_url(proposal, poll),
|
label: t("dashboard.polls.poll.show_results"),
|
||||||
collection: {
|
class: "js-submit-on-change" %>
|
||||||
false: raw('<input type="checkbox">'),
|
<% end %>
|
||||||
true: raw('<input type="checkbox" checked>')
|
|
||||||
} %>
|
|
||||||
<strong><%= t("dashboard.polls.poll.show_results") %></strong>
|
|
||||||
<p class="help-text"><%= t("dashboard.polls.poll.show_results_help") %></p>
|
<p class="help-text"><%= t("dashboard.polls.poll.show_results_help") %></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -38,9 +38,6 @@ Rails.application.configure do
|
|||||||
}
|
}
|
||||||
config.action_mailer.asset_host = "http://consul.test"
|
config.action_mailer.asset_host = "http://consul.test"
|
||||||
|
|
||||||
# Randomize the order test cases are executed.
|
|
||||||
config.active_support.test_order = :random
|
|
||||||
|
|
||||||
# Print deprecation notices to the stderr.
|
# Print deprecation notices to the stderr.
|
||||||
config.active_support.deprecation = :stderr
|
config.active_support.deprecation = :stderr
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class AddPublishedAtToProposal < ActiveRecord::Migration
|
class AddPublishedAtToProposal < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
add_column :proposals, :published_at, :datetime, null: true
|
add_column :proposals, :published_at, :datetime, null: true
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class CreateProposalDashboardActions < ActiveRecord::Migration
|
class CreateProposalDashboardActions < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
create_table :proposal_dashboard_actions do |t|
|
create_table :proposal_dashboard_actions do |t|
|
||||||
t.string :title, limit: 80
|
t.string :title, limit: 80
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class AddActionTypeToProposalDashboardActions < ActiveRecord::Migration
|
class AddActionTypeToProposalDashboardActions < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
add_column :proposal_dashboard_actions, :action_type, :integer, null: false, default: 0
|
add_column :proposal_dashboard_actions, :action_type, :integer, null: false, default: 0
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class CreateProposalExecutedDashboardActions < ActiveRecord::Migration
|
class CreateProposalExecutedDashboardActions < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
create_table :proposal_executed_dashboard_actions do |t|
|
create_table :proposal_executed_dashboard_actions do |t|
|
||||||
t.references :proposal, index: true, foreign_key: true
|
t.references :proposal, index: true, foreign_key: true
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class CreateAdministratorTasks < ActiveRecord::Migration
|
class CreateAdministratorTasks < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
create_table :administrator_tasks do |t|
|
create_table :administrator_tasks do |t|
|
||||||
t.references :source, polymorphic: true, index: true
|
t.references :source, polymorphic: true, index: true
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class AddRelatedToPolls < ActiveRecord::Migration
|
class AddRelatedToPolls < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
add_reference :polls, :related, index: true, polymorphic: true
|
add_reference :polls, :related, index: true, polymorphic: true
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class AddShortDescriptionToProposalDashboardActions < ActiveRecord::Migration
|
class AddShortDescriptionToProposalDashboardActions < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
add_column :proposal_dashboard_actions, :short_description, :string
|
add_column :proposal_dashboard_actions, :short_description, :string
|
||||||
change_column :proposal_dashboard_actions, :description, :text
|
change_column :proposal_dashboard_actions, :description, :text
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class CreateLinks < ActiveRecord::Migration
|
class CreateLinks < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
create_table :links do |t|
|
create_table :links do |t|
|
||||||
t.string :label
|
t.string :label
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class RemoveCommentsFromProposalExecutedDashboardAction < ActiveRecord::Migration
|
class RemoveCommentsFromProposalExecutedDashboardAction < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
remove_column :proposal_executed_dashboard_actions, :comments, :text
|
remove_column :proposal_executed_dashboard_actions, :comments, :text
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class RenameProposalDashboardActionsToDashboardActions < ActiveRecord::Migration
|
class RenameProposalDashboardActionsToDashboardActions < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
rename_table :proposal_dashboard_actions, :dashboard_actions
|
rename_table :proposal_dashboard_actions, :dashboard_actions
|
||||||
rename_column :proposal_executed_dashboard_actions, :proposal_dashboard_action_id, :dashboard_action_id
|
rename_column :proposal_executed_dashboard_actions, :proposal_dashboard_action_id, :dashboard_action_id
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class RenameProposalExecutedDashboardActionsToDashboardExecutedActions < ActiveRecord::Migration
|
class RenameProposalExecutedDashboardActionsToDashboardExecutedActions < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
rename_table :proposal_executed_dashboard_actions, :dashboard_executed_actions
|
rename_table :proposal_executed_dashboard_actions, :dashboard_executed_actions
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class RenameAdministratorTaskToDashboardAdministratorTask < ActiveRecord::Migration
|
class RenameAdministratorTaskToDashboardAdministratorTask < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
rename_index :administrator_tasks, 'index_administrator_tasks_on_source_type_and_source_id', 'index_dashboard_administrator_tasks_on_source'
|
rename_index :administrator_tasks, 'index_administrator_tasks_on_source_type_and_source_id', 'index_dashboard_administrator_tasks_on_source'
|
||||||
rename_table :administrator_tasks, :dashboard_administrator_tasks
|
rename_table :administrator_tasks, :dashboard_administrator_tasks
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class RenameDashboardActionIdToActionId < ActiveRecord::Migration
|
class RenameDashboardActionIdToActionId < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
rename_column :dashboard_executed_actions, :dashboard_action_id, :action_id
|
rename_column :dashboard_executed_actions, :dashboard_action_id, :action_id
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class AddTimestampsToDashboardActions < ActiveRecord::Migration
|
class AddTimestampsToDashboardActions < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
add_column :dashboard_actions, :created_at, :datetime
|
add_column :dashboard_actions, :created_at, :datetime
|
||||||
add_column :dashboard_actions, :updated_at, :datetime
|
add_column :dashboard_actions, :updated_at, :datetime
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class AddPublishedProposalToDashboardActions < ActiveRecord::Migration
|
class AddPublishedProposalToDashboardActions < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
add_column :dashboard_actions, :published_proposal, :boolean, default: :false
|
add_column :dashboard_actions, :published_proposal, :boolean, default: :false
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class RemoveOpenInNewTabFromLinks < ActiveRecord::Migration
|
class RemoveOpenInNewTabFromLinks < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
remove_column :links, :open_in_new_tab, :boolean
|
remove_column :links, :open_in_new_tab, :boolean
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user