From 586703f9b7245ffe781aa89d54262001d580f00d Mon Sep 17 00:00:00 2001 From: Ridhwana Date: Wed, 15 Apr 2020 03:30:13 +0200 Subject: [PATCH] [deploy] Cleanup some more dev.to generalisation (#7263) * feat: rename ApplicationConfig[COMMUNITY_NAME] to just community_name * refactor: use the method name defined in the file * chore: use community name on the information template * refactor: move the social media links into a partial * chore: reuse the css * chore: update the partners page * chore: make the code-of conduct DEV related vars dynamic * feat: update the code of conduct * feat: first pass at the editor guide * feat: update more templates (maybe this one should go?) * feat: update the tags page * feat: set configurable email * feat: article urls updated to be dynamic * feat: add comment * feat: update rss guide to use local dev * chore: revert hashtag as it will come from https://github.com/thepracticaldev/dev.to/issues/7254 * chore: string interpolation * feat: add the code for the svg resizing on the information page. --- app/assets/stylesheets/minimal.scss | 1 + app/assets/stylesheets/social_media.scss | 9 ++ app/assets/stylesheets/widgets.scss | 4 - app/helpers/application_helper.rb | 4 +- app/views/articles/_actions.html.erb | 12 +-- app/views/articles/_sidebar.html.erb | 10 +-- .../articles/_sidebar_additional.html.erb | 2 +- app/views/articles/_sticky_nav.html.erb | 2 +- app/views/articles/index.html.erb | 2 +- app/views/articles/tag_index.html.erb | 2 +- .../chat_channel_memberships/edit.html.erb | 2 +- app/views/classified_listings/_form.html.erb | 2 +- app/views/comments/_comment_proper.html.erb | 2 +- .../comments/_login_cta_comment.html.erb | 2 +- .../registrations/_registration_form.html.erb | 2 +- app/views/layouts/_nav_menu.html.erb | 2 +- app/views/layouts/_social_media.html.erb | 11 +++ app/views/layouts/_top_bar.html.erb | 4 +- .../channel_invite_email.html.erb | 6 +- .../channel_invite_email.text.erb | 2 +- app/views/pages/_coc_text.html.erb | 86 +++++++++---------- app/views/pages/_editor_guide_text.html.erb | 16 ++-- .../_publishing_from_rss_guide_text.html.erb | 2 +- app/views/pages/code_of_conduct.html.erb | 12 +-- app/views/pages/information.html.erb | 16 +--- app/views/pages/sponsors.html.erb | 4 +- app/views/stories/_narrow_nav_menu.html.erb | 2 +- app/views/tags/index.html.erb | 8 +- 28 files changed, 113 insertions(+), 116 deletions(-) create mode 100644 app/assets/stylesheets/social_media.scss create mode 100644 app/views/layouts/_social_media.html.erb diff --git a/app/assets/stylesheets/minimal.scss b/app/assets/stylesheets/minimal.scss index ae18e8ab6..96638a4f6 100644 --- a/app/assets/stylesheets/minimal.scss +++ b/app/assets/stylesheets/minimal.scss @@ -37,6 +37,7 @@ @import 'typography'; @import 'buttons'; @import 'widgets'; +@import 'social_media'; @import 'ltags/LiquidTags'; diff --git a/app/assets/stylesheets/social_media.scss b/app/assets/stylesheets/social_media.scss new file mode 100644 index 000000000..8c38661e0 --- /dev/null +++ b/app/assets/stylesheets/social_media.scss @@ -0,0 +1,9 @@ +.social-media-link { + color: var(--card-secondary-color); + margin-right: 8px; +} + +.social-links .social-media-svg { + width: 35px; + height: 35px; +} diff --git a/app/assets/stylesheets/widgets.scss b/app/assets/stylesheets/widgets.scss index 0907e3e62..2a0675a36 100644 --- a/app/assets/stylesheets/widgets.scss +++ b/app/assets/stylesheets/widgets.scss @@ -369,10 +369,6 @@ opacity: 0.9; } } - .social-icons a { - color: var(--card-secondary-color); - margin-right: 8px; - } .row { position: relative; overflow: hidden; diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index d31444d7f..4328f02ce 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -18,10 +18,10 @@ module ApplicationHelper end def title(page_title) - derived_title = if page_title.include?(ApplicationConfig["COMMUNITY_NAME"]) + derived_title = if page_title.include?(community_name) page_title else - page_title + " - #{ApplicationConfig['COMMUNITY_NAME']} Community 👩‍💻👨‍💻" + "#{page_title} - #{community_qualified_name} 👩‍💻👨‍💻" end content_for(:title) { derived_title } derived_title diff --git a/app/views/articles/_actions.html.erb b/app/views/articles/_actions.html.erb index ba453c7dc..a4895f574 100644 --- a/app/views/articles/_actions.html.erb +++ b/app/views/articles/_actions.html.erb @@ -68,12 +68,12 @@ - + @@ -81,7 +81,7 @@ + href="https://www.linkedin.com/shareArticle?mini=true&url=<%= article_url(@article) %>&title=<%= @article.title %>&summary=<%= @article.description %>&source=<%= community_name %>"> Share to LinkedIn @@ -89,7 +89,7 @@ + href="https://www.reddit.com/submit?url=<%= article_url(@article) %>&title=<%= @article.title %>"> Share to Reddit @@ -97,7 +97,7 @@ + href="https://news.ycombinator.com/submitlink?u=<%= article_url(@article) %>&t=<%= @article.title %>"> Share to Hacker News @@ -105,7 +105,7 @@ + href="https://www.facebook.com/sharer.php?u=<%= article_url(@article) %>"> Share to Facebook diff --git a/app/views/articles/_sidebar.html.erb b/app/views/articles/_sidebar.html.erb index 0bbf00110..fe4ca1784 100644 --- a/app/views/articles/_sidebar.html.erb +++ b/app/views/articles/_sidebar.html.erb @@ -29,19 +29,13 @@

Key links

- Welcome to <%= ApplicationConfig["COMMUNITY_NAME"] %> + Welcome to <%= community_name %>

Sign in below to compose your post and share it with the community. diff --git a/app/views/layouts/_nav_menu.html.erb b/app/views/layouts/_nav_menu.html.erb index 3fca78def..a7981a749 100644 --- a/app/views/layouts/_nav_menu.html.erb +++ b/app/views/layouts/_nav_menu.html.erb @@ -23,7 +23,7 @@ <% end %>

<% end %> diff --git a/app/views/layouts/_social_media.html.erb b/app/views/layouts/_social_media.html.erb new file mode 100644 index 000000000..48c9ab7ec --- /dev/null +++ b/app/views/layouts/_social_media.html.erb @@ -0,0 +1,11 @@ +<% SiteConfig.social_media_handles.keys.each do |social_media_type| %> + <% if SiteConfig.social_media_handles[social_media_type].present? %> + " + target="_blank" + class="social-media-link" + rel="noopener"> + <%= inline_svg_tag("#{social_media_type}.svg", aria: true, title: social_media_type.capitalize, class: "crayons-icon social-media-svg") %> + + <% end %> +<% end %> diff --git a/app/views/layouts/_top_bar.html.erb b/app/views/layouts/_top_bar.html.erb index 5d31c40cd..c753f32ef 100644 --- a/app/views/layouts/_top_bar.html.erb +++ b/app/views/layouts/_top_bar.html.erb @@ -3,7 +3,7 @@
Skip to content
- +