Updated ADBanner with fixes on index page, ADImage with fixes
Conflicts: app/views/admin/ad_banners/index.html.erb app/views/admin/ad_images/_form.html.erb vendor/built_in_modules/ad_banner/init.rb
This commit is contained in:
parent
a5c800d3fe
commit
a2e9aa2e0b
|
@ -242,7 +242,7 @@
|
|||
bodyAnimateIn['margin-left'] = '-=' + slideWidth;
|
||||
slideAnimateIn['left'] = '-=' + slideWidth;
|
||||
if($pageslide.find('.preview').length) {
|
||||
$pageslide.find('.preview').cycle('destroy');
|
||||
// $pageslide.find('.preview').cycle('destroy');
|
||||
$pageslide.find('.preview img').removeAttr('style');
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
class Admin::AdBannersController < OrbitBackendController
|
||||
|
||||
before_filter :force_order_for_visitor,:only=>[:index]
|
||||
before_filter :force_order_for_user,:except => [:index]
|
||||
before_filter :for_app_sub_manager,:except => [:index]
|
||||
before_filter :force_order_for_visitor,:only=>[:index, :show]
|
||||
before_filter :force_order_for_user,:except => [:index, :show]
|
||||
before_filter :for_app_sub_manager,:except => [:index, :show]
|
||||
before_filter :for_app_manager,:except => [:index,:show,:update,:realtime_preview]
|
||||
|
||||
|
||||
|
@ -24,17 +24,18 @@ class Admin::AdBannersController < OrbitBackendController
|
|||
end
|
||||
|
||||
def new
|
||||
@ad_banners = AdBanner.all
|
||||
render :action => 'index',:params => 'new'
|
||||
@ad_banner = AdBanner.new
|
||||
render layout: false
|
||||
end
|
||||
|
||||
def create
|
||||
@ad_banner = AdBanner.new(params[:ad_banner])
|
||||
if @ad_banner.save
|
||||
@active = @ad_banner
|
||||
respond_to do |format|
|
||||
format.js {render 'new_created_node'}
|
||||
end
|
||||
redirect_to admin_ad_banners_url
|
||||
#respond_to do |format|
|
||||
# format.js {render 'new_created_node'}
|
||||
#end
|
||||
else
|
||||
render 'create_error_msg'
|
||||
end
|
||||
|
@ -42,7 +43,6 @@ class Admin::AdBannersController < OrbitBackendController
|
|||
|
||||
def edit
|
||||
@ad_banner = AdBanner.find(params[:id])
|
||||
|
||||
end
|
||||
|
||||
def update
|
||||
|
|
|
@ -9,9 +9,15 @@ class Admin::AdImagesController < Admin::AdBannersController
|
|||
@app_title = "ad_banner"
|
||||
end
|
||||
|
||||
def index
|
||||
@ad_banner = AdBanner.find params[:ad_banner_id]
|
||||
@ad_images = @ad_banner.ad_images.all.page(params[:page]).per(10)
|
||||
end
|
||||
|
||||
def edit
|
||||
@ad_banner = AdBanner.find params[:ad_banner_id]
|
||||
@ad_image = @ad_banner.ad_images.find params[:id]
|
||||
@tags = get_tags
|
||||
end
|
||||
|
||||
def update
|
||||
|
@ -28,6 +34,7 @@ class Admin::AdImagesController < Admin::AdBannersController
|
|||
@ad_image =ad_banner.ad_images.build
|
||||
@ad_image.post_date = Date.today
|
||||
@ad_image.unpost_date = Date.today + 30
|
||||
@tags = get_tags
|
||||
#render :action => 'new',:url=> {:ad_banner_id => params.has_key?(:ad_banner_id)? params[:ad_banner_id],nil}
|
||||
end
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ class AdBanner
|
|||
include Mongoid::Timestamps
|
||||
include Mongoid::MultiParameterAttributes
|
||||
include OrbitCoreLib::ObjectAuthable
|
||||
include OrbitTag::Taggable
|
||||
|
||||
field :title
|
||||
field :transition_msec,type: Integer
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
class AdImage
|
||||
include Mongoid::Document
|
||||
include Mongoid::Timestamps
|
||||
include OrbitTag::Taggable
|
||||
|
||||
mount_uploader :file, ImageUploader
|
||||
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
<div class="content">
|
||||
<%= form_for(:ad_banner, :url => admin_ad_banners_path) do |f| %>
|
||||
<fieldset>
|
||||
<legend>Ad Banner</legend>
|
||||
<label>Banner Name</label>
|
||||
<%= f.text_field :title, :class=>"input-large", :placeholder=>"Banner Name" %>
|
||||
<span class="help-block">Banner Name only english</span>
|
||||
<label for="timeout">Ste</label>
|
||||
<%= f.text_field :transition_sec, :class => 'input-large', :placeholder => 'Time' %>
|
||||
<span class="help-block">Please enter the number of seconds</span>
|
||||
<label>Best Size</label>
|
||||
<%= f.text_field :best_size, :class=>"input-large", :placeholder=>"Banner Size" %>
|
||||
<span class="help-block">Best Size EX:120x30 </span>
|
||||
<label>Effect</label>
|
||||
<%= f.select :ad_fx ,AdBanner::FX_TYPES %>
|
||||
<div class="preview">
|
||||
<%= image_tag "slideshow_preview_A.png", :width=>220 %>
|
||||
<%= image_tag "slideshow_preview_B.png", :width=>220 %>
|
||||
</div>
|
||||
<span class="help-block">Effect</span>
|
||||
<a href="javascript:$.pageslide.close()" class="btn btn-small"><%= t(:cancel) %></a>
|
||||
<%= f.submit t(:create_), class: 'btn btn-primary btn-small' %>
|
||||
</fieldset>
|
||||
<% end %>
|
||||
</div>
|
|
@ -0,0 +1,25 @@
|
|||
<div class="content">
|
||||
<%= form_for(:ad_banner, :url => admin_ad_banners_path, :remote => true) do |f| %>
|
||||
<fieldset>
|
||||
<legend>Ad Banner</legend>
|
||||
<label>Banner Name</label>
|
||||
<%= f.text_field :title, :class=>"input-large", :placeholder=>"Banner Name" %>
|
||||
<span class="help-block">Banner Name only english</span>
|
||||
<label for="timeout">Ste</label>
|
||||
<%= f.text_field :transition_sec, :class => 'input-large', :placeholder => 'Time' %>
|
||||
<span class="help-block">Please enter the number of seconds</span>
|
||||
<label>Best Size</label>
|
||||
<%= f.text_field :best_size, :class=>"input-large", :placeholder=>"Banner Size" %>
|
||||
<span class="help-block">Best Size EX:120x30 </span>
|
||||
<label>Effect</label>
|
||||
<%= f.select :ad_fx ,AdBanner::FX_TYPES %>
|
||||
<div class="preview">
|
||||
<%= image_tag "slideshow_preview_A.png", :width=>220 %>
|
||||
<%= image_tag "slideshow_preview_B.png", :width=>220 %>
|
||||
</div>
|
||||
<span class="help-block">Effect</span>
|
||||
<a href="javascript:$.pageslide.close()" class="btn btn-small"><%= t(:cancel) %></a>
|
||||
<%= f.submit t(:create_), class: 'btn btn-primary btn-small' %>
|
||||
</fieldset>
|
||||
<% end %>
|
||||
</div>
|
|
@ -1,34 +1,51 @@
|
|||
<% content_for :page_specific_css do -%>
|
||||
<%#= stylesheet_link_tag "admin/ad_banner_preview" %>
|
||||
<% end -%>
|
||||
<% content_for :page_specific_javascript do -%>
|
||||
<%= javascript_include_tag "/static/jquery.cycle.all.latest.js" %>
|
||||
<%= javascript_include_tag "inc/modal-preview" %>
|
||||
<%= javascript_include_tag "lib/contenteditable" %>
|
||||
|
||||
<% end -%>
|
||||
<% set_default_index do
|
||||
objects @ad_banners
|
||||
|
||||
|
||||
<div id="post-body-content" class="clear">
|
||||
<ul id="banner_tab" class="nav nav-tabs">
|
||||
<% @ad_banners.each do |ab| %>
|
||||
<%= content_tag :li ,:class => (ab == @active ? 'active' : nil) do %>
|
||||
<%if at_least_module_manager%>
|
||||
<i class="icons-pencil"></i>
|
||||
<%= link_to(ab.title,"##{ab.title.dehumanize}",:contenteditable=>"false",:data=>{:toggle=>"tab" ,'edit-url' =>(admin_rename_ad_banner_path ab) } )%>
|
||||
<% else %>
|
||||
<%= link_to(ab.title,"##{ab.title.dehumanize}",:data=>{:toggle=>"tab" } )%>
|
||||
<% end -%>
|
||||
<% end -%>
|
||||
<% end -%>
|
||||
quick_edit_link type: 'edit',
|
||||
link: 'edit_admin_ad_banner_path'
|
||||
quick_edit_link type: 'detail'
|
||||
quick_edit_link type: "add image",
|
||||
link: 'new_admin_ad_banner_ad_image_path'
|
||||
quick_edit_link type: "Images",
|
||||
link: 'admin_ad_banner_ad_images_path'
|
||||
|
||||
<%= content_tag :li,link_to(t('new.banner'),"#new-a-banner",:data=>{:toggle=>"modal"}),:id=>'new_ad_banner_tab_but',:class => (@active.nil? ? 'active' : nil ) if at_least_module_manager%>
|
||||
field type: 'field',
|
||||
db_field: 'title',
|
||||
translation: 'title',
|
||||
sort: 'title',
|
||||
link: 'admin_ad_banner_path',
|
||||
quick_edit: true,
|
||||
header_class: 'span5'
|
||||
|
||||
</ul>
|
||||
field type: 'field',
|
||||
db_field: 'ad_fx',
|
||||
translation: 'ad_fx',
|
||||
sort: 'ad_fx',
|
||||
link: 'admin_ad_banner_path',
|
||||
quick_edit: true,
|
||||
header_class: 'span5'
|
||||
|
||||
<div class="tab-content" id="ad_banner-tab-content">
|
||||
<%= render :partial => 'ad_banner_tab',:collection => @ad_banners %>
|
||||
</div>
|
||||
<%= render :partial => "modal_ad_banner_form"%>
|
||||
field db_field: 'best_size',
|
||||
translation: 'best_size',
|
||||
header_class: 'span5'
|
||||
|
||||
|
||||
filter_field type: 'objects',
|
||||
values: @tags,
|
||||
translation: 'tags',
|
||||
object_field: 'name'
|
||||
|
||||
end %>
|
||||
<%= render 'admin/default_index/index' %>
|
||||
|
||||
<!-- footer -->
|
||||
<div class="bottomnav clearfix">
|
||||
<div class="action pull-right">
|
||||
<%= link_to content_tag(:i, nil, class: "icons-plus") + " " + t(:add_new), "#add-banner", :class => "btn btn-primary open-slide"%>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="add-banner" class="nano" style="display:none">
|
||||
<%= render 'new' %>
|
||||
</div>
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
<%= render 'new' %>
|
|
@ -0,0 +1 @@
|
|||
$('#view-page .content').html("<%= j render 'new' %>");
|
|
@ -1,121 +1,256 @@
|
|||
<% content_for :page_specific_css do %>
|
||||
<%= stylesheet_link_tag "lib/main-forms" %>
|
||||
<%= stylesheet_link_tag "lib/fileupload" %>
|
||||
<%= stylesheet_link_tag "lib/main-list" %>
|
||||
<% end %>
|
||||
<% content_for :page_specific_javascript do %>
|
||||
<%= javascript_include_tag "inc/modal-preview" %>
|
||||
<%= javascript_include_tag "/static/jquery.cycle.all.latest.js" %>
|
||||
<%= javascript_include_tag "inc/jquery.imagesloaded.js" %>
|
||||
<%= javascript_include_tag "lib/bootstrap-fileupload" %>
|
||||
<%= javascript_include_tag "lib/bootstrap-datetimepicker" %>
|
||||
<%= javascript_include_tag "lib/datetimepicker/datetimepicker.js" %>
|
||||
<%= javascript_include_tag "lib/modal-preview" %>
|
||||
<%= javascript_include_tag "lib/file-type" %>
|
||||
<% end %>
|
||||
|
||||
<!-- Forms -->
|
||||
<form class="form-horizontal main-forms">
|
||||
<fieldset>
|
||||
|
||||
<div id="poststuff">
|
||||
<form class="clear">
|
||||
<!--Widget start-->
|
||||
<div id="sub-wiget">
|
||||
<div id="widget-date" class="widget-box">
|
||||
<div class="widget-action clear tip" title="<%= t('ad.set_dates') %>">
|
||||
<a href="#" class="action"><i class="icon-exclamation-sign icon-white"></i></a>
|
||||
</div>
|
||||
<h3 class="widget-title"><i class="icons-calendar"></i><%= t(:date_) %></h3>
|
||||
<div class="widget-content clear">
|
||||
<%= f.datetime_picker :post_date, :picker_type => 'date', :label => t(:start_date) %>
|
||||
<%= f.datetime_picker :unpost_date, :picker_type => 'date', :label => t(:end_date) %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="widget-picture" class="widget-box">
|
||||
<div class="widget-action clear tip" title="<%= t('ad.upload_pictures') %>" >
|
||||
<a class="action"><iclass="icon-exclamation-sign icon-white"></i></a>
|
||||
<!-- Input Area -->
|
||||
<div class="input-area">
|
||||
|
||||
<!-- Module Tabs -->
|
||||
<div class="nav-name"><strong>Module</strong></div>
|
||||
<ul class="nav nav-pills module-nav">
|
||||
<li class="active">
|
||||
<a href="#basic" data-toggle="tab">Basic</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#status" data-toggle="tab">Status</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#tag" data-toggle="tab">Tags</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#type" data-toggle="tab">Type</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#frequency" data-toggle="tab">Frequency</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#link" data-toggle="tab">Link</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#imageupload" data-toggle="tab">Images</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<!-- Module -->
|
||||
<div class="tab-content module-area">
|
||||
|
||||
<!-- Basic Module -->
|
||||
<div class="tab-pane fade in active" id="basic">
|
||||
|
||||
<!-- Category -->
|
||||
<div class="control-group">
|
||||
<label class="control-label muted">Banner</label>
|
||||
<div class="controls">
|
||||
<%= select_tag 'ad_banner[id]',options_from_collection_for_select(AdBanner.all, "id", "title",params[:ad_banner_id]) , :class=>"input-medium" %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Date Time Picker -->
|
||||
<div class="control-group">
|
||||
<label class="control-label muted"><%= t(:start_date) %></label>
|
||||
<div class="controls">
|
||||
<%= f.datetime_picker :post_date, :no_label => true %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Date Time Picker -->
|
||||
<div class="control-group">
|
||||
<label class="control-label muted"><%= t(:end_date) %></label>
|
||||
<div class="controls">
|
||||
<%= f.datetime_picker :unpost_date, :no_label => true %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Status Module -->
|
||||
<div class="tab-pane fade" id="status">
|
||||
|
||||
<!-- Status -->
|
||||
<div class="control-group">
|
||||
<label class="control-label muted">Status</label>
|
||||
<div class="controls" data-toggle="buttons-checkbox">
|
||||
<label class="checkbox inline btn">
|
||||
<input type="checkbox" value="1"> Top
|
||||
</label>
|
||||
<label class="checkbox inline btn">
|
||||
<input type="checkbox" value="2"> Hot
|
||||
</label>
|
||||
<label class="checkbox inline btn">
|
||||
<input type="checkbox" value="3"> Hide
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- Tag Module -->
|
||||
<div class="tab-pane fade" id="tag">
|
||||
|
||||
<!-- Tag -->
|
||||
<div class="control-group">
|
||||
<label class="control-label muted"><%= t(:tags) %></label>
|
||||
<div class="controls" data-toggle="buttons-checkbox">
|
||||
<% @tags.each do |tag| %>
|
||||
<label class="checkbox inline btn <%= 'active' if @ad_image.tag_ids.include?(tag.id) %>">
|
||||
<%= check_box_tag 'ad_image[tag_ids][]', tag.id, @ad_image.tag_ids.include?(tag.id) %> <%= tag.name %>
|
||||
<%= hidden_field_tag 'ad_image[tag_ids][]', '' %>
|
||||
</label>
|
||||
<% end %>
|
||||
</div>
|
||||
<h3 class="widget-title"><i class="icons-pictures"></i><%= t(:picture) %></h3>
|
||||
<div class="widget-content clear">
|
||||
<div class="control-group">
|
||||
<div class="upload-picture">
|
||||
<!--請程式務必將圖片尺寸加入到行內裡-->
|
||||
<%= image_tag @ad_image.file rescue ''%>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Type Module -->
|
||||
<div class="tab-pane fade" id="type">
|
||||
|
||||
<!-- Type -->
|
||||
<div class="control-group">
|
||||
<label class="control-label muted">Type</label>
|
||||
<div class="controls">
|
||||
<%= f.select :link_open ,AdImage::LINK_OPEN_TYPES%>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Frequency Module -->
|
||||
<div class="tab-pane fade" id="frequency">
|
||||
|
||||
<!-- Frequency -->
|
||||
<div class="control-group">
|
||||
<label class="control-label muted">Frequency</label>
|
||||
<div class="controls">
|
||||
<%= f.text_field :weight ,:class=> 'span3',:placeholder=> t('ad.chinese_1') %>
|
||||
<span class="help-block">Please enter the number</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Link Module -->
|
||||
<div class="tab-pane fade" id="link">
|
||||
|
||||
<!-- Link -->
|
||||
<div class="control-group">
|
||||
<label class="control-label muted">link</label>
|
||||
<div class="controls">
|
||||
<%= f.text_field :out_link ,:class=> 'span3',:placeholder=> "URL" %>
|
||||
<span class="help-block">Please enter the URL</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Images Module -->
|
||||
<div class="tab-pane fade" id="imageupload">
|
||||
|
||||
<!-- Images Upload -->
|
||||
<div class="control-group">
|
||||
<label class="control-label muted"><%= t(:image) %></label>
|
||||
<div class="controls">
|
||||
<!-- if this page editing please add class "fileupload-edit" -->
|
||||
<div class="fileupload fileupload-new clearfix fileupload-edit" data-provides="fileupload">
|
||||
<div class="fileupload-new thumbnail pull-left">
|
||||
<% if @ad_image.file %>
|
||||
<%= image_tag @ad_image.file %>
|
||||
<% else %>
|
||||
<%= image_tag "http://www.placehold.it/50x50/EFEFEF/AAAAAA" %>
|
||||
<%end%>
|
||||
</div>
|
||||
<div class="fileupload-preview fileupload-exists thumbnail pull-left"></div>
|
||||
<span class="btn btn-file">
|
||||
<span class="fileupload-new"><%= t(:select_image) %></span>
|
||||
<span class="fileupload-exists"><%= t(:change) %></span>
|
||||
<%= f.file_field :file %>
|
||||
</span>
|
||||
<a href="#" class="btn fileupload-exists" data-dismiss="fileupload"><%= t(:cancel) %></a>
|
||||
<div class="controls" data-toggle="buttons-checkbox">
|
||||
<label class="checkbox inline btn btn-danger fileupload-remove">
|
||||
<%= f.check_box :remove_file %><%= t(:remove) %>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- Language Tabs -->
|
||||
<div class="nav-name"><strong><%= t(:language) %></strong></div>
|
||||
<ul class="nav nav-pills language-nav">
|
||||
<% @site_valid_locales.each_with_index do |locale, i| %>
|
||||
<li class="<%= 'active' if i == 0 %>">
|
||||
<a data-toggle="tab" href=".<%= locale %>"><%= I18nVariable.from_locale(locale) %></a>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
||||
<!-- Language -->
|
||||
<div class="tab-content language-area">
|
||||
|
||||
<% @site_valid_locales.each_with_index do |locale, i| %>
|
||||
|
||||
<div class="<%= locale %> tab-pane fade <%= ( i == 0 ) ? "in active" : '' %>">
|
||||
|
||||
<!-- Title-->
|
||||
<div class="control-group input-title">
|
||||
<label class="control-label muted"><%= t(:title) %></label>
|
||||
<div class="controls">
|
||||
<%= f.fields_for :title_translations do |f| %>
|
||||
<%= f.text_field locale, class: "input-block-level", placeholder: t(:title), value: (@ad_image.title_translations[locale] rescue nil) %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Content -->
|
||||
<div class="control-group input-content">
|
||||
<label class="control-label muted"><%= t(:content) %></label>
|
||||
<div class="controls">
|
||||
<div class="textarea">
|
||||
<%= f.fields_for :text_translations do |f| %>
|
||||
<%= f.cktext_area locale, rows: 5, class: "input-block-level", :value => (@ad_image.text_translations[locale] rescue nil) %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% if !@ad_image.ad_banner.best_size.empty?%>
|
||||
<span class="alert widgetInfo"><%= t("ad.widget_info_for_ad_image_size",:best_size=> @ad_image.ad_banner.best_size) %>
|
||||
</span>
|
||||
<% end -%>
|
||||
<div class="controls file-upload input-prepend">
|
||||
<label class="control-label add-on btn" for="input-upload">
|
||||
<%= t(:browse) %>
|
||||
<%= f.file_field :file,:id=>"input-upload",:class => "upload", :onchange=> "document.getElementById('fu1').innerHTML = this.form.fu1.value = this.value;" %>
|
||||
</label>
|
||||
<span id="fu1" class="file-name"></span>
|
||||
<br>
|
||||
<input name="fu1" class="input-medium" type="text">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="widget-type" class="widget-box">
|
||||
<div class="widget-action clear tip" title="<%= t('ad.select_fx') %>">
|
||||
<a class="action"><i class="icon-exclamation-sign icon-white"></i></a>
|
||||
</div>
|
||||
<h3 class="widget-title"><i class="icons-target"></i><%= t(:type) %></h3>
|
||||
<div class="widget-content clear">
|
||||
<%= f.select :link_open ,AdImage::LINK_OPEN_TYPES%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="widget-time" class="widget-box widget-size-300">
|
||||
<div class="widget-action clear tip" title="<%= t('ad.set_range') %>">
|
||||
<a class="action"><i class="icon-exclamation-sign icon-white"></i></a>
|
||||
</div>
|
||||
<h3 class="widget-title"><i class="icons-time"></i><%= t(:frequency) %></h3>
|
||||
<div class="widget-content clear">
|
||||
<%= f.text_field :weight ,:class=> 'span3',:placeholder=> t('ad.chinese_1') %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div id="widget-link" class="widget-box widget-size-300">
|
||||
<div class="widget-action clear tip" title="<%= t('ad.add_link') %>">
|
||||
<a class="action"><i class="icon-exclamation-sign icon-white"></i></a>
|
||||
</div>
|
||||
<h3 class="widget-title"><i class="icons-link"></i><%= t(:link) %></h3>
|
||||
<div class="widget-content clear">
|
||||
<%= f.text_field :out_link ,:class=> 'span3',:placeholder => t('ad.chinese_2') %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--Wiget End-->
|
||||
<!--Post Start-->
|
||||
<div id="post-body">
|
||||
<div id="post-body-content" class="clear">
|
||||
<ul class="nav nav-tabs">
|
||||
<% @site_valid_locales.each do |locale|%>
|
||||
<%= content_tag :li,link_to(I18nVariable.from_locale(locale),"##{locale}",:data=>{:toggle => "tab"}),:class=> (active_when_current_locale_eq locale) %>
|
||||
<% end %>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<%= select_tag 'ad_banner[id]',options_from_collection_for_select(AdBanner.all, "id", "title",params[:ad_banner_id]) , :class=>"input-medium" %>
|
||||
<% @site_valid_locales.each do |locale|%>
|
||||
<%= content_tag :div,:class => "tab-pane #{active_when_current_locale_eq locale}",:id=>"#{locale}" do%>
|
||||
<div class="title">
|
||||
<%= f.fields_for :title_translations do |f| %>
|
||||
<%= f.text_field locale, :class=>"ad_image-title post-title", :placeholder => t('ad.chinese_3'), :value => (@ad_image.title_translations[locale] rescue nil) %>
|
||||
<% end %>
|
||||
</div>
|
||||
<br/>
|
||||
<div class="context editor">
|
||||
<%= f.fields_for :context_translations, @ad_image.context do |f| %>
|
||||
<%= f.text_area locale, :style => "width:100%", :class => "tinymce_textarea post-title", :value => (@ad_image.context_translations[locale] rescue nil) %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<%#= link_to t(:preview), admin_realtime_preview_ad_banner_path(@ad_image.ad_banner.title) ,:class=>"preview_trigger btn btn-success" rescue nil%>
|
||||
<%= f.submit t("submit"),:class=>"btn btn-primary" %>
|
||||
<%= f.submit t("cancel"),:class=>"btn ",:type => 'reset' %>
|
||||
</div>
|
||||
</div>
|
||||
<!--Post End-->
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- Form Actions -->
|
||||
<div class="form-actions">
|
||||
<%= f.submit t("submit"),:class=>"btn btn-primary" %>
|
||||
<%= f.submit t("cancel"),:class=>"btn ",:type => 'reset' %>
|
||||
<!-- <button type="submit" class="btn btn-primary">Save</button>
|
||||
<button type="button" class="btn">Preview</button>
|
||||
<button type="button" class="btn">Cancel</button> -->
|
||||
</div>
|
||||
|
||||
</fieldset>
|
||||
</form>
|
|
@ -0,0 +1,31 @@
|
|||
<% set_default_index do
|
||||
objects @ad_images
|
||||
|
||||
quick_edit_link type: 'edit',
|
||||
link: 'edit_admin_ad_banner_ad_image_path'
|
||||
quick_edit_link type: 'detail'
|
||||
quick_edit_link type: 'delete',
|
||||
link: 'admin_ad_banner_ad_image_path'
|
||||
|
||||
field db_field: 'file',
|
||||
translation: 'image'
|
||||
|
||||
field db_field: 'post_date',
|
||||
translation: 'start_date',
|
||||
hide: 'phone',
|
||||
sort: 'start_date'
|
||||
|
||||
field db_field: 'unpost_date',
|
||||
translation: 'end_date',
|
||||
hide: 'phone',
|
||||
sort: 'end_date'
|
||||
|
||||
field db_field: 'unpost_date',
|
||||
translation: 'end_date',
|
||||
hide: 'phone',
|
||||
sort: 'end_date'
|
||||
|
||||
footer link: 'new_admin_ad_banner_ad_image_path'
|
||||
|
||||
end %>
|
||||
<%= render 'admin/default_index/index' %>
|
|
@ -50,7 +50,7 @@ Orbit::Application.routes.draw do
|
|||
match 'new_ad_image' => 'ad_images#new',:as => :new_ad_image,:via => :get
|
||||
match 'new_ad_image' => 'ad_images#create',:as => :create_ad_image,:via => :post
|
||||
end
|
||||
resources :ad_images ,:except => [:show,:index]
|
||||
resources :ad_images ,:except => [:show]
|
||||
end
|
||||
|
||||
match 'authorizations/add_roles/:module(/:type(/:id))' => 'authorizations#add_roles', :as => :add_roles_authorizations
|
||||
|
|
|
@ -10,7 +10,8 @@ module AdBanner
|
|||
intro "I am intro"
|
||||
update_info 'some update_info'
|
||||
|
||||
authorizable
|
||||
|
||||
taggable
|
||||
|
||||
# front_end do
|
||||
# app_page 'bulletins'
|
||||
|
@ -41,6 +42,18 @@ module AdBanner
|
|||
|
||||
head_link_path "admin_ad_banners_path"
|
||||
|
||||
context_link 'ad_banner.banner',
|
||||
:link_path=>"admin_ad_banners_path" ,
|
||||
:priority=>1,
|
||||
:active_for_action=>{'admin/ad_banners'=>:index},
|
||||
:available_for => [:manager]
|
||||
|
||||
context_link 'tags',
|
||||
:link_path=>"admin_module_tags_path(module_app_id: get_module_app)" ,
|
||||
:priority=>4,
|
||||
:active_for_tag => 'Announcement',
|
||||
:available_for => [:manager]
|
||||
|
||||
context_link 'module_authorization',
|
||||
:link_path=>"admin_module_app_manager_auth_proc_path(ModuleApp.first(conditions: {title: 'AdBanner'}))",
|
||||
:priority=>6,
|
||||
|
|
Loading…
Reference in New Issue