| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
If you are installing your own instance of DMPRoadmap it is likely that you will want to add your own branding. Following these basic guidelines will help ensure that your codebase is able to be kept up to date with the latest DMPRoadmap codebase:
Stylesheet customizations can be broken down into two areas:
For more information on stylesheets and how they are structured within the DMPRoadmap codebase please see the README sections for CSS Variables, CSS Utils and CSS Blocks
The codebase contains logic that will look for a particular view/partial in the app/views/branded directory first before looking in the standard app/views directories. To customise a view simply create a branded directory under app/views, then take a copy of the view you wish to customize and place it into the appropriate directory under app/views/branded (follow the same subdirectory patterns). For example: app/views/branded/home/index.html.erb or app/views/branded/paginable/plans/_privately_visible.html.erb
Pros: The custom code is isolated and would not be accidentally broken by a change in the core codebase. It makes it a bit easier to share your customization with other members of the community since the code is isolated.
Cons: When the underlying DMPRoadmap code changes you need to pay closer attention to the release notes to see if a change was made to one of the files you copied and if so you would need to manually update your customized copy.
If you need to add/remove functionality from any other files in the codebase we recommend that you try to place them into mixins that can be pulled into the core codebase. This gives you the benefit of only having to worry about a single include statement than having your changes overwritten when doing a git merge. For example if you wanted to add a new public facing page for your users, you could add the appropriate route to config.routes.rb and then add the new endpoint directly to the app/controllers/public_pages_controller.rb.
It would be better though to add them to a separate app/controllers/[my_app]/public_pages.rb file that could then be used as a mixin:
# contents of app/controllers/[my_app]/public_pages.rb
module MyApp
module PublicPages
# The sign in/account creation options page accessed via the 'Get Started' button
# on the home page
def get_started
skip_authorization
render "/shared/_get_started"
end
end
end
end
# contents of app/controllers/public_pages_controller.rb
class PublicPagesController < ApplicationController
after_action :verify_authorized, except: [:template_index, :plan_index]
include MyApp::PublicPages
...
endWith this approach we only need to ensure that our include statement is in the controller during future merges of the latest DMPRoadmap codebase.
The mixin approach though doesn't always work. Sometimes you may need to update the existing files directly. If you do need to do this, we recommend commenting out the original line of code and adding your changed version below it. We also recommend placing comments around the change to help highlight it during future merges.
| Back | FazBrowse Home | New Git URL |