Permalink
Browse files

upgrade to spree 1.1.0rc1

  • Loading branch information...
1 parent 781814d commit 4681680eb362e8eb265168c75a296d2781df1833 @citrus committed Apr 11, 2012
@@ -7,10 +7,10 @@ def index
private
def collection
- params[:search] ||= {}
- params[:search][:meta_sort] ||= "created_at.desc"
- @search = Spree::Upload.metasearch(params[:search])
- @collection = @search.page(params[:page]).per(Spree::Config[:orders_per_page])
+ params[:q] ||= {}
+ params[:q][:sort] ||= "created_at.desc"
+ @search = Spree::Upload.search(params[:q])
+ @collection = @search.result.page(params[:page]).per(Spree::Config[:orders_per_page])
end
end
@@ -1,5 +1,7 @@
class Spree::Upload < ::Spree::Asset
+ attr_accessible :attachment, :alt
+
default_scope where(:type => "Upload") if table_exists?
validate :no_attachement_errors
@@ -32,6 +32,21 @@
<%= paginate @uploads %>
+
+<% content_for :sidebar do %>
+
+<div class="box">
+ <h3><%= t(:search) %></h3>
+ <%= search_form_for [ :admin, @search ] do |f| %>
+ <p>
+ <%= f.label :alt_cont, t("description") %><br />
+ <%= f.text_field :alt_cont, :size => 25 %>
+ </p>
+ <p><%= button t("search") %></p>
+ <% end %>
+</div>
+<% end %>
+
<div id="images"></div>
<br/>
<p>
@@ -19,6 +19,10 @@ en:
model_name: Upload
file_name: File Name
size: Size
+
+ # spree hack
+ first_name_start: "First Name starts with"
+ last_name_start: "Last Name starts with"
spree:
admin:
@@ -39,7 +43,3 @@ en:
index:
listing_uploads: Listing Uploads
new_upload: Upload a file
-
- faker:
- lorem:
- words: [alias, consequatur, perferendis, voluptatem, accusantium, doloremque, aperiam, eaque, ipsa, quae, illo, inventore, veritatis, quasi, architecto, beatae, vitae, dicta, sunt, explicabo, aspernatur, aut, odit, aut, fugit, sed, quia, consequuntur, magni, dolores, eos, qui, ratione, voluptatem, sequi, nesciunt, neque, dolorem, ipsum, quia, dolor, sit, amet, consectetur, adipisci, velit, sed, quia, non, numquam, eius, modi, tempora, incidunt, ut, labore, et, dolore, magnam, aliquam, quaerat, voluptatem, ut, enim, ad, minima, veniam, quis, nostrum, exercitationem, ullam, corporis, nemo, enim, ipsam, voluptatem, quia, voluptas, sit, suscipit, laboriosam, nisi, ut, aliquid, ex, ea, commodi, consequatur, quis, autem, vel, eum, iure, reprehenderit, qui, in, ea, voluptate, velit, esse, quam, nihil, molestiae, et, iusto, odio, dignissimos, ducimus, qui, blanditiis, praesentium, laudantium, totam, rem, voluptatum, deleniti, atque, corrupti, quos, dolores, et, quas, molestias, excepturi, sint, occaecati, cupiditate, non, provident, sed, ut, perspiciatis, unde, omnis, iste, natus, error, similique, sunt, in, culpa, qui, officia, deserunt, mollitia, animi, id, est, laborum, et, dolorum, fuga, et, harum, quidem, rerum, facilis, est, et, expedita, distinctio, nam, libero, tempore, cum, soluta, nobis, est, eligendi, optio, cumque, nihil, impedit, quo, porro, quisquam, est, qui, minus, id, quod, maxime, placeat, facere, possimus, omnis, voluptas, assumenda, est, omnis, dolor, repellendus, temporibus, autem, quibusdam, et, aut, consequatur, vel, illum, qui, dolorem, eum, fugiat, quo, voluptas, nulla, pariatur, accusamus, officiis, debitis, aut, rerum, necessitatibus, saepe, eveniet, ut, et, voluptates, repudiandae, sint, molestiae, non, recusandae, itaque, earum, rerum, tenetur, sapiente, delectus, reiciendis, voluptatibus, maiores, doloribus, asperiores, repellat]
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
s.require_paths = ["lib"]
- s.add_runtime_dependency('spree_core', '~> 1.0.0')
+ s.add_runtime_dependency('spree_core', '~> 1.1.0.rc1')
s.add_runtime_dependency('rdiscount', '~> 1.6.8')
s.add_development_dependency('shoulda', '~> 3.0.0')
@@ -56,7 +56,7 @@ def setup
should "display the index" do
visit spree.admin_uploads_path
assert has_link?("1.png", :href => @upload.attachment.url(:original))
- assert_seen "Just an image!", :within => "tr#spree_upload_#{@upload.id}"
+ assert_seen "Just an image!", :within => "tr#upload_#{@upload.id}"
within "td.actions" do
assert find("a.icon_link").native.attribute("href").include?(spree.edit_admin_upload_path(@upload))
assert has_selector?("a[href='#']")
@@ -65,7 +65,7 @@ def setup
should "edit the upload" do
visit spree.edit_admin_upload_path(@upload)
- assert_seen "Preview", :within => ".edit_spree_upload p b"
+ assert_seen "Preview", :within => ".edit_upload p b"
assert has_xpath?("//img[@src='#{@upload.attachment.url(:small)}']")
attach_file "Attachment", @image2
fill_in "Description", :with => "Just another image"
@@ -1,2 +1,5 @@
class Spree::Example < ActiveRecord::Base
+
+ attr_accessible :title, :body
+
end

0 comments on commit 4681680

Please sign in to comment.