Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logo and favicon from Carrierwave #1672

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions app/models/app_settings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,17 @@

# RailsSettings Model
class AppSettings < RailsSettings::CachedSettings

def self.get_logo
@logo = Logo.new
@logo.file.retrieve_from_store!(File.basename(AppSettings['design.header_logo']))
@logo.file
end

def self.get_favicon
@icon = Logo.new
@icon.file.retrieve_from_store!(File.basename(AppSettings['design.favicon']))
@icon.file
end

end
8 changes: 4 additions & 4 deletions app/themes/flat/views/layouts/_head.html.erb
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<!-- <title><%= @title_tag || AppSettings['settings.site_name'] %></title> -->
<title><%= content_for(:title) ? content_for(:title) : AppSettings['settings.site_name'] %></title>
<!--
<!--
HELPY VERSION: <%= APP_VERSION %>
========================================
Copyright (c) <%= Time.now.year %> Helpy.io, LLC, and Contributors.
Full license at https://github.com/helpyio/helpy/blob/master/LICENSE

Note: If this install is running Helpy Cloud, Bot, Pro, Chat or other
commercial or third party extensions those may be licensed differently.
Note: If this install is running Helpy Cloud, Bot, Pro, Chat or other
commercial or third party extensions those may be licensed differently.
See https://support.helpy.io for more information.

REMOVAL OF THIS COPYRIGHT NOTICE IS EXPRESSLY PROHIBITED BY THE ABOVE
Expand All @@ -34,7 +34,7 @@ REFERENCED LICENSE
<link href='//fonts.googleapis.com/css?family=Raleway:400,700|Droid+Serif:400,700' rel='stylesheet' type='text/css'>

<%= csrf_meta_tags %>
<%= favicon_link_tag "#{AppSettings['design.favicon']}" %>
<%= favicon_link_tag AppSettings.get_favicon %>
<%= cloudinary_js_config %>

<%= render 'layouts/google_analytics' %>
Expand Down
2 changes: 1 addition & 1 deletion app/themes/flat/views/layouts/_header.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

<div id="header-wrapper">
<%= nav_bar brand: image_tag("#{AppSettings['design.header_logo']}", width: 40, class: "pull-left logo") + "#{AppSettings['settings.product_name'] + " " if AppSettings['settings.product_name']}" "#{AppSettings['settings.site_name']}", responsive: true do %>
<%= nav_bar brand: image_tag("#{AppSettings.get_logo}", width: 40, class: "pull-left logo") + "#{AppSettings['settings.product_name'] + " " if AppSettings['settings.product_name']}" "#{AppSettings['settings.site_name']}", responsive: true do %>
<%= menu_group pull: :right do %>
<span class="hidden-lg hidden-sm hidden-md"><%= render('result/search_form') %></span>
<%= menu_divider %>
Expand Down
2 changes: 1 addition & 1 deletion app/themes/flat/views/layouts/clean.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<div class="container">
<div class="row">
<div class="col-md-3 col-sm-3 col-xs-8 text-left">
<%= link_to image_tag("#{AppSettings['design.header_logo']}", width: 40, class: "pull-left logo") + "#{AppSettings['settings.product_name'] + " " if AppSettings['settings.product_name']}" "#{AppSettings['settings.site_name']}", root_path, class: 'navbar-brand', responsive: true %>
<%= link_to image_tag(AppSettings.get_logo, width: 40, class: "pull-left logo") + "#{AppSettings['settings.product_name'] + " " if AppSettings['settings.product_name']}" "#{AppSettings['settings.site_name']}", root_path, class: 'navbar-brand', responsive: true %>
</div>
<div class="col-lg-9 col-md-9 col-sm-9 col-xs-4 text-right">
<ul class="list-inline" data-hook="header-mini-nav">
Expand Down
2 changes: 1 addition & 1 deletion app/themes/flat/views/layouts/flat.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<div class="container">
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-10 text-left">
<%= link_to image_tag("#{AppSettings['design.header_logo']}", width: 40, class: "pull-left logo") + "#{AppSettings['settings.product_name'] + " " if AppSettings['settings.product_name']}" "#{AppSettings['settings.site_name']}", root_path, class: 'navbar-brand', responsive: true %>
<%= link_to image_tag(AppSettings.get_logo, width: 40, class: "pull-left logo") + "#{AppSettings['settings.product_name'] + " " if AppSettings['settings.product_name']}" "#{AppSettings['settings.site_name']}", root_path, class: 'navbar-brand', responsive: true %>
</div>
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-2 text-right">
<ul class="list-inline" data-hook="header-mini-nav">
Expand Down
8 changes: 4 additions & 4 deletions app/themes/light/views/layouts/_head.html.erb
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<!-- <title><%= @title_tag || AppSettings['settings.site_name'] %></title> -->
<title><%= content_for(:title) ? content_for(:title) : AppSettings['settings.site_name'] %></title>
<!--
<!--
HELPY VERSION: <%= APP_VERSION %>
========================================
Copyright (c) <%= Time.now.year %> Helpy.io, LLC, and Contributors.
Full license at https://github.com/helpyio/helpy/blob/master/LICENSE

