Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change font to webfont, add ingredient captions
- Loading branch information
Showing
9 changed files
with
67 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,29 @@ | ||
module ApplicationHelper | ||
|
||
def get_components_str_from_order(order) | ||
selected_components = order.get_selected_components | ||
componentText = '' | ||
if selected_components.any? | ||
txt = componentName(selected_components[selected_components.length-1]); | ||
|
||
#b and c | ||
#a, b and c | ||
second_last_component = selected_components.length-2; | ||
second_last_component.downto(0) {|i| | ||
if i == second_last_component | ||
componentText = componentName(selected_components[i]) + " and " + txt | ||
else | ||
componentText = componentName(selected_components[i]) + ", " + txt | ||
end | ||
} | ||
componentText = " with " + componentText | ||
end | ||
return componentText | ||
end | ||
|
||
def componentName(comp_name) | ||
return "<span class='selected-component'>" + comp_name + "</span>" | ||
end | ||
|
||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,5 @@ | ||
module OrdersHelper | ||
|
||
def get_components_str_from_order(order) | ||
selected_components = order.get_selected_components | ||
|
||
if selected_components.any? | ||
txt = componentName(selected_components[selected_components.length-1]); | ||
|
||
#b and c | ||
#a, b and c | ||
second_last_component = selected_components.length-2; | ||
second_last_component.downto(0) {|i| | ||
if i == second_last_component | ||
componentText = componentName(selected_components[i]) + " and " + txt | ||
else | ||
componentText = componentName(selected_components[i]) + ", " + txt | ||
end | ||
} | ||
componentText = " with " + componentText | ||
end | ||
return componentText | ||
end | ||
|
||
def componentName(comp_name) | ||
return "<span class='selected-component'>" + comp_name + "</span>" | ||
end | ||
|
||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters