Permalink
Browse files

set bids_due_at to null, closes #58

  • Loading branch information...
1 parent b5eb5f7 commit 909167bb3fbe819e5be57390a9eb3b510099a7b5 @ajb ajb committed Apr 6, 2013
@@ -14,7 +14,10 @@
·
%span.project-bids-due-at
- Bids due on #{@bids_due_at_readable_dateonly}
+ - if @bids_due_at
+ Bids due on #{@bids_due_at_readable_dateonly}
+ - else
+ Open for bids
·
@@ -43,7 +43,7 @@ def twitter_oauth_callback
event_hooks = @global_config.event_hooks
event_hooks[GlobalConfig.event_hooks[:twitter]] ||= {
"enabled" => "on",
- "tweet_body" => "Posted a project, \":title\"! Bids due at :bids_due_at."
+ "tweet_body" => "Posted a project, \":title\"!"
}
event_hooks[GlobalConfig.event_hooks[:twitter]]["oauth_token"] = access_token.token
event_hooks[GlobalConfig.event_hooks[:twitter]]["oauth_token_secret"] = access_token.secret
View
@@ -12,7 +12,10 @@ def initialize(user)
private
def vendor(user)
- can :create, Bid do |bid| bid.project.bids_due_at > Time.now && !user.submitted_bid_for_project(bid.project) end
+ can :create, Bid do |bid|
+ (!bid.project.bids_due_at || (bid.project.bids_due_at > Time.now)) && !user.submitted_bid_for_project(bid.project)
+ end
+
can :watch, Project, posted: true
end
@@ -15,4 +15,8 @@
.abstract
= project.abstract_or_truncated_body
= link_to "Read more", project
- .bids-due Bids due on #{project.bids_due_at.to_formatted_s(:readable_dateonly)}
+ .bids-due
+ - if project.bids_due_at
+ Bids due on #{project.bids_due_at.to_formatted_s(:readable_dateonly)}
+ - else
+ Open for bids
@@ -38,7 +38,7 @@
});
= f.label :bids_due_at
- = f.datetime_select :bids_due_at, {}, style: "width: 100px;"
+ = f.datetime_select :bids_due_at, {include_blank: true}, style: "width: 100px;"
%div
%label
@@ -6,7 +6,10 @@
%small
- if @project.featured
%i.icon-star
- Bids due on #{@project.bids_due_at.to_formatted_s(:readable)}
+ - if @project.bids_due_at
+ Bids due on #{@project.bids_due_at.to_formatted_s(:readable)}
+ - else
+ Open for bids
.row-fluid
.span7

0 comments on commit 909167b

Please sign in to comment.