Merge branch 'design_team' into ldap
Conflicts: vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_sort_headers.html.erb
This commit is contained in:
		
						commit
						70f6c7b540
					
				|  | @ -0,0 +1,137 @@ | |||
| /*! | ||||
|  * 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); | ||||
| 
 | ||||
| $(document).ready(function() { | ||||
| 	$('.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); | ||||
| 	        }); | ||||
| 	    }); | ||||
| 	}); | ||||
| }); | ||||
|  | @ -6,10 +6,17 @@ $(document).ready(function() { | |||
| 	$("a.preview_trigger").click(function(){ | ||||
| 		$(this).after("<span id='show_preview'></span>"); | ||||
| 		$.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; | ||||
| 		}); | ||||
| }); | ||||
|  | @ -66,6 +66,7 @@ textarea { | |||
|   margin: 0; | ||||
|   font-size: 100%; | ||||
|   vertical-align: middle; | ||||
|   margin-bottom: 10px; | ||||
| } | ||||
| button, input { | ||||
|   *overflow: visible; | ||||
|  |  | |||
|  | @ -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; | ||||
| } | ||||
|  | @ -5,8 +5,8 @@ | |||
|  *= require reset | ||||
|  *= require_self | ||||
|  *= require message | ||||
|  *= require style | ||||
|  *= require bootstrap | ||||
|  *= require style | ||||
|  *= require bootstrap-orbit | ||||
|  *= require list | ||||
|  *= require widgets | ||||
|  |  | |||
|  | @ -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 { | ||||
|  |  | |||
|  | @ -84,7 +84,7 @@ | |||
| 	border-radius: 0 3px 3px 0; | ||||
| 	text-align: left; | ||||
| 	margin: 0; | ||||
|     width: 180px; | ||||
|     width: 193px; | ||||
| } | ||||
| .file-upload .upload { | ||||
| 	margin:0; | ||||
|  |  | |||
|  | @ -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 | ||||
|  |  | |||
|  | @ -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 | ||||
|    | ||||
|  |  | |||
|  | @ -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 rescue nil | ||||
|   end | ||||
|    | ||||
|   def transition_sec=(sec) | ||||
|     self.transition_msec = sec.to_i*1000 | ||||
|   end | ||||
|    | ||||
|   def preview_clone | ||||
|     preview_banner = self.clone | ||||
|  |  | |||
|  | @ -24,16 +24,15 @@ 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) | ||||
|     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? | ||||
|  |  | |||
|  | @ -5,7 +5,7 @@ | |||
| 		<%= 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' %> | ||||
| 	<div class="adbanner-list"> | ||||
|  |  | |||
|  | @ -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"); | ||||
| 	 | ||||
| }); | ||||
| </script> | ||||
| 
 | ||||
|  |  | |||
|  | @ -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 %> | ||||
| 
 | ||||
|  | @ -23,8 +24,8 @@ | |||
|                   <div id="calendarRange"> | ||||
|                       <div class="input-append"> | ||||
|                           <span class="showDate"></span><span class="add-on btn">▼</span> | ||||
| 													<%= 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')%> | ||||
| 
 | ||||
|                       </div> | ||||
|                       <div id="widgetCalendar"> | ||||
|  | @ -74,49 +75,24 @@ | |||
|         </div> | ||||
|         <h3 class="widget-title"><i class="icons-picture icons-white"></i>Picture</h3> | ||||
|         <div class="widget-content clear">          | ||||
|             <div class="control-group"> | ||||
|                 <div  class="upload-picture"> | ||||
|                     <!--請程式務必將圖片尺寸加入到行內裡--> | ||||
|                     <%= image_tag @ad_image.file,:width=> "456",:height=>'700' rescue ''%> | ||||
|                     <script type="text/javascript"> | ||||
|                         var picH = $('.upload-picture').width()/$('.upload-picture').find('img').attr("width")*$('.upload-picture').find('img').attr("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); | ||||
|                             }); | ||||
|                         }); | ||||
|                     </script> | ||||
|                 </div> | ||||
|                 <span class="alert widgetInfo">此區塊圖片尺寸請使用580px × 225px</span> | ||||
|                 <div class="controls file-upload input-prepend"> | ||||
|                     <label class="control-label add-on btn" for="input-upload"> | ||||
| 									Choose file | ||||
| 									 | ||||
| 									<%= 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 class="control-group"> | ||||
|             <div  class="upload-picture"> | ||||
|               <!--請程式務必將圖片尺寸加入到行內裡--> | ||||
|               <%= image_tag @ad_image.file rescue ''%> | ||||
|             </div> | ||||
|             <span class="alert widgetInfo">此區塊圖片尺寸請使用580px × 225px</span> | ||||
|             <div class="controls file-upload input-prepend"> | ||||
|               <label class="control-label add-on btn" for="input-upload"> | ||||
| 								Choose file | ||||
| 								<%= 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 id="widget-type" class="widget-box"> | ||||
| 					<div class="widget-action clear"> | ||||
|  | @ -181,16 +157,11 @@ | |||
| 					</div> | ||||
| 				</div> | ||||
| 				<div class="form-actions"> | ||||
| 					<button class="btn btn-success" type="submit">Preview/預覽</button> | ||||
| 					<button class="btn btn-primary" type="submit">Submit/送出</button> | ||||
| 					<button class="btn" type="reset">Cancel/取消</button> | ||||
| 					<%= 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' %> | ||||
| 				</div> | ||||
| 			</div> | ||||
| 			<!--Post End--> | ||||
| 			<div class="form-actions"> | ||||
| 				<%= 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' %> | ||||
| 			</div> | ||||
| 		</form> | ||||
| 	</div> | ||||
|  | @ -7,7 +7,7 @@ | |||
| <div id="container" class="sign-in"> | ||||
| 	<%= form_for :user, :url => user_session_path, :html => {:class => 'user_new form-horizontal'} do |f| %> | ||||
| 		<div class="content"> | ||||
| 			<p class="notice hide">Notice</p> | ||||
| 			<p class="notice label label-warning">Notice</p> | ||||
| 			<p class="alert hide">You need to sign in or sign up before continuing.</p> | ||||
| 			<div class="main"> | ||||
| 				<div class="control-group clear"> | ||||
|  |  | |||
|  | @ -5,12 +5,12 @@ | |||
| 			    <a class="brand dropdown-toggle" data-toggle="dropdown" href="#">Orbit</a> | ||||
| 			    <ul class="dropdown-menu"> | ||||
| 							<li><%= link_to content_tag(:i, nil, :class => 'icons-dashboard') + t('admin.dashboard'), admin_dashboards_path %></li> | ||||
| 			        <li><a href="#"><i class="icons-content"></i><%= t('admin.content') %></a></li> | ||||
| 							<li><%= link_to content_tag(:i, nil, :class => 'icons-member') + t('admin.member'), admin_users_path %></li> | ||||
| 							<li><%= link_to content_tag(:i, nil, :class => 'icons-asset') + t('admin.asset'), admin_assets_path %></li> | ||||
| 			        <li><%#= link_to content_tag(:i, nil, :class => 'icons-content') + t('admin.content') %></li> | ||||
| 							<li><%#= link_to content_tag(:i, nil, :class => 'icons-member') + t('admin.member'), admin_users_path %></li> | ||||
| 							<li><%#= link_to content_tag(:i, nil, :class => 'icons-asset') + t('admin.asset'), admin_assets_path %></li> | ||||
| 			        <li class="divider"></li> | ||||
| 							<li><%= link_to content_tag(:i, nil, :class => 'icons-structure') + t('admin.structure'), admin_items_path %></li> | ||||
| 			        <li><a href="#"><i class="icons-plus-cube"></i><%= t('admin.add_item') %></a></li> | ||||
| 			        <li><%#= link_to content_tag(:i, nil, :class => 'icons-plus-cube') + t('admin.add_item') %></li> | ||||
| 			    </ul> | ||||
| 			</div> | ||||
| 			<ul class="nav"> | ||||
|  |  | |||
|  | @ -9,6 +9,7 @@ en: | |||
|   account_settings: Account settings | ||||
|   add: Add | ||||
|   back: Back | ||||
|   browse: Browse | ||||
|   cancel: Cancel | ||||
|   create: Create | ||||
|   delete: Delete | ||||
|  | @ -46,6 +47,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 | ||||
|  |  | |||
|  | @ -6,6 +6,7 @@ zh_tw: | |||
|   account_settings: 帳號設定 | ||||
|   add: 新增 | ||||
|   back: 回上一步 | ||||
|   browse: 選擇檔案 | ||||
|   cancel: 取消 | ||||
|   create: 創建 | ||||
|   delete: 刪除 | ||||
|  | @ -43,6 +44,7 @@ zh_tw: | |||
|     action: 操作 | ||||
|     ad_banner: 廣告輪播 | ||||
|     ad: | ||||
|       sec_place_holder: 3秒請輸入3 | ||||
|       ab_fx: 轉場特效 | ||||
|       all_banners: 輪播清單 | ||||
|       banner_best_size: Banner 尺寸 | ||||
|  | @ -59,7 +61,7 @@ zh_tw: | |||
|     add_language: 新增語言 | ||||
|     add_drop_down_item: +增加Orbit選單 | ||||
|     admin: 管理 | ||||
|     announcement: 公告系統 | ||||
|     announcement: 公告管理 | ||||
|     asset: 資產 | ||||
|     assets: | ||||
|         file: 檔案 | ||||
|  | @ -155,6 +157,7 @@ zh_tw: | |||
|     purchase: 購買 | ||||
|     role: 角色 | ||||
|     roles: 角色 | ||||
|     site_setting: 基本設定 | ||||
|     setup_member: 成員設置 | ||||
|     setup_translations: 語系設定 | ||||
|     setup_designs: 版型設定 | ||||
|  |  | |||
|  | @ -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 | ||||
|  |  | |||
|  | @ -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 << "<ul>" | ||||
|       res << "<div class='category_list'>" | ||||
|       res << "<h3 class='h3'>#{page.i18n_variable[I18n.locale]}</h3>" | ||||
|       res << "<ul class='list'>" | ||||
|       page.children.each do |child| | ||||
|         res << "<li>" | ||||
|         res << "<a href='#{child.full_name}'>#{child.i18n_variable[I18n.locale]}</a>" | ||||
|         res << "</li>" | ||||
|       end | ||||
|       res << "</ul>" | ||||
|       res << "</h3>" | ||||
|       res << "</div>" | ||||
|       fragment = Nokogiri::HTML::DocumentFragment.new(body, res) | ||||
|       sub_menu.swap(fragment) | ||||
|     end | ||||
|  |  | |||
|  | @ -91,7 +91,7 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController | |||
|   # GET /bulletins/1/edit | ||||
|   def edit | ||||
|     @bulletin = Bulletin.find(params[:id]) | ||||
|     if @bulletin.is_rejected? | ||||
|     if !current_user.admin? && (@bulletin.is_rejected? || @bulletin.is_checked?) | ||||
|       redirect_to :action => :index | ||||
|     else | ||||
|       # @summary_variable = @bulletin.summary_variable | ||||
|  |  | |||
|  | @ -14,7 +14,7 @@ | |||
| 			<span class="label"><%= t(:pending) %></span> | ||||
| 		<% end %> | ||||
| 		<% if bulletin.is_checked? %> | ||||
| 			<span class="label"><%= t(:checked) %></span> | ||||
| 			<span class="label"><%= t(:passed) %></span> | ||||
| 		<% end %> | ||||
| 		<% if bulletin.is_rejected? %> | ||||
| 			<span class="label"><%= t(:rejected) %></span> | ||||
|  | @ -25,23 +25,23 @@ | |||
| 		<%= link_to bulletin.title[I18n.locale], panel_announcement_front_end_bulletin_path(bulletin, :category_id => bulletin.bulletin_category.id) rescue ''%> | ||||
| 		<div class="quick-edit"> | ||||
| 			<ul class="nav nav-pills hide"> | ||||
| 				<% unless bulletin.is_rejected?%> | ||||
| 				<li><%= link_to t('bulletin.edit'), edit_panel_announcement_back_end_bulletin_path(bulletin) %></li> | ||||
| 				<li class="dropdown"> | ||||
| 					<a href="#" data-toggle="dropdown" class="dropdown-toggle"><%= t(:quick_edit) %><b class="caret"></b></a> | ||||
| 					<ul class="dropdown-menu" id="menu1"> | ||||
| 						<li><%= link_to t(:basic), load_quick_edit_panel_announcement_back_end_bulletin_path(bulletin, :type => 'basic'), :remote => true %></li> | ||||
| 						<li><%= link_to t(:picture), load_quick_edit_panel_announcement_back_end_bulletin_path(bulletin, :type => 'picture'), :remote => true %></li> | ||||
| 						<li><%= link_to t(:tags), load_quick_edit_panel_announcement_back_end_bulletin_path(bulletin, :type => 'tags'), :remote => true %></li> | ||||
| 						<li><%= link_to t(:link), load_quick_edit_panel_announcement_back_end_bulletin_path(bulletin, :type => 'links'), :remote => true %></li> | ||||
| 						<li><%= link_to t(:file), load_quick_edit_panel_announcement_back_end_bulletin_path(bulletin, :type => 'files'), :remote => true %></li> | ||||
| 					</ul> | ||||
| 				</li> | ||||
| 				<%#= debugger  %> | ||||
| 				<%#= a=1 %> | ||||
| 				<% if (bulletin.bulletin_category.authed_users('fact_check').include?(current_user) or is_manager?) and !bulletin.is_expired? %> | ||||
| 				<li><%= link_to t('bulletin.fact_check'), edit_panel_announcement_back_end_bulletin_path(bulletin)   %></li><%#= #TODO add ancher so user can quick access into that part %> | ||||
| 				<% end %>				 | ||||
| 				<% if current_user.admin? || (!bulletin.is_rejected? && !bulletin.is_checked?) %> | ||||
| 					<li><%= link_to t('bulletin.edit'), edit_panel_announcement_back_end_bulletin_path(bulletin) %></li> | ||||
| 					<li class="dropdown"> | ||||
| 						<a href="#" data-toggle="dropdown" class="dropdown-toggle"><%= t(:quick_edit) %><b class="caret"></b></a> | ||||
| 						<ul class="dropdown-menu" id="menu1"> | ||||
| 							<li><%= link_to t(:basic), load_quick_edit_panel_announcement_back_end_bulletin_path(bulletin, :type => 'basic'), :remote => true %></li> | ||||
| 							<li><%= link_to t(:picture), load_quick_edit_panel_announcement_back_end_bulletin_path(bulletin, :type => 'picture'), :remote => true %></li> | ||||
| 							<li><%= link_to t(:tags), load_quick_edit_panel_announcement_back_end_bulletin_path(bulletin, :type => 'tags'), :remote => true %></li> | ||||
| 							<li><%= link_to t(:link), load_quick_edit_panel_announcement_back_end_bulletin_path(bulletin, :type => 'links'), :remote => true %></li> | ||||
| 							<li><%= link_to t(:file), load_quick_edit_panel_announcement_back_end_bulletin_path(bulletin, :type => 'files'), :remote => true %></li> | ||||
| 						</ul> | ||||
| 					</li> | ||||
| 					<%#= debugger  %> | ||||
| 					<%#= a=1 %> | ||||
| 					<% if (bulletin.bulletin_category.authed_users('fact_check').include?(current_user) or is_manager?) and !bulletin.is_expired? %> | ||||
| 					<li><%= link_to t('bulletin.fact_check'), edit_panel_announcement_back_end_bulletin_path(bulletin)   %></li><%#= #TODO add ancher so user can quick access into that part %> | ||||
| 					<% end %>				 | ||||
| 				<% end %> | ||||
| 				<li class="dropdown"><%= link_to t('bulletin.delete'), panel_announcement_back_end_bulletin_path(bulletin), :confirm => t('announcement.sure?'), :method => :delete, :remote => true %></li> | ||||
| 			</ul> | ||||
|  |  | |||
|  | @ -4,23 +4,31 @@ | |||
| 	<%= f.error_messages %> | ||||
| 	 | ||||
| 	<div id="sub-wiget"> | ||||
| 		<div id="widget-picture" class="widget-box widget-size-300"> | ||||
| 		<div id="widget-picture" class="widget-box"> | ||||
| 			<div class="widget-action clear"> | ||||
| 				<a class="action"><i title="Upload pictures" class="icon-exclamation-sign icon-white tip"></i></a> | ||||
| 			</div> | ||||
| 			<h3 class="widget-title"><i class="icons-picture icons-white"></i>Picture</h3> | ||||
| 			<div class="widget-content clear"> | ||||
| 				<div class="control-group"> | ||||
| 					<img class="pull-left upload-picture" src="/assets/default-img.png" /> | ||||
|            <!-- <img class="pull-left upload-picture" src="/assets/default-img.png" /> --> | ||||
| 					<div  class="upload-picture"> | ||||
|               <!--請程式務必將圖片尺寸加入到行內裡--> | ||||
|               <% if @bulletin.image %> | ||||
|               	<%= image_tag @bulletin.image, :width=> "456", :height=>'700' rescue ''%> | ||||
|               <% else %> | ||||
|               	<img class="pull-left upload-picture" src="/assets/default-img.png" /> | ||||
|               <% end %> | ||||
| 
 | ||||
| 					<div class="controls file-upload"> | ||||
| 					<label class="control-label btn" for="input-upload"> | ||||
| 						Browse/選擇檔案 | ||||
|           </div> | ||||
| 					<div class="controls file-upload input-prepend"> | ||||
| 					<label class="control-label add-on btn" for="input-upload"> | ||||
| 						<%= t(:browse) %> | ||||
| 						<%= f.file_field :image, :id => "input-upload", :class => 'upload', :onchange => "document.getElementById('fu').innerHTML = this.form.fu.value = this.value;" %> | ||||
| 					</label> | ||||
| 					<span id='fu' class="file-name"></span> | ||||
| 					<br> | ||||
| 					<input name='fu' class="input-large" type="text"> | ||||
| 					<input name='fu' class="input-medium" type="text"> | ||||
| 					<br> | ||||
| 					<% if @bulletin.image.file %> | ||||
| 					  <%= f.check_box :remove_image %> | ||||
|  | @ -31,6 +39,8 @@ | |||
| 			</div> | ||||
| 		</div> | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 		<div id="widget-date" class="widget-box widget-size-300"> | ||||
| 			<div class="widget-action clear"> | ||||
| 				<a href="#" class="action"><i title="Set the announcement to start and end dates" class="icon-exclamation-sign icon-white tip"></i></a> | ||||
|  | @ -198,7 +208,7 @@ | |||
| 								<td style="text-align:center" colspan="4"> | ||||
| 									<div id='add_bulletin_link' class="info_input bulletin_links_block"> | ||||
| 										<%= hidden_field_tag 'bulletin_link_field_count', @bulletin.bulletin_links.count %> | ||||
| 										<a class="add"><span class="btn btn-primary btn-small"><i class="icon-plus icon-white"></i> ADD/新增</span></a> | ||||
| 										<a class="add"><span class="btn btn-primary btn-small"><i class="icon-plus icon-white"></i><%= t(:add) %></span></a> | ||||
| 									</div> | ||||
| 								</td> | ||||
| 							</tr> | ||||
|  | @ -243,7 +253,7 @@ | |||
| 								<td style="text-align:center" colspan="4"> | ||||
| 									<div id='add_bulletin_file' class="info_input bulletin_files_block"> | ||||
| 										<%= hidden_field_tag 'bulletin_file_field_count', @bulletin.bulletin_files.count %> | ||||
| 										<a class="add"><span class="btn btn-primary btn-small"><i class="icon-plus icon-white"></i> ADD/新增</span></a> | ||||
| 										<a class="add"><span class="btn btn-primary btn-small"><i class="icon-plus icon-white"></i><%= t(:add) %></span></a> | ||||
| 									</div> | ||||
| 								</td> | ||||
| 							</tr> | ||||
|  | @ -281,6 +291,7 @@ | |||
| 
 | ||||
| <% content_for :page_specific_javascript do %> | ||||
| 	<%= javascript_include_tag "bulletin_form" %> | ||||
| 	<%= javascript_include_tag "inc/jquery.imagesloaded" %> | ||||
| 	<script> | ||||
| 		$('#add_bulletin_link a.add').live('click', function(){ | ||||
| 			var new_id = $(this).prev().attr('value'); | ||||
|  |  | |||
|  | @ -4,6 +4,7 @@ | |||
| 				<div class="control-group"> | ||||
| 					<div class="controls"> | ||||
| 					<%= f.file_field :file %> | ||||
| 					<%= form_bulletin_file.file.file ? ( link_to t(:view), form_bulletin_file.file.url, {:target => '_blank', :title => t(:view)} ) : '' %> | ||||
| 					</div> | ||||
| 				</div> | ||||
| 			</td>	 | ||||
|  | @ -19,7 +20,7 @@ | |||
| 							<div class="control-group"> | ||||
| 								<label for="link-<%= locale %>" class="control-label"><%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %></label> | ||||
| 								<div class="controls"> | ||||
| 								<%= f.text_field locale, :id => "link-#{locale}", :class => "input-xlarge" %> | ||||
| 								<%= f.text_field locale, :id => "link-#{locale}" %> | ||||
| 								</div> | ||||
| 							</div> | ||||
| 						<% end %> | ||||
|  | @ -43,7 +44,7 @@ | |||
| 							<div class="control-group"> | ||||
| 								<label for="link-<%= locale %>" class="control-label"><%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %></label> | ||||
| 								<div class="controls"> | ||||
| 								<%= f.text_field locale, :id => "link-#{locale}", :class => "input-xlarge" %> | ||||
| 								<%= f.text_field locale, :id => "link-#{locale}" %> | ||||
| 								</div> | ||||
| 							</div> | ||||
| 						<% end %> | ||||
|  |  | |||
|  | @ -6,25 +6,25 @@ | |||
| 				<a href='#' class="list-remove"><i class="icon-trash"></i></a> | ||||
| 			</th> | ||||
| 			<th class="sort span1-2 <%= is_sort_active?('status') %>"> | ||||
| 				<%= 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' %> | ||||
| 			</th> | ||||
| 			<th class="sort span1-2 <%= is_sort_active?('category') %>"> | ||||
| 				<%= (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').html_safe %> | ||||
| 				<%= 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' %> | ||||
| 			</th> | ||||
| 			<th class="sort span7 <%= is_sort_active?('title') %>"> | ||||
| 				<%= 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' %> | ||||
| 			</th> | ||||
| 			<th class="sort span1-2 <%= is_sort_active?('postdate') %>"> | ||||
| 				<%= 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' %> | ||||
| 			</th> | ||||
| 			<th class="sort span1-2 <%= is_sort_active?('deadline') %>"> | ||||
| 				<%= 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' %> | ||||
| 			</th> | ||||
| 			<th class="sort span1-2 <%= is_sort_active?('tags') %>"> | ||||
| 				<%= 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' %> | ||||
| 			</th> | ||||
| 			<th class="sort span1-3 <%= is_sort_active?('update_user_id') %>"> | ||||
| 				<%= 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' %> | ||||
| 			</th> | ||||
| 	   </tr> | ||||
| 	</thead> | ||||
|  |  | |||
|  | @ -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)  %> | ||||
|  |  | |||
|  | @ -5,6 +5,12 @@ en: | |||
|    | ||||
|   _locale: English | ||||
|    | ||||
|   basic: Basic | ||||
|   picture: Piture | ||||
|   tags: Tag | ||||
|   link: Link | ||||
|   file: File | ||||
| 
 | ||||
|   add: Add | ||||
|   back: Back | ||||
|   create: Create | ||||
|  | @ -23,6 +29,14 @@ en: | |||
|   update: Update | ||||
|   yes_: "Yes" | ||||
| 
 | ||||
|   hot: Hot | ||||
|   top: Top | ||||
|   hidden: Hidden | ||||
|   passed: Passed | ||||
|   pending: Pending | ||||
|   rejected: Rejected | ||||
|   clear: Clear | ||||
|    | ||||
|   announcement: | ||||
|     sure?: Sure? | ||||
|     campus_news: Campus News | ||||
|  |  | |||
|  | @ -24,12 +24,12 @@ zh_tw: | |||
|   update: 更新 | ||||
|   yes_: "Yes" | ||||
| 
 | ||||
|   is_hot: 熱門 | ||||
|   is_top: 置頂 | ||||
|   is_hidden: 隱藏 | ||||
|   is_checked: 通過 | ||||
|   is_pending: 待審核 | ||||
|   is_rejected: 不通過 | ||||
|   hot: 熱門 | ||||
|   top: 置頂 | ||||
|   hidden: 隱藏 | ||||
|   passed: 通過 | ||||
|   pending: 待審核 | ||||
|   rejected: 不通過 | ||||
|   clear: 清除 | ||||
| 
 | ||||
|   quick_edit: 快速編輯 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue