Skip to content

Commit

Permalink
Change primary colour depending on guild colours
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesHDuffield committed Oct 3, 2016
1 parent 1ac6254 commit d5b205f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
1 change: 0 additions & 1 deletion app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ body {
}

.panel-primary .panel-heading {
background-color: #8E000E;
border-color: #0f1415;
}

Expand Down
8 changes: 8 additions & 0 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,12 @@ module ApplicationHelper
def guild_name
Rails.application.config.guild_name
end

def guild_colour
g = Guild.find_by(name: Rails.application.config.guild_name)
if g == nil
return '#000'
end
return "##{g.background_colour.last(6)}"
end
end
4 changes: 4 additions & 0 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
<%= javascript_include_tag '//wow.zamimg.com/widgets/power.js' %>

<style>
.panel-primary .panel-heading { background-color: <%= guild_colour %>; }
</style>
</head>

<body>
Expand Down

0 comments on commit d5b205f

Please sign in to comment.