beer_recipe 0.3.0 → 0.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,12 @@
1
1
  <html>
2
2
  <head>
3
+ <link href='http://fonts.googleapis.com/css?family=Montserrat' rel='stylesheet' type='text/css'>
3
4
  <title><%= name %></title>
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
4
6
  <style>
7
+ @-ms-viewport{
8
+ width: device-width;
9
+ }
5
10
  .colorbox {
6
11
  width: 1em;
7
12
  height: 1em;
@@ -12,7 +17,10 @@
12
17
  border-color: beige;
13
18
  border-style: solid;
14
19
  display: inline-block;
20
+ vertical-align: text-top;
15
21
  }
22
+ .srm-min { background-color: #FFFFFF; }
23
+ .srm-max { background-color: #000000; }
16
24
  .srm1 { background-color: #FFE699; }
17
25
  .srm2 { background-color: #FFD878; }
18
26
  .srm3 { background-color: #FFCA5A; }
@@ -53,112 +61,280 @@
53
61
  .srm38 { background-color: #3B0607; }
54
62
  .srm39 { background-color: #3A070B; }
55
63
  .srm40 { background-color: #36080A; }
64
+
65
+ body {
66
+ font-family: "Montserrat",sans-serif;
67
+ font-size: 12pt;
68
+ line-height: 18pt;
69
+ color: #4a4a4a;
70
+ background-color: #fafafa;
71
+ }
72
+ section {
73
+ float: left;
74
+ width: 70%;
75
+ }
76
+ footer {
77
+ clear: both;
78
+ }
79
+ .beer_recipe table {
80
+ border-collapse: collapse;
81
+ border: 1px solid #e0e0e0;
82
+ -webkit-border-radius: 3px;
83
+ -moz-border-radius: 3px;
84
+ border-radius: 3px;
85
+ border-spacing: 0;
86
+ width: 100%;
87
+ max-width: 100%;
88
+ margin: 0 0 10px 0;
89
+ }
90
+ .beer_recipe thead:first-child tr:first-child th:first-child {
91
+ border-top-left-radius: 3px;
92
+ border-left: 0;
93
+ }
94
+ .beer_recipe thead:first-child tr:first-child th:last-child {
95
+ border-top-right-radius: 3px;
96
+ }
97
+ .beer_recipe thead tr:first-child th,
98
+ .beer_recipe thead tr:first-child td {
99
+ border-top: 0;
100
+ }
101
+ .beer_recipe thead th {
102
+ vertical-align: left;
103
+ background-color: #cacaca;
104
+ }
105
+ .beer_recipe tbody tr {
106
+ text-align: left;
107
+ background-color: #eaeaea;
108
+ }
109
+ .beer_recipe tbody tr:nth-child(even) {
110
+ background-color: #f5f5f5;
111
+ }
112
+ .beer_recipe td, .beer_recipe th {
113
+ border-top: 1px solid #e0e0e0;
114
+ border-left: 1px solid #e0e0e0;
115
+ padding: 6px;
116
+ }
117
+ .beer_recipe tbody tr td:first-child {
118
+ border-left: 0;
119
+ }
120
+ .beer_recipe tbody tr:last-child td:first-child {
121
+ border-bottom-left-radius: 3px;
122
+ }
123
+ .beer_recipe tbody tr:last-child td:last-child {
124
+ border-bottom-right-radius: 3px;
125
+ }
126
+ .beer_recipe .format_number {
127
+ text-align: right;
128
+ }
129
+ .beer_recipe .recipe_information {
130
+ float: right;
131
+ width: 25%;
132
+ border: 1px solid #e0e0e0;
133
+ -webkit-border-radius: 6px;
134
+ -moz-border-radius: 6px;
135
+ border-radius: 6px;
136
+ background-color: #eaeaea;
137
+ padding: 0 8px 0 8px;
138
+ margin: 0 5px 15px 5px;
139
+ }
140
+ .beer_recipe .recipe_information h3 {
141
+ margin-bottom: 0;
142
+ }
143
+ .beer_recipe .recipe_information p {
144
+ margin-top: 1pt;
145
+ }
146
+ .beer_recipe td {
147
+ white-space: nowrap
148
+ }
149
+ @media only screen and (max-width: 640px) {
150
+ section {
151
+ overflow-x: scroll;
152
+ }
153
+ .beer_recipe .recipe_information {
154
+ float: left;
155
+ width: 100%;
156
+ max-width: 100%;
157
+ margin: 0 0 15px 0;
158
+ }
159
+ .beer_recipe .recipe_information p,
160
+ .beer_recipe .recipe_information h3 {
161
+ display: inline;
162
+ }
163
+ .beer_recipe .recipe_information h3:after {
164
+ content: ":"
165
+ }
166
+ .beer_recipe .recipe_information .recipe_notes p,
167
+ .beer_recipe .recipe_information .recipe_notes h3 {
168
+ display: block;
169
+ }
170
+ section {
171
+ float: left;
172
+ width: 100%;
173
+ max-width: 100%;
174
+ }
175
+ }
176
+ @media screen and (max-width: 320px) {
177
+ .beer_recipe .recipe_information {
178
+ width: 95%;
179
+ }
180
+ }
56
181
  </style>
57
182
  </head>
58
183
  <body>
59
- <article class="beer_recipe">
60
- <h1><%= name %></h1>
61
- <aside>
62
- <h2>Information</h2>
184
+ <article class="beer_recipe" itemscope itemtype="http://schema.org/Recipe">
185
+ <meta itemprop="author" content="<%= brewer %>"/>
186
+ <meta itemprop="recipeCategory" content="beverage"/>
187
+ <meta itemprop="totalTime" content="<%= total_time_period %>"/>
188
+ <meta itemprop="cookTime" content="<%= boil_time_period %>">
189
+
190
+ <h1 itemprop="name"><%= name %></h1>
191
+
192
+ <aside class="recipe_information">
193
+ <h2><%= I18n.t(:information) %></h2>
63
194
 
64
- <h3>Style</h3>
65
- <p><%= style.name %> (<%= style_code %> / <%= style.style_guide %>)</p>
195
+ <div class="recipe_style">
196
+ <h3><%= I18n.t(:style) %></h3>
197
+ <p><%= style.name %> (<%= style_code %> / <%= style.style_guide %>)</p>
198
+ </div>
66
199
 
67
- <h3>Type</h3>
68
- <p><%= style.type %></p>
200
+ <div class="recipe_type">
201
+ <h3><%= I18n.t(:type) %></h3>
202
+ <p><%= style.type %></p>
203
+ </div>
69
204
 
70
- <h3>Grains</h3>
71
- <p><%= '%.2f' % total_grains %> kg</p>
205
+ <div class="recipe_grains">
206
+ <h3><%= I18n.t(:grains) %></h3>
207
+ <p><%= '%.2f' % total_grains %> <%= I18n.t(:kilograms) %></p>
208
+ </div>
72
209
 
73
- <h3>Hops</h3>
74
- <p><%= '%.0f' % total_hops %> g</p>
210
+ <div class="recipe_hops">
211
+ <h3><%= I18n.t(:hops) %></h3>
212
+ <p><%= '%.0f' % total_hops %> <%= I18n.t(:grams) %></p>
213
+ </div>
75
214
 
76
- <h3>Equipment</h3>
77
- <p><%= equipment.name %> (<%= equipment.tun_volume %>L)</p>
215
+ <div class="recipe_equipment">
216
+ <h3><%= I18n.t(:equipment) %></h3>
217
+ <p><%= equipment.name %> (<%= equipment.tun_volume %> <%= I18n.t(:liter_abbr) %>)</p>
218
+ </div>
78
219
 
79
- <h3>Notes</h3>
80
- <p><%= notes %></p>
220
+ <div class="recipe_date">
221
+ <h3><%= I18n.t(:brew_date) %></h3>
222
+ <p><%= date %></p>
223
+ </div>
224
+
225
+ <div class="recipe_brewer">
226
+ <h3><%= I18n.t(:brewer) %></h3>
227
+ <p>
228
+ <%= brewer %>
229
+ <% unless asst_brewer.blank? %>
230
+ (<%= I18n.t(:assisted_by, assistant: asst_brewer) %>)
231
+ <% end %>
232
+ </p>
233
+ </div>
234
+
235
+ <div class="recipe_notes">
236
+ <h3><%= I18n.t(:notes) %></h3>
237
+ <p itemprop="description"><%= notes %></p>
238
+ </div>
81
239
 
82
240
  </aside>
83
241
 
84
242
  <section class="recipe_details">
85
- <h2>Recipe Details</h2>
243
+ <h2><%= I18n.t(:recipe_details) %></h2>
86
244
  <table>
87
245
  <thead>
88
246
  <tr>
89
- <th>Batch Size</th>
90
- <th>Boil Time</th>
91
- <th>IBU</th>
92
- <th>OG</th>
93
- <th>FG</th>
94
- <th>ABV</th>
95
- <th>Color</th>
247
+ <th><%= I18n.t(:batch_size) %></th>
248
+ <th><%= I18n.t(:boil_time) %></th>
249
+ <th><%= I18n.t(:ibu) %></th>
250
+ <th><%= I18n.t(:og) %></th>
251
+ <th><%= I18n.t(:fg) %></th>
252
+ <th><%= I18n.t(:abv) %></th>
253
+ <th><%= I18n.t(:calories_per_liter) %></th>
254
+ <th><%= I18n.t(:color) %></th>
96
255
  </tr>
97
256
  </thead>
98
257
  <tbody>
99
258
  <tr>
100
- <td><%= '%.1f' % batch_size %> L</td>
101
- <td><%= '%.0f' % boil_time %> min</td>
102
- <td><%= '%.0f' % ibu %></td>
103
- <td><%= '%.3f' % og %> SG</td>
104
- <td><%= '%.3f' % fg %> SG</td>
105
- <td><%= '%.1f' % abv %>%</td>
106
- <td><%= '%.0f' % color_ebc %> EBC
107
- <div class="colorbox <%= color_class %>">&nbsp;</span></td>
259
+ <td class="recipe_batch_size format_number" itemprop="recipeYield"><%= '%.1f' % batch_size %> <%= I18n.t(:liter_abbr) %></td>
260
+ <td class="recipe_boil_time format_number"><%= '%.0f' % boil_time %> <%= I18n.t(:minutes) %></td>
261
+ <td class="recipe_ibu format_number"><%= '%.0f' % ibu %></td>
262
+ <td class="recipe_og format_number"><%= '%.3f' % og %> <%= I18n.t(:sg) %></td>
263
+ <td class="recipe_fg format_number"><%= '%.3f' % fg %> <%= I18n.t(:sg) %></td>
264
+ <td class="recipe_abv format_number"><%= '%.1f' % abv %><%= I18n.t(:percent_sign) %></td>
265
+ <td class="recipe_calories format_number" itemprop="nutrition" itemscope
266
+ itemtype="http://schema.org/NutritionInformation">
267
+ <span itemprop="calories"><%= '%.0f' % calories %></span>
268
+ <meta itemprop="servingSize" content="1 L">
269
+ </td>
270
+ <td class="recipe_color format_number">
271
+ <%= '%.0f' % color_ebc %> <%= I18n.t(:ebc) %>
272
+ <div class="colorbox" style="background-color: <%= color_hex %>">&nbsp;</div>
273
+ <!-- <div class="colorbox <%= color_class %>">&nbsp;</div> --></td>
108
274
  </tr>
109
275
  </tbody>
110
276
  </table>
111
277
  </section>
112
278
 
113
- <section class="fermentables">
114
- <h2>Fermentables</h2>
279
+ <section class="recipe_fermentables">
280
+ <h2><%= I18n.t(:fermentables) %></h2>
115
281
  <table>
116
282
  <thead>
117
283
  <tr>
118
- <th>Name</th>
119
- <th>Amount</th>
120
- <th>Type</th>
121
- <th>Color</th>
284
+ <th><%= I18n.t(:percent) %></th>
285
+ <th><%= I18n.t(:fermentable_name) %></th>
286
+ <th><%= I18n.t(:fermentable_amount) %></th>
287
+ <th><%= I18n.t(:fermentable_type) %></th>
288
+ <th><%= I18n.t(:fermentable_color) %></th>
122
289
  </tr>
123
290
  </thead>
124
291
  <tbody>
125
292
  <% fermentables.each do |f| %>
293
+ <meta itemprop="recipeIngredient"
294
+ content="<%= f.formatted_amount %> <%= I18n.t(:kilograms) %> <%= f.name %>">
126
295
  <tr>
127
- <td><%= f.name %></td>
128
- <td><%= f.formatted_amount %></td>
129
- <td><%= f.type %></td>
130
- <td><%= '%.0f' % f.color_ebc %> EBC
131
- <div class="colorbox <%= f.color_class %>">&nbsp;</span></td>
296
+ <td class="fermentable_percent format_number"><%= '%.1f' % f.amount_percent %><%= I18n.t(:percent_sign) %></td>
297
+ <td class="fermentable_name"><%= f.name %></td>
298
+ <td class="fermentable_amount format_number"><%= f.formatted_amount %> <%= I18n.t(:kilograms) %></td>
299
+ <td class="fermentable_type"><%= I18n.t(f.type, default: f.type) %></td>
300
+ <td class="fermentable_color format_number">
301
+ <%= '%.0f' % f.color_ebc %> <%= I18n.t(:ebc) %>
302
+ <div class="colorbox" style="background-color: <%= f.color_hex %>">&nbsp;</div>
303
+ <!-- <div class="colorbox <%= f.color_class %>">&nbsp;</div> --></td>
132
304
  </tr>
133
305
  <% end %>
134
306
  </tbody>
135
307
  </table>
136
308
  </section>
137
309
 
138
- <section class="hops">
139
- <h2>Hops</h2>
310
+ <section class="recipe_hops">
311
+ <h2><%= I18n.t(:hops) %></h2>
140
312
  <table>
141
313
  <thead>
142
314
  <tr>
143
- <th>Name</th>
144
- <th>Amount</th>
145
- <th>Time</th>
146
- <th>Use</th>
147
- <th>Form</th>
148
- <th>Alpha</th>
149
- <th>IBU</th>
315
+ <th><%= I18n.t(:percent_sign) %></th>
316
+ <th><%= I18n.t(:hops_name) %></th>
317
+ <th><%= I18n.t(:hops_amount) %></th>
318
+ <th><%= I18n.t(:hops_time) %></th>
319
+ <th><%= I18n.t(:hops_use) %></th>
320
+ <th><%= I18n.t(:hops_form) %></th>
321
+ <th><%= I18n.t(:hops_alpha) %></th>
322
+ <th><%= I18n.t(:hops_ibu) %></th>
150
323
  </tr>
151
324
  </thead>
152
325
  <tbody>
153
326
  <% hops.each do |hop| %>
327
+ <meta itemprop="recipeIngredient"
328
+ content="<%= hop.formatted_amount %> <%= I18n.t(:grams) %> <%= hop.name %> (<%= I18n.t(hop.use, default: hop.use) %> <%= hop.formatted_time %> <%= I18n.t(hop.time_unit, default: hop.time_unit) %>)">
154
329
  <tr>
155
- <td><%= hop.name %></td>
156
- <td><%= hop.formatted_amount %></td>
157
- <td><%= hop.formatted_time %></td>
158
- <td><%= hop.use %></td>
159
- <td><%= hop.form %></td>
160
- <td><%= hop.alpha %>%</td>
161
- <td><%= '%.1f' % hop.ibu %></td>
330
+ <td class="hops_percent format_number"><%= '%.1f' % hop.amount_percent %><%= I18n.t(:percent_sign) %></td>
331
+ <td class="hops_name"><%= hop.name %></td>
332
+ <td class="hops_amount format_number"><%= hop.formatted_amount %> <%= I18n.t(:grams) %></td>
333
+ <td class="hops_time format_number"><%= hop.formatted_time %> <%= I18n.t(hop.time_unit, default: hop.time_unit) %></td>
334
+ <td class="hops_use"><%= I18n.t(hop.use, default: hop.use) %></td>
335
+ <td class="hops_form"><%= I18n.t(hop.form, default: hop.form) %></td>
336
+ <td class="hops_alpha format_number"><%= hop.alpha %><%= I18n.t(:percent_sign) %></td>
337
+ <td class="hops_ibu format_number"><%= hop.formatted_ibu %></td>
162
338
  </tr>
163
339
  <% end %>
164
340
  </tbody>
@@ -166,36 +342,68 @@
166
342
  </section>
167
343
 
168
344
  <section class="yeasts">
169
- <h2>Yeasts</h2>
345
+ <h2><%= I18n.t(:yeasts) %></h2>
170
346
  <table>
171
347
  <thead>
172
348
  <tr>
173
- <th>Name</th>
174
- <th>Product ID</th>
175
- <th>Lab</th>
176
- <th>Form</th>
177
- <th>Attenuation</th>
178
- <th>Temperature</th>
349
+ <th><%= I18n.t(:yeast_name) %></th>
350
+ <th><%= I18n.t(:yeast_product_id) %></th>
351
+ <th><%= I18n.t(:yeast_lab) %></th>
352
+ <th><%= I18n.t(:yeast_form) %></th>
353
+ <th><%= I18n.t(:yeast_attenuation) %></th>
354
+ <th><%= I18n.t(:yeast_temperature) %></th>
179
355
  </tr>
180
356
  </thead>
181
357
  <tbody>
182
358
  <% yeasts.each do |yeast| %>
183
359
  <tr>
184
- <td><%= yeast.name %></td>
185
- <td><%= yeast.product_id %></td>
186
- <td><%= yeast.laboratory %></td>
187
- <td><%= yeast.form %></td>
188
- <td><%= yeast.formatted_attenuation %></td>
189
- <td><%= yeast.formatted_temperatures %></td>
360
+ <meta itemprop="name" content="<%= yeast.name %> (<%= yeast.product_id %>) <%= yeast.laboratory %>">
361
+ <td class="yeast_name"><%= yeast.name %></td>
362
+ <td class="yeast_product_id"><%= yeast.product_id %></td>
363
+ <td class="yeast_laboratory"><%= yeast.laboratory %></td>
364
+ <td class="yeast_form"><%= I18n.t(yeast.form, default: yeast.form) %></td>
365
+ <td class="yeast_attenuation format_number"><%= yeast.formatted_attenuation %></td>
366
+ <td class="yeast_temperatures format_number"><%= yeast.formatted_temperatures %></td>
367
+ </tr>
368
+ <% end %>
369
+ </tbody>
370
+ </table>
371
+ </section>
372
+
373
+ <section class="recipe_mash" itemprop="recipeInstructions"
374
+ itemscope itemtype="https://schema.org/ItemList">
375
+ <h2><%= I18n.t(:mash) %></h2>
376
+ <table>
377
+ <thead>
378
+ <tr>
379
+ <th><%= I18n.t(:mash_name) %></th>
380
+ <th><%= I18n.t(:mash_type) %></th>
381
+ <th><%= I18n.t(:mash_infuse_amount) %></th>
382
+ <th><%= I18n.t(:mash_step_temp) %></th>
383
+ <th><%= I18n.t(:mash_ramp_time) %></th>
384
+ <th><%= I18n.t(:mash_step_time) %></th>
385
+ </tr>
386
+ </thead>
387
+ <tbody>
388
+ <% mash.steps.each do |step| %>
389
+ <tr>
390
+ <meta itemprop="name" content="<%= I18n.t(step.name, default: step.name) %> (<%= I18n.t(step.type, default: step.type) %>) <%= step.formatted_step_temp %> @ <%= step.formatted_step_time %>">
391
+ <td class="mash_name"><%= I18n.t(step.name, default: step.name) %></td>
392
+ <td class="mash_type"><%= I18n.t(step.type, default: step.type) %></td>
393
+ <td class="mash_infuse_amount format_number"><%= step.formatted_infuse_amount %> <%= I18n.t(:liter_abbr) %></td>
394
+ <td class="mash_step_temp format_number"><%= step.formatted_step_temp %><%= I18n.t(:degrees) %></td>
395
+ <td class="mash_ramp_time format_number"><%= step.formatted_ramp_time %> <%= I18n.t(:minutes) %></td>
396
+ <td class="mash_step_time format_number"><%= step.formatted_step_time %> <%= I18n.t(:minutes) %></td>
190
397
  </tr>
191
398
  <% end %>
192
399
  </tbody>
193
400
  </table>
194
401
  </section>
402
+
195
403
  </article>
196
404
 
197
405
  <footer>
198
- <p><small>Generated by <a href="http://github.com/ollej/beer_recipe">BeerRecipe</a> v<%= BeerRecipe::VERSION %></small></p>
406
+ <p><small><%= I18n.t(:generated_by) %> <a href="http://github.com/ollej/beer_recipe">BeerRecipe</a> v<%= BeerRecipe::VERSION %></small></p>
199
407
  </footer>
200
408
  </body>
201
409
  </html>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beer_recipe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Olle Johansson
@@ -77,6 +77,7 @@ files:
77
77
  - lib/beer_recipe.rb
78
78
  - lib/beer_recipe/errors.rb
79
79
  - lib/beer_recipe/fermentable_wrapper.rb
80
+ - lib/beer_recipe/formula.rb
80
81
  - lib/beer_recipe/hop_wrapper.rb
81
82
  - lib/beer_recipe/html_formatter.rb
82
83
  - lib/beer_recipe/mash_step_wrapper.rb
@@ -89,6 +90,9 @@ files:
89
90
  - lib/beer_recipe/version.rb
90
91
  - lib/beer_recipe/wrapper.rb
91
92
  - lib/beer_recipe/yeast_wrapper.rb
93
+ - locales/en.yml
94
+ - locales/se.yml
95
+ - template/exalted_beer.html.erb
92
96
  - template/html.erb
93
97
  homepage: https://github.com/ollej/beer_recipe
94
98
  licenses: