Remove open in new tab option for links
This commit is contained in:
@@ -57,7 +57,7 @@ class Admin::Dashboard::ActionsController < Admin::Dashboard::BaseController
|
|||||||
:title, :description, :short_description, :request_to_administrators, :day_offset,
|
:title, :description, :short_description, :request_to_administrators, :day_offset,
|
||||||
:required_supports, :order, :active, :action_type, :published_proposal,
|
:required_supports, :order, :active, :action_type, :published_proposal,
|
||||||
documents_attributes: [:id, :title, :attachment, :cached_attachment, :user_id, :_destroy],
|
documents_attributes: [:id, :title, :attachment, :cached_attachment, :user_id, :_destroy],
|
||||||
links_attributes: [:id, :label, :url, :open_in_new_tab, :_destroy]
|
links_attributes: [:id, :label, :url, :_destroy]
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -13,11 +13,7 @@
|
|||||||
<div class="margin-top">
|
<div class="margin-top">
|
||||||
<h4><%= t("dashboard.new_request.links") %></h4>
|
<h4><%= t("dashboard.new_request.links") %></h4>
|
||||||
<% dashboard_action.links.each do |link| %>
|
<% dashboard_action.links.each do |link| %>
|
||||||
<% if link.open_in_new_tab %>
|
<p><%= link_to link.label, link.url, target: "_blank" %></p>
|
||||||
<p><%= link_to link.label, link.url, target: "_blank" %></p>
|
|
||||||
<% else %>
|
|
||||||
<p><%= link_to link.label, link.url %></p>
|
|
||||||
<% end %>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -354,7 +354,6 @@ en:
|
|||||||
link:
|
link:
|
||||||
label: Title
|
label: Title
|
||||||
url: Link
|
url: Link
|
||||||
open_in_new_tab: Open in new tab
|
|
||||||
errors:
|
errors:
|
||||||
models:
|
models:
|
||||||
user:
|
user:
|
||||||
|
|||||||
@@ -355,7 +355,6 @@ es:
|
|||||||
link:
|
link:
|
||||||
label: Título
|
label: Título
|
||||||
url: Enlace
|
url: Enlace
|
||||||
open_in_new_tab: Abrir en ventana nueva
|
|
||||||
errors:
|
errors:
|
||||||
models:
|
models:
|
||||||
user:
|
user:
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
class RemoveOpenInNewTabFromLinks < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
remove_column :links, :open_in_new_tab, :boolean
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
#
|
#
|
||||||
# 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: 20190205131722) do
|
ActiveRecord::Schema.define(version: 20190411090023) 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
|
||||||
enable_extension "plpgsql"
|
enable_extension "plpgsql"
|
||||||
@@ -804,7 +804,6 @@ ActiveRecord::Schema.define(version: 20190205131722) do
|
|||||||
create_table "links", force: :cascade do |t|
|
create_table "links", force: :cascade do |t|
|
||||||
t.string "label"
|
t.string "label"
|
||||||
t.string "url"
|
t.string "url"
|
||||||
t.boolean "open_in_new_tab"
|
|
||||||
t.string "linkable_type"
|
t.string "linkable_type"
|
||||||
t.integer "linkable_id"
|
t.integer "linkable_id"
|
||||||
t.datetime "created_at", null: false
|
t.datetime "created_at", null: false
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ namespace :proposal_actions do
|
|||||||
Link.create!(
|
Link.create!(
|
||||||
label: action.title,
|
label: action.title,
|
||||||
url: action.link,
|
url: action.link,
|
||||||
open_in_new_tab: true,
|
|
||||||
linkable: action
|
linkable: action
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -174,10 +174,5 @@ FactoryBot.define do
|
|||||||
linkable { |s| s.association(:action) }
|
linkable { |s| s.association(:action) }
|
||||||
label { Faker::Lorem.sentence }
|
label { Faker::Lorem.sentence }
|
||||||
url { Faker::Internet.url }
|
url { Faker::Internet.url }
|
||||||
open_in_new_tab false
|
|
||||||
|
|
||||||
trait :open_in_new_tab do
|
|
||||||
open_in_new_tab true
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user