Permalink
Browse files

Merge branch 'master'

  • Loading branch information...
nikolailv committed Sep 18, 2017
2 parents 7f5ea6f + 8099a97 commit 26ba016d658f7723853214144851735f31740ec4
Showing with 788 additions and 281 deletions.
  1. +1 −1 .wti
  2. +37 −2 CHANGELOG.md
  3. +1 −1 Dockerfile
  4. +2 −1 Gemfile
  5. +5 −2 Gemfile.lock
  6. +25 −4 UPGRADE.md
  7. +1 −1 VERSION
  8. +9 −4 app/assets/javascripts/datepicker.js
  9. +5 −2 app/assets/javascripts/image_uploader.js
  10. +1 −1 app/assets/javascripts/kassi.js
  11. +3 −1 app/assets/stylesheets/views/_listing-image-carousel.scss
  12. +7 −0 app/assets/stylesheets/views/_listings.scss
  13. +18 −0 app/controllers/landing_page_controller.rb
  14. +1 −1 app/helpers/application_helper.rb
  15. +2 −0 app/jobs/confirm_reminder_job.rb
  16. +2 −0 app/jobs/testimonial_reminder_job.rb
  17. +2 −0 app/jobs/transaction_preauthorized_reminder_job.rb
  18. +0 −10 app/mailers/transaction_mailer.rb
  19. +1 −0 app/models/custom_field_option.rb
  20. +2 −1 app/services/feature_flag_service/store.rb
  21. +14 −22 app/view_utils/money_view_utils.rb
  22. +4 −7 app/views/admin/getting_started_guide/index.haml
  23. +102 −0 app/views/landing_page/_icon.erb
  24. +1 −1 app/views/landing_page/landing_page.erb
  25. +2 −1 app/views/layouts/_intercom.erb
  26. +3 −3 app/views/layouts/_marketplace_head.haml
  27. +3 −3 app/views/layouts/react_page.haml
  28. +1 −1 app/views/listings/custom_field_partials/_checkbox.haml
  29. +1 −1 app/views/listings/help_texts/_help_valid_until.ja.haml
  30. +1 −0 app/views/testimonials/new.haml
  31. +1 −1 circle.yml
  32. +1 −2 client/app/actions/ManageAvailabilityActions.js
  33. +4 −0 config/application.rb
  34. +11 −0 config/config.defaults.yml
  35. +118 −0 config/initializers/rack_attack.rb
  36. +1 −1 config/locales/branded/en.yml
  37. +2 −2 config/locales/da-DK.yml
  38. +4 −4 config/locales/de.yml
  39. +1 −1 config/locales/devise.ja.yml
  40. +3 −3 config/locales/devise.sv.yml
  41. +5 −5 config/locales/en.yml
  42. +6 −6 config/locales/es-ES.yml
  43. +3 −3 config/locales/es.yml
  44. +2 −2 config/locales/fi.yml
  45. +6 −6 config/locales/fr.yml
  46. +3 −3 config/locales/it.yml
  47. +18 −18 config/locales/ja.yml
  48. +6 −6 config/locales/nl.yml
  49. +98 −92 config/locales/sv.yml
  50. +27 −27 config/locales/vi.yml
  51. +2 −0 config/routes.rb
  52. +0 −17 db/structure.sql
  53. +1 −1 features/support/feature_tests/action/paypal.rb
  54. +31 −9 vendor/assets/javascripts/datepicker/bootstrap-datepicker.js
  55. +177 −1 vendor/assets/javascripts/jquery.ui.touch-punch.min.js