Note: If this install is running Helpy Cloud, Bot, Pro, Chat or other
commercial or third party extensions those may be licensed differently.
Note: If this install is running Helpy Cloud, Bot, Pro, Chat or other
commercial or third party extensions those may be licensed differently.
See https://support.helpy.io for more information.

REMOVAL OF THIS COPYRIGHT NOTICE IS EXPRESSLY PROHIBITED BY THE ABOVE
Expand All @@ -34,7 +34,7 @@ REFERENCED LICENSE
<link href='//fonts.googleapis.com/css?family=Raleway:400,700|Droid+Serif:400,700' rel='stylesheet' type='text/css'>

<%= csrf_meta_tags %>
<%= favicon_link_tag "#{AppSettings['design.favicon']}" %>
<%= favicon_link_tag AppSettings.get_favicon %>
<%= cloudinary_js_config %>

<%= render 'layouts/google_analytics' %>
Expand Down
2 changes: 1 addition & 1 deletion app/themes/light/views/layouts/_header.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

<div id="header-wrapper">
<%= nav_bar brand: image_tag("#{AppSettings['design.header_logo']}", width: 40, class: "pull-left logo") + "#{AppSettings['settings.product_name'] + " " if AppSettings['settings.product_name']}" "#{AppSettings['settings.site_name']}", responsive: true do %>
<%= nav_bar brand: image_tag(AppSettings.get_logo, width: 40, class: "pull-left logo") + "#{AppSettings['settings.product_name'] + " " if AppSettings['settings.product_name']}" "#{AppSettings['settings.site_name']}", responsive: true do %>
<%= menu_group pull: :right do %>
<span class="hidden-lg hidden-sm hidden-md"><%= render('result/search_form') %></span>
<%= menu_divider %>
Expand Down
2 changes: 1 addition & 1 deletion app/themes/light/views/layouts/clean.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<div class="container">
<div class="row">
<div class="col-md-3 col-sm-3 col-xs-8 text-left">
<%= link_to image_tag("#{AppSettings['design.header_logo']}", width: 40, class: "pull-left logo") + "#{AppSettings['settings.product_name'] + " " if AppSettings['settings.product_name']}" "#{AppSettings['settings.site_name']}", root_path, class: 'navbar-brand', responsive: true %>
<%= link_to image_tag(AppSettings.get_logo, width: 40, class: "pull-left logo") + "#{AppSettings['settings.product_name'] + " " if AppSettings['settings.product_name']}" "#{AppSettings['settings.site_name']}", root_path, class: 'navbar-brand', responsive: true %>
</div>
<div class="col-lg-9 col-md-9 col-sm-9 col-xs-4 text-right">
<ul class="list-inline" data-hook="header-mini-nav">
Expand Down
2 changes: 1 addition & 1 deletion app/themes/light/views/layouts/light.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<div class="container">
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-10 text-left">
<%= link_to image_tag("#{AppSettings['design.header_logo']}", width: 40, class: "pull-left logo") + "#{AppSettings['settings.product_name'] + " " if AppSettings['settings.product_name']}" "#{AppSettings['settings.site_name']}", root_path, class: 'navbar-brand', responsive: true %>
<%= link_to image_tag(AppSettings.get_logo, width: 40, class: "pull-left logo") + "#{AppSettings['settings.product_name'] + " " if AppSettings['settings.product_name']}" "#{AppSettings['settings.site_name']}", root_path, class: 'navbar-brand', responsive: true %>
</div>
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-2 text-right">
<ul class="list-inline" data-hook="header-mini-nav">
Expand Down
8 changes: 4 additions & 4 deletions app/themes/nordic/views/layouts/_head.html.erb
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<!-- <title><%= @title_tag || AppSettings['settings.site_name'] %></title> -->
<title><%= content_for(:title) ? content_for(:title) : AppSettings['settings.site_name'] %></title>
<!--
<!--
HELPY VERSION: <%= APP_VERSION %>
========================================
Copyright (c) <%= Time.now.year %> Helpy.io, LLC, and Contributors.
Full license at https://github.com/helpyio/helpy/blob/master/LICENSE

