Merge branch 'master' of ssh://source.elbert.us:777/dan/parsley

This commit is contained in:
Dan Elbert 2018-03-29 00:28:41 -05:00
commit dea393d514
7 changed files with 149 additions and 136 deletions

View File

@ -1 +1 @@
2.4.1
2.4.3

15
Gemfile
View File

@ -1,8 +1,8 @@
source 'https://rubygems.org'
gem 'rails', '5.0.2'
gem 'rails', '5.0.6'
gem 'sqlite3'
gem 'pg', '~> 0.20.0'
gem 'pg', '~> 0.21.0'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
@ -14,16 +14,17 @@ gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails', '~> 4.3.1'
gem 'bootstrap-sass', '~> 3.3.7'
gem 'kaminari', '~> 1.0.1'
gem 'turbolinks', '~> 5.0.1'
gem 'jbuilder', '~> 2.6'
gem 'kaminari', '~> 1.1.1'
gem 'turbolinks', '~> 5.1.0'
gem 'jbuilder', '~> 2.7'
gem 'cocoon', '~> 1.2.9'
gem 'unitwise', '~> 2.0.0'
gem 'unitwise', '~> 2.2.0'
gem 'redcarpet', '~> 3.4.0'
# Use ActiveModel has_secure_password
gem 'bcrypt', '~> 3.1.11'
gem 'tzinfo-data'
group :development, :test do
@ -35,5 +36,3 @@ group :development, :test do
gem 'database_cleaner', '~> 1.5.3'
end

View File

