add ad_banner inner page,pic title.

This commit is contained in:
Fu Matthew committed 2013-01-09 16:54:33 +08:00
1 parent 614b6fde71
commit 5ab4bbd367
7 files changed
+43 -2

No files matched your search

+4
View File
@@ -28,6 +28,10 @@ class FrontController < ApplicationController
@page_id = params[:page_id]
end
def show_inner_ad_image
@ad_image = AdImage.find(params[:id]) rescue nil
@ad_images = AdImage.all
end
private
-1
View File
@@ -65,7 +65,6 @@ class PagesController < ApplicationController
def get_item
module_app = ModuleApp.first(:conditions => {:key => params[:app_name]})
if !params[:category_id].blank? && !params[:tag_id].blank?
@item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action], :category => params[:category_id], :tag => params[:tag_id]})
@item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action], :category => params[:category_id], :tag => ''}) unless @item
+9
View File
@@ -0,0 +1,9 @@
module FrontHelper
def ad_image_link(ad_image)
link = ad_image.out_link
link =front_show_inner_ad_image_path(:id=> ad_image.id) if link.blank? && !ad_image.context.blank?
end
end
+1 -1
View File
@@ -19,7 +19,7 @@
<div id='slideshow-<%= @ad_banner.title.dehumanize %>' class='slideshow'>
<% (images = @ad_banner.ad_images).shuffle.each do |ad_image| %>
<% if ad_image.display? %>
<img src='<%= ad_image.file %>' alt='<%= ad_image.title || ' ' %>' time_to_next='<%= @ad_banner.transition_msec %>' link_open='<%= ad_image.link_open %>' link_url='<%= (ad_image.out_link) %>' style=' <%= 'cursor:pointer;' if !ad_image.out_link.blank? %>'/>
<img src='<%= ad_image.file %>' alt='<%= ad_image.title || ' ' %>' title='<%= ad_image.title || ' ' %>' time_to_next='<%= @ad_banner.transition_msec %>' link_open='<%= ad_image.link_open %>' link_url='<%= ad_image_link(ad_image)%>' style=' <%= 'cursor:pointer;' if !ad_image.out_link.blank? %>'/>
<% end %>
<% end %>
</div>
@@ -0,0 +1,21 @@
<%if @ad_image && @ad_image.display? %>
<h1 class="h1"><%= @ad_image.title %></h1>
<div class="info">
<div class="info1">
<span class="date"><%= display_date_time(@ad_image.post_date) %></span>
</div>
</div>
<div class="news_image">
<%#= image_tag(@ad_image.image.url, :size => "320x240") if @ad_image.image.file %>
<%= link_to image_tag(@ad_image.file.url, :size => "320x240"), @ad_image.file.url, {:target => '_blank', :title => @ad_image.title} if @ad_image.file.file %>
</div>
<div class="news_paragraph">
<%= @ad_image.context.html_safe rescue '' %>
</div>
<%#= share_links(@ad_image, 'ad_image') %>
<% else %>
<% end %>