Note: If this install is running Helpy Cloud, Bot, Pro, Chat or other
commercial or third party extensions those may be licensed differently.
Note: If this install is running Helpy Cloud, Bot, Pro, Chat or other
commercial or third party extensions those may be licensed differently.
See https://support.helpy.io for more information.

REMOVAL OF THIS COPYRIGHT NOTICE IS EXPRESSLY PROHIBITED BY THE ABOVE
Expand All @@ -34,7 +34,7 @@ REFERENCED LICENSE
<link href="https://fonts.googleapis.com/css?family=Inconsolata|Libre+Franklin:300,300i,600,600i" rel="stylesheet">

<%= csrf_meta_tags %>
<%= favicon_link_tag "#{AppSettings['design.favicon']}" %>
<%= favicon_link_tag AppSettings.get_favicon %>
<%= cloudinary_js_config %>

<%= render 'layouts/google_analytics' %>
Expand Down
2 changes: 1 addition & 1 deletion app/themes/nordic/views/layouts/_header.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

<div id="header-wrapper">
<%= nav_bar brand: image_tag("#{AppSettings['design.header_logo']}", width: 40, class: "pull-left logo") + "#{AppSettings['settings.product_name'] + " " if AppSettings['settings.product_name']}" "#{AppSettings['settings.site_name']}", responsive: true do %>
<%= nav_bar brand: image_tag(AppSettings.get_logo, width: 40, class: "pull-left logo") + "#{AppSettings['settings.product_name'] + " " if AppSettings['settings.product_name']}" "#{AppSettings['settings.site_name']}", responsive: true do %>
<%= menu_group pull: :right do %>
<span class="hidden-lg hidden-sm hidden-md"><%= render('result/search_form') %></span>
<%= menu_divider %>
Expand Down
2 changes: 1 addition & 1 deletion app/themes/nordic/views/layouts/clean.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<div class="container">
<div class="row">
<div class="col-md-3 col-sm-3 col-xs-8 text-left">
<%= link_to image_tag("#{AppSettings['design.header_logo']}", width: 40, class: "pull-left logo") + "#{AppSettings['settings.product_name'] + " " if AppSettings['settings.product_name']}" "#{AppSettings['settings.site_name']}", root_path, class: 'navbar-brand', responsive: true %>
<%= link_to image_tag(AppSettings.get_logo, width: 40, class: "pull-left logo") + "#{AppSettings['settings.product_name'] + " " if AppSettings['settings.product_name']}" "#{AppSettings['settings.site_name']}", root_path, class: 'navbar-brand', responsive: true %>
</div>
<div class="col-lg-9 col-md-9 col-sm-9 col-xs-4 text-right">
<ul class="list-inline" data-hook="header-mini-nav">
Expand Down
2 changes: 1 addition & 1 deletion app/themes/nordic/views/layouts/nordic.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<div class="container">
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-10 text-left">
<%= link_to image_tag("#{AppSettings['design.header_logo']}", width: 40, class: "pull-left logo") + "#{AppSettings['settings.product_name'] + " " if AppSettings['settings.product_name']}" "#{AppSettings['settings.site_name']}", root_path, class: 'navbar-brand', responsive: true %>
<%= link_to image_tag(AppSettings.get_logo, width: 40, class: "pull-left logo") + "#{AppSettings['settings.product_name'] + " " if AppSettings['settings.product_name']}" "#{AppSettings['settings.site_name']}", root_path, class: 'navbar-brand', responsive: true %>
</div>
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-2 text-right">
<ul class="list-inline" data-hook="header-mini-nav">
Expand Down
8 changes: 4 additions & 4 deletions app/themes/singular/views/layouts/_head.html.erb
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<!-- <title><%= @title_tag || AppSettings['settings.site_name'] %></title> -->
<title><%= content_for(:title) ? content_for(:title) : AppSettings['settings.site_name'] %></title>
<!--
<!--
HELPY VERSION: <%= APP_VERSION %>
========================================
Copyright (c) <%= Time.now.year %> Helpy.io, LLC, and Contributors.
Full license at https://github.com/helpyio/helpy/blob/master/LICENSE

