Basic function for AdBanner

This commit is contained in:
Matthew Kaito Juyuan Fu authored and Christophe Vilayphiou committed 2012-02-01 14:27:51 +08:00
1 parent 3287b68354
commit a980847eb3
15 files changed
+298

No files matched your search

@@ -0,0 +1,7 @@
<div id="basic_block" class="roles_block">
<%= image_tag ad_image.file %>
Time to next: <%= ad_image.time_to_next %>
Intro: <%= ad_image.picture_intro %>
Out Link <%= link_to ad_image.out_link %>
<%= render :partial => "ad_image_update", :locals => { :ad_image => ad_image } %>
</div>
@@ -0,0 +1,3 @@
Time: <%= f.text_field :time_to_next ,:class=> 'ad_time'%>
Link:<%= f.text_field :out_link ,:class=> 'ad_out_link'%>
<%= f.hidden_field :to_save %>
@@ -0,0 +1,8 @@
<%= fields_for "ad_banner[existing_ad_images][#{ad_image.id}]", ad_image do |f| %>
<p class="new_file">
Destroy?<%= f.check_box :to_destroy %>
<%= render :partial => "ad_image_form", :locals => { :f => f } %>
</p>
<% end %>
+51
View File
@@ -0,0 +1,51 @@
<% content_for :page_specific_css do %>
<%= stylesheet_link_tag "ad_banner" %>
<% end %>
<% content_for :page_specific_javascript do %>
<%= javascript_include_tag "ad_banner" %>
<% end %>
<p>
<%= f.label :title, t('admin.title') %>
<%= f.text_field :title, :class => 'text' %>
</p>
<p>
<%= f.label :picture_position, t('admin.picture_position') %>
<%= f.text_field :picture_position, :class => 'text' %>
</p>
<p>
<%= f.label :post_date, t('admin.post_date') %>
<%= f.date_select :post_date, :order => [:year, :month, :day], :use_month_numbers => true %>
</p>
<p>
<%= f.label :unpost_date, t('admin.unpost_date') %>
<%= f.date_select :unpost_date, :order => [:year, :month, :day], :use_month_numbers => true %>
</p>
<p>
<%= f.label :context, t('admin.context') %>
<%= f.text_field :context, :class => 'text' %>
</p>
<p>
<%= f.label :direct_to_after_click, t('admin.direct_to_after_click') %>
<%= f.check_box :direct_to_after_click %>
</p>
<p>
<%= f.label :ad_images, t('admin.ad_images') %>
<ul>
<% @ad_banner.ad_images.each do |ad_image| %>
<%= render :partial => 'ad_image', :object => ad_image, :locals => { :field_name => "ad_images", :f => f, :classes => "r_destroy, r_edit" } %>
<% end %>
</ul>
<%= render :partial => 'new_add_banner_file', :object => @ad_banner.ad_images.build, :locals => { :field_name => "new_ad_images[]", :f => f, :classes => "r_destroy" } %>
</p>
<p>
<%#= render :partial => 'new_design_file', :object => @design.themes.build, :locals => { :field_name => "themes", :f => f, :classes => "r_destroy" } %>
</p>
@@ -0,0 +1,7 @@
<%= f.fields_for field_name, new_add_banner_file do |f| %>
<p class="new_file">
<%= f.file_field :file %>
<%= render :partial => "ad_image_form", :locals => { :f => f } %>
<%= button_tag '+', :class => "multi_files"%>
</p>
<% end %>
@@ -0,0 +1,11 @@
<div id="search">
<input id="user_search" name="user[username]" size="30" type="text" />
</div>
<div class="member_setup <%= @class %>">
<h1><%= t('admin.setup_member') %></h1>
<ul class="list">
<li class="set_1"><%= link_to content_tag(:span, t('admin.list_users')), admin_users_path %></li>
<li class="set_2"><%= link_to content_tag(:span, t('admin.list_roles')), admin_roles_path %></li>
<li class="set_3"><%= link_to content_tag(:span, t('admin.list_infos')), admin_infos_path %></li>
</ul>
</div>
+11
View File
@@ -0,0 +1,11 @@
<h1><%= t('admin.editing_ad_banner') %></h1>
<%= form_for @ad_banner, :url => admin_ad_banner_path(@ad_banner),:html => {:multipart => true} do |f| %>
<%= f.error_messages %>
<%= render :partial => "form", :locals => { :f => f } %>
<p>
<%= f.submit t('update') %> <%= link_back %>
</p>
<% end %>
<br /><br/>
+46
View File
@@ -0,0 +1,46 @@
<% content_for :secondary do %>
<div class="ad_banners_setup">
<h1><%= t('admin.setup_ad_banners') %></h1>
<ul class="list">
<li><%= link_to content_tag(:span, t('admin.new_ad_banner')), new_admin_ad_banner_path, :class => 'seclink1' %></li>
</ul>
</div>
<% end -%>
<%= flash_messages %>
<div class="main2">
<h1><%= t('admin.list_ad_banners') %></h1>
<table>
<thead>
<tr>
<td><%= t('admin.title') %></td>
<td><%= t('admin.picture_position') %></td>
<td><%= t('admin.post_date') %></td>
<td><%= t('admin.unpost_date') %></td>
<td><%= t('admin.context') %></td>
<td><%= t('admin.direct_to_after_click') %></td>
</tr>
</thead>
<% @ad_banners.each do |ad_banner| %>
<tr class="have">
<td><%= ad_banner.title %></td>
<td><%= ad_banner.picture_position %></td>
<td><%= ad_banner.post_date %></td>
<td><%= ad_banner.unpost_date %></td>
<td><%= ad_banner.context %></td>
<td><%= ad_banner.direct_to_after_click %></td>
<td class="action">
<%= link_to t(:show), admin_ad_banner_path(ad_banner), :class => 'show' %>
<%= link_to t(:edit), edit_admin_ad_banner_path(ad_banner), :class => 'edit' %>
<%= link_to t(:delete), admin_ad_banner_path(ad_banner), :confirm => t('sure?'), :method => :delete, :class => 'delete' %>
</td>
</tr>
<tr></tr>
<% end %>
</table>
</div>
<div class="button_bar">
<%= link_to t('admin.new_ad_banner'), new_admin_ad_banner_path, :class => 'new' %>
</div>
+13
View File
@@ -0,0 +1,13 @@
<div class="main2">
<h1><%= t('admin.new_ad_banner') %></h1>
<%= form_for :ad_banner, :url => admin_ad_banners_path, :html => {:multipart => true} do |f| %>
<%= f.error_messages %>
<%= render :partial => "form", :locals => { :f => f } %>
<div class="button_bar">
<%= link_back %>
<%= f.submit t('create') %>
</div>
<% end %>
</div>
+18
View File
@@ -0,0 +1,18 @@
<% content_for :secondary do %>
<%= render 'side_bar' %>
<% end %>
<br /><br /><br /><br />
<ul>
<li><%=t('admin.ad_banner.title') %> <%= @ad_banner.title %></li>
<li><%=t('admin.ad_banner.picture_position') %> <%= @ad_banner.picture_position %></li>
<li><%=t('admin.ad_banner.post_date') %> <%= @ad_banner.post_date %></li>
<li><%=t('admin.ad_banner.unpost_date') %> <%= @ad_banner.unpost_date %></li>
<li><%=t('admin.ad_banner.context') %> <%= @ad_banner.context %></li>
<li><%=t('admin.ad_banner.direct_to_after_click') %> <%= @ad_banner.direct_to_after_click %></li>
<li><%=t('admin.ad_banner.ad_style') %> <%= @ad_banner.ad_style %></li>
</ul>
<%= render :partial => "admin/ad_banners/ad_image", :collection => @ad_banner.ad_images %>