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)

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 {
list-style-type: disc;
margin-left: 20px;

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

em {
background-color: yellow;
Expand Down Expand Up @@ -70,22 +74,26 @@
}
input, textarea {
float: left;
margin-top: 4px;
padding: 8px;
border: 1px solid #ddd;
font-size: 16px;
@include border-radius(8px);
}
input {
margin-top: 4px;
width: 300px;
&.default {
color: #ccc;
}
}
textarea {
margin-top: 8px;
height: 40px;
height: 20px;
width: 300px;
}
#order_comment {
}
&.wide textarea {
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
= subscription_type(order) + '.'
%p
That is amazing! Thank you so much. We love you :)
That is amazing! Thank you so much, we love you :)

- unless signed_in?
#user
= simple_fields_for user do |u|
= u.hidden_field :stripe_card_token
%fieldset
= u.input :name
= u.input :email
= u.input :password
= u.input :name, required: true
= u.input :email, required: true
= u.input :password, required: true
%fieldset
= 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
Expand All @@ -31,13 +31,13 @@
%h3 Address
= f.simple_fields_for :billing_address do |a|
%fieldset
= a.input :name
= a.input :street
= a.input :zip
= a.input :name, required: company?
= a.input :street, required: company?
= a.input :zip, required: company?
%fieldset
= a.input :city
= a.input :city, required: company?
= a.input :state
= a.input :country
= a.input :country, required: company?

- unless signed_in?
#credit_card
Expand All @@ -57,7 +57,8 @@
#comment
%h3 Leave a comment
%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
= 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.

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

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

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

0 comments on commit 157f390

Please sign in to comment.