Note: If this install is running Helpy Cloud, Bot, Pro, Chat or other
commercial or third party extensions those may be licensed differently.
Note: If this install is running Helpy Cloud, Bot, Pro, Chat or other
commercial or third party extensions those may be licensed differently.
See https://support.helpy.io for more information.

REMOVAL OF THIS COPYRIGHT NOTICE IS EXPRESSLY PROHIBITED BY THE ABOVE
Expand All @@ -34,7 +34,7 @@ REFERENCED LICENSE
<link href='//fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'>

<%= csrf_meta_tags %>
<%= favicon_link_tag "#{AppSettings['design.favicon']}" %>
<%= favicon_link_tag AppSettings.get_favicon %>
<%= cloudinary_js_config %>

<%= render 'layouts/google_analytics' %>
Expand Down
2 changes: 1 addition & 1 deletion app/themes/singular/views/layouts/_header.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

<div id="header-wrapper">
<%= nav_bar brand: image_tag("#{AppSettings['design.header_logo']}", width: 40, class: "pull-left logo") + "#{AppSettings['settings.product_name'] + " " if AppSettings['settings.product_name']}" "#{AppSettings['settings.site_name']}", responsive: true do %>
<%= nav_bar brand: image_tag(AppSettings.get_logo, width: 40, class: "pull-left logo") + "#{AppSettings['settings.product_name'] + " " if AppSettings['settings.product_name']}" "#{AppSettings['settings.site_name']}", responsive: true do %>
<%= menu_group pull: :right do %>
<span class="hidden-lg hidden-sm hidden-md"><%= render('result/search_form') %></span>
<%= menu_divider %>
Expand Down
2 changes: 1 addition & 1 deletion app/themes/singular/views/layouts/clean.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<div class="container">
<div class="row">
<div class="col-md-3 col-sm-3 col-xs-8 text-left">
<%= link_to image_tag("#{AppSettings['design.header_logo']}", width: 40, class: "pull-left logo") + "#{AppSettings['settings.product_name'] + " " if AppSettings['settings.product_name']}" "#{AppSettings['settings.site_name']}", root_path, class: 'navbar-brand', responsive: true %>
<%= link_to image_tag(AppSettings.get_logo, width: 40, class: "pull-left logo") + "#{AppSettings['settings.product_name'] + " " if AppSettings['settings.product_name']}" "#{AppSettings['settings.site_name']}", root_path, class: 'navbar-brand', responsive: true %>
</div>
<div class="col-lg-9 col-md-9 col-sm-9 col-xs-4 text-right">
<ul class="list-inline" data-hook="header-mini-nav">
Expand Down
2 changes: 1 addition & 1 deletion app/themes/singular/views/layouts/singular.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@

<div class="row">
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-10 text-left">
<%= link_to image_tag("#{AppSettings['design.header_logo']}", width: 40, class: "pull-left logo") + "#{AppSettings['settings.product_name'] + " " if AppSettings['settings.product_name']}" "#{AppSettings['settings.site_name']}", root_path, class: 'navbar-brand', responsive: true %>
<%= link_to image_tag(AppSettings.get_logo, width: 40, class: "pull-left logo") + "#{AppSettings['settings.product_name'] + " " if AppSettings['settings.product_name']}" "#{AppSettings['settings.site_name']}", root_path, class: 'navbar-brand', responsive: true %>
</div>
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-2 text-right">
<ul class="list-inline" data-hook="header-mini-nav">
Expand Down
2 changes: 1 addition & 1 deletion app/uploaders/attachment_uploader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def self.set_storage
def store_dir
"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
end