View
2 .wti
@@ -1,4 +1,4 @@
api_key: 1344ea9663dfe3de439f913bd8ea15ac7c26dd1b
api_key: proj_pub_BsrHgvBQRZxQmO6r6_JCXw
# Optional: locales not to sync with Web Translate It.
# Takes a string, a symbol, or an array of string or symbol.
View
@@ -20,7 +20,40 @@ This file follows the best practices from [keepachangelog.com](http://keepachang
### Security
## [7.0.0] - 2017-06-09
## [7.1.0] - 2017-09-15
### Added
- Added configuration for trusted proxies [#3040](https://github.com/sharetribe/sharetribe/pull/3040)
### Changed
- Currencies can now be formatted with translations [#3043](https://github.com/sharetribe/sharetribe/pull/3043)
- Transaction status is now named Completed everywhere instead of Confirmed [#3028](https://github.com/sharetribe/sharetribe/pull/3028)
- WebTranslateIt API keys were updated [#3029](https://github.com/sharetribe/sharetribe/pull/3029)
- Force meta tags content to be HTML escaped [#3047](https://github.com/sharetribe/sharetribe/pull/3047)
- Upgrade to latest ruby 2.3.4 with latest rubygems (2.6.13+) [#3056](https://github.com/sharetribe/sharetribe/pull/3056)
### Deprecated
### Removed
### Fixed
- Fixed image deletion in Android [3023](https://github.com/sharetribe/sharetribe/pull/3023)
- Fixed changing the names of custom listing field options [3024](https://github.com/sharetribe/sharetribe/pull/3024)
- Fixed image ordering usability in Android [3034](https://github.com/sharetribe/sharetribe/pull/3034)
- Fixed not sending automatic emails to expired and deleted marketplaces [3044](https://github.com/sharetribe/sharetribe/pull/3044)
- Fixed carousel black box rendering issue [3045](https://github.com/sharetribe/sharetribe/pull/3045)
- Fixed datepicker issue with per night availability [3046](https://github.com/sharetribe/sharetribe/pull/3046)
- Fixed listing checkbox layout issue on mobile [3048](https://github.com/sharetribe/sharetribe/pull/3048)
- Fixed admin layout issue in Safari [3066](https://github.com/sharetribe/sharetribe/pull/3066)
- Fixed error message layout placement when reviewing without grade [3067](https://github.com/sharetribe/sharetribe/pull/3067)
- Fixed managing availability of rejected booking dates [3068](https://github.com/sharetribe/sharetribe/pull/3068)
### Security
## [7.0.0] - 2017-08-08
### Changed
@@ -396,7 +429,9 @@ This file follows the best practices from [keepachangelog.com](http://keepachang
For older releases, see [RELEASE_NOTES.md](https://github.com/sharetribe/sharetribe/blob/v5.0.0/RELEASE_NOTES.md).
[Unreleased]: https://github.com/sharetribe/sharetribe/compare/v6.4.0...HEAD
[Unreleased]: https://github.com/sharetribe/sharetribe/compare/v7.1.0...HEAD
[7.1.0]: https://github.com/sharetribe/sharetribe/compare/v7.0.0...v7.1.0
[7.0.0]: https://github.com/sharetribe/sharetribe/compare/v6.4.0...v7.1.0
[6.4.0]: https://github.com/sharetribe/sharetribe/compare/v6.3.0...v6.4.0
[6.3.0]: https://github.com/sharetribe/sharetribe/compare/v6.2.0...v6.3.0
[6.2.0]: https://github.com/sharetribe/sharetribe/compare/v6.1.0...v6.2.0
View
@@ -1,4 +1,4 @@
FROM ruby:2.3.1
FROM ruby:2.3.4
MAINTAINER Sharetribe Team <team@sharetribe.com>
View
@@ -1,6 +1,6 @@
source 'http://rubygems.org'
ruby '2.3.1'
ruby '2.3.4'
gem 'rails', '5.1.1'
@@ -20,6 +20,7 @@ gem "passenger", '~> 5.1.4'
gem "mysql2", '~> 0.4.6'
gem 'haml', '~> 5.0.1'
gem 'sass', '~> 3.4.24'
gem 'rack-attack', '~> 5.0.1'
gem 'rest-client', '~> 2.0.2'
gem 'paperclip', '~> 5.1.0'
View
@@ -370,6 +370,8 @@ GEM
json
websocket (~> 1.0)
rack (2.0.3)
rack-attack (5.0.1)
rack
rack-contrib (1.2.0)
rack (>= 0.9.1)
rack-protection (2.0.0)
@@ -629,6 +631,7 @@ DEPENDENCIES
premailer (~> 1.10.4)
pry-byebug
public_suffix (~> 2.0.5)
rack-attack (~> 5.0.1)
rack-test (~> 0.6.3)
rails (= 5.1.1)
rails-controller-testing (~> 1.0.2)
@@ -665,7 +668,7 @@ DEPENDENCIES
zeus (~> 0.15.13)
RUBY VERSION
ruby 2.3.1p112
ruby 2.3.4p301
BUNDLED WITH
1.15.1
1.15.4
View
@@ -33,16 +33,37 @@ See instructions how to set application in [maintenance mode in Heroku](https://
## Unreleased
## Upgrade from 7.0.0 to 7.1.0
Ruby version is updated from 2.3.1 to 2.3.4. The update contains fixes for several security vulnerabilities.
Using [RVM](https://rvm.io/), you can upgrade your local Ruby version like this:
```
rvm install ruby-2.3.4
rvm use ruby-2.3.4
gem install bundler
bundle install
```
## Upgrade from 6.4.0 to 7.0.0
Make sure you have node 7.8 installed.
Then follow the [#general-update-instructions].
if foreman causes trouble with an error message:
`'method_missing': undefined method 'this'`
it's an issue with rubygems itself. Can be solved by updating rubygems with:
`gem update --system`
If foreman causes trouble with an error message:
```
'method_missing': undefined method 'this'
```
it's an issue with rubygems. This issue can be solved by updating rubygems with:
```bash
gem update --system
```
## Upgrade from 6.3.0 to 6.4.0
View
@@ -1 +1 @@
6.4.0
7.1.0
@@ -30,7 +30,8 @@ window.ST = window.ST || {};
startDate: today,
inputs: [$("#start-on"), $("#end-on")],
endDate: endDate,
datesDisabled: disabledStartDates
datesDisabled: disabledStartDates,
plusOne: nightPicker
};
if(dateLocale !== 'en') {
@@ -41,11 +42,15 @@ window.ST = window.ST || {};
if (nightPicker) {
$("#start-on").focus(function() {
$("#start-on").datepicker("setDatesDisabled", disabledStartDates);
if(!$(this).is(":focus")) {
$("#start-on").datepicker("setDatesDisabled", disabledStartDates);
}
});
$("#end-on").focus(function() {
$("#end-on").datepicker("setDatesDisabled", disabledEndDates);
if(!$(this).is(":focus")) {
$("#end-on").datepicker("setDatesDisabled", disabledEndDates);
}
});
}
@@ -64,8 +69,8 @@ window.ST = window.ST || {};
// End date should be excluded
newDate.setDate(newDate.getDate() + 1);
}
outputElement.val(module.utils.toISODate(newDate));
setTimeout(function() { $("#end-on").valid(); }, 360)
});
};
})(window.ST);
@@ -558,10 +558,13 @@ window.ST.imageUploader = function(listings, opts) {
$("#listing_ordered_images").val(ordered.join(","));
}
function unfocusMe() {
$(":text").blur();
}
if (opts.reorderUrl) {
$(".listing-images").sortable({stop: reorderImages, items: '.fileinput-button:not(:last-child)' });
$(".listing-images").sortable({start: unfocusMe, stop: reorderImages, items: '.fileinput-button:not(:last-child)' });
} else {
$(".listing-images").sortable({stop: localReorderImages, items: '.fileinput-button:not(:last-child)'});
$(".listing-images").sortable({start: unfocusMe, stop: localReorderImages, items: '.fileinput-button:not(:last-child)'});
}
return status;
@@ -360,7 +360,7 @@ function initialize_give_feedback_form(locale, grade_error_message, text_error_m
$(form_id).validate({
errorPlacement: function(error, element) {
if (element.attr("name") == "testimonial[grade]") {
error.appendTo(element.parent().parent());
error.appendTo($("#testimonial-grade-error"));
} else {
error.insertAfter(element);
}
@@ -68,13 +68,15 @@
right: 0;
text-align: right;
width: 75%;
background: transparent;
}
.listing-image-navi-left {
@extend .listing-image-navi-clickarea;
left: 0;
text-align: left;
width: 25%;
background: transparent;
}
.listing-no-image {
@@ -145,4 +147,4 @@
&.too-narrow {
@include image-too-narrow;
}
}
}
@@ -254,3 +254,10 @@ $listing-author-avatar-height: 108;
.listings-how-paypal-works-link {
font-size: em(14);
}
@media (max-width: 480px) {
.checkbox-group {
.col-4 {
margin-bottom: 0;
}
}
}
@@ -140,6 +140,24 @@ def preview
end
end
include ActionView::Helpers::JavaScriptHelper
def custom_head_scripts
@current_community = request.env[:current_marketplace]
FeatureFlagHelper.init(community_id: @current_community.id,
user_id: @current_user&.id,
request: request,
is_admin: Maybe(@current_user).is_admin?.or_else(false),
is_marketplace_admin: Maybe(@current_user).is_marketplace_admin?(@current_community).or_else(false))
if FeatureFlagHelper.feature_enabled?(:landing_scripts)
js = @current_community.custom_head_script.to_s
render body: "document.write(\"#{escape_javascript js}\")", content_type: 'text/javascript'
else
render body: "", content_type: 'text/javascript'
end
end
private
@@ -324,7 +324,7 @@ def admin_links_for(community)
:topic => :general,
:text => t("admin.left_hand_navigation.academy"),
:icon_class => icon_class("academy"),
:path => "https://www.sharetribe.com/academy/?utm_source=marketplaceadminpanel&utm_medium=referral&utm_campaign=leftnavi",
:path => "https://www.sharetribe.com/academy/guide/?utm_source=marketplaceadminpanel&utm_medium=referral&utm_campaign=leftnavi",
:name => "academy"
}
]
@@ -11,6 +11,8 @@ def before(job)
end
def perform
return if Maybe(::PlanService::API::Api.plans.get_current(community_id: community_id).data)[:expired].or_else(false)
transaction = Transaction.find(conversation_id)
community = Community.find(community_id)
if transaction.status.eql?("paid")
@@ -12,6 +12,8 @@ def before(job)
end
def perform
return if Maybe(::PlanService::API::Api.plans.get_current(community_id: community_id).data)[:expired].or_else(false)
transaction = Transaction.find(conversation_id)
community = Community.find(community_id)
@@ -15,6 +15,8 @@ def before(job)
def perform
transaction = Transaction.find(transaction_id)
return if Maybe(::PlanService::API::Api.plans.get_current(community_id: transaction.community.id).data)[:expired].or_else(false)
if transaction.status == "preauthorized"
MailCarrier.deliver_now(TransactionMailer.transaction_preauthorized_reminder(transaction))
end
@@ -84,11 +84,6 @@ def payment_receipt_to_seller(transaction, seller_model = nil, buyer_model = nil
unit_type = Maybe(transaction).select { |t| t[:unit_type].present? }.map { |t| ListingViewUtils.translate_unit(t[:unit_type], t[:unit_tr_key]) }.or_else(nil)
quantity_selector_label = Maybe(transaction).select { |t| t[:unit_type].present? }.map { |t| ListingViewUtils.translate_quantity(t[:unit_type], t[:unit_selector_tr_key]) }.or_else(nil)
FeatureFlagHelper.init(community_id: community.id,
user_id: seller_model.id,
request: OpenStruct.new(session: {}, params: []), #fake request, will provide fake .session and .params
is_admin: seller_model.is_admin?,
is_marketplace_admin: seller_model.is_marketplace_admin?(community)) # TODO: remove when :currency_formatting flag is removed
premailer_mail(:to => seller_model.confirmed_notification_emails_to,
:from => community_specific_sender(community),
:subject => t("emails.new_payment.new_payment")) do |format|
@@ -128,11 +123,6 @@ def payment_receipt_to_buyer(transaction, seller_model = nil, buyer_model = nil,
unit_type = Maybe(transaction).select { |t| t[:unit_type].present? }.map { |t| ListingViewUtils.translate_unit(t[:unit_type], t[:unit_tr_key]) }.or_else(nil)
quantity_selector_label = Maybe(transaction).select { |t| t[:unit_type].present? }.map { |t| ListingViewUtils.translate_quantity(t[:unit_type], t[:unit_selector_tr_key]) }.or_else(nil)
FeatureFlagHelper.init(community_id: community.id,
user_id: buyer_model.id,
request: OpenStruct.new(session: {}, params: []), #fake request, will provide fake .session and .params
is_admin: buyer_model.is_admin?,
is_marketplace_admin: buyer_model.is_marketplace_admin?(community)) # TODO: remove when :currency_formatting flag is removed
premailer_mail(:to => buyer_model.confirmed_notification_emails_to,
:from => community_specific_sender(community),
:subject => t("emails.receipt_to_payer.receipt_of_payment")) { |format|
@@ -36,5 +36,6 @@ def title_attributes=(attributes)
titles.build(:value => value, :locale => locale)
end
end
self.updated_at = Time.zone.now # to change TranslationCache key
end
end
@@ -22,7 +22,8 @@ class FeatureFlag
:searchpage_v1,
:manage_searchpage,
:currency_formatting,
:stripe
:stripe,
:landing_scripts
].to_set
def initialize(additional_flags:)
@@ -9,29 +9,21 @@ module MoneyViewUtils
def to_humanized(m, locale = I18n.locale)
return "" if m.nil?
# TODO: Remove feature flag
if FeatureFlagHelper.feature_enabled?(:currency_formatting)
# Explicitly resolve formatting. WebTranslateit resolves
# translations to nils which causes an error with number_to_currency
formatting = currency_opts(locale, m.currency)
precision = formatting[:digits]
zero_cents = "0" * precision
# Explicitly resolve formatting. WebTranslateit resolves
# translations to nils which causes an error with number_to_currency
formatting = currency_opts(locale, m.currency)
precision = formatting[:digits]
zero_cents = "0" * precision
number_to_currency(m.amount,
unit: formatting[:symbol],
delimiter: formatting[:delimiter],
separator: formatting[:separator],
format: formatting[:format],
precision: precision)
.tr(" ", "\u202F")
.gsub("#{formatting[:separator]}#{zero_cents}", "") # remove cents if they are zero
.encode('utf-8')
else
humanized_money_with_symbol(m).upcase
end
rescue FeatureFlagHelper::FeatureFlagHelperNotInitialized
humanized_money_with_symbol(m).upcase
number_to_currency(m.amount,
unit: formatting[:symbol],
delimiter: formatting[:delimiter],
separator: formatting[:separator],
format: formatting[:format],
precision: precision)
.tr(" ", "\u202F")
.gsub("#{formatting[:separator]}#{zero_cents}", "") # remove cents if they are zero
.encode('utf-8')
end
# Return a hash of currency formatting options, sets defaults if
Oops, something went wrong.

0 comments on commit 26ba016

Please sign in to comment.