Open proposals dashboard links in the same window
Out of the usability issues I've experienced when using Consul Democracy, the biggest one has arguably been the fact that the link to edit a proposal opens in a new tab. I guess the reasoning behind it is that the page to edit a proposal is not part of the proposals dashboard, but what the hell! Imagine if every link to edit something opened in a new tab... So we're reducing the impact of this nonsense by opening most dashboard links in the same window; for now, we're still opening in a new window links to download files and links that might point to external websites. We'll address those ones in the future.
This commit is contained in:
@@ -4,8 +4,7 @@
|
||||
<div class="small-12 medium-9 column">
|
||||
<%= link_to t("dashboard.community.access_community"),
|
||||
community_path(proposal.community),
|
||||
class: "button hollow",
|
||||
target: "_blank" %>
|
||||
class: "button hollow" %>
|
||||
<% if proposal.community.latest_activity.present? %>
|
||||
<p class="help-text">
|
||||
<%= t("dashboard.community.latest_activity",
|
||||
|
||||
@@ -33,8 +33,7 @@
|
||||
border-radius: 6px; color: #fff !important; font-weight: bold;
|
||||
padding: 17px 20px; text-align: center; text-decoration: none;
|
||||
font-size: 20px; min-width: 200px; display: inline-block;
|
||||
box-shadow: -4px 18px 45px -19px rgba(0,0,0,0.75);",
|
||||
target: "_blank" do %>
|
||||
box-shadow: -4px 18px 45px -19px rgba(0,0,0,0.75);" do %>
|
||||
<%= t("dashboard.mailer.forward.support_button") %>
|
||||
<% end %>
|
||||
</td>
|
||||
|
||||
@@ -35,8 +35,7 @@
|
||||
style: "font-family: 'Open Sans',arial,sans-serif; background: #3700fd;
|
||||
border-radius: 6px; color: #fff !important; font-weight: bold;
|
||||
padding: 17px 20px; text-align: center; text-decoration: none;
|
||||
font-size: 20px; min-width: 200px; display: inline-block;",
|
||||
target: "_blank" do %>
|
||||
font-size: 20px; min-width: 200px; display: inline-block;" do %>
|
||||
<%= t("mailers.new_actions_notification_on_create.dashboard_button") %>
|
||||
<% end %>
|
||||
</td>
|
||||
|
||||
@@ -52,8 +52,7 @@
|
||||
style: "font-family: 'Open Sans',arial,sans-serif; background: #3700fd;" \
|
||||
"border-radius: 6px; color: #fff !important; font-weight: bold;" \
|
||||
"padding: 17px 20px; text-align: center; text-decoration: none;" \
|
||||
"font-size: 20px; min-width: 200px; display: inline-block;",
|
||||
target: "_blank" do %>
|
||||
"font-size: 20px; min-width: 200px; display: inline-block;" do %>
|
||||
<%= t("mailers.new_actions_notification_on_published.dashboard_button") %>
|
||||
<% end %>
|
||||
</td>
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
<div id="<%= dom_id(poll) %>" class="small-12 medium-6 large-4 column end">
|
||||
<div class="poll-card" data-equalizer-watch="poll-cards">
|
||||
<h4>
|
||||
<%= link_to poll.title,
|
||||
proposal_poll_path(proposal, poll),
|
||||
target: "_blank" %>
|
||||
</h4>
|
||||
<h4><%= link_to poll.title, proposal_poll_path(proposal, poll) %></h4>
|
||||
<span class="small">
|
||||
<%= l(poll.starts_at.to_date) %> - <%= l(poll.ends_at.to_date) %>
|
||||
</span>
|
||||
@@ -20,7 +16,7 @@
|
||||
<% else %>
|
||||
<%= link_to t("dashboard.polls.poll.view_results"),
|
||||
results_proposal_poll_path(proposal, poll),
|
||||
class: "button", target: "_blank" %>
|
||||
class: "button" %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -3,15 +3,13 @@
|
||||
<% if current_editable?(proposal) %>
|
||||
<%= link_to t("dashboard.index.edit_proposal_link"),
|
||||
edit_proposal_path(proposal),
|
||||
target: "_blank",
|
||||
class: "button hollow" %>
|
||||
<% end %>
|
||||
|
||||
<% unless proposal.retired? %>
|
||||
<%= link_to t("dashboard.index.retire"),
|
||||
retire_form_proposal_path(proposal),
|
||||
class: "button hollow alert",
|
||||
target: "_blank" %>
|
||||
class: "button hollow alert" %>
|
||||
<% end %>
|
||||
|
||||
<% if can?(:publish, proposal) %>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<h3 class="proposal-title">
|
||||
<%= link_to proposal.title, proposal, target: "_blank" %>
|
||||
<%= link_to proposal.title, proposal %>
|
||||
</h3>
|
||||
|
||||
<% if proposal.retired? %>
|
||||
|
||||
@@ -47,9 +47,9 @@
|
||||
<div class="small-12 column">
|
||||
<div class="proposal-link">
|
||||
<% if proposal.draft? %>
|
||||
<%= link_to t("layouts.dashboard.proposal_totals.preview_proposal"), proposal_path(proposal), class: "button success expanded", target: "_blank" %>
|
||||
<%= link_to t("layouts.dashboard.proposal_totals.preview_proposal"), proposal_path(proposal), class: "button success expanded" %>
|
||||
<% else %>
|
||||
<%= link_to t("layouts.dashboard.proposal_totals.show_proposal"), proposal_path(proposal), class: "button success expanded", target: "_blank" %>
|
||||
<%= link_to t("layouts.dashboard.proposal_totals.show_proposal"), proposal_path(proposal), class: "button success expanded" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -256,10 +256,10 @@ describe "Polls" do
|
||||
|
||||
visit proposal_dashboard_polls_path(proposal)
|
||||
|
||||
within_window(window_opened_by { click_link "View results" }) do
|
||||
click_link "View results"
|
||||
|
||||
expect(page).to have_current_path(results_proposal_poll_path(proposal, poll))
|
||||
end
|
||||
end
|
||||
|
||||
scenario "Enable and disable results" do
|
||||
create(:poll, related: proposal)
|
||||
|
||||
@@ -423,10 +423,10 @@ describe "Proposals" do
|
||||
click_link "Dashboard"
|
||||
click_link "Edit my proposal"
|
||||
|
||||
within_window(window_opened_by { click_link "Edit proposal" }) do
|
||||
click_link "Edit proposal"
|
||||
|
||||
expect(page).to have_field "Full name of the person submitting the proposal", with: "Isabel Garcia"
|
||||
end
|
||||
end
|
||||
|
||||
scenario "Responsible name field is not shown for verified users" do
|
||||
author = create(:user, :level_two)
|
||||
@@ -628,7 +628,8 @@ describe "Proposals" do
|
||||
click_link "Edit my proposal"
|
||||
end
|
||||
|
||||
within_window(window_opened_by { click_link "Withdraw proposal" }) do
|
||||
click_link "Withdraw proposal"
|
||||
|
||||
expect(page).to have_current_path(retire_form_proposal_path(proposal))
|
||||
|
||||
select "Duplicated", from: "proposal_retired_reason"
|
||||
@@ -636,7 +637,6 @@ describe "Proposals" do
|
||||
click_button "Withdraw proposal"
|
||||
|
||||
expect(page).to have_content "The proposal has been withdrawn"
|
||||
end
|
||||
|
||||
visit proposal_path(proposal)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user