5 Commits

Author SHA1 Message Date
Jeff Dutil
7dabf1a520 Support Spree 1.3.x, add default unauthorized page, and organize locales. 2013-03-10 09:46:06 -04:00
Michael Bianco
52e7009c17 Running tests, and fixing breaking changes, for 1.2.3 2013-03-10 09:35:48 -04:00
Michael Bianco
8d44a25199 Note about improvement to create_digital_links 2013-03-10 09:35:48 -04:00
Michael Bianco
e6f8d6b4cc Merge pull request #35 from nitsujri/master
Fix for digital_controller throwing an error with unavailable.html.erb
2013-03-10 06:29:03 -07:00
Justin Louie
1d9fab3942 Fixing controller for current_order bug
unavailable.html.erb throws an error missing current_order

https://groups.google.com/forum/?fromgroups=#!topic/spree-user/mbEVVManQY8
2013-03-10 14:08:04 +08:00
11 changed files with 54 additions and 34 deletions

View File

@@ -9,4 +9,4 @@ group :test do
end
end
gem 'spree', '~> 1.2'
gem 'spree', '~> 1.3.2'

View File

@@ -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" }

View File

@@ -1,7 +1,7 @@
module Spree
class DigitalsController < Spree::BaseController
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

View File

@@ -9,7 +9,7 @@ Spree::LineItem.class_eval do
private
# Create the download link for this item if it is digital.
# TODO there is no reason to create the digital links until the order is complete
def create_digital_links
digital_links.delete_all

View File

@@ -0,0 +1,9 @@
<% if defined?(SpreeFancy) %>
<% content_for :subheader do %>
<h1><%= t('.unauthorized') %></h1>
<% end %>
<% else %>
<h1><%= t('.unauthorized') %></h1>
<% end %>
<%= t('.explained') %>

View File

@@ -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
upload: Upload

View File

@@ -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

View File

@@ -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: ダウンロードリンクを<strong>%{email}</strong>に送ります
digital_versions: デジタル版
new_file: 新しいファイル
spree:
digitals:
unauthorized:
explained: This download link has expired.
unauthorized: Unauthorized
upload: アップロード

View File

@@ -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

View File

@@ -1,16 +1,14 @@
ENV["RAILS_ENV"] = "test"
require File.expand_path("../dummy/config/environment.rb", __FILE__)
require 'rspec/rails'
require 'database_cleaner'
require 'ffaker'
require 'shoulda-matchers'
# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Dir[File.join(File.dirname(__FILE__), "support/**/*.rb")].each {|f| require f }
require 'spree/core/testing_support/factories'
require 'spree/core/testing_support/env'
require 'spree/core/testing_support/controller_requests'
require 'spree/core/url_helpers'

View File

@@ -3,7 +3,7 @@ Gem::Specification.new do |s|
s.name = 'spree_digital'
s.version = '1.1.1'
s.summary = ''
s.description = 'Add digital download functionality to spree'
s.description = 'Digital download functionality for spree'
s.authors = ['funkensturm', 'Michael Bianco']
s.email = ['info@cliffsidedev.com']
s.homepage = 'http://www.funkensturm.com'
@@ -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.0'
s.add_dependency 'spree_core', '~> 1.3.0'
# test suite
s.add_development_dependency 'shoulda-matchers'