Skip to content

Commit

Permalink
add @advertisement.keyword for edit page
Browse files Browse the repository at this point in the history
  • Loading branch information
zhinanhu committed Sep 11, 2012
1 parent 40ad11b commit 3e28b8c
Showing 1 changed file with 28 additions and 22 deletions.
50 changes: 28 additions & 22 deletions app/views/ad_man/advertisements/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
</div>
<% end %>

<div class="field">
<%= f.label :ad_banner, "Acceptable sizes: 728x90 or 468x60" %><br />
<%= f.file_field :ad_banner %>
<div class="preview"></div>
</div><br />
<div class="field">
<%= f.label :ad_banner, "Acceptable sizes: 728x90 or 468x60" %><br />
<%= f.file_field :ad_banner %>
<div class="preview"></div>
</div><br />
<div class="field">
<%= f.label :title %><br />
<%= f.text_field :title %>
Expand All @@ -26,26 +26,32 @@
</div><br />
<div class="field">
<%= f.label :keyword %>
<%= f.collection_select :keyword_id, AdMan::Keyword.available, :id, :name, :include_blank => true %>
<% if AdMan::Keyword.unavailable.count > 0 %>
<p>Warning: <b><%= AdMan::Keyword.unavailable.map(&:name) %></b> keyword has already been used <%= AdMan::Keyword::MAX_COUNT %> times.</p>
<% end %>
<% if @advertisement.keyword %>
<!-- for edit advertisement page -->
<%= f.collection_select :keyword_id, AdMan::Keyword.available | [@advertisement.keyword], :id, :name, :include_blank => true %>
<% else %>
<!-- for new advertisement page -->
<%= f.collection_select :keyword_id, AdMan::Keyword.available, :id, :name, :include_blank => true %>
<% end %>
<% if AdMan::Keyword.unavailable.count > 0 %>
<p>Warning: <b><%= AdMan::Keyword.unavailable.map(&:name) %></b> keyword has already been used <%= AdMan::Keyword::MAX_COUNT %> times.</p>
<% end %>
</div>
<br />
<!--
<!--
<div class="field">
<#%= f.label :priority %>
<#%= select_tag :priority, options_for_select(1..10) %>
</div><br />
-->
<div class="field">
<#%= f.label :priority %>
<#%= select_tag :priority, options_for_select(1..10) %>
</div><br />
-->
<div class="field">
<%= f.label :start_date %><br />
<%= f.date_select :start_date %>
</div><br />
<div class="field">
<%= f.label :end_date %><br />
<%= f.date_select :end_date, :default => 1.month.from_now %>
</div><br />
<%= f.label :start_date %><br />
<%= f.date_select :start_date %>
</div><br />
<div class="field">
<%= f.label :end_date %><br />
<%= f.date_select :end_date, :default => 1.month.from_now %>
</div><br />


<div class="actions">
Expand Down

0 comments on commit 3e28b8c

Please sign in to comment.