Skip to content

Allow custom page title and logo

Ramya Authappan requested to merge github/fork/rspeicher/custom_logo into master

Created by: rspeicher

Two points of customization:

First, a user can override any of the app's CSS by editing app/assets/stylesheets/overrides.scss. The file was checked into Git and then ignored, so any customizations won't be wiped out by future updates upstream. This takes care of changing the logo.

Second, I added two helper methods, page_title and application_title that can be customized with an initializer (below), which we can document in the Wiki for people who want to do that.

module MyCustomApplicationHelper
  def custom_application_title
    content_tag(:h1, "Startup, Inc.")
  end

  def custom_page_title
    title = "Startup, Inc."
    title += " > #{@project.name}" if @project && @project.persisted?
    title
  end
end

Rails.application.config.after_initialize do
  ActionView::Base.send(:include, MyCustomApplicationHelper)
end

My goal with this was that if you didn't need to customize anything, it was invisible to you. So nothing in the Admin area about uploading a logo or the like.

Merge request reports

Loading