Orbit/app/views/admin/ad_banners/_form.html.erb

45 lines
2.1 KiB
Plaintext
Raw Normal View History

2013-10-18 07:25:19 +00:00
<%= flash_messages %>
<%= f.error_messages %>
<%= f.label :title, t('ad_banner.banner_name') %>
<%= f.text_field :title, class: 'input-large', placeholder: t('ad_banner.banner_name') %>
<span class="help-block"><%= t('ad_banner.name_only_english') %></span>
<%= f.label :timeout, t('ad_banner.transition_interval') %>
<%= f.number_field :timeout, in: 0..60, step: 1, class: 'input-mini', onkeypress: "if (event.keyCode < 48 || event.keyCode > 57) event.returnValue = false;" %>
<span class="help-block"><%= t('ad_banner.number_seconds') %></span>
<%= f.label :speed, t('ad_banner.transition_speed') %>
<%= f.number_field :speed, in: 0..1000, step: 100, class: 'input-mini', onkeypress: "if (event.keyCode < 48 || event.keyCode > 57) event.returnValue = false;" %>
<span class="help-block"><%= t('ad_banner.number_milliseconds') %></span>
<%= f.label :size, t('ad_banner.size') %>
<span class="banner_set">W</span>
<%= f.number_field :width, in: 10..1000, step: 10, class: 'input-mini', onkeypress: "if (event.keyCode < 48 || event.keyCode > 57) event.returnValue = false;" %>
<span class="banner_set">H</span>
<%= f.number_field :height, in: 10..1000, step: 10, class: 'input-mini', onkeypress: "if (event.keyCode < 48 || event.keyCode > 57) event.returnValue = false;" %>
<span class="help-block"><%= t('ad_banner.number_milliseconds') %></span>
<%= f.label :ad_fx, t('ad_banner.effect') %>
<%= f.select :ad_fx, AdBanner::FX_TYPES, {}, {class: 'ad_banner_ad_fx'} %>
<div class="preview">
<%= image_tag "slideshow_preview_A.png" %>
<%= image_tag "slideshow_preview_B.png" %>
</div>
<span class="help-block"><%= t('ad_banner.effect') %></span>
<script type="text/javascript">
$(".ad_banner_ad_fx").change(function () {
// bannerTime = $("#pageslide #timeout").val()*1000;
// bannerSpeed = $("#pageslide #speed").val()*1000;
bannerTime = "<%= @ad_banner.timeout_in_min %>"
bannerSpeed = "<%= @ad_banner.speed %>"
bannerTime = parseInt(bannerTime) || 300;
bannerSpeed = parseInt(bannerSpeed) || 300;
slideshow($(this).val(), bannerTime, bannerSpeed);
});
</script>