Code Monkey home page Code Monkey logo

Comments (2)

raycarrick-ed avatar raycarrick-ed commented on August 19, 2024

Tried a quick mock up of a solution to this:

  • add instancename to branding.yml
  • add setting a variable with this in set_locale so it's available everywhere
  • set it to "roadmap" if not set otherwise
  • in assets/images create sub directories for the custom logos etc
    seems to work ok so far

from roadmap.

briri avatar briri commented on August 19, 2024

Ok. I think I got it working with a minimal amount of modification to the underlying codebase. Please review and merge it in if it looks like a good route.

  • I did some reading up on Rails' asset pipeline and discovered that anything placed in app/assets will override content in lib/assets. So I moved our current assets to lib/assets. Now, any files that appear in app/assets would be considered overrides to the default files.
  • I set the application_controller.rb to check for templates in app/views/branded/ first. This will allow us to customize templates. Keep in mind that the location of the file must match the default one (e.g. to override app/views/layouts/_header.html.erb you would create an app/views/branded/layouts/_header.html.erb)
  • I moved the static page content out of the large locale files and placed them into a new locales subdirectory called static_pages. I placed example files into that directory.
  • I updated the gitignore file so that branded content in app/assets, app/views/branded and config/locales/static_pages/*.yml will be ignored

To test things out:

  • just drop a new logo into app/assets/images/logo.jpg
  • create a directory called app/views/branded and add a new projects/index.html.erb to it with 'Hello World' or something.
  • Make copies of each of the config/locales/static_pages/ files (change the contents of one if you want to test that)
  • Then pull up the site and verify that your new logo is being used and then login to make sure you see the 'Hello World' page

from roadmap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.