Skip to content

Commit

Permalink
Colours for models
Browse files Browse the repository at this point in the history
  • Loading branch information
pikesley committed Feb 16, 2016
1 parent d04d618 commit 8509ebd
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 7 deletions.
30 changes: 30 additions & 0 deletions app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,33 @@ a {
.field_with_errors {

}

#add-links, .buttons {
.btn {
color: white;
}
}

.btn-glucose {
background-color: $glucose;
}

.btn-carbs {
background-color: $carbs;
}

.btn-meds {
background-color: $meds;
}

.btn-exercise {
background-color: $exercise;
}

.btn-back {
background-color: $gray-light;
}

.btn-delete {
background-color: $gray-dark;
}
16 changes: 13 additions & 3 deletions app/assets/stylesheets/colours.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
$brand-primary: #fa8100;
$warning-pink: #FFE6E6;
$warning-blue: #ECE6FF;
$orange: #fa5100;
$yellow: #fa9400;
$blue: #0c58a2;
$green: #00a86d;

$brand-primary: $orange;
$warning-pink: #ffe6e6;
$warning-blue: #ece6ff;

$glucose: $orange;
$carbs: $blue;
$meds: $yellow;
$exercise: $green;
5 changes: 4 additions & 1 deletion app/views/shared/_add_links.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<div id='add-links'>
<% models.each do |model| %>
<%= link_to "Add #{model.short_name}", send("new_#{model.name.underscore}_path"), class: 'btn btn-success' %>
<%= link_to "Add #{model.short_name}",
send("new_#{model.name.underscore}_path"),
class: "btn btn-#{model.short_name.downcase}"
%>
<% end %>
</div>
2 changes: 1 addition & 1 deletion app/views/shared/_back.html.erb
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<%= link_to 'Back', root_path, class: 'btn btn-primary' %>
<%= link_to 'Back', root_path, class: 'btn btn-back' %>
2 changes: 1 addition & 1 deletion app/views/shared/_delete.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<% if @metric.id %>
<%= link_to 'Delete', send("#{@metric.class.name.underscore}_path".to_sym, @metric),
class: 'btn btn-danger',
class: 'btn btn-delete',
method: :delete,
data: {
confirm: 'Sure you want to delete this metric?'
Expand Down
2 changes: 1 addition & 1 deletion app/views/shared/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<% end %>

<div class='col-xs-12 buttons'>
<%= f.submit class: 'btn btn-success' %>
<%= f.submit class: "btn btn-#{@metric.class.short_name.downcase}" %>
<%= render partial: 'shared/back' %>
<%= render partial: 'shared/delete' %>
</div>
Expand Down

0 comments on commit 8509ebd

Please sign in to comment.