Merge pull request #224 from Skud/launch-tweaks

Launch tweaks
This commit is contained in:
pozorvlak
2013-06-06 04:33:52 -07:00
15 changed files with 141 additions and 46 deletions

View File

@@ -7,4 +7,23 @@ class Account < ActiveRecord::Base
:message => 'already has account details associated with it'
}
def account_type_string
if account_type
return account_type.name
else
return "Free"
end
end
def paid_until_string
if account_type
if account_type.is_permanent_paid
return "forever"
elsif account_type.is_paid
return paid_until.to_s
end
end
return nil
end
end

View File

@@ -34,7 +34,7 @@
account
%br/
- if current_member == current_member && !current_member.is_paid?
= link_to "Upgrade and Support Growstuff", shop_path, :class => 'btn btn-primary'
= link_to "Upgrade and Support #{Growstuff::Application.config.site_name}", shop_path, :class => 'btn btn-primary'
- else
.visible-desktop.visible-tablet

View File

@@ -24,6 +24,7 @@
%ul.dropdown-menu
%li= link_to "Profile", member_path(current_member)
%li= link_to "Settings", edit_member_registration_path
%li= link_to "Account", orders_path
%li= link_to "Sign out", destroy_member_session_path, :method => :delete
%li
- if current_member.notifications.unread_count > 0

View File

@@ -3,13 +3,15 @@
%p Thank you for your order.
%p
Completed at:
%strong Completed at:
= @order.completed_at
%p
%strong Order number:
= @order.id
= render "shared/account_status"
%h2 Order items
%table.table.table-striped

View File

@@ -1,31 +1,44 @@
- content_for :title, "Order History"
- content_for :title, "Your Account"
%p
Your order history shows what you have bought via our
=succeed "." do
=link_to "shop", shop_path
= render "shared/account_status"
%table.table.table-striped
%tr
%th Order number
%th Date completed
%th Items
%th
- @orders.each do |order|
%h2 Orders
- if current_member.orders.present?
%p
Your order history shows what you have bought via our
=succeed "." do
=link_to "shop", shop_path
%table.table.table-striped
%tr
%td= order.id
%td
- if order.completed_at
= order.completed_at.to_s
- else
In progress
%td
- if order.order_items.count > 0
- order.order_items.each do |o|
= o.quantity
x
= o.product.name
@
= price_with_currency(o.price)
%br/
%td= link_to 'Details', order, :class => 'btn btn-mini'
%th Order number
%th Date completed
%th Items
%th
- @orders.each do |order|
%tr
%td= order.id
%td
- if order.completed_at
= order.completed_at.to_s
- else
In progress
%td
- if order.order_items.count > 0
- order.order_items.each do |o|
= o.quantity
x
= o.product.name
@
= price_with_currency(o.price)
%br/
%td= link_to 'Details', order, :class => 'btn btn-mini'
- else
%p
You have not made any orders. You can place an order via our
=succeed "." do
=link_to "shop", shop_path

View File

@@ -57,7 +57,7 @@
= link_to 'Delete this order', @order, method: :delete, |
data: { confirm: 'Are you sure?' }, :class => 'btn'
- if can? :complete, @order
= link_to 'Checkout', checkout_order_path(@order), :class => 'btn btn-primary'
= link_to 'Checkout with PayPal', checkout_order_path(@order), :class => 'btn btn-primary'
%p
= link_to "View other orders/order history", orders_path

View File

@@ -1,6 +1,6 @@
- content_for :title, "Photo Gallery"
- content_for :title, "Photos"
%p This page shows all your photos.
%p Most recent photos added to #{Growstuff::Application.config.site_name}.
%div.pagination
= page_entries_info @photos, :model => "photos"

View File

@@ -0,0 +1,13 @@
%h2 Your current account status
%p
%strong Account type:
= current_member.account.account_type_string
- if current_member.account.paid_until_string
%p
%strong Paid until:
= current_member.account.paid_until_string
- if ! current_member.is_paid?
= link_to "Upgrade and support #{Growstuff::Application.config.site_name}", shop_path, :class => 'btn btn-primary'

View File

