forked from decidim/decidim
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added short link on share modal * Fixed tests * Small fix * Insert short_link dependency * Revert helpers * Apply review recommendations * Fix pipeline * Rubocops * Apply review recommendation --------- Co-authored-by: Alexandru Emil Lupu <[email protected]>
- Loading branch information
1 parent
061a4ac
commit e82bb6a
Showing
18 changed files
with
98 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<%= decidim_modal id: "socialShare", class: "share-modal" do %> | ||
<div data-dialog-container> | ||
<%= icon "share-line" %> | ||
<h2 id="dialog-title-socialShare" tabindex="-1" data-dialog-title><%= t("share", scope: "decidim.shared.share_modal") %></h2> | ||
<div> | ||
<%= social_share_button_tag(decidim_page_title, | ||
url: decidim_meta_url, | ||
image: decidim_meta_image_url, | ||
desc: decidim_html_escape(decidim_meta_description || ""), | ||
via: decidim_meta_twitter_handler) %> | ||
|
||
<div class="share-modal__input"> | ||
<input id="urlShareLink" type="text" title="<%= t("share_link" , scope: "decidim.shared.share_modal") %>" value="<%= resource_name ? short_url(route_name: resource_name, params:) : decidim_meta_url %>" readonly> | ||
<button type="button" | ||
class="button button__sm button__text-secondary" | ||
data-clipboard-copy="#urlShareLink" | ||
data-clipboard-copy-label="<%= t("copy_share_link_copied", scope: "decidim.shared.share_modal") %>" | ||
data-clipboard-copy-message="<%= t("copy_share_link_message", scope: "decidim.shared.share_modal") %>" | ||
title="<%= t("copy_share_link_clarification", scope: "decidim.shared.share_modal") %>"> | ||
<span><%= t("copy_share_link", scope: "decidim.shared.share_modal") %></span> | ||
<%= icon "file-copy-line" %> | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<%= cell("decidim/share_button", model) %> | ||
<%= render :modal %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# frozen_string_literal: true | ||
|
||
module Decidim | ||
class ShareWidgetCell < Decidim::ViewModel | ||
include Decidim::ShortLinkHelper | ||
include Decidim::SocialShareButtonHelper | ||
|
||
def show | ||
render | ||
end | ||
|
||
private | ||
|
||
def resource_name | ||
return "budget_project" if model.is_a?(Decidim::Budgets::Project) | ||
|
||
model.class.name.demodulize.underscore | ||
end | ||
end | ||
end |
26 changes: 0 additions & 26 deletions
26
decidim-core/app/views/decidim/shared/_share_modal.html.erb
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
decidim-design/app/views/decidim/design/components/share.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
<% add_decidim_page_title(t(".title")) %> | ||
<% content_for :heading do %> | ||
<%= t(".title") %> | ||
<% end %> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters