Skip to content
This repository has been archived by the owner on Dec 26, 2019. It is now read-only.

rearranged the dropdowns on the new check in page #189

Merged
merged 1 commit into from
Mar 30, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/assets/stylesheets/_activities.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
.contents {

article {
@extend %project;
@extend %activity;
}
}
}

%project {
%activity {
@include span-columns(4);
@include omega(3n);
background-color: $dark-blue;
Expand Down
11 changes: 11 additions & 0 deletions app/assets/stylesheets/_check-in.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.check-in {
.amount-field,
.quality-field,
.notes-field {
@include span-columns(4);
}

.activity {
@include outer-container;
}
}
1 change: 1 addition & 0 deletions app/assets/stylesheets/application.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
@import 'nav';
@import 'filters';
@import 'activities';
@import 'check-in';

body {
background-color: $background-color;
Expand Down
2 changes: 1 addition & 1 deletion app/models/features.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Co-erces an HStore object of feature flags into a ruby model
class Features
include Virtus.model
attribute :check_in, Boolean, default: false
attribute :check_in, Boolean, default: true

def self.dump(features)
features.to_hash
Expand Down
31 changes: 17 additions & 14 deletions app/views/check_ins/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
<section id="new-check-in">
<section class="check-in">
<%= form_for @check_in do |check_in_form| %>
<%= check_in_form.label :worked_at, "What day is this for?" %>
<%= check_in_form.text_field :worked_at, class: "datepicker" %>
<%= render partial: "error_for_field", locals: { model: check_in_form.object, field: :worked_at } %>

<%= check_in_form.fields_for :log_entries do |log_fields| %>
<div id="activity-<%=log_fields.object.activity_id%>">
<div class="activity" id="activity-<%=log_fields.object.activity_id%>">
<h4><%= log_fields.object.activity_name %></h4>
<%= log_fields.hidden_field :activity_id %>


<%= log_fields.label :amount, "How many hours did you work?" %>
<%= log_fields.select :amount, options_for_select(CheckInDecorator::HOURS_WORKED) %>
<%= render partial: "error_for_field", locals: { model: log_fields.object, field: :amount } %>

<%= log_fields.label :quality, "How'd it go?" %>
<%= log_fields.select :quality, options_for_select(CheckInDecorator::ATTENTION_QUALITY) %>
<%= render partial: "error_for_field", locals: { model: log_fields.object, field: :quality } %>

<%= log_fields.label :notes %>
<%= log_fields.text_area :notes %>
<%= render partial: "error_for_field", locals: { model: log_fields.object, field: :notes } %>
<div class="amount-field">
<%= log_fields.label :amount, "How many hours did you work?" %>
<%= log_fields.select :amount, options_for_select(CheckInDecorator::HOURS_WORKED) %>
<%= render partial: "error_for_field", locals: { model: log_fields.object, field: :amount } %>
</div>
<div class="quality-field">
<%= log_fields.label :quality, "How'd it go?" %>
<%= log_fields.select :quality, options_for_select(CheckInDecorator::ATTENTION_QUALITY) %>
<%= render partial: "error_for_field", locals: { model: log_fields.object, field: :quality } %>
</div>
<div class="notes-field">
<%= log_fields.label :notes %>
<%= log_fields.text_field :notes %>
<%= render partial: "error_for_field", locals: { model: log_fields.object, field: :notes } %>
</div>
</div>
<% end %>
<%= check_in_form.submit %>
Expand Down