Add nightmode image (#2640)
This commit is contained in:
parent
6de9515ec0
commit
f0663d83ca
7 changed files with 30 additions and 5 deletions
|
|
@ -1182,9 +1182,13 @@
|
|||
img {
|
||||
border: 0;
|
||||
margin: auto;
|
||||
margin-bottom: 8px;
|
||||
width: 98%;
|
||||
min-height: 35px;
|
||||
border-radius: 8px;
|
||||
&.partner-image-dark-mode {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
.sponsor-tagline {
|
||||
margin: 10px auto;
|
||||
|
|
@ -1616,4 +1620,4 @@
|
|||
);
|
||||
background-size: 800px 104px;
|
||||
position: relative;
|
||||
}
|
||||
}
|
||||
|
|
@ -45,6 +45,12 @@ body.night-theme {
|
|||
border-color: white !important;
|
||||
box-shadow: 3px 3px 0px #fff !important;
|
||||
}
|
||||
.partner-image-dark-mode {
|
||||
display: block !important;
|
||||
}
|
||||
.partner-image-light-mode {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
body.sans-serif-article-body {
|
||||
|
|
@ -65,4 +71,4 @@ body.comic-sans-article-body {
|
|||
font-size: 0.98em;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -15,6 +15,7 @@ class OrganizationDashboard < Administrate::BaseDashboard
|
|||
tag_line: Field::String,
|
||||
profile_image: CarrierwaveField,
|
||||
nav_image: CarrierwaveField,
|
||||
dark_nav_image: CarrierwaveField,
|
||||
url: Field::String,
|
||||
twitter_username: Field::String,
|
||||
github_username: Field::String,
|
||||
|
|
@ -36,7 +37,9 @@ class OrganizationDashboard < Administrate::BaseDashboard
|
|||
cta_body_markdown: Field::Text,
|
||||
sponsorship_url: Field::Text,
|
||||
sponsorship_tagline: Field::Text,
|
||||
is_gold_sponsor: Field::Boolean
|
||||
is_gold_sponsor: Field::Boolean,
|
||||
sponsorship_blurb_html: Field::Text,
|
||||
sponsorship_featured_number: Field::Number
|
||||
}.freeze
|
||||
|
||||
# COLLECTION_ATTRIBUTES
|
||||
|
|
@ -66,6 +69,7 @@ class OrganizationDashboard < Administrate::BaseDashboard
|
|||
tag_line
|
||||
profile_image
|
||||
nav_image
|
||||
dark_nav_image
|
||||
url
|
||||
bg_color_hex
|
||||
text_color_hex
|
||||
|
|
@ -84,7 +88,9 @@ class OrganizationDashboard < Administrate::BaseDashboard
|
|||
cta_body_markdown
|
||||
sponsorship_url
|
||||
sponsorship_tagline
|
||||
sponsorship_blurb_html
|
||||
is_gold_sponsor
|
||||
sponsorship_featured_number
|
||||
].freeze
|
||||
|
||||
def display_resource(organization)
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@ class Organization < ApplicationRecord
|
|||
|
||||
mount_uploader :profile_image, ProfileImageUploader
|
||||
mount_uploader :nav_image, ProfileImageUploader
|
||||
mount_uploader :dark_nav_image, ProfileImageUploader
|
||||
|
||||
alias_attribute :username, :slug
|
||||
alias_attribute :old_username, :old_slug
|
||||
|
|
|
|||
|
|
@ -16,7 +16,8 @@
|
|||
<% @sponsors.each do |organization| %>
|
||||
<div class="sidebar-sponsor">
|
||||
<a class="partner-link" href="<%= organization.sponsorship_url %>" target="_blank" data-details="<%= organization.slug %>__image">
|
||||
<img src="<%= cloudinary(organization.nav_image_url) %>" style="margin-bottom:8px;" alt="Digital Ocean logo" />
|
||||
<img src="<%= cloudinary(organization.nav_image_url) %>" style="margin-bottom:8px;" alt="<%= organization.name %> logo" class="partner-image-light-mode" />
|
||||
<img src="<%= cloudinary(organization.dark_nav_image_url || organization.nav_image_url) %>" style="margin-bottom:8px;" alt="<%= organization.name %> logo" class="partner-image-dark-mode" />
|
||||
</a>
|
||||
<div class="sponsor-tagline" style="display:inline;">
|
||||
<%= organization.sponsorship_tagline %>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,5 @@
|
|||
class AddDarkNavImageToOrganizations < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
add_column :organizations, :dark_nav_image, :string
|
||||
end
|
||||
end
|
||||
|
|
@ -10,7 +10,7 @@
|
|||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 2019_04_30_123156) do
|
||||
ActiveRecord::Schema.define(version: 2019_05_01_180125) do
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
|
||||
|
|
@ -241,6 +241,7 @@ ActiveRecord::Schema.define(version: 2019_04_30_123156) do
|
|||
t.bigint "organization_id"
|
||||
t.text "processed_html"
|
||||
t.boolean "published"
|
||||
t.string "slug"
|
||||
t.string "title"
|
||||
t.datetime "updated_at", null: false
|
||||
t.bigint "user_id"
|
||||
|
|
@ -541,6 +542,7 @@ ActiveRecord::Schema.define(version: 2019_04_30_123156) do
|
|||
t.string "cta_button_text"
|
||||
t.string "cta_button_url"
|
||||
t.text "cta_processed_html"
|
||||
t.string "dark_nav_image"
|
||||
t.string "email"
|
||||
t.string "github_username"
|
||||
t.boolean "is_gold_sponsor", default: false
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue