Skip to content

Commit

Permalink
add a private message to orders and make address fields required for …
Browse files Browse the repository at this point in the history
…companies
  • Loading branch information
Sven Fuchs committed Jan 9, 2012
1 parent d65c20a commit 157f390
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 12 deletions.
2 changes: 2 additions & 0 deletions TODO
@@ -1 +1,3 @@
- add a badge with number of donators to packages (as on http://www.kickstarter.com/projects/510303020/the-people-is-singular/backers#p1) - add a badge with number of donators to packages (as on http://www.kickstarter.com/projects/510303020/the-people-is-singular/backers#p1)

https://twitter.com/#!/derekcollison/status/155413659273789442
Binary file added app/assets/images/tipsy.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 9 additions & 1 deletion app/assets/stylesheets/orders.css.scss
Expand Up @@ -6,10 +6,14 @@
ul { ul {
list-style-type: disc; list-style-type: disc;
margin-left: 20px; margin-left: 20px;

li { li {
margin: 0; margin: 0;
} }
} }
ul.footnotes {
list-style-type: none;
}


em { em {
background-color: yellow; background-color: yellow;
Expand Down Expand Up @@ -70,22 +74,26 @@
} }
input, textarea { input, textarea {
float: left; float: left;
margin-top: 4px;
padding: 8px; padding: 8px;
border: 1px solid #ddd; border: 1px solid #ddd;
font-size: 16px; font-size: 16px;
@include border-radius(8px); @include border-radius(8px);
} }
input { input {
margin-top: 4px;
width: 300px; width: 300px;
&.default { &.default {
color: #ccc; color: #ccc;
} }
} }
textarea { textarea {
margin-top: 8px;
height: 40px; height: 40px;
height: 20px;
width: 300px; width: 300px;
} }
#order_comment {
}
&.wide textarea { &.wide textarea {
width: 740px; width: 740px;
} }
Expand Down
21 changes: 11 additions & 10 deletions app/views/orders/new.html.haml
Expand Up @@ -10,16 +10,16 @@
to Travis CI to Travis CI
= subscription_type(order) + '.' = subscription_type(order) + '.'
%p %p
That is amazing! Thank you so much. We love you :) That is amazing! Thank you so much, we love you :)


- unless signed_in? - unless signed_in?
#user #user
= simple_fields_for user do |u| = simple_fields_for user do |u|
= u.hidden_field :stripe_card_token = u.hidden_field :stripe_card_token
%fieldset %fieldset
= u.input :name = u.input :name, required: true
= u.input :email = u.input :email, required: true
= u.input :password = u.input :password, required: true
%fieldset %fieldset
= u.input :twitter_handle, label: 'Twitter', hint: 'Your twitter handle', required: false, input_html: { placeholder: '@' } = u.input :twitter_handle, label: 'Twitter', hint: 'Your twitter handle', required: false, input_html: { placeholder: '@' }
= u.input :github_handle, label: 'Github', hint: 'Your Github handle', required: false = u.input :github_handle, label: 'Github', hint: 'Your Github handle', required: false
Expand All @@ -31,13 +31,13 @@
%h3 Address %h3 Address
= f.simple_fields_for :billing_address do |a| = f.simple_fields_for :billing_address do |a|
%fieldset %fieldset
= a.input :name = a.input :name, required: company?
= a.input :street = a.input :street, required: company?
= a.input :zip = a.input :zip, required: company?
%fieldset %fieldset
= a.input :city = a.input :city, required: company?
= a.input :state = a.input :state
= a.input :country = a.input :country, required: company?


- unless signed_in? - unless signed_in?
#credit_card #credit_card
Expand All @@ -57,7 +57,8 @@
#comment #comment
%h3 Leave a comment %h3 Leave a comment
%fieldset.wide %fieldset.wide
= f.input :comment, :as => 'text', required: false = f.input :comment, as: 'text', required: false, hint: 'Add a comment (will be published on the donators list).'
= f.input :message, as: 'text', required: false, hint: 'You can leave us a message (will not be published).'


.actions .actions
= f.submit 'Confirm' = f.submit 'Confirm'
Expand Down
7 changes: 7 additions & 0 deletions db/migrate/20120109000009_orders_add_message.rb
@@ -0,0 +1,7 @@
class OrdersAddMessage < ActiveRecord::Migration
def change
change_table :orders do |t|
t.text :message
end
end
end
3 changes: 2 additions & 1 deletion db/schema.rb
Expand Up @@ -11,7 +11,7 @@
# #
# It's strongly recommended to check this file into your version control system. # It's strongly recommended to check this file into your version control system.


ActiveRecord::Schema.define(:version => 20120107130508) do ActiveRecord::Schema.define(:version => 20120109000009) do


create_table "addresses", :force => true do |t| create_table "addresses", :force => true do |t|
t.integer "addressable_id" t.integer "addressable_id"
Expand All @@ -37,6 +37,7 @@
t.datetime "updated_at" t.datetime "updated_at"
t.boolean "active", :default => true, :null => false t.boolean "active", :default => true, :null => false
t.datetime "cancelled_at" t.datetime "cancelled_at"
t.text "message"
end end


create_table "users", :force => true do |t| create_table "users", :force => true do |t|
Expand Down

0 comments on commit 157f390

Please sign in to comment.