def extension_blacklist
AppSettings['settings.extension_blacklist'].split(',').map(&:strip) if AppSettings['settings.extension_blacklist'].present?
end
Expand Down
4 changes: 2 additions & 2 deletions app/views/admin/settings/design.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<div class="settings-section design">
<div class="row">
<div class="col-md-1 col-sm-2 col-xs-2">
<%= image_tag(AppSettings['design.header_logo'], width: 40, class: 'pull-left') %>
<%= image_tag(AppSettings.get_logo, width: 40, class: 'pull-left') %>
</div>
<div class="col-md-11 col-sm-10 col-xs-10">
<%= f.file_field 'uploader.design.header_logo', class: "settings-uploader", label: t('header_logo', default: "Header Logo") %>
Expand All @@ -15,7 +15,7 @@
</div>
<div class="row">
<div class="col-md-1 col-sm-2 col-xs-2">
<%= image_tag(AppSettings['design.favicon'], width: 32, class: 'pull-left') %>
<%= image_tag(AppSettings.get_favicon, width: 32, class: 'pull-left') %>
</div>
<div class="col-md-11 col-sm-10 col-xs-10">
<%= f.file_field 'uploader.design.favicon', class: "favicon-uploader", label: "Favicon" %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/errors/internal_server_error.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<% title "#{AppSettings['settings.site_name']}: 500 Error" %>
<div class="error" style="height: 500px;">
<%= link_to image_tag("#{AppSettings['design.header_logo']}", width: 40, class: "logo"), root_url %>
<%= link_to image_tag(AppSettings.get_logo, width: 40, class: "logo"), root_url %>
<h2>
Oops there has been an error...
<br/><small>We log all errors and an engineers pager is going off somewhere!</small>
Expand Down
2 changes: 1 addition & 1 deletion app/views/errors/not_found.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<% title "#{AppSettings['settings.site_name']}: 404 Error" %>
<div class="error" style="height: 500px;">
<%= link_to image_tag("#{AppSettings['design.header_logo']}", width: 40, class: "logo"), root_url %>
<%= link_to image_tag(AppSettings.get_logo, width: 40, class: "logo"), root_url %>
<h2>
Nothing was found at this address...
</h2>
Expand Down
8 changes: 4 additions & 4 deletions app/views/layouts/_head.html.erb
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<!-- <title><%= @title_tag || AppSettings['settings.site_name'] %></title> -->
<title><%= content_for(:title) ? content_for(:title) : AppSettings['settings.site_name'] %></title>
<!--
<!--
HELPY VERSION: <%= APP_VERSION %>
========================================
Copyright (c) <%= Time.now.year %> Helpy.io, LLC, and Contributors.
Full license at https://github.com/helpyio/helpy/blob/master/LICENSE

Note: If this install is running Helpy Cloud, Bot, Pro, Chat or other
commercial or third party extensions those may be licensed differently.
Note: If this install is running Helpy Cloud, Bot, Pro, Chat or other
commercial or third party extensions those may be licensed differently.
See https://support.helpy.io for more information.

REMOVAL OF THIS COPYRIGHT NOTICE IS EXPRESSLY PROHIBITED BY THE ABOVE
Expand All @@ -32,7 +32,7 @@ REFERENCED LICENSE
<link href='//fonts.googleapis.com/css?family=Droid+Sans:400,700|Droid+Serif:400,700|Lobster' rel='stylesheet' type='text/css'>

<%= csrf_meta_tags %>
<%= favicon_link_tag "#{AppSettings['design.favicon']}" %>
<%= favicon_link_tag AppSettings.get_favicon %>
<%= cloudinary_js_config %>

<%= render 'layouts/google_analytics' %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/_header.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div id="above-header" class="hidden-xs small">
<%= render :partial => 'layouts/above_header' %>
</div>
<%= nav_bar brand: image_tag("#{AppSettings['design.header_logo']}", width: 40, class: "pull-left logo") + "#{AppSettings['settings.product_name'] + " " if AppSettings['settings.product_name']}" "#{AppSettings['settings.site_name']}", responsive: true do %>
<%= nav_bar brand: image_tag(AppSettings.get_logo, width: 40, class: "pull-left logo") + "#{AppSettings['settings.product_name'] + " " if AppSettings['settings.product_name']}" "#{AppSettings['settings.site_name']}", responsive: true do %>
<%= menu_group pull: :right do %>
<span class="hidden-lg hidden-sm hidden-md hidden-xs"><%= render('result/search_form') %></span>
<%= menu_divider %>
Expand Down