-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feature-commendation
Conflicts: app/views/articles/show/_commendation.html.slim
- Loading branch information
Showing
20 changed files
with
180 additions
and
102 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
json.(@article,:id,:slug,:title,:price_cents,:quantity_available) | ||
json.partial! 'articles/show/legal_entity', article: @article | ||
json.partial! 'articles/show/tags', article: @article | ||
json.partial! 'articles/show/donation', article: @article | ||
json.categories resource.categories.each do |leaf| | ||
json.name leaf.name | ||
json.ancestors leaf.ancestors.map(&:name) | ||
end | ||
if @article.title_image | ||
json.title_image do | ||
json.thumb_url asset_url(@article.title_image.image.url :thumb) | ||
json.original_url asset_url(@article.title_image.image.url :original) | ||
end | ||
end | ||
if show_fair_percent_for? @article | ||
json.fair_percent_html t('article.show.donate_html') | ||
end | ||
|
||
json.thumbnails @article.thumbnails do |thumbnail| | ||
json.thumb_url asset_url(thumbnail.image.url :thumb) | ||
json.original_url asset_url(thumbnail.image.url :original) | ||
end | ||
json.seller do | ||
json.type @article.seller.type.underscore | ||
if @article.seller.is_a?(LegalEntity) && @article.seller.ngo | ||
json.type_name t('users.legal_status.show.ngo') | ||
elsif @article.seller.is_a? LegalEntity | ||
json.type_name t('users.legal_status.show.legal_entity') | ||
else | ||
json.type_name t('users.legal_status.show.private_user') | ||
end | ||
json.ngo @article.seller.ngo | ||
json.name @article.seller.name | ||
json.vacationing @article.seller.vacationing? | ||
json.image_url @article.user.image_url(:profile) | ||
json.html_url user_url(@article.seller) | ||
json.ratings do | ||
json.url user_ratings_url(@article.seller) | ||
json.count @article.seller.ratings.count | ||
json.positive_percent @article.seller.percentage_of_positive_ratings | ||
json.neutral_percent @article.seller.percentage_of_neutral_ratings | ||
json.negative_percent @article.seller.percentage_of_negative_ratings | ||
end | ||
json.terms @article.seller.terms | ||
json.cancellation @article.seller.cancellation | ||
end | ||
json.content @article.content | ||
json.payment_html render(partial: '/articles/show/payment', formats: [:html]) | ||
json.transport_html render(partial: '/articles/show/transport', formats: [:html]) | ||
json.commendation_html render(partial: '/articles/show/commendation', formats: [:html], locals: {commendation_link: url_for(controller: 'contents', action: 'show', id: 'faq', anchor: 'f1', only_path: false)}) | ||
json.html_url article_url(@article) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
json.donation do | ||
if article.seller_ngo | ||
json.percent 100 | ||
json.organization do | ||
json.name article.seller_nickname | ||
json.id article.seller | ||
json.html_url user_url(article.seller) | ||
end | ||
elsif show_friendly_percent_for? article | ||
json.percent article.friendly_percent | ||
json.organization do | ||
json.name article.friendly_percent_organisation_nickname | ||
json.id article.friendly_percent_organisation_id | ||
json.html_url user_url(article.friendly_percent_organisation) | ||
end | ||
else | ||
json.nil! | ||
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
if article.belongs_to_legal_entity? | ||
json.vat article.vat if article.vat != 0 | ||
if show_basic_price_for? article | ||
json.basic_price_cents (article.basic_price.is_a?(Money) ? article.basic_price_cents : article.basic_price) | ||
json.basic_price_amount article.basic_price_amount | ||
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
h4 | ||
= t('formtastic.labels.article.payment_methods')+':' | ||
ul | ||
= payment_format_for "bank_transfer" | ||
= payment_format_for "cash" | ||
= payment_format_for "paypal" | ||
= payment_format_for "cash_on_delivery" | ||
= payment_format_for "invoice" | ||
|
||
= simple_format(resource.payment_details).html_safe |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
json.tags do | ||
json.condition article.condition | ||
json.fair article.fair | ||
json.ecologic article.ecologic | ||
json.small_and_precious article.small_and_precious | ||
json.borrowable article.borrowable | ||
json.swappable article.swappable | ||
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
h4 | ||
= t('formtastic.labels.article.transport_method') + ':' | ||
ul | ||
= transport_format_for "pickup" | ||
= transport_format_for "type1" | ||
= transport_format_for "type2" | ||
|
||
= simple_format(resource.transport_details).html_safe |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
if @line_item.errors.any? | ||
json.error I18n.t('line_item.notices.error_quantity') | ||
else | ||
json.cart_id @cart.id | ||
json.cart_url cart_url(@cart) | ||
json.line_item @line_item | ||
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
Oops, something went wrong.