@ -1,71 +1,72 @@
GEM
remote: https://rubygems.org/
specs:
actioncable (5.0.2)
actionpack (= 5.0.2)
actioncable (5.0.6)
actionpack (= 5.0.6)
nio4r (>= 1.2, < 3.0)
websocket-driver (~> 0.6.1)
actionmailer (5.0.2)
actionpack (= 5.0.2)
actionview (= 5.0.2)
activejob (= 5.0.2)
actionmailer (5.0.6)
actionpack (= 5.0.6)
actionview (= 5.0.6)
activejob (= 5.0.6)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (5.0.2)
actionview (= 5.0.2)
activesupport (= 5.0.2)
actionpack (5.0.6)
actionview (= 5.0.6)
activesupport (= 5.0.6)
rack (~> 2.0)
rack-test (~> 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (5.0.2)
activesupport (= 5.0.2)
actionview (5.0.6)
activesupport (= 5.0.6)
builder (~> 3.1)
erubis (~> 2.7.0)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
activejob (5.0.2)
activesupport (= 5.0.2)
activejob (5.0.6)
activesupport (= 5.0.6)
globalid (>= 0.3.6)
activemodel (5.0.2)
activesupport (= 5.0.2)
activerecord (5.0.2)
activemodel (= 5.0.2)
activesupport (= 5.0.2)
activemodel (5.0.6)
activesupport (= 5.0.6)
activerecord (5.0.6)
activemodel (= 5.0.6)
activesupport (= 5.0.6)
arel (~> 7.0)
activesupport (5.0.2)
activesupport (5.0.6)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (~> 0.7)
minitest (~> 5.1)
tzinfo (~> 1.1)
arel (7.1.4)
autoprefixer-rails (6.7.7.1)
autoprefixer-rails (8.1.0.1)
execjs
bcrypt (3.1.11)
bootstrap-sass (3.3.7)
autoprefixer-rails (>= 5.2.1)
sass (>= 3.3.4)
builder (3.2.3)
cocoon (1.2.9)
coderay (1.1.1)
cocoon (1.2.11)
coderay (1.1.2)
concurrent-ruby (1.0.5)
crass (1.0.3)
database_cleaner (1.5.3)
diff-lcs (1.3)
erubis (2.7.0)
execjs (2.7.0)
factory_girl (4.8.0)
factory_girl (4.8.1)
activesupport (>= 3.0.0)
factory_girl_rails (4.8.0)
factory_girl (~> 4.8.0)
railties (>= 3.0.0)
ffi (1.9.18)
ffi (1.9.23)
formatador (0.2.5)
globalid (0.3.7)
activesupport (>= 4.1.0)
guard (2.14.1)
globalid (0.4.1)
activesupport (>= 4.2.0)
guard (2.14.2)
formatador (>= 0.2.4)
listen (>= 2.7, < 4.0)
lumberjack (~> 1.0)
lumberjack (>= 1.0.12, < 2.0)
nenv (~> 0.1)
notiffany (~> 0.0)
pry (>= 0.9.12)
@ -76,94 +77,93 @@ GEM
guard (~> 2.1)
guard-compat (~> 1.1)
rspec (>= 2.99.0, < 4.0)
i18n (0.8.1)
jbuilder (2.6.3)
activesupport (>= 3.0.0, < 5.2)
multi_json (~> 1.2)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
jbuilder (2.7.0)
activesupport (>= 4.2.0)
multi_json (>= 1.2)
jquery-rails (4.3.1)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
kaminari (1.0.1)
kaminari (1.1.1)
activesupport (>= 4.1.0)
kaminari-actionview (= 1.0.1)
kaminari-activerecord (= 1.0.1)
kaminari-core (= 1.0.1)
kaminari-actionview (1.0.1)
kaminari-actionview (= 1.1.1)
kaminari-activerecord (= 1.1.1)
kaminari-core (= 1.1.1)
kaminari-actionview (1.1.1)
actionview
kaminari-core (= 1.0.1)
kaminari-activerecord (1.0.1)
kaminari-core (= 1.1.1)
kaminari-activerecord (1.1.1)
activerecord
kaminari-core (= 1.0.1)
kaminari-core (1.0.1)
kaminari-core (= 1.1.1)
kaminari-core (1.1.1)
libv8 (3.16.14.19)
liner (0.2.4)
listen (3.1.5)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
ruby_dep (~> 1.2)
loofah (2.0.3)
loofah (2.2.1)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
lumberjack (1.0.11)
mail (2.6.4)
mime-types (>= 1.16, < 4)
lumberjack (1.0.12)
mail (2.7.0)
mini_mime (>= 0.1.1)
memoizable (0.4.2)
thread_safe (~> 0.3, >= 0.3.1)
method_source (0.8.2)
mime-types (3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521)
mini_portile2 (2.1.0)
minitest (5.10.1)
multi_json (1.12.1)
method_source (0.9.0)
mini_mime (1.0.0)
mini_portile2 (2.3.0)
minitest (5.11.3)
multi_json (1.13.1)
nenv (0.3.0)
nio4r (2.0.0)
nokogiri (1.7.1)
mini_portile2 (~> 2.1.0)
nio4r (2.3.0)
nokogiri (1.8.2)
mini_portile2 (~> 2.3.0)
notiffany (0.1.1)
nenv (~> 0.1)
shellany (~> 0.0)
parslet (1.8.0)
pg (0.20.0)
pry (0.10.4)
parslet (1.8.2)
pg (0.21.0)
pry (0.11.3)
coderay (~> 1.1.0)
method_source (~> 0.8.1)
slop (~> 3.4)
puma (3.8.2)
rack (2.0.1)
method_source (~> 0.9.0)
puma (3.11.3)
rack (2.0.4)
rack-test (0.6.3)
rack (>= 1.0)
rails (5.0.2)
actioncable (= 5.0.2)
actionmailer (= 5.0.2)
actionpack (= 5.0.2)
actionview (= 5.0.2)
activejob (= 5.0.2)
activemodel (= 5.0.2)
activerecord (= 5.0.2)
activesupport (= 5.0.2)
bundler (>= 1.3.0, < 2.0)
railties (= 5.0.2)
rails (5.0.6)
actioncable (= 5.0.6)
actionmailer (= 5.0.6)
actionpack (= 5.0.6)
actionview (= 5.0.6)
activejob (= 5.0.6)
activemodel (= 5.0.6)
activerecord (= 5.0.6)
activesupport (= 5.0.6)
bundler (>= 1.3.0)
railties (= 5.0.6)
sprockets-rails (>= 2.0.0)
rails-controller-testing (1.0.1)
actionpack (~> 5.x)
actionview (~> 5.x)
rails-controller-testing (1.0.2)
actionpack (~> 5.x, >= 5.0.1)
actionview (~> 5.x, >= 5.0.1)
activesupport (~> 5.x)
rails-dom-testing (2.0.2)
activesupport (>= 4.2.0, < 6.0)
nokogiri (~> 1.6)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.0.3)
loofah (~> 2.0)
railties (5.0.2)
actionpack (= 5.0.2)
activesupport (= 5.0.2)
railties (5.0.6)
actionpack (= 5.0.6)
activesupport (= 5.0.6)
method_source
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (12.0.0)
rb-fsevent (0.9.8)
rb-inotify (0.9.8)
ffi (>= 0.5.0)
rake (12.3.0)
rb-fsevent (0.10.3)
rb-inotify (0.9.10)
ffi (>= 0.5.0, < 2)
redcarpet (3.4.0)
ref (2.0.0)
rspec (3.5.0)
@ -188,8 +188,12 @@ GEM
rspec-support (~> 3.5.0)
rspec-support (3.5.0)
ruby_dep (1.5.0)
sass (3.4.23)
sass-rails (5.0.6)
sass (3.5.5)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
sass-rails (5.0.7)
railties (>= 4.0.0, < 6)
sass (~> 3.1)
sprockets (>= 2.8, < 4.0)
@ -197,11 +201,10 @@ GEM
tilt (>= 1.1, < 3)
shellany (0.0.1)
signed_multiset (0.2.1)
slop (3.6.0)
sprockets (3.7.1)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-rails (3.2.0)
sprockets-rails (3.2.1)
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
@ -209,24 +212,26 @@ GEM
therubyracer (0.12.3)
libv8 (~> 3.16.14.15)
ref
thor (0.19.4)
thor (0.20.0)
thread_safe (0.3.6)
tilt (2.0.7)
turbolinks (5.0.1)
turbolinks-source (~> 5)
turbolinks-source (5.0.0)
tzinfo (1.2.3)
tilt (2.0.8)
turbolinks (5.1.0)
turbolinks-source (~> 5.1)
turbolinks-source (5.1.0)
tzinfo (1.2.5)
thread_safe (~> 0.1)
uglifier (3.2.0)
tzinfo-data (1.2018.3)
tzinfo (>= 1.0.0)
uglifier (4.1.8)
execjs (>= 0.3.0, < 3)
unitwise (2.0.0)
unitwise (2.2.0)
liner (~> 0.2)
memoizable (~> 0.4)
parslet (~> 1.5)
signed_multiset (~> 0.2)
websocket-driver (0.6.5)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.2)
websocket-extensions (0.1.3)
PLATFORMS
ruby
@ -239,21 +244,22 @@ DEPENDENCIES
factory_girl_rails (~> 4.8.0)
guard (~> 2.14.0)
guard-rspec
jbuilder (~> 2.6)
jbuilder (~> 2.7)
jquery-rails (~> 4.3.1)
kaminari (~> 1.0.1)
pg (~> 0.20.0)
kaminari (~> 1.1.1)
pg (~> 0.21.0)
puma
rails (= 5.0.2)
rails (= 5.0.6)
rails-controller-testing
redcarpet (~> 3.4.0)
rspec-rails (~> 3.5.0)
sass-rails (~> 5.0)
sqlite3
therubyracer
turbolinks (~> 5.0.1)
turbolinks (~> 5.1.0)
tzinfo-data
uglifier (>= 1.3.0)
unitwise (~> 2.0.0)
unitwise (~> 2.2.0)
BUNDLED WITH
1.14.6
1.16.1

