From 2901e0cb118e3dd97c400c7357352c642cce7dd0 Mon Sep 17 00:00:00 2001 From: Skud Date: Thu, 6 Jun 2013 20:17:32 +1000 Subject: [PATCH 1/6] tweaked wording on photos/index --- app/views/photos/index.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/photos/index.html.haml b/app/views/photos/index.html.haml index 94ff1539d..1e2cadabd 100644 --- a/app/views/photos/index.html.haml +++ b/app/views/photos/index.html.haml @@ -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" From 170315e4bd2c401140f6d613c933567d4aa79ec7 Mon Sep 17 00:00:00 2001 From: Skud Date: Thu, 6 Jun 2013 20:28:33 +1000 Subject: [PATCH 2/6] added test for default_photo ordering --- spec/models/planting_spec.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spec/models/planting_spec.rb b/spec/models/planting_spec.rb index e5c2f777e..02cc5a062 100644 --- a/spec/models/planting_spec.rb +++ b/spec/models/planting_spec.rb @@ -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 From 4332628d6fa57e455706b195e0232c1b2fb3bfd2 Mon Sep 17 00:00:00 2001 From: Skud Date: Thu, 6 Jun 2013 20:36:35 +1000 Subject: [PATCH 3/6] improved wording on shop homepage --- app/views/shop/index.html.haml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/app/views/shop/index.html.haml b/app/views/shop/index.html.haml index d7f182529..43a022c8a 100644 --- a/app/views/shop/index.html.haml +++ b/app/views/shop/index.html.haml @@ -2,16 +2,22 @@ %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 From 6cf64694f469b8aa7c874f91fe8fa33b7fa42c66 Mon Sep 17 00:00:00 2001 From: Skud Date: Thu, 6 Jun 2013 21:07:54 +1000 Subject: [PATCH 4/6] added account status info in various places --- app/models/account.rb | 19 ++++++ app/views/home/index.html.haml | 2 +- app/views/layouts/_header.html.haml | 1 + app/views/orders/complete.html.haml | 4 +- app/views/orders/index.html.haml | 69 +++++++++++++--------- app/views/orders/show.html.haml | 2 +- app/views/shared/_account_status.html.haml | 13 ++++ app/views/shop/index.html.haml | 2 + spec/models/account_spec.rb | 14 +++++ spec/views/layouts/application_spec.rb | 4 ++ spec/views/orders/index.html.haml_spec.rb | 9 ++- 11 files changed, 106 insertions(+), 33 deletions(-) create mode 100644 app/views/shared/_account_status.html.haml diff --git a/app/models/account.rb b/app/models/account.rb index 25cfc05ba..f68c61988 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -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 diff --git a/app/views/home/index.html.haml b/app/views/home/index.html.haml index e1c681526..a5b0a1bdb 100644 --- a/app/views/home/index.html.haml +++ b/app/views/home/index.html.haml @@ -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 diff --git a/app/views/layouts/_header.html.haml b/app/views/layouts/_header.html.haml index 622244364..9f6bf78f9 100644 --- a/app/views/layouts/_header.html.haml +++ b/app/views/layouts/_header.html.haml @@ -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 diff --git a/app/views/orders/complete.html.haml b/app/views/orders/complete.html.haml index de2c7df75..a9c4ae133 100644 --- a/app/views/orders/complete.html.haml +++ b/app/views/orders/complete.html.haml @@ -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 diff --git a/app/views/orders/index.html.haml b/app/views/orders/index.html.haml index 6e1302765..d20214bf4 100644 --- a/app/views/orders/index.html.haml +++ b/app/views/orders/index.html.haml @@ -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 diff --git a/app/views/orders/show.html.haml b/app/views/orders/show.html.haml index 8136c13ec..391701df2 100644 --- a/app/views/orders/show.html.haml +++ b/app/views/orders/show.html.haml @@ -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 diff --git a/app/views/shared/_account_status.html.haml b/app/views/shared/_account_status.html.haml new file mode 100644 index 000000000..d4f2f2a76 --- /dev/null +++ b/app/views/shared/_account_status.html.haml @@ -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' diff --git a/app/views/shop/index.html.haml b/app/views/shop/index.html.haml index 43a022c8a..808764f5f 100644 --- a/app/views/shop/index.html.haml +++ b/app/views/shop/index.html.haml @@ -24,6 +24,8 @@ %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 diff --git a/spec/models/account_spec.rb b/spec/models/account_spec.rb index 26d59116e..8b2acd470 100644 --- a/spec/models/account_spec.rb +++ b/spec/models/account_spec.rb @@ -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 diff --git a/spec/views/layouts/application_spec.rb b/spec/views/layouts/application_spec.rb index 48cd360ce..0637faf80 100644 --- a/spec/views/layouts/application_spec.rb +++ b/spec/views/layouts/application_spec.rb @@ -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 diff --git a/spec/views/orders/index.html.haml_spec.rb b/spec/views/orders/index.html.haml_spec.rb index 139efab9b..2eb399abd 100644 --- a/spec/views/orders/index.html.haml_spec.rb +++ b/spec/views/orders/index.html.haml_spec.rb @@ -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 From b85b533afa006af64a6f5da886393f19502e1cf1 Mon Sep 17 00:00:00 2001 From: Skud Date: Thu, 6 Jun 2013 21:16:46 +1000 Subject: [PATCH 5/6] updated wording in support/faq --- app/views/support/index.html.haml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/app/views/support/index.html.haml b/app/views/support/index.html.haml index 24a41dd04..2b64fd000 100644 --- a/app/views/support/index.html.haml +++ b/app/views/support/index.html.haml @@ -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). From 4c2971f67088aaf05aa978d726ce0941e871e851 Mon Sep 17 00:00:00 2001 From: Skud Date: Thu, 6 Jun 2013 21:19:24 +1000 Subject: [PATCH 6/6] oops, fixed broken test for checkout button --- spec/views/orders/show.html.haml_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/views/orders/show.html.haml_spec.rb b/spec/views/orders/show.html.haml_spec.rb index 749fa9002..04670b567 100644 --- a/spec/views/orders/show.html.haml_spec.rb +++ b/spec/views/orders/show.html.haml_spec.rb @@ -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