diff --git a/Gemfile b/Gemfile
index a27e7b2..f310df2 100644
--- a/Gemfile
+++ b/Gemfile
@@ -9,4 +9,4 @@ group :test do
end
end
-gem 'spree', '~> 1.2.3'
+gem 'spree', '~> 1.3.2'
diff --git a/Versionfile b/Versionfile
index 611e92c..46204a6 100644
--- a/Versionfile
+++ b/Versionfile
@@ -1,4 +1,5 @@
"0.7.x" => { :ref => "eddaea63959586d123007cbca3be5bf9c5edb1a7" }
"1.0.x" => { :ref => "a8c27750ef1cf9d0ad1a2a6ebe33307da900a5c1" }
"1.1.x" => { :branch => "1-1-stable" }
-"1.2.x" => { :branch => "master" }
+"1.2.x" => { :ref => "9360c635039aaeeee18026b830aa96cc7587cd0d" }
+"1.3.x" => { :branch => "master" }
diff --git a/app/controllers/spree/digitals_controller.rb b/app/controllers/spree/digitals_controller.rb
index a05c661..0ea4cb2 100644
--- a/app/controllers/spree/digitals_controller.rb
+++ b/app/controllers/spree/digitals_controller.rb
@@ -1,7 +1,7 @@
module Spree
class DigitalsController < Spree::StoreController
ssl_required :show
-
+
def show
link = DigitalLink.find_by_secret(params[:secret])
@@ -19,9 +19,9 @@ module Spree
Rails.logger.error "Missing Digital Item: #{attachment.path}"
end
end
-
+
render :unauthorized
end
-
+
end
end
diff --git a/app/views/spree/digitals/unauthorized.html.erb b/app/views/spree/digitals/unauthorized.html.erb
new file mode 100644
index 0000000..6cffbc2
--- /dev/null
+++ b/app/views/spree/digitals/unauthorized.html.erb
@@ -0,0 +1,9 @@
+<% if defined?(SpreeFancy) %>
+ <% content_for :subheader do %>
+
<%= t('.unauthorized') %>
+ <% end %>
+<% else %>
+ <%= t('.unauthorized') %>
+<% end %>
+
+<%= t('.explained') %>
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 2126a3b..440bb39 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -1,11 +1,7 @@
en:
- digital_versions: Digital Versions
- reset_downloads: Reset Digital Downloads
- downloads_reset: Digital Downloads Reset
- current_file: Current File
- new_file: New File
- delete_file: Delete this file
broken_file: Warning! this file is broken
+ current_file: Current File
+ delete_file: Delete this file
delete_file_cofirmation: Are you sure you want to delete the file %{filename}?
digital_delivery: Digital Delivery
digital_download: Download %{type} ↓
@@ -15,5 +11,14 @@ en:
mobi: Kindle eBook
epub: ePub eBook
pdf: pdf eBook
+ digital_versions: Digital Versions
+ downloads_reset: Digital Downloads Reset
+ new_file: New File
+ reset_downloads: Reset Digital Downloads
+ spree:
+ digitals:
+ unauthorized:
+ explained: This download link has expired.
+ unauthorized: Unauthorized
spree_digital:
- upload: Upload
\ No newline at end of file
+ upload: Upload
diff --git a/config/locales/it.yml b/config/locales/it.yml
index eb7e817..46a44c8 100644
--- a/config/locales/it.yml
+++ b/config/locales/it.yml
@@ -1,9 +1,7 @@
it:
- digital_versions: Versioni Digitali
- current_file: File Corrente
- new_file: Nuovo File
- delete_file: Elimina questo file
broken_file: Attenzione! questo file sembra essere rotto
+ current_file: File Corrente
+ delete_file: Elimina questo file
delete_file_cofirmation: Sei sicuro di voler eliminare il file %{filename}?
digital_delivery: Consegna Digitale
digital_download: Download %{type} ↓
@@ -13,6 +11,12 @@ it:
mobi: Kindle eBook
epub: ePub eBook
pdf: pdf eBook
+ digital_versions: Versioni Digitali
+ new_file: Nuovo File
+ spree:
+ digitals:
+ unauthorized:
+ explained: This download link has expired.
+ unauthorized: Unauthorized
spree_digital:
- upload: Upload
-
+ upload: Upload
\ No newline at end of file
diff --git a/config/locales/ja.yml b/config/locales/ja.yml
index 4f06e6b..cb3ff2c 100644
--- a/config/locales/ja.yml
+++ b/config/locales/ja.yml
@@ -1,12 +1,14 @@
ja:
- digital_versions: デジタル版
-
- current_file: 現在のバージョン
- new_file: 新しいファイル
- upload: アップロード
- delete_file: このファイルを削除
broken_file: 注意! このファイルが壊れている!
+ current_file: 現在のバージョン
+ delete_file: このファイルを削除
delete_file_cofirmation: 本当に「%{filename}」を削除しても宜しいですか?
-
digital_shipping: ダウンロードリンクを%{email}に送ります
-
+ digital_versions: デジタル版
+ new_file: 新しいファイル
+ spree:
+ digitals:
+ unauthorized:
+ explained: This download link has expired.
+ unauthorized: Unauthorized
+ upload: アップロード
diff --git a/readme.md b/readme.md
index ba3883a..37c683f 100644
--- a/readme.md
+++ b/readme.md
@@ -17,7 +17,7 @@ The idea is simple. You attach a file to a Product (or a Variant of this Product
* The file `views/order_mailer/confirm_email.text.erb` is the only thing that should need customization. If you are looking for HTML emails, [this branch of spree-html-email](http://github.com/iloveitaly/spree-html-email) supports spree_digital
* A purchased product can be downloaded even if you disable the product immediately. You would have to remove the attached file in your admin section to prevent people from downloading purchased products.
* File are uploaded to `rails_root/private`. Make sure it's symlinked in case you're using Capistrano. If you want to change the upload path, [check out this gist](https://gist.github.com/3187793#file_spree_digital_path_change_decorator.rb)
-* You must add a `views/spree/digitals/unauthorized.html.erb` file to present an error message to the user if they exceed the download / days limit
+* You must add a `views/spree/digitals/unauthorized.html.erb` file to customize an error message to the user if they exceed the download / days limit
* We use send_file to send the files on download. See below for instructions on how to push file downloading off to nginx.
## Installation
diff --git a/spree_digital.gemspec b/spree_digital.gemspec
index c3c2be2..98bcfe5 100644
--- a/spree_digital.gemspec
+++ b/spree_digital.gemspec
@@ -12,7 +12,8 @@ Gem::Specification.new do |s|
s.require_path = 'lib'
s.requirements << 'none'
s.required_ruby_version = '>= 1.8.7'
- s.add_dependency 'spree_core', '~> 1.1'
+
+ s.add_dependency 'spree_core', '~> 1.3.0'
# test suite
s.add_development_dependency 'shoulda-matchers'