diff --git a/DEVELOPING.md b/DEVELOPING.md index 9de28cba..e808ea72 100644 --- a/DEVELOPING.md +++ b/DEVELOPING.md @@ -57,3 +57,15 @@ rake check:all Now, when you go to the main Klaxon page, you should start to see changes in the Feed of the latest updates. Go forth and add some features, and be sure to send us your [pull requests](/pulls) for features you think other Klaxon users might find handy. + +## Adding your org's logo to the app + +Adding a logo is simple! At the top left of the app, there is the Klaxon logo and name. If you save your logo as `app/assets/images/logo.svg` in your repository, the top left will display as `Klaxon for {your logo}`. + +If you are running the app in Docker, you will need to rebuild your Docker container to recompile the static assets like so: + +``` +docker-compose down +docker-compose build +docker-compose up +``` \ No newline at end of file diff --git a/app/assets/stylesheets/bootstrap/_navbar.scss b/app/assets/stylesheets/bootstrap/_navbar.scss index 11e5c01c..deff8664 100644 --- a/app/assets/stylesheets/bootstrap/_navbar.scss +++ b/app/assets/stylesheets/bootstrap/_navbar.scss @@ -165,7 +165,18 @@ padding: $navbar-padding-vertical $navbar-padding-horizontal; font-size: $font-size-large; line-height: $line-height-computed; - height: $navbar-height; + display: flex; + flex-direction: row; + // prevents trimming of leading/trailing whitespace + white-space: pre; + + > svg { + min-width: 23px; + } + + > * { + margin: 0 10 0 10; + } &:hover, &:focus { diff --git a/app/helpers/logo_helper.rb b/app/helpers/logo_helper.rb new file mode 100644 index 00000000..c6cb8c97 --- /dev/null +++ b/app/helpers/logo_helper.rb @@ -0,0 +1,16 @@ +module LogoHelper + def show_logo_text(path) + if File.file?("app/assets/images/#{path}") + text = " for " + text.html_safe + end + end + + def show_svg(path) + if File.file?("app/assets/images/#{path}") + File.open("app/assets/images/#{path}", "rb") do |file| + raw file.read + end + end + end +end \ No newline at end of file diff --git a/app/views/layouts/_nav.html.erb b/app/views/layouts/_nav.html.erb index b124a0ca..9af40017 100644 --- a/app/views/layouts/_nav.html.erb +++ b/app/views/layouts/_nav.html.erb @@ -9,7 +9,10 @@ - Klaxon + Klaxon + <%= show_logo_text('logo.svg') %> + <%= show_svg('logo.svg') %> +