From 35452c039d6a3c20929845d192bc28e1230d6f7b Mon Sep 17 00:00:00 2001 From: "Matthew K. Fu JuYuan" Date: Mon, 23 Apr 2012 17:03:55 +0800 Subject: [PATCH 01/15] Fix ad_banner --- app/assets/javascripts/inc/modal-preview.js | 17 ++++++++++++----- app/models/ad_banner.rb | 10 +++++++++- .../admin/ad_banners/_ad_banner_tab.html.erb | 4 ++-- .../ad_banners/_modal_ad_banner_form.html.erb | 10 ++++++---- config/locales/en.yml | 1 + config/locales/zh_tw.yml | 1 + config/routes.rb | 2 +- 7 files changed, 32 insertions(+), 13 deletions(-) diff --git a/app/assets/javascripts/inc/modal-preview.js b/app/assets/javascripts/inc/modal-preview.js index 2f915f6c..35195999 100644 --- a/app/assets/javascripts/inc/modal-preview.js +++ b/app/assets/javascripts/inc/modal-preview.js @@ -6,10 +6,17 @@ $(document).ready(function() { $("a.preview_trigger").click(function(){ $(this).after(""); $.ajax({ - type:"put", + type: 'PUT', + //async : true, url:$(this).attr("href"), - data:$(this).parents("form").serialize() - }).done(function(){ $("#"+start_modal_with_id).modal('show');}); - return false;} - ); + contentType: 'application/javascript; charset=utf-8', + data:$(this).parents("form").serialize(), + success: function (msg) { + $("#"+start_modal_with_id).modal('show'); }, + error: function(){ + alert("ERROR"); + } + }); + return false; + }); }); \ No newline at end of file diff --git a/app/models/ad_banner.rb b/app/models/ad_banner.rb index 0147c3d2..7377d852 100644 --- a/app/models/ad_banner.rb +++ b/app/models/ad_banner.rb @@ -4,7 +4,7 @@ class AdBanner include Mongoid::MultiParameterAttributes field :title - field :transition_sec,type: Integer + field :transition_msec,type: Integer field :ad_fx #TODO Design should explain before_save :save_or_destroy @@ -13,6 +13,14 @@ class AdBanner has_many :ad_images , dependent: :delete FX_TYPES = ["blindX","blindY","blindZ","cover","curtainX","curtainY","fade","fadeZoom","growX","growY","scrollUp","scrollDown","scrollLeft","scrollRight","scrollHorz","scrollVert","shuffle","slideX","slideY","toss","turnUp","turnDown","turnLeft","turnRight","uncover","wipe","zoom"] +attr_writer :transition_sec + def transition_sec + self.transition_msec/1000 + end + + def transition_sec=(sec) + self.transition_msec = sec.to_i*1000 + end def preview_clone preview_banner = self.clone diff --git a/app/views/admin/ad_banners/_ad_banner_tab.html.erb b/app/views/admin/ad_banners/_ad_banner_tab.html.erb index 530e45cb..c2c9697b 100644 --- a/app/views/admin/ad_banners/_ad_banner_tab.html.erb +++ b/app/views/admin/ad_banners/_ad_banner_tab.html.erb @@ -5,14 +5,14 @@ <%= f.label :ad_fx, t('admin.ad.ab_fx') %> <%= f.select :ad_fx ,AdBanner::FX_TYPES %> <%= f.label :transition_sec, t('admin.ad.transition_sec') %> - <%= f.text_field :transition_sec,:placeholder=>"3秒請輸入3000",:class=> "span3" %> <%= t("admin.ad.trans_unit_sec") %> + <%= f.text_field :transition_sec,:placeholder=>t('admin.ad.sec_place_holder'),:class=> "span3" %> <%= t("admin.ad.trans_unit_sec") %> <%= f.submit t("admin.ad.update_banner") %> <%= f.submit t("cancel"),:type=>'reset' %>
<%= render :partial => "ad_image_update", :collection => ad_banner_tab.ad_images,:as => :ad_image,:locals=>{:ad_banner => ad_banner_tab} %> <%#= render :partial => 'new_add_banner_file', :object => ad_banner_tab.ad_images.build, :locals => { :field_name => "new_ad_images[]", :f => f, :classes => "r_destroy" } %> <%= link_to t("admin.ad.new_image"),new_admin_ad_banner_ad_image_path(ad_banner_tab) ,:class => "btn btn-primary"%> - <%= link_to t("modal.preview"), admin_realtime_preview_ad_banner_path(ad_banner_tab.title) , :class=>'preview_trigger btn btn-success'%> + <%= link_to t("modal.preview"), admin_realtime_preview_ad_banner_url(ad_banner_tab.title) , :class=>'preview_trigger btn btn-success'%>
<% end -%> diff --git a/app/views/admin/ad_banners/_modal_ad_banner_form.html.erb b/app/views/admin/ad_banners/_modal_ad_banner_form.html.erb index 235e7e15..cac5f1a1 100644 --- a/app/views/admin/ad_banners/_modal_ad_banner_form.html.erb +++ b/app/views/admin/ad_banners/_modal_ad_banner_form.html.erb @@ -40,11 +40,13 @@ $('#new_ad_banner_tab_but').on('shown', function (e) { $('#new-a-banner').modal({show: true}); }); -<% if params[:action] == "new" -%> - $('#new-a-banner').modal({show: true}); -<% end -%> + $('#new-a-banner').on('hidden', function (e) { - $(".nav.nav-tabs a[id!='new_ad_banner_tab_but']:last").tab('show'); + $('#post-body-content').find(".nav.nav-tabs").children('li.active').removeClass("active"); + + $('#post-body-content').find(".nav.nav-tabs").children('li[id!="new_ad_banner_tab_but"]').last().addClass("active"); + $('.tab-pane').find(".nav.nav-tabs").children('li[id!="new_ad_banner_tab_but"]').last().addClass("active"); + }); diff --git a/config/locales/en.yml b/config/locales/en.yml index f34557ca..bb161a04 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -43,6 +43,7 @@ en: action: Action ad_banner: AD Banner ad: + sec_place_holder: Enter 3 if 3 sec ab_fx: FX all_banners: AdBanner list banner_best_size: Banner Best Size diff --git a/config/locales/zh_tw.yml b/config/locales/zh_tw.yml index 2615c99c..d0acb21f 100644 --- a/config/locales/zh_tw.yml +++ b/config/locales/zh_tw.yml @@ -40,6 +40,7 @@ zh_tw: action: 操作 ad_banner: 廣告輪播 ad: + sec_place_holder: 3秒請輸入3 ab_fx: 轉場特效 all_banners: 輪播清單 banner_best_size: Banner 尺寸 diff --git a/config/routes.rb b/config/routes.rb index 9200492d..d8552cdd 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -25,7 +25,7 @@ Orbit::Application.routes.draw do end - match 'ad_banner/:title/preivew' => 'ad_banners#realtime_preview',:as => :realtime_preview_ad_banner,:via => :put + match 'ad_banner/:title/preview' => 'ad_banners#realtime_preview',:as => :realtime_preview_ad_banner,:via => :put resources :ad_banners do collection do match 'new_ad_image' => 'ad_images#new',:as => :new_ad_image,:via => :get From a5db2382e765508c6a28f2e0f3e1c2156fc9aaf6 Mon Sep 17 00:00:00 2001 From: "Matthew K. Fu JuYuan" Date: Mon, 23 Apr 2012 18:20:12 +0800 Subject: [PATCH 02/15] Fix ad image date selector --- app/controllers/admin/ad_images_controller.rb | 2 ++ app/models/ad_image.rb | 4 ++-- app/views/admin/ad_images/_form.html.erb | 4 ++-- .../panel/announcement/back_end/fact_checks/setting.html.erb | 4 ++-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/app/controllers/admin/ad_images_controller.rb b/app/controllers/admin/ad_images_controller.rb index 3fb681da..d2039ab5 100644 --- a/app/controllers/admin/ad_images_controller.rb +++ b/app/controllers/admin/ad_images_controller.rb @@ -19,6 +19,8 @@ class Admin::AdImagesController < ApplicationController def new @ad_image =AdImage.new + @ad_image.post_date = Date.today + @ad_image.unpost_date = Date.today + 30 #render :action => 'new',:url=> {:ad_banner_id => params.has_key?(:ad_banner_id)? params[:ad_banner_id],nil} end diff --git a/app/models/ad_image.rb b/app/models/ad_image.rb index 3eb63511..f20a5582 100644 --- a/app/models/ad_image.rb +++ b/app/models/ad_image.rb @@ -28,12 +28,12 @@ class AdImage attr_reader :parse_post_date,:parse_unpost_date def parse_post_date=(att) - self.post_date = (Date.parse att rescue nil) + self.post_date = (Date.parse att.gsub(/\s+/, "") rescue nil) end def parse_unpost_date=(att) - self.unpost_date = (Date.parse att rescue nil) + self.unpost_date = (Date.parse att.gsub(/\s+/, "") rescue nil) end def display? diff --git a/app/views/admin/ad_images/_form.html.erb b/app/views/admin/ad_images/_form.html.erb index c19b2cf4..0fe04b28 100644 --- a/app/views/admin/ad_images/_form.html.erb +++ b/app/views/admin/ad_images/_form.html.erb @@ -23,8 +23,8 @@
- <%= f.hidden_field :parse_post_date %> - <%= f.hidden_field :parse_unpost_date%> + <%= f.hidden_field :parse_post_date,:value => @ad_image.post_date.strftime('%Y / %m / %d') %> + <%= f.hidden_field :parse_unpost_date,:value => @ad_image.unpost_date.strftime('%Y / %m / %d')%>
diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/fact_checks/setting.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/fact_checks/setting.html.erb index 7303b705..6b8ba483 100644 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/fact_checks/setting.html.erb +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/fact_checks/setting.html.erb @@ -3,8 +3,8 @@ <% end %> <% content_for :page_specific_javascript do %> <%= javascript_include_tag "bootstrap" %> - <%= javascript_include_tag "inc/permission-checkbox" %> - <%= javascript_include_tag "inc/search" %> + <%#= javascript_include_tag "inc/permission-checkbox" %> + <%#= javascript_include_tag "inc/search" %> <% end %> <%#= label_tag :fact_check_setting, t("announcement.bulletin.fact_check_setting") %> <%= form_tag('', :remote => true) %> From 083658369416fe701ac851996ad9543cb5bd1ce5 Mon Sep 17 00:00:00 2001 From: "Matthew K. Fu JuYuan" Date: Mon, 23 Apr 2012 18:29:23 +0800 Subject: [PATCH 03/15] Disable ad_banner_preview. Just show window --- app/controllers/admin/ad_banners_controller.rb | 2 +- app/models/ad_image.rb | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/app/controllers/admin/ad_banners_controller.rb b/app/controllers/admin/ad_banners_controller.rb index 19983b66..1e96907f 100644 --- a/app/controllers/admin/ad_banners_controller.rb +++ b/app/controllers/admin/ad_banners_controller.rb @@ -46,7 +46,7 @@ class Admin::AdBannersController < ApplicationController def realtime_preview @ad_banner = AdBanner.first(conditions: { title: params[:title] }).preview_clone - @ad_banner.update_attributes(params[:ad_banner]).update_attributes(params[:ad_images]) + #@ad_banner.update_attributes(params[:ad_banner]).update_attributes(params[:ad_images]) end def index diff --git a/app/models/ad_image.rb b/app/models/ad_image.rb index f20a5582..9d7fe55b 100644 --- a/app/models/ad_image.rb +++ b/app/models/ad_image.rb @@ -24,7 +24,6 @@ class AdImage # validates_numericality_of :weight, greater_than_or_equal_to: 1,less_than_or_equal_to: 10 # validates_format_of :out_link, with: /(http:\/\/.*|)/ ,:message => 'Need a valid URL' - # validates_presence_of :post_date,:message => 'Need a valid post date' attr_reader :parse_post_date,:parse_unpost_date def parse_post_date=(att) From 8041452be50fb91593ac67b41cfc6203c5cf0da8 Mon Sep 17 00:00:00 2001 From: Christophe Vilayphiou Date: Tue, 24 Apr 2012 11:05:01 +0800 Subject: [PATCH 04/15] Fix for translation in sort headers for announcement --- .../back_end/bulletins/_sort_headers.html.erb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_sort_headers.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_sort_headers.html.erb index 6d6c54e0..b48cca39 100644 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_sort_headers.html.erb +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_sort_headers.html.erb @@ -6,25 +6,25 @@ - <%= link_to t('bulletin.status') + content_tag(:b, nil, :class => is_sort?('status')), panel_announcement_back_end_bulletins_path({:filter => @filter}.merge(sortable('status'))), :class => 'js_history' %> + <%= link_to (t('bulletin.status') + content_tag(:b, nil, :class => is_sort?('status'))).html_safe, panel_announcement_back_end_bulletins_path({:filter => @filter}.merge(sortable('status'))), :class => 'js_history' %> - <%= link_to t('bulletin.category') + content_tag(:b, nil, :class => is_sort?('category')), panel_announcement_back_end_bulletins_path({:filter => @filter}.merge(sortable('category'))), :class => 'js_history' %> + <%= link_to (t('bulletin.category') + content_tag(:b, nil, :class => is_sort?('category'))).html_safe, panel_announcement_back_end_bulletins_path({:filter => @filter}.merge(sortable('category'))), :class => 'js_history' %> - <%= link_to t('bulletin.title') + content_tag(:b, nil, :class => is_sort?('title')), panel_announcement_back_end_bulletins_path({:filter => @filter}.merge(sortable('title'))), :class => 'js_history' %> + <%= link_to (t('bulletin.title') + content_tag(:b, nil, :class => is_sort?('title'))).html_safe, panel_announcement_back_end_bulletins_path({:filter => @filter}.merge(sortable('title'))), :class => 'js_history' %> - <%= link_to t('bulletin.start_date') + content_tag(:b, nil, :class => is_sort?('postdate')), panel_announcement_back_end_bulletins_path({:filter => @filter}.merge(sortable('postdate'))), :class => 'js_history' %> + <%= link_to (t('bulletin.start_date') + content_tag(:b, nil, :class => is_sort?('postdate'))).html_safe, panel_announcement_back_end_bulletins_path({:filter => @filter}.merge(sortable('postdate'))), :class => 'js_history' %> - <%= link_to t('bulletin.end_date') + content_tag(:b, nil, :class => is_sort?('deadline')), panel_announcement_back_end_bulletins_path({:filter => @filter}.merge(sortable('deadline'))), :class => 'js_history' %> + <%= link_to (t('bulletin.end_date') + content_tag(:b, nil, :class => is_sort?('deadline'))).html_safe, panel_announcement_back_end_bulletins_path({:filter => @filter}.merge(sortable('deadline'))), :class => 'js_history' %> - <%= link_to t('bulletin.tags') + content_tag(:b, nil, :class => is_sort?('tags')), panel_announcement_back_end_bulletins_path({:filter => @filter}.merge(sortable('tags'))), :class => 'js_history' %> + <%= link_to (t('bulletin.tags') + content_tag(:b, nil, :class => is_sort?('tags'))).html_safe, panel_announcement_back_end_bulletins_path({:filter => @filter}.merge(sortable('tags'))), :class => 'js_history' %> - <%= link_to t('bulletin.last_modified') + content_tag(:b, nil, :class => is_sort?('update_user_id')), panel_announcement_back_end_bulletins_path({:filter => @filter}.merge(sortable('update_user_id'))), :class => 'js_history' %> + <%= link_to (t('bulletin.last_modified') + content_tag(:b, nil, :class => is_sort?('update_user_id'))).html_safe, panel_announcement_back_end_bulletins_path({:filter => @filter}.merge(sortable('update_user_id'))), :class => 'js_history' %> From f05b7db73a629e9295a01980be9724c02e4132b9 Mon Sep 17 00:00:00 2001 From: Christophe Vilayphiou Date: Tue, 24 Apr 2012 11:26:36 +0800 Subject: [PATCH 05/15] Fix for parser sub_menu Add style to the sub_menu --- lib/parsers/parser_common.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/parsers/parser_common.rb b/lib/parsers/parser_common.rb index 94a968c4..403c05e4 100644 --- a/lib/parsers/parser_common.rb +++ b/lib/parsers/parser_common.rb @@ -110,13 +110,17 @@ module ParserCommon def parse_sub_menus(body = nil, page = nil, id = nil) body.css('sub_menu').each do |sub_menu| res = '' - res << "
    " + res << "
    " + res << "

    #{page.i18n_variable[I18n.locale]}

    " + res << "" + res << "" + res << "
    " fragment = Nokogiri::HTML::DocumentFragment.new(body, res) sub_menu.swap(fragment) end From b80339d7046b58226c8d26b5f0aa6dc5ddd194d1 Mon Sep 17 00:00:00 2001 From: Christophe Vilayphiou Date: Tue, 24 Apr 2012 11:35:50 +0800 Subject: [PATCH 06/15] Ray's changes for image upload component and sign-in page --- .../javascripts/inc/jquery.imagesloaded.js | 112 ++++++++++++++++++ .../inc/permission-checkbox.css.erb | 79 ++++++++++++ app/assets/stylesheets/new_admin.css.erb | 2 +- app/assets/stylesheets/style.css.erb | 4 +- app/views/admin/ad_images/_form.html.erb | 56 +++++---- app/views/devise/sessions/new.html.erb | 2 +- 6 files changed, 223 insertions(+), 32 deletions(-) create mode 100644 app/assets/javascripts/inc/jquery.imagesloaded.js create mode 100644 app/assets/stylesheets/inc/permission-checkbox.css.erb diff --git a/app/assets/javascripts/inc/jquery.imagesloaded.js b/app/assets/javascripts/inc/jquery.imagesloaded.js new file mode 100644 index 00000000..a488974d --- /dev/null +++ b/app/assets/javascripts/inc/jquery.imagesloaded.js @@ -0,0 +1,112 @@ +/*! + * jQuery imagesLoaded plugin v2.0.1 + * http://github.com/desandro/imagesloaded + * + * MIT License. by Paul Irish et al. + */ + +/*jshint curly: true, eqeqeq: true, noempty: true, strict: true, undef: true, browser: true */ +/*global jQuery: false */ + +;(function($, undefined) { +'use strict'; + +// blank image data-uri bypasses webkit log warning (thx doug jones) +var BLANK = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw=='; + +$.fn.imagesLoaded = function( callback ) { + var $this = this, + deferred = $.isFunction($.Deferred) ? $.Deferred() : 0, + hasNotify = $.isFunction(deferred.notify), + $images = $this.find('img').add( $this.filter('img') ), + loaded = [], + proper = [], + broken = []; + + function doneLoading() { + var $proper = $(proper), + $broken = $(broken); + + if ( deferred ) { + if ( broken.length ) { + deferred.reject( $images, $proper, $broken ); + } else { + deferred.resolve( $images ); + } + } + + if ( $.isFunction( callback ) ) { + callback.call( $this, $images, $proper, $broken ); + } + } + + function imgLoaded( img, isBroken ) { + // don't proceed if BLANK image, or image is already loaded + if ( img.src === BLANK || $.inArray( img, loaded ) !== -1 ) { + return; + } + + // store element in loaded images array + loaded.push( img ); + + // keep track of broken and properly loaded images + if ( isBroken ) { + broken.push( img ); + } else { + proper.push( img ); + } + + // cache image and its state for future calls + $.data( img, 'imagesLoaded', { isBroken: isBroken, src: img.src } ); + + // trigger deferred progress method if present + if ( hasNotify ) { + deferred.notifyWith( $(img), [ isBroken, $images, $(proper), $(broken) ] ); + } + + // call doneLoading and clean listeners if all images are loaded + if ( $images.length === loaded.length ){ + setTimeout( doneLoading ); + $images.unbind( '.imagesLoaded' ); + } + } + + // if no images, trigger immediately + if ( !$images.length ) { + doneLoading(); + } else { + $images.bind( 'load.imagesLoaded error.imagesLoaded', function( event ){ + // trigger imgLoaded + imgLoaded( event.target, event.type === 'error' ); + }).each( function( i, el ) { + var src = el.src; + + // find out if this image has been already checked for status + // if it was, and src has not changed, call imgLoaded on it + var cached = $.data( el, 'imagesLoaded' ); + if ( cached && cached.src === src ) { + imgLoaded( el, cached.isBroken ); + return; + } + + // if complete is true and browser supports natural sizes, try + // to check for image status manually + if ( el.complete && el.naturalWidth !== undefined ) { + imgLoaded( el, el.naturalWidth === 0 || el.naturalHeight === 0 ); + return; + } + + // cached images don't fire load sometimes, so we reset src, but only when + // dealing with IE, or image is complete (loaded) and failed manual check + // webkit hack from http://groups.google.com/group/jquery-dev/browse_thread/thread/eee6ab7b2da50e1f + if ( el.readyState || el.complete ) { + el.src = BLANK; + el.src = src; + } + }); + } + + return deferred ? deferred.promise( $this ) : $this; +}; + +})(jQuery); \ No newline at end of file diff --git a/app/assets/stylesheets/inc/permission-checkbox.css.erb b/app/assets/stylesheets/inc/permission-checkbox.css.erb new file mode 100644 index 00000000..9e61df20 --- /dev/null +++ b/app/assets/stylesheets/inc/permission-checkbox.css.erb @@ -0,0 +1,79 @@ +/*permission-checkbox*/ + +.checkblock { + display: inline-block; + float: left; + width: 200px; +} +.check[type="checkbox"]{ + display:none; +} +.checkbox{ + padding: 5px; + margin: 5px 5px 10px; + display: inline-block; + color:#777777; + text-shadow: 0 1px 0px rgba(255,255,255,.4); + border-radius: 3px; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + height: 30px; + position: relative; + cursor: pointer; + background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #ededed), color-stop(1, #dfdfdf) ); + background:-moz-linear-gradient( center top, #ededed 5%, #dfdfdf 100% ); + filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ededed', endColorstr='#dfdfdf'); + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); +} +.checkbox .check-icon { + display: none; + position: absolute; + width: 32px; + height: 32px; + background: url(<%= asset_path 'check.png' %>) no-repeat left top; + right: -10px; + top: 15px; +} +.checkbox .member-name { + cursor: pointer; + font-family: helvetica; + font-size: 12px; + line-height: 30px; + padding: 0 10px 0 40px; + color: #333333; + display: inline-block; + margin-bottom: 0; +} +.member-avatar { + position: absolute; + width: 34px; + height: 34px; + overflow: hidden; + margin-top: -2px; +} +img.member-img { + max-width: 100%; +} +.checked .check-icon { + display: block; +} +.popover-inner { + width: auto; + display: inline-block; + text-align: center; +} +.popover-title { + display: block; + font-size: 12px; + font-weight: normal; + padding: 3px 10px; +} +.popover-content { + padding: 3px 10px; + color: #898989; +} +.popover-content p { + font-size: 12px; +} \ No newline at end of file diff --git a/app/assets/stylesheets/new_admin.css.erb b/app/assets/stylesheets/new_admin.css.erb index 4b004d3d..99542101 100644 --- a/app/assets/stylesheets/new_admin.css.erb +++ b/app/assets/stylesheets/new_admin.css.erb @@ -5,8 +5,8 @@ *= require reset *= require_self *= require message - *= require style *= require bootstrap + *= require style *= require bootstrap-orbit *= require list *= require widgets diff --git a/app/assets/stylesheets/style.css.erb b/app/assets/stylesheets/style.css.erb index c08a23e4..e0a704ef 100644 --- a/app/assets/stylesheets/style.css.erb +++ b/app/assets/stylesheets/style.css.erb @@ -565,7 +565,9 @@ padding: 5px; } .popover-content { - border-radius: 3px; + -webkit-border-radius: 0 0 3px 3px; + -moz-border-radius: 0 0 3px 3px; + border-radius: 0 0 3px 3px; padding: 5px; } .popover-title { diff --git a/app/views/admin/ad_images/_form.html.erb b/app/views/admin/ad_images/_form.html.erb index 075f01b4..d38a86a6 100644 --- a/app/views/admin/ad_images/_form.html.erb +++ b/app/views/admin/ad_images/_form.html.erb @@ -6,6 +6,7 @@ <%= javascript_include_tag "lib/date.format" %> <%= javascript_include_tag "inc/modal-preview" %> <%= javascript_include_tag "/static/jquery.cycle.all.latest.js" %> + <%= javascript_include_tag "inc/jquery.imagesloaded" %> <% end %> @@ -79,27 +80,29 @@ <%= image_tag @ad_image.file,:width=> "456",:height=>'700' rescue ''%> + $('.upload-picture').find('img').imagesLoaded(function(){; + var picH = $('.upload-picture').width()/$('.upload-picture').find('img').width()*$('.upload-picture').find('img').height(); + var imgMarginTop = ($('.upload-picture').height()-picH)/2; + var d = $('.upload-picture').height(); + if(imgMarginTop>0){ + imgMarginTop = 0; + d = picH; + $('.upload-picture').css({height:d}) + } + $('.upload-picture').find('img').css({marginTop:imgMarginTop}) + $('.upload-picture').each(function (i){ + $(this).mouseenter(function(){ + var h= picH; + $(this).stop().animate({height:h}, 500); + $(this).find('img').stop().animate({marginTop:0}, 500); + }); + $(this).mouseleave(function(){ + $(this).stop().animate({height:d}, 500); + $(this).find('img').stop().animate({marginTop:imgMarginTop}, 500); + }); + }); + }); +
此區塊圖片尺寸請使用580px × 225px
@@ -181,16 +184,11 @@
- - - + <%= link_to t("modal.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' %>
-
- <%= link_to t("modal.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' %> -
\ No newline at end of file diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb index 37f58994..29501fbf 100644 --- a/app/views/devise/sessions/new.html.erb +++ b/app/views/devise/sessions/new.html.erb @@ -5,7 +5,7 @@