sync
This commit is contained in:
28
app/views/advertisements/_form.html.erb
Normal file
28
app/views/advertisements/_form.html.erb
Normal file
@@ -0,0 +1,28 @@
|
||||
<% form_for @advertisement, :html => {:multipart => true} do |f| %>
|
||||
<table width="100%">
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><%= submit_tag "Submit" %></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th width="15%"><%= f.label :file %></th>
|
||||
<td width="85%"><%= f.file_field "file" %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><%= f.label :referral_url %></th>
|
||||
<td><%= f.text_field :referral_url %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><%= f.label :ad_type %></th>
|
||||
<td><%= f.select :ad_type, ["vertical", "horizontal"] %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><%= f.label :status %></th>
|
||||
<td><%= f.select :status, ["active", "inactive"] %></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<% end %>
|
||||
11
app/views/advertisements/_secondary_nav_links.html.erb
Normal file
11
app/views/advertisements/_secondary_nav_links.html.erb
Normal file
@@ -0,0 +1,11 @@
|
||||
<% content_for(:secondary_nav_links) do %>
|
||||
<menu>
|
||||
<li><%= link_to "Listing", advertisements_path %></li>
|
||||
<li><%= link_to "New", new_advertisement_path %></li>
|
||||
<% if @advertisement && !@advertisement.new_record? %>
|
||||
<li>|</li>
|
||||
<li><%= link_to "Edit", edit_advertisement_path(@advertisement) %></li>
|
||||
<li><%= link_to "Show", advertisement_path(@advertisement) %></li>
|
||||
<% end %>
|
||||
</menu>
|
||||
<% end %>
|
||||
3
app/views/advertisements/edit.html.erb
Normal file
3
app/views/advertisements/edit.html.erb
Normal file
@@ -0,0 +1,3 @@
|
||||
<%= image_tag(@advertisement.image_url) %>
|
||||
<%= render :partial => "form" %>
|
||||
<%= render :partial => "secondary_nav_links" %>
|
||||
45
app/views/advertisements/index.html.erb
Normal file
45
app/views/advertisements/index.html.erb
Normal file
@@ -0,0 +1,45 @@
|
||||
<h4>Advertisements</h4>
|
||||
|
||||
<div style="margin-bottom: 1em;">
|
||||
<% form_tag(advertisements_path, :method => :get) do %>
|
||||
<table width="100%">
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td><%= submit_tag "Search" %></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th width="15%"><label>Start Date</label></th>
|
||||
<td width="85%"><%= text_field_tag "start_date", @start_date %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th width="15%"><label>End Date</label></th>
|
||||
<td width="85%"><%= text_field_tag "end_date", @end_date %></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<table width="100%" class="highlightable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="5%"></th>
|
||||
<th width="5%" style="text-align: right;">Hits</th>
|
||||
<th width="90%"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @advertisements.each do |advertisement| %>
|
||||
<tr>
|
||||
<td><%= image_tag(advertisement.image_url, :width => advertisement.preview_width, :height => advertisement.preview_height) %></td>
|
||||
<td style="text-align: right;"><%= advertisement.hits.between(@start_date, @end_date).count %></td>
|
||||
<td><%= link_to "Edit", edit_advertisement_path(advertisement) %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<%= render :partial => "secondary_nav_links" %>
|
||||
3
app/views/advertisements/new.html.erb
Normal file
3
app/views/advertisements/new.html.erb
Normal file
@@ -0,0 +1,3 @@
|
||||
<%= error_messages_for :advertisement %>
|
||||
<%= render :partial => "form" %>
|
||||
<%= render :partial => "secondary_nav_links" %>
|
||||
7
app/views/advertisements/show.html.erb
Normal file
7
app/views/advertisements/show.html.erb
Normal file
@@ -0,0 +1,7 @@
|
||||
<div><%= image_tag(@advertisement.image_url, :width => @advertisement.preview_width, :height => @advertisement.preview_height) %></div>
|
||||
|
||||
<ul>
|
||||
<li>Hits: <%= @advertisement.hits.between(@start_date, @end_date).count %></li>
|
||||
</ul>
|
||||
|
||||
<%= render :partial => "secondary_nav_links" %>
|
||||
Reference in New Issue
Block a user