@@ -2,22 +2,30 @@
%p
Growstuff relies on your support to build and run this open source
platform for food growers.
platform for food growers. We do not have outside investment, and do
not accept ads. Instead, we offer paid memberships, which give you
access to premium features, and ensure that we focus our efforts on
keeping you, our members, happy.
%p
We offer paid accounts which have access to exclusive features. You can
buy a monthly, yearly, or permanent ("seed") account.
We are currently developing a number of advanced features for paid
members. We will announce our progress on these in our
= link_to "Feedback and Support forum", "http://www.growstuff.org/forums/growstuff-feedback-support"
as well as via other channels.
%p
All our accounts are priced on a sliding scale. You can choose how much
you want to pay. Remember, your subscription supports an open source
platform promoting sustainable lifestyles!
All our accounts are priced on a sliding scale. You can choose how
much you want to pay. Remember, your subscription supports an open
source, open data platform supporting home food growers and promoting
sustainable food systems!
- if current_member && current_member.is_paid?
%h2 Thank you for supporting Growstuff
%p You currently have a paid membership, and can't buy another one at this time.
= render "shared/account_status"
- elsif @order and @order.order_items.count > 0
%h2 Your current order

View File

@@ -30,9 +30,13 @@
### What's the status of Growstuff? Is it in beta?
As of March 2013, we are using the term "soft launch" for Growstuff's status. What we mean by this is that although we're open for signups, we're still busily working on features and getting everything ready for our larger, more public launch, which will happen in a couple of months' time. You can read more about this in our [blog post about the soft launch](http://blog.growstuff.org/2013/03/21/a-soft-launch/).
We don't much like the word "beta" or the idea it represents.
Growstuff is in a constant state of change and improvement, and we
hope we will always be adding new features and making things better
for our members.
Beyond that, Growstuff will always be in development, and we hope to keep releasing features regularly. You should expect Growstuff to change and grow all the time, just like your garden. If a feature you want isn't available yet, check back soon!
If you find any bugs or problems, please let us know via our support
forum. If a feature you want isn't available yet, check back soon!
## Membership and payments
@@ -48,7 +52,10 @@
### What other types of accounts are there?
We will be releasing paid accounts soon, which will give you access to special or "premium" features in thanks for supporting the site's operations with your cash.
You can purchase a paid account which will give you access to special
features, and a warm glow of knowing you're supporting a
community-focused, open source project. You can see the current list
of paid account options in our [shop](/shop).
## Profile, settings, and privacy
@@ -109,7 +116,10 @@
### Is there a Growstuff API?
At present there is no official API, as our site is still changing so rapidly. However, we do expose some of our data via JSON and/or RSS feeds, and you're welcome to play with it, on the understanding that it may change under you. You can find API docs on our wiki, at http://wiki.growstuff.org/index.php/API
At present there is no official API, as our site is still changing so
rapidly. However, we do expose some of our data via JSON and/or RSS
feeds, and you're welcome to play with it, on the understanding that
it may change under you. You can find [API docs on our wiki](http://wiki.growstuff.org/index.php/API).
Use of our API and data is subject to the [API and Data Use Policy](http://www.growstuff.org/policy/api).

View File

@@ -13,4 +13,18 @@ describe Account do
@details = Account.new(:member_id => @member.id)
@details.should_not be_valid
end
it "formats the 'paid until' date nicely" do
@member.account.account_type = FactoryGirl.create(:account_type)
@member.account.paid_until_string.should eq nil
@member.account.account_type = FactoryGirl.create(:permanent_paid_account_type)
@member.account.paid_until_string.should eq "forever"
@member.account.account_type = FactoryGirl.create(:paid_account_type)
@time = Time.zone.now
@member.account.paid_until = @time
@member.account.paid_until_string.should eq @time.to_s
end
end

View File

@@ -108,6 +108,12 @@ describe Planting do
it 'has a default photo' do
@planting.default_photo.should eq @photo
end
it 'chooses the most recent photo' do
@photo2 = FactoryGirl.create(:photo)
@planting.photos << @photo2
@planting.default_photo.should eq @photo2
end
end
end

View File

@@ -40,6 +40,10 @@ describe 'layouts/application.html.haml', :type => "view" do
assert_select "a[href=/members/edit]", "Settings"
end
it "should show settings link" do
assert_select "a[href=#{orders_path}]", "Account"
end
it 'should show logout link' do
rendered.should contain 'Sign out'
end

View File

@@ -4,11 +4,16 @@ describe "orders/index" do
before(:each) do
@member = FactoryGirl.create(:member)
sign_in @member
@order1 = FactoryGirl.create(:order)
@order2 = FactoryGirl.create(:completed_order)
@order1 = FactoryGirl.create(:order, :member => @member)
@order2 = FactoryGirl.create(:completed_order, :member => @member)
assign(:orders, [ @order1, @order2 ])
end
it "shows your current account status" do
render
rendered.should contain "Your current account status"
end
it "renders a list of orders" do
render
# Run the generator again with the --webrat flag if you want to use webrat matchers

View File

@@ -33,7 +33,7 @@ describe "orders/show" do
end
it "shows a checkout button" do
assert_select "a", :text => "Checkout"
assert_select "a", :text => "Checkout with PayPal"
end
it "shows a delete order button" do