diff --git a/.gitignore b/.gitignore index f7bacf9..9090558 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,10 @@ public/assets/* public/apidocs/* +# Ignore branded content +app/views/branded/* +app/assets/**/* + # Ignore gemfile.lock #Gemfile.lock diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 6d2d8b3..2598cdf 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -102,9 +102,11 @@ # Override rails default render action to look for a branded version of a # template instead of using the default one. If no override exists, the # default version in ./app/views/[:controller]/[:action] will be used + # + # The path in the app/views/branded/ directory must match the the file it is + # replacing. For example: + # app/views/branded/layouts/_header.html.erb -> app/views/layouts/_header.html.erb def prepend_view_paths - branded = Rails.configuration.branding[:branding_override_directory] - - prepend_view_path "app/views/#{branded}" unless branded.nil? + prepend_view_path "app/views/branded" unless branded.nil? end end diff --git a/config/branding.yml b/config/branding.yml index 8e82b56..783b2c0 100644 --- a/config/branding.yml +++ b/config/branding.yml @@ -10,19 +10,6 @@ name: 'DMPRoadmap' url: 'https://github.com/DMPRoadmap/roadmap' - # You can override the generic DMPRoadmap versions of several types of files - # by simply adding your own override directory to the ./app/views, ./app/assets, - # and ./config/locales directories. - # - # For example, ./app/views/overrides/_dmponline_header.html.erb would be used by - # the system instead of the one at ./app/views/layouts/_dmponline_header.html.erb - # and ./app/assets/overrides/admin.css would override the one at - # ./app/assets/stylesheets/admin.css. - # - # NOTE: that file names must match - # - branding_override_directory: 'overrides' - development: <<: *defaults