View File

@ -2,6 +2,14 @@
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
div.table_tags {
width: 275px;
}
div.recipe_list_controls {
width: 85px;
}
@mixin editor {
@extend .well;

View File

@ -10,11 +10,15 @@ class RecipeDecorator < BaseDecorator
end
end
def created_at
wrapped.created_at ? wrapped.created_at.strftime('%D') : ''
end
def tag_names
tags = wrapped.tag_names
tags.map do |t|
h.content_tag('span', t, class: 'label label-default')
end.join('&nbsp;').html_safe
end.join(' ').html_safe
end
def source_markup

View File

@ -47,7 +47,7 @@
<% decorate(@recipes, RecipeDecorator).each do |recipe| %>
<tr>
<td><%= link_to recipe.short_name, recipe %></td>
<td><%= recipe.tag_names %></td>
<td><div class="table_tags"><%= recipe.tag_names %></div></td>
<td>
<% if recipe.rating %>
<%= text_field_tag('rating', recipe.rating, disabled: true, data: {rating: true, size: '20px', interval: '0.25'}) %>
@ -57,19 +57,21 @@
</td>
<td><%= recipe.yields %></td>
<td><%= recipe_time(recipe) %></td>
<td><%= timestamp(recipe.created_at) %></td>
<td><%= recipe.created_at %></td>
<td>
<% if current_user? %>
<%= link_to new_recipe_log_path(recipe), class: 'btn btn-sm btn-primary' do %>
<div class="recipe_list_controls">
<%= link_to new_recipe_log_path(recipe), class: 'btn btn-xs btn-primary' do %>
<span class="glyphicon glyphicon-copy"></span>
<% end %>
<%= link_to edit_recipe_path(recipe), class: 'btn btn-sm btn-primary' do %>
<%= link_to edit_recipe_path(recipe), class: 'btn btn-xs btn-primary' do %>
<span class="glyphicon glyphicon-pencil"></span>
<% end %>
<%= link_to recipe, method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-sm btn-danger' do %>
<%= link_to recipe, method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-xs btn-danger' do %>
<span class="glyphicon glyphicon-remove"></span>
<% end %>
</div>
<% end %>
</td>
</tr>

View File

@ -98,15 +98,9 @@
</tr>
</thead>
<%= nutrient_row(@recipe, nutrition_data, 'Calories', :kcal) %>
<%= nutrient_row(@recipe, nutrition_data, 'g Protein', :protein) %>
<%= nutrient_row(@recipe, nutrition_data, 'g Fat', :lipids) %>
<%= nutrient_row(@recipe, nutrition_data, 'g Carbohydrates', :carbohydrates) %>
<%= nutrient_row(@recipe, nutrition_data, 'mg Sodium', :sodium) %>
<%= nutrient_row(@recipe, nutrition_data, 'g Sugar', :sugar) %>
<%= nutrient_row(@recipe, nutrition_data, 'g Fiber', :fiber) %>
<%= nutrient_row(@recipe, nutrition_data, 'µg Vitamin K', :vit_k) %>
<% NutritionData::NUTRIENTS.select { |_, v| v.present? }.each do |k, v| %>
<%= nutrient_row(@recipe, nutrition_data, v, k) %>
<% end %>
</table>
<% end %>