From 8989a2848a5c04647d6576cd26fc7811706541d0 Mon Sep 17 00:00:00 2001 From: Dan Elbert Date: Thu, 14 Jan 2016 11:07:15 -0600 Subject: [PATCH] Editor --- Gemfile.lock | 3 -- app/assets/stylesheets/application.scss | 5 +- app/assets/stylesheets/recipes.scss | 2 +- app/views/recipes/_form.html.erb | 24 ++++----- app/views/recipes/editor/_ingredient.html.erb | 51 +++++++++++-------- app/views/recipes/editor/_step.html.erb | 36 ++++++------- 6 files changed, 65 insertions(+), 56 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index f6c74a4..4d40c84 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -187,6 +187,3 @@ DEPENDENCIES turbolinks uglifier (>= 1.3.0) web-console (~> 2.0) - -BUNDLED WITH - 1.10.6 diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 793e66f..6da1356 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -10,8 +10,7 @@ * defined in the other CSS/SCSS files in this directory. It is generally better to create a new * file per style scope. * - *= require_tree . - *= require_self + *= require flash_messages */ @import "bootstrap-sprockets"; @@ -19,6 +18,8 @@ @import "bootstrap"; @import "spacelab/_bootswatch"; +@import "recipes"; + $footer_height: 40px; html { diff --git a/app/assets/stylesheets/recipes.scss b/app/assets/stylesheets/recipes.scss index 631f710..84856d2 100644 --- a/app/assets/stylesheets/recipes.scss +++ b/app/assets/stylesheets/recipes.scss @@ -3,7 +3,7 @@ // You can use Sass (SCSS) here: http://sass-lang.com/ @mixin editor { - border: solid 1px grey; + @extend .panel-body; } div.ingredient-editor { diff --git a/app/views/recipes/_form.html.erb b/app/views/recipes/_form.html.erb index 4721028..cb36117 100644 --- a/app/views/recipes/_form.html.erb +++ b/app/views/recipes/_form.html.erb @@ -2,37 +2,37 @@ <%= render partial: 'shared/error_list', locals: {model: @recipe} %> -
- <%= f.label :name %> +
+ <%= f.label :name, class: "control-label" %> <%= f.text_field :name, class: 'form-control' %>
-
- <%= f.label :description %> +
+ <%= f.label :description, class: "control-label" %> <%= f.text_area :description, class: 'form-control' %>
-
- <%= f.label :source %> +
+ <%= f.label :source, class: "control-label" %> <%= f.text_field :source, class: 'form-control' %>
-
- <%= f.label :yields %> +
+ <%= f.label :yields, class: "control-label" %> <%= f.number_field :yields, class: 'form-control', placeholder: 'Servings' %>
-
- <%= f.label :total_time %> +
+ <%= f.label :total_time, class: "control-label" %> <%= f.number_field :total_time, class: 'form-control', placeholder: 'Minutes' %>
-
- <%= f.label :active_time %> +
+ <%= f.label :active_time, class: "control-label" %> <%= f.number_field :active_time, class: 'form-control', placeholder: 'Minutes' %>
diff --git a/app/views/recipes/editor/_ingredient.html.erb b/app/views/recipes/editor/_ingredient.html.erb index 37ad753..c636bda 100644 --- a/app/views/recipes/editor/_ingredient.html.erb +++ b/app/views/recipes/editor/_ingredient.html.erb @@ -1,29 +1,38 @@ -
+
+
-
-
-
- <%= f.label :custom_name, "Name" %> - <%= f.text_field :custom_name, class: 'form-control' %> +
+
+ +
+ <%= f.label :custom_name, "Name" %> + <%= f.text_field :custom_name, class: 'form-control' %> +
+ +
+
+
+ <%= f.label :quantity %> + <%= f.text_field :quantity, class: 'form-control' %> +
+
+ +
+
+ <%= f.label :units %> + <%= f.text_field :units, class: 'form-control' %> +
+
+
-
- <%= f.label :quantity %> - <%= f.text_field :quantity, class: 'form-control' %> -
- -
- <%= f.label :units %> - <%= f.text_field :units, class: 'form-control' %> +
+ <%= link_to_remove_association f, class: 'btn btn-danger' do %> + + <% end %>
-
- <%= link_to_remove_association f, class: 'btn btn-danger' do %> - - <% end %> -
+ <%= f.hidden_field :sort_order, class: 'sort-order' %>
- - <%= f.text_field :sort_order, class: 'sort-order' %>
\ No newline at end of file diff --git a/app/views/recipes/editor/_step.html.erb b/app/views/recipes/editor/_step.html.erb index 59b692f..02e2c04 100644 --- a/app/views/recipes/editor/_step.html.erb +++ b/app/views/recipes/editor/_step.html.erb @@ -1,24 +1,26 @@ -
+
+
-
-
- <%= f.object ? f.object.sort_order : '' %> -
+
+
+ <%= f.object ? f.object.sort_order : '' %> +
-
-
- <%= f.label :step %> - <%= f.text_area :step, class: 'form-control' %> +
+
+ <%= f.label :step %> + <%= f.text_area :step, class: 'form-control' %> +
+
+ +
+ <%= link_to_remove_association f, class: 'btn btn-danger' do %> + + <% end %>
-
- <%= link_to_remove_association f, class: 'btn btn-danger' do %> - - <% end %> -
+ <%= f.hidden_field :sort_order, class: 'sort-order' %> +
- - <%= f.hidden_field :sort_order, class: 'sort-order' %> -
\ No newline at end of file