adds consistency on social media filenames

This commit is contained in:
decabeza
2017-07-18 11:40:19 +02:00
parent f73c0a700a
commit 2844c03e43
11 changed files with 11 additions and 8 deletions

View File

@@ -53,7 +53,8 @@ If you want to overwrite any image, firstly you need to findout the filename, an
* logo_email.png * logo_email.png
* logo_header.png * logo_header.png
* map.jpg * map.jpg
* social-media-icon.png * social_media_icon.png
* social_media_icon_twitter.png
### Views (HTML) ### Views (HTML)

View File

@@ -53,7 +53,8 @@ Si quieres sobreescribir alguna imagen debes primero fijarte el nombre que tiene
* logo_email.png * logo_email.png
* logo_header.png * logo_header.png
* map.jpg * map.jpg
* social-media-icon.png * social_media_icon.png
* social_media_icon_twitter.png
### Vistas (HTML) ### Vistas (HTML)

View File

@@ -2,7 +2,8 @@ class SiteCustomization::Image < ActiveRecord::Base
VALID_IMAGES = { VALID_IMAGES = {
"icon_home" => [330, 240], "icon_home" => [330, 240],
"logo_header" => [80, 80], "logo_header" => [80, 80],
"social-media-icon" => [200, 200], "social_media_icon" => [470, 246],
"social_media_icon_twitter" => [246, 246],
"apple-touch-icon-200" => [200, 200] "apple-touch-icon-200" => [200, 200]
} }

View File

@@ -3,7 +3,7 @@
<meta name="twitter:site" content="@consul_dev" /> <meta name="twitter:site" content="@consul_dev" />
<meta name="twitter:title" content="<%= social_title %>" /> <meta name="twitter:title" content="<%= social_title %>" />
<meta name="twitter:description" content="<%= social_description %>" /> <meta name="twitter:description" content="<%= social_description %>" />
<meta name="twitter:image" content="<%= image_url local_assigns[:twitter_image_url] || image_path_for('social-media-icon.png') %>" /> <meta name="twitter:image" content="<%= image_url local_assigns[:twitter_image_url] || image_path_for('social_media_icon_twitter.png') %>" />
<!-- Facebook OG --> <!-- Facebook OG -->
<meta id="ogtitle" property="og:title" content="<%= social_title %>"/> <meta id="ogtitle" property="og:title" content="<%= social_title %>"/>
<% if setting['url'] %> <% if setting['url'] %>
@@ -14,7 +14,7 @@
<% end %> <% end %>
<meta property="og:type" content="article"/> <meta property="og:type" content="article"/>
<meta id="ogurl" property="og:url" content="<%= social_url %>"/> <meta id="ogurl" property="og:url" content="<%= social_url %>"/>
<meta id="ogimage" property="og:image" content="<%= image_url local_assigns[:og_image_url] || image_path_for('social-media-icon.png') %>"/> <meta id="ogimage" property="og:image" content="<%= image_url local_assigns[:og_image_url] || image_path_for('social_media_icon.png') %>"/>
<meta property="og:site_name" content="<%= setting['org_name'] %>"/> <meta property="og:site_name" content="<%= setting['org_name'] %>"/>
<meta id="ogdescription" property="og:description" content="<%= social_description %>"/> <meta id="ogdescription" property="og:description" content="<%= social_description %>"/>
<meta property="fb:app_id" content="<%= Rails.application.secrets.facebook_key %>"/> <meta property="fb:app_id" content="<%= Rails.application.secrets.facebook_key %>"/>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@@ -47,16 +47,16 @@ feature "Admin custom images" do
end end
within("tr.social-media-icon") do within("tr.social-media-icon") do
attach_file "site_customization_image_image", "spec/fixtures/files/social-media-icon.png" attach_file "site_customization_image_image", "spec/fixtures/files/social_media_icon.png"
click_button "Update" click_button "Update"
end end
expect(page).to have_css("img[src*='social-media-icon.png']") expect(page).to have_css("img[src*='social_media_icon.png']")
within("tr.social-media-icon") do within("tr.social-media-icon") do
click_link "Delete" click_link "Delete"
end end
expect(page).to_not have_css("img[src*='social-media-icon.png']") expect(page).to_not have_css("img[src*='social_media_icon.png']")
end end
end end

Binary file not shown.

Before

Width:  |  Height:  |  Size: 463 B

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB