Extract social links to a component
This commit is contained in:
@@ -33,6 +33,7 @@
|
|||||||
@import "tags";
|
@import "tags";
|
||||||
@import "admin/**/*";
|
@import "admin/**/*";
|
||||||
@import "budgets/**/*";
|
@import "budgets/**/*";
|
||||||
|
@import "layout/**/*";
|
||||||
@import "sdg/**/*";
|
@import "sdg/**/*";
|
||||||
@import "sdg_management/*";
|
@import "sdg_management/*";
|
||||||
@import "sdg_management/**/*";
|
@import "sdg_management/**/*";
|
||||||
|
|||||||
@@ -1633,23 +1633,6 @@ table {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.social {
|
|
||||||
|
|
||||||
li {
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
|
|
||||||
a {
|
|
||||||
font-size: rem-calc(24);
|
|
||||||
margin: 0 $line-height / 2;
|
|
||||||
text-decoration: none;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
@include brand-text;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.share-supported {
|
.share-supported {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
||||||
|
|||||||
16
app/assets/stylesheets/layout/social.scss
Normal file
16
app/assets/stylesheets/layout/social.scss
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
.social {
|
||||||
|
|
||||||
|
li {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
font-size: rem-calc(24);
|
||||||
|
margin: 0 $line-height / 2;
|
||||||
|
text-decoration: none;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
@include brand-text;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
52
app/components/layout/social_component.html.erb
Normal file
52
app/components/layout/social_component.html.erb
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
<div class="small-12 medium-4 column social">
|
||||||
|
<div class="text-right">
|
||||||
|
<ul>
|
||||||
|
<% if setting["twitter_handle"] %>
|
||||||
|
<li>
|
||||||
|
<%= link_to "https://twitter.com/#{setting["twitter_handle"]}", target: "_blank",
|
||||||
|
title: t("shared.go_to_page") + t("social.twitter", org: setting["org_name"]) + t("shared.target_blank") do %>
|
||||||
|
<span class="show-for-sr"><%= t("social.twitter", org: setting["org_name"]) %></span>
|
||||||
|
<span class="icon-twitter" aria-hidden="true"></span>
|
||||||
|
<% end %>
|
||||||
|
</li>
|
||||||
|
<% end %>
|
||||||
|
<% if setting["facebook_handle"] %>
|
||||||
|
<li>
|
||||||
|
<%= link_to "https://www.facebook.com/#{setting["facebook_handle"]}/", target: "_blank",
|
||||||
|
title: t("shared.go_to_page") + t("social.facebook", org: setting["org_name"]) + t("shared.target_blank") do %>
|
||||||
|
<span class="show-for-sr"><%= t("social.facebook", org: setting["org_name"]) %></span>
|
||||||
|
<span class="icon-facebook" aria-hidden="true"></span>
|
||||||
|
<% end %>
|
||||||
|
</li>
|
||||||
|
<% end %>
|
||||||
|
<% if setting["youtube_handle"] %>
|
||||||
|
<li>
|
||||||
|
<%= link_to "https://www.youtube.com/#{setting["youtube_handle"]}", target: "_blank",
|
||||||
|
title: t("shared.go_to_page") + t("social.youtube", org: setting["org_name"]) + t("shared.target_blank") do %>
|
||||||
|
<span class="show-for-sr"><%= t("social.youtube", org: setting["org_name"]) %></span>
|
||||||
|
<span class="icon-youtube" aria-hidden="true"></span>
|
||||||
|
<% end %>
|
||||||
|
</li>
|
||||||
|
<% end %>
|
||||||
|
<% if setting["telegram_handle"] %>
|
||||||
|
<li>
|
||||||
|
<%= link_to "https://www.telegram.me/#{setting["telegram_handle"]}", target: "_blank",
|
||||||
|
title: t("shared.go_to_page") + t("social.telegram", org: setting["org_name"]) + t("shared.target_blank") do %>
|
||||||
|
<span class="show-for-sr"><%= t("social.telegram", org: setting["org_name"]) %></span>
|
||||||
|
<span class="icon-telegram" aria-hidden="true"></span>
|
||||||
|
<% end %>
|
||||||
|
</li>
|
||||||
|
<% end %>
|
||||||
|
<% if setting["instagram_handle"] %>
|
||||||
|
<li>
|
||||||
|
<%= link_to "https://www.instagram.com/#{setting["instagram_handle"]}", target: "_blank",
|
||||||
|
title: t("shared.go_to_page") + t("social.instagram", org: setting["org_name"]) + t("shared.target_blank") do %>
|
||||||
|
<span class="show-for-sr"><%= t("social.instagram", org: setting["org_name"]) %></span>
|
||||||
|
<span class="icon-instagram" aria-hidden="true"></span>
|
||||||
|
<% end %>
|
||||||
|
</li>
|
||||||
|
<% end %>
|
||||||
|
<%= raw content_block("footer", I18n.locale) %>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
3
app/components/layout/social_component.rb
Normal file
3
app/components/layout/social_component.rb
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
class Layout::SocialComponent < ApplicationComponent
|
||||||
|
delegate :content_block, to: :helpers
|
||||||
|
end
|
||||||
@@ -31,57 +31,6 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="small-12 medium-4 column social">
|
<%= render Layout::SocialComponent.new %>
|
||||||
<div class="text-right">
|
|
||||||
<ul>
|
|
||||||
<% if setting["twitter_handle"] %>
|
|
||||||
<li>
|
|
||||||
<%= link_to "https://twitter.com/#{setting["twitter_handle"]}", target: "_blank",
|
|
||||||
title: t("shared.go_to_page") + t("social.twitter", org: setting["org_name"]) + t("shared.target_blank") do %>
|
|
||||||
<span class="show-for-sr"><%= t("social.twitter", org: setting["org_name"]) %></span>
|
|
||||||
<span class="icon-twitter" aria-hidden="true"></span>
|
|
||||||
<% end %>
|
|
||||||
</li>
|
|
||||||
<% end %>
|
|
||||||
<% if setting["facebook_handle"] %>
|
|
||||||
<li>
|
|
||||||
<%= link_to "https://www.facebook.com/#{setting["facebook_handle"]}/", target: "_blank",
|
|
||||||
title: t("shared.go_to_page") + t("social.facebook", org: setting["org_name"]) + t("shared.target_blank") do %>
|
|
||||||
<span class="show-for-sr"><%= t("social.facebook", org: setting["org_name"]) %></span>
|
|
||||||
<span class="icon-facebook" aria-hidden="true"></span>
|
|
||||||
<% end %>
|
|
||||||
</li>
|
|
||||||
<% end %>
|
|
||||||
<% if setting["youtube_handle"] %>
|
|
||||||
<li>
|
|
||||||
<%= link_to "https://www.youtube.com/#{setting["youtube_handle"]}", target: "_blank",
|
|
||||||
title: t("shared.go_to_page") + t("social.youtube", org: setting["org_name"]) + t("shared.target_blank") do %>
|
|
||||||
<span class="show-for-sr"><%= t("social.youtube", org: setting["org_name"]) %></span>
|
|
||||||
<span class="icon-youtube" aria-hidden="true"></span>
|
|
||||||
<% end %>
|
|
||||||
</li>
|
|
||||||
<% end %>
|
|
||||||
<% if setting["telegram_handle"] %>
|
|
||||||
<li>
|
|
||||||
<%= link_to "https://www.telegram.me/#{setting["telegram_handle"]}", target: "_blank",
|
|
||||||
title: t("shared.go_to_page") + t("social.telegram", org: setting["org_name"]) + t("shared.target_blank") do %>
|
|
||||||
<span class="show-for-sr"><%= t("social.telegram", org: setting["org_name"]) %></span>
|
|
||||||
<span class="icon-telegram" aria-hidden="true"></span>
|
|
||||||
<% end %>
|
|
||||||
</li>
|
|
||||||
<% end %>
|
|
||||||
<% if setting["instagram_handle"] %>
|
|
||||||
<li>
|
|
||||||
<%= link_to "https://www.instagram.com/#{setting["instagram_handle"]}", target: "_blank",
|
|
||||||
title: t("shared.go_to_page") + t("social.instagram", org: setting["org_name"]) + t("shared.target_blank") do %>
|
|
||||||
<span class="show-for-sr"><%= t("social.instagram", org: setting["org_name"]) %></span>
|
|
||||||
<span class="icon-instagram" aria-hidden="true"></span>
|
|
||||||
<% end %>
|
|
||||||
</li>
|
|
||||||
<% end %>
|
|
||||||
<%= raw content_block("footer", I18n.locale) %>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
Reference in New Issue
Block a user