Change event to recruitment

This commit is contained in:
rulingcom 2026-05-27 19:26:20 +08:00
parent eee3b04ab0
commit 1df9e31a78
33 changed files with 13764 additions and 120 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 B

View File

@ -0,0 +1,2 @@
// Place all the behaviors and hooks related to the matching controller here.
// All this logic will automatically be available in application.js.

View File

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,605 @@
var EventCalendarModuleMonth2 = function(date,dom,subpart,url,index_flag){
_this = this;
var events = {}
var template = dom.find(".month_template"),
month_names = ["Jan","Feb","March","April","May","June","July","Aug","Sep","Oct","Nov","Dec"],
monthNames = ['January','February','March','April','May','June','July','August','September','October','November','December'],
initialDate = date,
subpartid = subpart,
index_url = url,
fetchInterval = null,
month = date.getMonth(),
year = date.getFullYear(),
first_target_day = new Date(Date.UTC(year,month,1)),
last_target_day = new Date(Date.UTC(year,month+1,0)),
firstDay = new Date(Date.UTC(year,month,1)),
lastDay = new Date(Date.UTC(year,month+1,0)),
today = date.getDate(),
last_inserted_date = 1,
monthDom = $("<div class=\"height100\" data-year='"+year+"' data-month='"+month+"'></div>"),
eventHTML = dom.find('div.calendar-events')[0],
event_template = dom.find('div.calendar-events .event').prop('outerHTML'),
prevMonthFunc,
nextMonthFunc,
toggle_data,
hover_step=10,
hover_step_max=10,
hover_max_height=13,
toggling=false,
switching=false,
tp1,
tp2;
monthDom.html(template);
var format_time = function(date){
var hours = date.getHours(),
minutes = date.getMinutes();
if (hours < 10) {hours = "0"+hours}
if (minutes < 10) {minutes = "0"+minutes}
return hours+':'+minutes;
}
function rgb2hex(rgb) {
rgb = rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
function hex(x) {
return ("0" + parseInt(x).toString(16)).slice(-2);
}
if (rgb){
return "#" + hex(rgb[1]) + hex(rgb[2]) + hex(rgb[3]);
}else{
return "#000000";
}
}
function hexToRGB(hex, alpha) {
if (hex){
var r = parseInt(hex.slice(1, 3), 16),
g = parseInt(hex.slice(3, 5), 16),
b = parseInt(hex.slice(5, 7), 16);
if (alpha) {
return "rgba(" + r + ", " + g + ", " + b + ", " + alpha + ")";
} else {
return "rgb(" + r + ", " + g + ", " + b + ")";
}
}else{
return ''
}
}
function lighten_color(my_hex,percent){
if (my_hex[0] == '#'){
my_hex = my_hex.slice(1)
}
var comp = ''
var rgb = []
var batch_size = Math.ceil(my_hex.length/3)
for (var i=0;i<3;i++){
rgb.push(my_hex.slice(batch_size*i,batch_size*(i+1)))
}
$.each(rgb,function(){
var a = this
var tmp
tmp = Math.ceil(parseInt(a,16)*(1+percent/100))
if (tmp>255) tmp = 255
if (tmp < 0) tmp = 0
tmp = tmp.toString(16)
for (var i=0;i<2-tmp.length;i++){
tmp = '0' + tmp
}
comp = comp + tmp
})
return '#'+comp
}
var format_date = function(date){
var y = date.getFullYear(),
m = date.getMonth() + 1,
d = date.getDate();
if (m < 10) {m = "0"+m}
if (d < 10) {d = "0"+d}
return y+'/'+m+'/'+d;
}
var formate_datetime = function(date){
date = new Date(date)
return [format_date(date),format_time(date)]
}
$(window).resize(function(){
var window_w = $(window).width()
var this_w = dom.width()
var event_doc = dom.find('.calendar-events');
if (this_w>=728 && window_w>=768){
if (!event_doc.hasClass('width-50')){
event_doc.removeClass('width-100')
event_doc.addClass('width-50')
event_doc.css('width','50%')
event_doc.parents('div.w-calendar').find('div').eq(0).css('width','50%')
}
}else{
if (!event_doc.hasClass('width-100')){
event_doc.addClass('width-100')
event_doc.removeClass('width-50')
event_doc.css('width','100%')
event_doc.parents('div.w-calendar').find('div').eq(0).css('width','100%')
}
}
})
var show_event = function(date,ele){
var event_div = $(ele).parents('div.w-calendar').find('div.calendar-events')
$(ele).parents('.w-calendar').find('td.shown').removeClass('shown')
$(ele).addClass('shown')
function set_event(date,active_flag){
var date_split = date.split('-')
var event_temp = $(event_template)
var read_more_text = $('html').attr('lang')=='zh_tw' ? '查看詳情' : 'Read more'
event_temp.find('.event-header .date .month').text(month_names[parseInt(date_split[1])])
event_temp.find('.event-header .date .day').text(parseInt(date_split[0]))
$.each(events[date],function(k,v){
var tp
if (v.url_linked==''){
var time_string = ''
if(v.allDay) {
var end_time
var start_time = formate_datetime(v.start)[0]
if(v.end)
end_time = formate_datetime(v.end)[0]
else
end_time = start_time
time_string = (start_time==end_time ? "<p class='start-date'><i class='icons-calendar' /> " + start_time + "</p>" : "<i class='icons-calendar' /> " + start_time + " <i class='icons-arrow-right-5' /> " + end_time + "")
}else{
var st = formate_datetime(v.start),
et = formate_datetime(v.end),
start_time = st[0],
end_time = et[0],
same = (start_time==end_time),
etime = et[1],
stime = st[1]
time_string = (same ? "<p class='date'><i class='icons-calendar' /> " + start_time + "</p><p class='time'><i class='icons-clock' /> " + stime + " <i class='icons-arrow-right-5' /> " + etime : "<p class='start-date'><i class='icons-arrow-right-2' /> " + start_time + "<span class='pull-right'>" + stime + "</span></p><p class='end-date'><i class='icons-arrow-left-2' /> " + end_time + "<span class='pull-right'>" + etime + "</p>");
}
var modal_tp = ('<div class="dialog_event" style="display: none;">' +
'<div class="modal-header">' +
'<h3>' + v.title + '</h3>' +
'</div>' +
'<div class="modal-body">' +
'<div class="event_summary">' + time_string + '</div>' +
v.note +
'</div>' +
'</div>')
tp = $('<div class="event-container-one has-dialog"><div class="title_temp"></div><div class="duration_temp"></div><div class="event-content"></div>'+modal_tp+'</div>')
}else{
tp = $('<a class="event-container-one"><div class="title_temp"></div><div class="duration_temp"></div><div class="event-content"></div></a>')
}
var sd = formate_datetime(v.start),
ed = formate_datetime(v.end),
duration = '';
if(v.allDay){
if (sd[0]!=ed[0]){
duration = sd[0]+'>'+ed[0] +'<br>'
}
}else if (sd[0]==ed[0]){
duration = sd[1]+'>'+ed[1] +'<br>'
}else{
duration = sd[0]+' '+sd[1]+'>'+ed[0]+' '+ed[1] +'<br>'
}
tp.css('color',hexToRGB(v.color,0.45))
tp.find('.event-content').html(v.note || read_more_text)
tp.find('.title_temp').html(v.title)
tp.find('.duration_temp').html(duration)
if (k==0){
tp.addClass('active')
event_temp.find('.event-header .event-inner-title').html(v.title)
event_temp.find('.event-header .duration').html(duration)
}
event_temp.find('.event-containers').append(tp)
if(v.url_linked != ''){
tp.attr('href',v.url_linked)
}
})
if (active_flag){
event_temp.addClass('active')
}
if (events[date] && events[date].length>1){
var switch_button_wraper = $("<div class=\"switch_button_wraper\"> <button class=\"switch_button\" for=\"prev\" type=\"button\">&lt;</button>"
+"<button class=\"switch_button\" for=\"next\" type=\"button\">&gt;</button>"
+"</div>")
switch_button_wraper.find('button').click(function(){
if (!switching){
var showing_event = $(this).parents('.event-wraper').find('.event-container-one.active')
var next_event
showing_event.css('position','')
showing_event.css('right','0')
showing_event.removeClass('active')
if ($(this).attr('for')=='prev'){
next_event = showing_event.prev('.event-container-one')
if (next_event.length==0){
next_event = $(this).parents('.event-wraper').find('.event-container-one').eq(-1)
}
next_event.addClass('active')
next_event.css('right','100%')
switching = true
next_event.animate({'right': '0%'},function(){
$(this).css('right','')
if ($(this).find('.event-content').height()>$(this).height()){
$(this).css('position','relative')
}
})
showing_event.animate({'right': '-100%'},function(){
switching = false
})
}else{
next_event = showing_event.next('.event-container-one')
if (next_event.length==0){
next_event = $(this).parents('.event-wraper').find('.event-container-one').eq(0)
}
next_event.addClass('active')
next_event.css('right','-100%')
switching = true
next_event.animate({'right': '0%'},function(){
$(this).css('right','')
if ($(this).find('.event-content').height()>$(this).height()){
$(this).css('position','relative')
}
})
showing_event.animate({'right': '100%'},function(){
switching = false
})
}
$(this).parents('.event').eq(0).find('.event-header .event-inner-title').html(next_event.find('.title_temp').html())
$(this).parents('.event').eq(0).find('.event-header .duration').html(next_event.find('.duration_temp').html())
}
})
event_temp.find('.event-wraper').eq(0).append(switch_button_wraper)
}
event_div.append(event_temp)
}
event_div.html('')
set_event(date,true)
var all_event_in_table = $(ele).parents('table').eq(0).find('td.w-calendar-event')
var ele_index = all_event_in_table.index(ele)
var next_ele = all_event_in_table.eq(ele_index+1)
if (next_ele.length){
set_event(next_ele.data('date-node'),false)
}
event_div.find('.has-dialog').click(function(){
var tmp=$(this).find('.dialog_event').clone().dialog({dialogClass: 'calendar-dialog'});
$('.ui-dialog button').blur();
})
function event_hover(){
var event_doc = $(this).parents('.event').eq(0);
if (!event_doc.hasClass('active')){
tp1 = event_doc.parents('.calendar-events').eq(0).find('.event.active .event-containers');
tp2 = event_doc.find('.event-containers');
if (!toggling){
tp2.css('height','0');
tp2.css('min-height','0');
hover_step = hover_step_max;
}else{
hover_step = hover_step_max - hover_step;
}
event_doc.addClass('active');
function toggle_height(){
tp1.css('height',(hover_step*hover_max_height/hover_step_max)+'em');
tp2.css('height',(hover_max_height-hover_step*hover_max_height/hover_step_max)+'em');
hover_step = hover_step-1;
if (hover_step>=0){
setTimeout(toggle_height,50);
}else{
tp1.css('min-height','');
tp2.css('min-height','');
tp1.css('height','');
tp2.css('height','');
toggling = false;
}
}
if (!toggling){
setTimeout(toggle_height,50);
}
tp1.css('height',tp1.height());
tp1.css('min-height','0');
tp1.parents('.event').removeClass('active');
toggling = true;
}
}
event_div.find('.event .event-header').hover(event_hover);
event_div.find('.event .event-header').click(event_hover);
$(ele).parents('div.w-calendar').css('display','flex');
if ($(ele).parents('div.w-calendar').width()>=728 && $(window).width()>=768){
event_div.css('width','50%')
event_div.addClass('width-50')
event_div.removeClass('width-100')
$(ele).parents('div.w-calendar').find('div').eq(0).css('width','50%')
}else{
event_div.css('width','100%')
event_div.addClass('width-100')
event_div.removeClass('width-50')
$(ele).parents('div.w-calendar').find('div').eq(0).css('width','100%')
}
event_div.show()
}
var hide_event = function(ele){
$(ele).parents('.w-calendar').find('td.shown').removeClass('shown')
var event_div = $(ele).parents('div.w-calendar').find('div.calendar-events')
$(ele).parents('div.w-calendar').css('display','block')
$(ele).parents('div.w-calendar').find('div').eq(0).css('width','')
event_div.hide()
//$(ele).parents('div.w-calendar').find('td.w-calendar-toggle').removeClass('w-calendar-toggle')
event_div.find('.event-container-one').remove()
}
var renderMonth = function(){
var num_of_rows = getNumberOfRows(),
head_title = monthDom.find("h4 span.text"),
table_body = monthDom.find("table.table tbody");
table_body.html("");
for(var i = 0; i < num_of_rows; i++){
var tr = null;
if(i == 0){
tr = makeRow("first");
}else if(i == (num_of_rows - 1)){
tr = makeRow("last");
}else{
tr = makeRow("middle");
}
if(tr == null){
break;
}
table_body.append(tr);
head_title.text(monthNames[firstDay.getMonth()] + " " + firstDay.getFullYear());
}
}
var getNumberOfRows = function() {
var day = 1,
sat_counter = 0,
sunday_counter = 0,
date = new Date(year, month, day);
while(date.getMonth() === month) {
if(date.getDay() === 0) {
sunday_counter++;
}else if(date.getDay() === 6) {
sat_counter++;
}
day++;
date = new Date(year, month, day);
}
return (sunday_counter == 5 && sat_counter == 5 ? 6 : 5);
}
var makeRow = function(position){
if(last_inserted_date <= lastDay.getDate()){
var row = $("<tr></tr>");
switch (position){
case "first":
var first_line_first_day = new Date(year,month,firstDay.getDate()-firstDay.getDay())
var first_line_first_date = first_line_first_day.getDate()
var first_line_first_month = first_line_first_day.getMonth()
var first_line_first_year = first_line_first_day.getFullYear()
first_target_day = new Date(first_line_first_year,first_line_first_month,first_line_first_date)
for(var i = 0;i < 7;i++){
var td = $("<td><div></div></td>");
if(i >= firstDay.getDay()){
if(today != 0 && last_inserted_date == today){
td.addClass("w-calendar-today");
}
td.find('div').html(last_inserted_date<10 ? "&nbsp;"+last_inserted_date+"&nbsp;" : last_inserted_date);
td.attr("data-date-node",last_inserted_date+"-"+firstDay.getMonth()+"-"+firstDay.getFullYear());
last_inserted_date++;
}else{
td.find('div').text(first_line_first_date+i)
td.attr("data-date-node",(first_line_first_date+i)+"-"+first_line_first_month+"-"+first_line_first_year);
td.addClass("w-calendar-other-month")
}
row.append(td);
}
break;
case "middle":
for(var i = 0;i < 7;i++){
var td = $("<td><div></div></td>");
if(today != 0 && last_inserted_date == today){
td.attr("class","w-calendar-today");
}
td.find('div').html(last_inserted_date<10 ? "&nbsp;"+last_inserted_date+"&nbsp;" : last_inserted_date);
td.attr("data-date-node",last_inserted_date+"-"+firstDay.getMonth()+"-"+firstDay.getFullYear());
last_inserted_date++;
row.append(td);
}
break;
case "last":
var next_month = month+1,
next_year = year;
if (next_month==12){
next_month = 0;
next_year = next_year + 1;
}
last_target_day = new Date(next_year,next_month,6-lastDay.getDay())
for(var i = 0;i < 7;i++){
var td = $("<td><div></div></td>");
if(i <= lastDay.getDay()){
if(today != 0 && last_inserted_date == today){
td.attr("class","w-calendar-today");
}
td.find('div').html(last_inserted_date<10 ? "&nbsp;"+last_inserted_date+"&nbsp;" : last_inserted_date);
td.attr("data-date-node",last_inserted_date+"-"+firstDay.getMonth()+"-"+firstDay.getFullYear());
last_inserted_date++;
}else{
td.find('div').text(i-lastDay.getDay())
td.attr("data-date-node",(i-lastDay.getDay())+"-"+next_month+"-"+next_year);
td.addClass("w-calendar-other-month")
}
row.append(td);
}
break;
}
}else{
var row = null;
}
return row;
}
function toggle_event(ele,type){
$(ele).parents('.month_template').find('td').removeClass('w-calendar-toggle')
var toggle_month
if ($(ele).length==1){
$(ele).addClass('w-calendar-toggle')
toggle_data = $(ele).data('date-node')
toggle_month = $(ele).data('date-node').split('-')[1]
}
if (toggle_month==month || $(ele).length!=1){
if (type=='show'){
show_event($(ele).data('date-node'),ele)
}else{
hide_event(ele)
}
}
else if(toggle_month==month+1 || toggle_month==0){
nextMonthFunc(toggle_data)
}else{
prevMonthFunc(toggle_data)
}
}
var fetchEvents = function(){
var usd = Math.round(firstDay/1000),
usd_target = Math.round(first_target_day/1000),
ued_target = Math.round(last_target_day/1000);
$.ajax({
url : "/xhr/recruitment/agenda",
data : {"month_start" : usd,"unix_start" : usd_target, "unix_end" : ued_target, "subpart_id" : subpartid, "locale" : $('html').attr('lang')},
dataType : "json",
type : "get"
}).done(function(data){
events = {}
$(dom).find('.w-calendar-title span').eq(0).html(data['calendar_title'])
$.each(data.events,function(index,eve){
var sd = new Date(eve.start),
ed = new Date(eve.end),
sd_date = new Date(formate_datetime(eve.start)[0]),
ed_date = new Date(formate_datetime(eve.end)[0]),
timeDiff = ed_date.getTime() - sd_date.getTime(),
dayDiff = Math.round(timeDiff / (1000 * 3600 * 24));
if(eve.allDay && dayDiff < 1){
dayDiff = 1
}
if(dayDiff > 0){
var inserting_date = sd.getDate();
for(var i = 0;i < dayDiff; i++){
var dt = inserting_date + "-" + sd.getMonth() + "-" + sd.getFullYear(),
td = dom.find("td[data-date-node=" + dt + "]");
if (events[dt]==undefined){
events[dt]=[]
}
events[dt].push(eve)
td.addClass("w-calendar-event");
if(events[dt] && events[dt].length==1){
td.click(function(){
toggle_event(this,'show')
})
}
inserting_date++;
if(inserting_date > lastDay.getDate() || (ed.getMonth() == month && inserting_date > ed.getDate())){
break;
}
}
}else{
var dt = sd.getDate() + "-" + sd.getMonth() + "-" + sd.getFullYear();
td = dom.find("td[data-date-node=" + dt + "]");
if (events[dt]==undefined){
events[dt]=[]
}
events[dt].push(eve)
if(events[dt] && events[dt].length==1){
td.click(function(){
toggle_event(this,'show')
})
}
td.addClass("w-calendar-event");
}
})
if (!toggle_data){
if (dom.find('td.w-calendar-today').length != 0){
toggle_event(dom.find('td.w-calendar-today'),'show')
}else{
toggle_event(dom.find('td'),'hide')
}
}
dom.find('td:not(td.w-calendar-event)').click(function(){
toggle_event(this,'hide')
})
var clicked_color = dom.find('.w-calendar-event').css('background-color')
if (clicked_color){
var hex_color = rgb2hex(clicked_color)
if (hex_color != '#000000'){
clicked_color = lighten_color(hex_color,-45)
dom.find('table').append($('<style>.widget-calendar-2 table.w-calendar-table .w-calendar-toggle{ background-color:'+clicked_color+';color: white;}</style>'))
}
}
monthDom.find("i.loading").addClass("hide");
})
}
this.currentMonth = function(){
renderMonth();
var div_tag = $('<div class="height100"></div>')
var widge_title = dom.find('.w-calendar-title').eq(0)
div_tag.html(monthDom)
div_tag.prepend(widge_title)
dom.html(div_tag);
monthDom.find("i.loading").removeClass("hide");
fetchInterval = setTimeout(fetchEvents,300);
dom.find('div').eq(0).after(eventHTML)
}
this.nextMonth = function(toggle_flag){
clearTimeout(fetchInterval);
monthDom.find("i.loading").removeClass("hide");
month++;
if(month == 12){
year++;
month = 0;
}
firstDay = new Date(Date.UTC(year,month,1));
lastDay =new Date(Date.UTC(year,month+1,0));
today = (initialDate.getMonth() == month && initialDate.getFullYear() == year ? initialDate.getDate() : 0);
last_inserted_date = 1;
var toggle_type,ele;
if (toggle_data && toggle_flag){
ele = dom.find('td[data-date-node="'+toggle_data+'"]')
toggle_type = (ele.hasClass('w-calendar-event') ? 'show' : 'hide')
}else{
toggle_data = undefined
}
renderMonth();
dom.find("table.w-calendar-table tbody").html(monthDom.find("tbody").html());
if (ele){
ele = dom.find('td[data-date-node="'+toggle_data+'"]')
toggle_event(ele,toggle_type)
}
fetchInterval = setTimeout(fetchEvents,300);
}
nextMonthFunc = this.nextMonth;
this.prevMonth = function(toggle_flag){
clearTimeout(fetchInterval);
monthDom.find("i.loading").removeClass("hide");
month--;
if(month == -1){
year--;
month = 11;
}
firstDay = new Date(Date.UTC(year,month,1));
lastDay = new Date(Date.UTC(year,month+1,0));
today = (initialDate.getMonth() == month && initialDate.getFullYear() == year ? initialDate.getDate() : 0);
last_inserted_date = 1;
var toggle_type,ele;
if (toggle_data && toggle_flag){
ele = dom.find('td[data-date-node="'+toggle_data+'"]')
toggle_type = (ele.hasClass('w-calendar-event') ? 'show' : 'hide')
}else{
toggle_data = undefined
}
renderMonth();
dom.find("table.w-calendar-table tbody").html(monthDom.find("tbody").html());
if (ele){
ele = dom.find('td[data-date-node="'+toggle_data+'"]')
toggle_event(ele,toggle_type)
}
fetchInterval = setTimeout(fetchEvents,300);
}
prevMonthFunc = this.prevMonth;
}

View File

@ -0,0 +1,7 @@
/*
Place all the styles related to the matching controller here.
They will automatically be included in application.css.
*/
.table .expired{
color: #BE2E2E;
}

View File

View File

@ -0,0 +1,947 @@
//
// Mixins
// --------------------------------------------------
// Utilities
// -------------------------
// Clearfix
// Source: http://nicolasgallagher.com/micro-clearfix-hack/
//
// For modern browsers
// 1. The space content is one way to avoid an Opera bug when the
// contenteditable attribute is included anywhere else in the document.
// Otherwise it causes space to appear at the top and bottom of elements
// that are clearfixed.
// 2. The use of `table` rather than `block` is only necessary if using
// `:before` to contain the top-margins of child elements.
@mixin clearfix() {
&:before,
&:after {
content: " "; // 1
display: table; // 2
}
&:after {
clear: both;
}
}
// WebKit-style focus
@mixin tab-focus() {
// Default
outline: thin dotted;
// WebKit
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
}
// Center-align a block level element
@mixin center-block() {
display: block;
margin-left: auto;
margin-right: auto;
}
// Sizing shortcuts
@mixin size($width, $height) {
width: $width;
height: $height;
}
@mixin square($size) {
@include size($size, $size);
}
// Placeholder text
@mixin placeholder($color: $input-color-placeholder) {
&::-moz-placeholder { color: $color; // Firefox
opacity: 1; } // See https://github.com/twbs/bootstrap/pull/11526
&:-ms-input-placeholder { color: $color; } // Internet Explorer 10+
&::-webkit-input-placeholder { color: $color; } // Safari and Chrome
}
// Text overflow
// Requires inline-block or block for proper styling
@mixin text-overflow() {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
// CSS image replacement
//
// Heads up! v3 launched with with only `.hide-text()`, but per our pattern for
// mixins being reused as classes with the same name, this doesn't hold up. As
// of v3.0.1 we have added `.text-hide()` and deprecated `.hide-text()`. Note
// that we cannot chain the mixins together in Less, so they are repeated.
//
// Source: https://github.com/h5bp/html5-boilerplate/commit/aa0396eae757
// Deprecated as of v3.0.1 (will be removed in v4)
@mixin hide-text() {
font: #{0/0} a;
color: transparent;
text-shadow: none;
background-color: transparent;
border: 0;
}
// New mixin to use as of v3.0.1
@mixin text-hide() {
@include hide-text();
}
// CSS3 PROPERTIES
// --------------------------------------------------
// Single side border-radius
@mixin border-top-radius($radius) {
border-top-right-radius: $radius;
border-top-left-radius: $radius;
}
@mixin border-right-radius($radius) {
border-bottom-right-radius: $radius;
border-top-right-radius: $radius;
}
@mixin border-bottom-radius($radius) {
border-bottom-right-radius: $radius;
border-bottom-left-radius: $radius;
}
@mixin border-left-radius($radius) {
border-bottom-left-radius: $radius;
border-top-left-radius: $radius;
}
// Drop shadows
//
// Note: Deprecated `.box-shadow()` as of v3.1.0 since all of Bootstrap's
// supported browsers that have box shadow capabilities now support the
// standard `box-shadow` property.
@mixin box-shadow($shadow...) {
-webkit-box-shadow: $shadow; // iOS <4.3 & Android <4.1
box-shadow: $shadow;
}
// Transitions
@mixin transition($transition...) {
-webkit-transition: $transition;
transition: $transition;
}
@mixin transition-property($transition-property...) {
-webkit-transition-property: $transition-property;
transition-property: $transition-property;
}
@mixin transition-delay($transition-delay) {
-webkit-transition-delay: $transition-delay;
transition-delay: $transition-delay;
}
@mixin transition-duration($transition-duration...) {
-webkit-transition-duration: $transition-duration;
transition-duration: $transition-duration;
}
@mixin transition-transform($transition...) {
-webkit-transition: -webkit-transform $transition;
-moz-transition: -moz-transform $transition;
-o-transition: -o-transform $transition;
transition: transform $transition;
}
// Transformations
@mixin rotate($degrees) {
-webkit-transform: rotate($degrees);
-ms-transform: rotate($degrees); // IE9 only
transform: rotate($degrees);
}
@mixin scale($scale-args...) {
-webkit-transform: scale($scale-args);
-ms-transform: scale($scale-args); // IE9 only
transform: scale($scale-args);
}
@mixin translate($x, $y) {
-webkit-transform: translate($x, $y);
-ms-transform: translate($x, $y); // IE9 only
transform: translate($x, $y);
}
@mixin skew($x, $y) {
-webkit-transform: skew($x, $y);
-ms-transform: skewX($x) skewY($y); // See https://github.com/twbs/bootstrap/issues/4885; IE9+
transform: skew($x, $y);
}
@mixin translate3d($x, $y, $z) {
-webkit-transform: translate3d($x, $y, $z);
transform: translate3d($x, $y, $z);
}
@mixin rotateX($degrees) {
-webkit-transform: rotateX($degrees);
-ms-transform: rotateX($degrees); // IE9 only
transform: rotateX($degrees);
}
@mixin rotateY($degrees) {
-webkit-transform: rotateY($degrees);
-ms-transform: rotateY($degrees); // IE9 only
transform: rotateY($degrees);
}
@mixin perspective($perspective) {
-webkit-perspective: $perspective;
-moz-perspective: $perspective;
perspective: $perspective;
}
@mixin perspective-origin($perspective) {
-webkit-perspective-origin: $perspective;
-moz-perspective-origin: $perspective;
perspective-origin: $perspective;
}
@mixin transform-origin($origin) {
-webkit-transform-origin: $origin;
-moz-transform-origin: $origin;
-ms-transform-origin: $origin; // IE9 only
transform-origin: $origin;
}
// Animations
@mixin animation($animation) {
-webkit-animation: $animation;
animation: $animation;
}
@mixin animation-name($name) {
-webkit-animation-name: $name;
animation-name: $name;
}
@mixin animation-duration($duration) {
-webkit-animation-duration: $duration;
animation-duration: $duration;
}
@mixin animation-timing-function($timing-function) {
-webkit-animation-timing-function: $timing-function;
animation-timing-function: $timing-function;
}
@mixin animation-delay($delay) {
-webkit-animation-delay: $delay;
animation-delay: $delay;
}
@mixin animation-iteration-count($iteration-count) {
-webkit-animation-iteration-count: $iteration-count;
animation-iteration-count: $iteration-count;
}
@mixin animation-direction($direction) {
-webkit-animation-direction: $direction;
animation-direction: $direction;
}
// Backface visibility
// Prevent browsers from flickering when using CSS 3D transforms.
// Default value is `visible`, but can be changed to `hidden`
@mixin backface-visibility($visibility){
-webkit-backface-visibility: $visibility;
-moz-backface-visibility: $visibility;
backface-visibility: $visibility;
}
// Box sizing
@mixin box-sizing($boxmodel) {
-webkit-box-sizing: $boxmodel;
-moz-box-sizing: $boxmodel;
box-sizing: $boxmodel;
}
// User select
// For selecting text on the page
@mixin user-select($select) {
-webkit-user-select: $select;
-moz-user-select: $select;
-ms-user-select: $select; // IE10+
user-select: $select;
}
// Resize anything
@mixin resizable($direction) {
resize: $direction; // Options: horizontal, vertical, both
overflow: auto; // Safari fix
}
// CSS3 Content Columns
@mixin content-columns($column-count, $column-gap: $grid-gutter-width) {
-webkit-column-count: $column-count;
-moz-column-count: $column-count;
column-count: $column-count;
-webkit-column-gap: $column-gap;
-moz-column-gap: $column-gap;
column-gap: $column-gap;
}
// Optional hyphenation
@mixin hyphens($mode: auto) {
word-wrap: break-word;
-webkit-hyphens: $mode;
-moz-hyphens: $mode;
-ms-hyphens: $mode; // IE10+
-o-hyphens: $mode;
hyphens: $mode;
}
// Opacity
@mixin opacity($opacity) {
opacity: $opacity;
// IE8 filter
$opacity-ie: ($opacity * 100);
filter: #{alpha(opacity=$opacity-ie)};
}
// GRADIENTS
// --------------------------------------------------
// Horizontal gradient, from left to right
//
// Creates two color stops, start and end, by specifying a color and position for each color stop.
// Color stops are not available in IE9 and below.
@mixin gradient-horizontal($start-color: #555, $end-color: #333, $start-percent: 0%, $end-percent: 100%) {
background-image: -webkit-linear-gradient(left, color-stop($start-color $start-percent), color-stop($end-color $end-percent)); // Safari 5.1-6, Chrome 10+
background-image: linear-gradient(to right, $start-color $start-percent, $end-color $end-percent); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($start-color)}', endColorstr='#{ie-hex-str($end-color)}', GradientType=1); // IE9 and down
}
// Vertical gradient, from top to bottom
//
// Creates two color stops, start and end, by specifying a color and position for each color stop.
// Color stops are not available in IE9 and below.
@mixin gradient-vertical($start-color: #555, $end-color: #333, $start-percent: 0%, $end-percent: 100%) {
background-image: -webkit-linear-gradient(top, $start-color $start-percent, $end-color $end-percent); // Safari 5.1-6, Chrome 10+
background-image: linear-gradient(to bottom, $start-color $start-percent, $end-color $end-percent); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($start-color)}', endColorstr='#{ie-hex-str($end-color)}', GradientType=0); // IE9 and down
}
@mixin gradient-directional($start-color: #555, $end-color: #333, $deg: 45deg) {
background-repeat: repeat-x;
background-image: -webkit-linear-gradient($deg, $start-color, $end-color); // Safari 5.1-6, Chrome 10+
background-image: linear-gradient($deg, $start-color, $end-color); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+
}
@mixin gradient-horizontal-three-colors($start-color: #00b3ee, $mid-color: #7a43b6, $color-stop: 50%, $end-color: #c3325f) {
background-image: -webkit-linear-gradient(left, $start-color, $mid-color $color-stop, $end-color);
background-image: linear-gradient(to right, $start-color, $mid-color $color-stop, $end-color);
background-repeat: no-repeat;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($start-color)}', endColorstr='#{ie-hex-str($end-color)}', GradientType=1); // IE9 and down, gets no color-stop at all for proper fallback
}
@mixin gradient-vertical-three-colors($start-color: #00b3ee, $mid-color: #7a43b6, $color-stop: 50%, $end-color: #c3325f) {
background-image: -webkit-linear-gradient($start-color, $mid-color $color-stop, $end-color);
background-image: linear-gradient($start-color, $mid-color $color-stop, $end-color);
background-repeat: no-repeat;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($start-color)}', endColorstr='#{ie-hex-str($end-color)}', GradientType=0); // IE9 and down, gets no color-stop at all for proper fallback
}
@mixin gradient-radial($inner-color: #555, $outer-color: #333) {
background-image: -webkit-radial-gradient(circle, $inner-color, $outer-color);
background-image: radial-gradient(circle, $inner-color, $outer-color);
background-repeat: no-repeat;
}
@mixin gradient-striped($color: rgba(255,255,255,.15), $angle: 45deg) {
background-image: -webkit-linear-gradient($angle, $color 25%, transparent 25%, transparent 50%, $color 50%, $color 75%, transparent 75%, transparent);
background-image: linear-gradient($angle, $color 25%, transparent 25%, transparent 50%, $color 50%, $color 75%, transparent 75%, transparent);
}
// Reset filters for IE
//
// When you need to remove a gradient background, do not forget to use this to reset
// the IE filter for IE9 and below.
@mixin reset-filter() {
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
}
// Retina images
//
// Short retina mixin for setting background-image and -size
@mixin img-retina($file-1x, $file-2x, $width-1x, $height-1x) {
background-image: url(if($bootstrap-sass-asset-helper, twbs-image-path("#{$file-1x}"), "#{$file-1x}"));
@media
only screen and (-webkit-min-device-pixel-ratio: 2),
only screen and ( min--moz-device-pixel-ratio: 2),
only screen and ( -o-min-device-pixel-ratio: 2/1),
only screen and ( min-device-pixel-ratio: 2),
only screen and ( min-resolution: 192dpi),
only screen and ( min-resolution: 2dppx) {
background-image: url(if($bootstrap-sass-asset-helper, twbs-image-path("#{$file-2x}"), "#{$file-2x}"));
background-size: $width-1x $height-1x;
}
}
// Responsive image
//
// Keep images from scaling beyond the width of their parents.
@mixin img-responsive($display: block) {
display: $display;
max-width: 100%; // Part 1: Set a maximum relative to the parent
height: auto; // Part 2: Scale the height according to the width, otherwise you get stretching
}
// COMPONENT MIXINS
// --------------------------------------------------
// Horizontal dividers
// -------------------------
// Dividers (basically an hr) within dropdowns and nav lists
@mixin nav-divider($color: #e5e5e5) {
height: 1px;
margin: (($line-height-computed / 2) - 1) 0;
overflow: hidden;
background-color: $color;
}
// Panels
// -------------------------
@mixin panel-variant($border, $heading-text-color, $heading-bg-color, $heading-border) {
border-color: $border;
& > .panel-heading {
color: $heading-text-color;
background-color: $heading-bg-color;
border-color: $heading-border;
+ .panel-collapse .panel-body {
border-top-color: $border;
}
}
& > .panel-footer {
+ .panel-collapse .panel-body {
border-bottom-color: $border;
}
}
}
// Alerts
// -------------------------
@mixin alert-variant($background, $border, $text-color) {
background-color: $background;
border-color: $border;
color: $text-color;
hr {
border-top-color: darken($border, 5%);
}
.alert-link {
color: darken($text-color, 10%);
}
}
// Tables
// -------------------------
@mixin table-row-variant($state, $background) {
// Exact selectors below required to override `.table-striped` and prevent
// inheritance to nested tables.
.table > thead > tr,
.table > tbody > tr,
.table > tfoot > tr {
> td.#{$state},
> th.#{$state},
&.#{$state} > td,
&.#{$state} > th {
background-color: $background;
}
}
// Hover states for `.table-hover`
// Note: this is not available for cells or rows within `thead` or `tfoot`.
.table-hover > tbody > tr {
> td.#{$state}:hover,
> th.#{$state}:hover,
&.#{$state}:hover > td,
&.#{$state}:hover > th {
background-color: darken($background, 5%);
}
}
}
// List Groups
// -------------------------
@mixin list-group-item-variant($state, $background, $color) {
.list-group-item-#{$state} {
color: $color;
background-color: $background;
// [converter] extracted a& to a.list-group-item-#{$state}
}
a.list-group-item-#{$state} {
color: $color;
.list-group-item-heading { color: inherit; }
&:hover,
&:focus {
color: $color;
background-color: darken($background, 5%);
}
&.active,
&.active:hover,
&.active:focus {
color: #fff;
background-color: $color;
border-color: $color;
}
}
}
// Button variants
// -------------------------
// Easily pump out default styles, as well as :hover, :focus, :active,
// and disabled options for all buttons
@mixin button-variant($color, $background, $border) {
color: $color;
background-color: $background;
border-color: $border;
&:hover,
&:focus,
&:active,
&.active {
color: $color;
background-color: darken($background, 8%);
border-color: darken($border, 12%);
}
.open & { &.dropdown-toggle {
color: $color;
background-color: darken($background, 8%);
border-color: darken($border, 12%);
} }
&:active,
&.active {
background-image: none;
}
.open & { &.dropdown-toggle {
background-image: none;
} }
&.disabled,
&[disabled],
fieldset[disabled] & {
&,
&:hover,
&:focus,
&:active,
&.active {
background-color: $background;
border-color: $border;
}
}
.badge {
color: $background;
background-color: $color;
}
}
// Button sizes
// -------------------------
@mixin button-size($padding-vertical, $padding-horizontal, $font-size, $line-height, $border-radius) {
padding: $padding-vertical $padding-horizontal;
font-size: $font-size;
line-height: $line-height;
border-radius: $border-radius;
}
// Pagination
// -------------------------
@mixin pagination-size($padding-vertical, $padding-horizontal, $font-size, $border-radius) {
> li {
> a,
> span {
padding: $padding-vertical $padding-horizontal;
font-size: $font-size;
}
&:first-child {
> a,
> span {
@include border-left-radius($border-radius);
}
}
&:last-child {
> a,
> span {
@include border-right-radius($border-radius);
}
}
}
}
// Labels
// -------------------------
@mixin label-variant($color) {
background-color: $color;
&[href] {
&:hover,
&:focus {
background-color: darken($color, 10%);
}
}
}
// Contextual backgrounds
// -------------------------
// [converter] $parent hack
@mixin bg-variant($parent, $color) {
#{$parent} {
background-color: $color;
}
a#{$parent}:hover {
background-color: darken($color, 10%);
}
}
// Typography
// -------------------------
// [converter] $parent hack
@mixin text-emphasis-variant($parent, $color) {
#{$parent} {
color: $color;
}
a#{$parent}:hover {
color: darken($color, 10%);
}
}
// Navbar vertical align
// -------------------------
// Vertically center elements in the navbar.
// Example: an element has a height of 30px, so write out `.navbar-vertical-align(30px);` to calculate the appropriate top margin.
@mixin navbar-vertical-align($element-height) {
margin-top: (($navbar-height - $element-height) / 2);
margin-bottom: (($navbar-height - $element-height) / 2);
}
// Progress bars
// -------------------------
@mixin progress-bar-variant($color) {
background-color: $color;
.progress-striped & {
@include gradient-striped();
}
}
// Responsive utilities
// -------------------------
// More easily include all the states for responsive-utilities.less.
// [converter] $parent hack
@mixin responsive-visibility($parent) {
#{$parent} {
display: block !important;
}
table#{$parent} { display: table; }
tr#{$parent} { display: table-row !important; }
th#{$parent},
td#{$parent} { display: table-cell !important; }
}
// [converter] $parent hack
@mixin responsive-invisibility($parent) {
#{$parent} {
display: none !important;
}
}
// Grid System
// -----------
// Centered container element
@mixin container-fixed() {
margin-right: auto;
margin-left: auto;
padding-left: ($grid-gutter-width / 2);
padding-right: ($grid-gutter-width / 2);
@include clearfix();
}
// Creates a wrapper for a series of columns
@mixin make-row($gutter: $grid-gutter-width) {
margin-left: ($gutter / -2);
margin-right: ($gutter / -2);
@include clearfix();
}
// Generate the extra small columns
@mixin make-xs-column($columns, $gutter: $grid-gutter-width) {
position: relative;
float: left;
width: percentage(($columns / $grid-columns));
min-height: 1px;
padding-left: ($gutter / 2);
padding-right: ($gutter / 2);
}
@mixin make-xs-column-offset($columns) {
@media (min-width: $screen-xs-min) {
margin-left: percentage(($columns / $grid-columns));
}
}
@mixin make-xs-column-push($columns) {
@media (min-width: $screen-xs-min) {
left: percentage(($columns / $grid-columns));
}
}
@mixin make-xs-column-pull($columns) {
@media (min-width: $screen-xs-min) {
right: percentage(($columns / $grid-columns));
}
}
// Generate the small columns
@mixin make-sm-column($columns, $gutter: $grid-gutter-width) {
position: relative;
min-height: 1px;
padding-left: ($gutter / 2);
padding-right: ($gutter / 2);
@media (min-width: $screen-sm-min) {
float: left;
width: percentage(($columns / $grid-columns));
}
}
@mixin make-sm-column-offset($columns) {
@media (min-width: $screen-sm-min) {
margin-left: percentage(($columns / $grid-columns));
}
}
@mixin make-sm-column-push($columns) {
@media (min-width: $screen-sm-min) {
left: percentage(($columns / $grid-columns));
}
}
@mixin make-sm-column-pull($columns) {
@media (min-width: $screen-sm-min) {
right: percentage(($columns / $grid-columns));
}
}
// Generate the medium columns
@mixin make-md-column($columns, $gutter: $grid-gutter-width) {
position: relative;
min-height: 1px;
padding-left: ($gutter / 2);
padding-right: ($gutter / 2);
@media (min-width: $screen-md-min) {
float: left;
width: percentage(($columns / $grid-columns));
}
}
@mixin make-md-column-offset($columns) {
@media (min-width: $screen-md-min) {
margin-left: percentage(($columns / $grid-columns));
}
}
@mixin make-md-column-push($columns) {
@media (min-width: $screen-md-min) {
left: percentage(($columns / $grid-columns));
}
}
@mixin make-md-column-pull($columns) {
@media (min-width: $screen-md-min) {
right: percentage(($columns / $grid-columns));
}
}
// Generate the large columns
@mixin make-lg-column($columns, $gutter: $grid-gutter-width) {
position: relative;
min-height: 1px;
padding-left: ($gutter / 2);
padding-right: ($gutter / 2);
@media (min-width: $screen-lg-min) {
float: left;
width: percentage(($columns / $grid-columns));
}
}
@mixin make-lg-column-offset($columns) {
@media (min-width: $screen-lg-min) {
margin-left: percentage(($columns / $grid-columns));
}
}
@mixin make-lg-column-push($columns) {
@media (min-width: $screen-lg-min) {
left: percentage(($columns / $grid-columns));
}
}
@mixin make-lg-column-pull($columns) {
@media (min-width: $screen-lg-min) {
right: percentage(($columns / $grid-columns));
}
}
// Framework grid generation
//
// Used only by Bootstrap to generate the correct number of grid classes given
// any value of `$grid-columns`.
// [converter] This is defined recursively in LESS, but Sass supports real loops
@mixin make-grid-columns() {
$list: '';
$i: 1;
$list: ".col-xs-#{$i}, .col-sm-#{$i}, .col-md-#{$i}, .col-lg-#{$i}";
@for $i from (1 + 1) through $grid-columns {
$list: "#{$list}, .col-xs-#{$i}, .col-sm-#{$i}, .col-md-#{$i}, .col-lg-#{$i}";
}
#{$list} {
position: relative;
// Prevent columns from collapsing when empty
min-height: 1px;
// Inner gutter via padding
padding-left: ($grid-gutter-width / 2);
padding-right: ($grid-gutter-width / 2);
}
}
// [converter] This is defined recursively in LESS, but Sass supports real loops
@mixin float-grid-columns($class) {
$list: '';
$i: 1;
$list: ".col-#{$class}-#{$i}";
@for $i from (1 + 1) through $grid-columns {
$list: "#{$list}, .col-#{$class}-#{$i}";
}
#{$list} {
float: left;
}
}
@mixin calc-grid-column($index, $class, $type) {
@if ($type == width) and ($index > 0) {
.col-#{$class}-#{$index} {
width: percentage(($index / $grid-columns));
}
}
@if ($type == push) {
.col-#{$class}-push-#{$index} {
left: percentage(($index / $grid-columns));
}
}
@if ($type == pull) {
.col-#{$class}-pull-#{$index} {
right: percentage(($index / $grid-columns));
}
}
@if ($type == offset) {
.col-#{$class}-offset-#{$index} {
margin-left: percentage(($index / $grid-columns));
}
}
}
// [converter] This is defined recursively in LESS, but Sass supports real loops
@mixin loop-grid-columns($columns, $class, $type) {
@for $i from 0 through $columns {
@include calc-grid-column($i, $class, $type);
}
}
// Create grid for specific class
@mixin make-grid($class) {
@include float-grid-columns($class);
@include loop-grid-columns($grid-columns, $class, width);
@include loop-grid-columns($grid-columns, $class, pull);
@include loop-grid-columns($grid-columns, $class, push);
@include loop-grid-columns($grid-columns, $class, offset);
}
// Form validation states
//
// Used in forms.less to generate the form validation CSS for warnings, errors,
// and successes.
@mixin form-control-validation($text-color: #555, $border-color: #ccc, $background-color: #f5f5f5) {
// Color the label and help text
.help-block,
.control-label,
.radio,
.checkbox,
.radio-inline,
.checkbox-inline {
color: $text-color;
}
// Set the border and box shadow on specific inputs to match
.form-control {
border-color: $border-color;
@include box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); // Redeclare so transitions work
&:focus {
border-color: darken($border-color, 10%);
$shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten($border-color, 20%);
@include box-shadow($shadow);
}
}
// Set validation states also for addons
.input-group-addon {
color: $text-color;
border-color: $border-color;
background-color: $background-color;
}
// Optional feedback icon
.form-control-feedback {
color: $text-color;
}
}
// Form control focus state
//
// Generate a customized focus state and for any input with the specified color,
// which defaults to the `$input-focus-border` variable.
//
// We highly encourage you to not customize the default value, but instead use
// this to tweak colors on an as-needed basis. This aesthetic change is based on
// WebKit's default styles, but applicable to a wider range of browsers. Its
// usability and accessibility should be taken into account with any change.
//
// Example usage: change the default blue border and shadow to white for better
// contrast against a dark gray background.
@mixin form-control-focus($color: $input-border-focus) {
$color-rgba: rgba(red($color), green($color), blue($color), .6);
&:focus {
border-color: $color;
outline: 0;
@include box-shadow(inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px $color-rgba);
}
}
// Form control sizing
//
// Relative text size, padding, and border-radii changes for form controls. For
// horizontal sizing, wrap controls in the predefined grid classes. `<select>`
// element gets special love because it's special, and that's a fact!
// [converter] $parent hack
@mixin input-size($parent, $input-height, $padding-vertical, $padding-horizontal, $font-size, $line-height, $border-radius) {
#{$parent} {
height: $input-height;
padding: $padding-vertical $padding-horizontal;
font-size: $font-size;
line-height: $line-height;
border-radius: $border-radius;
}
select#{$parent} {
height: $input-height;
line-height: $input-height;
}
textarea#{$parent},
select[multiple]#{$parent} {
height: auto;
}
}

View File

@ -0,0 +1,833 @@
// a flag to toggle asset pipeline / compass integration
// defaults to true if twbs-font-path function is present (no function => twbs-font-path('') parsed as string == right side)
// in Sass 3.3 this can be improved with: function-exists(twbs-font-path)
$bootstrap-sass-asset-helper: (twbs-font-path("") != unquote('twbs-font-path("")')) !default;
//
// Variables
// --------------------------------------------------
//== Colors
//
//## Gray and brand colors for use across Bootstrap.
$gray-darker: lighten(#000, 13.5%) !default; // #222
$gray-dark: lighten(#000, 20%) !default; // #333
$gray: lighten(#000, 33.5%) !default; // #555
$gray-light: lighten(#000, 60%) !default; // #999
$gray-lighter: lighten(#000, 93.5%) !default; // #eee
$brand-primary: #47bab5 !default;
$brand-success: #5cb85c !default;
$brand-info: #5bc0de !default;
$brand-warning: #f0ad4e !default;
$brand-danger: #ed4c43 !default;
//== Scaffolding
//
// ## Settings for some of the most global styles.
//** Background color for `<body>`.
$body-bg: #fff !default;
//** Global text color on `<body>`.
$text-color: $gray-dark !default;
//** Global textual link color.
$link-color: $brand-primary !default;
//** Link hover color set via `darken()` function.
$link-hover-color: darken($link-color, 15%) !default;
//== Typography
//
//## Font, line-height, and color for body text, headings, and more.
$font-family-sans-serif: "Helvetica Neue", Helvetica, Arial, sans-serif !default;
$font-family-serif: Georgia, "Times New Roman", Times, serif !default;
//** Default monospace fonts for `<code>`, `<kbd>`, and `<pre>`.
$font-family-monospace: Menlo, Monaco, Consolas, "Courier New", monospace !default;
$font-family-base: $font-family-sans-serif !default;
$font-size-base: 14px !default;
$font-size-large: ceil(($font-size-base * 1.25)) !default; // ~18px
$font-size-small: ceil(($font-size-base * 0.85)) !default; // ~12px
$font-size-h1: floor(($font-size-base * 2.6)) !default; // ~36px
$font-size-h2: floor(($font-size-base * 2.15)) !default; // ~30px
$font-size-h3: ceil(($font-size-base * 1.7)) !default; // ~24px
$font-size-h4: ceil(($font-size-base * 1.25)) !default; // ~18px
$font-size-h5: $font-size-base !default;
$font-size-h6: ceil(($font-size-base * 0.85)) !default; // ~12px
//** Unit-less `line-height` for use in components like buttons.
$line-height-base: 1.428571429 !default; // 20/14
//** Computed "line-height" (`font-size` * `line-height`) for use with `margin`, `padding`, etc.
$line-height-computed: floor(($font-size-base * $line-height-base)) !default; // ~20px
//** By default, this inherits from the `<body>`.
$headings-font-family: inherit !default;
$headings-font-weight: 500 !default;
$headings-line-height: 1.1 !default;
$headings-color: inherit !default;
//-- Iconography
//
//## Specify custom locations of the include Glyphicons icon font. Useful for those including Bootstrap via Bower.
$icon-font-path: "bootstrap/" !default;
$icon-font-name: "glyphicons-halflings-regular" !default;
$icon-font-svg-id: "glyphicons_halflingsregular" !default;
//== Components
//
//## Define common padding and border radius sizes and more. Values based on 14px text and 1.428 line-height (~20px to start).
$padding-base-vertical: 6px !default;
$padding-base-horizontal: 12px !default;
$padding-large-vertical: 10px !default;
$padding-large-horizontal: 16px !default;
$padding-small-vertical: 5px !default;
$padding-small-horizontal: 10px !default;
$padding-xs-vertical: 1px !default;
$padding-xs-horizontal: 5px !default;
$line-height-large: 1.33 !default;
$line-height-small: 1.5 !default;
$border-radius-base: 4px !default;
$border-radius-large: 6px !default;
$border-radius-small: 3px !default;
//** Global color for active items (e.g., navs or dropdowns).
$component-active-color: #fff !default;
//** Global background color for active items (e.g., navs or dropdowns).
$component-active-bg: $brand-primary !default;
//** Width of the `border` for generating carets that indicator dropdowns.
$caret-width-base: 4px !default;
//** Carets increase slightly in size for larger components.
$caret-width-large: 5px !default;
//== Tables
//
//## Customizes the `.table` component with basic values, each used across all table variations.
//** Padding for `<th>`s and `<td>`s.
$table-cell-padding: 8px !default;
//** Padding for cells in `.table-condensed`.
$table-condensed-cell-padding: 5px !default;
//** Default background color used for all tables.
$table-bg: transparent !default;
//** Background color used for `.table-striped`.
$table-bg-accent: #f9f9f9 !default;
//** Background color used for `.table-hover`.
$table-bg-hover: #f5f5f5 !default;
$table-bg-active: $table-bg-hover !default;
//** Border color for table and cell borders.
$table-border-color: #ddd !default;
//== Buttons
//
//## For each of Bootstrap's buttons, define text, background and border color.
$btn-font-weight: normal !default;
$btn-default-color: #333 !default;
$btn-default-bg: #fff !default;
$btn-default-border: #ccc !default;
$btn-primary-color: #fff !default;
$btn-primary-bg: $brand-primary !default;
$btn-primary-border: darken($btn-primary-bg, 5%) !default;
$btn-success-color: #fff !default;
$btn-success-bg: $brand-success !default;
$btn-success-border: darken($btn-success-bg, 5%) !default;
$btn-info-color: #fff !default;
$btn-info-bg: $brand-info !default;
$btn-info-border: darken($btn-info-bg, 5%) !default;
$btn-warning-color: #fff !default;
$btn-warning-bg: $brand-warning !default;
$btn-warning-border: darken($btn-warning-bg, 5%) !default;
$btn-danger-color: #fff !default;
$btn-danger-bg: $brand-danger !default;
$btn-danger-border: darken($btn-danger-bg, 5%) !default;
$btn-link-disabled-color: $gray-light !default;
//== Forms
//
//##
//** `<input>` background color
$input-bg: #fff !default;
//** `<input disabled>` background color
$input-bg-disabled: $gray-lighter !default;
//** Text color for `<input>`s
$input-color: $gray !default;
//** `<input>` border color
$input-border: #ccc !default;
//** `<input>` border radius
$input-border-radius: $border-radius-base !default;
//** Border color for inputs on focus
$input-border-focus: #66afe9 !default;
//** Placeholder text color
$input-color-placeholder: $gray-light !default;
//** Default `.form-control` height
$input-height-base: ($line-height-computed + ($padding-base-vertical * 2) + 2) !default;
//** Large `.form-control` height
$input-height-large: (ceil($font-size-large * $line-height-large) + ($padding-large-vertical * 2) + 2) !default;
//** Small `.form-control` height
$input-height-small: (floor($font-size-small * $line-height-small) + ($padding-small-vertical * 2) + 2) !default;
$legend-color: $gray-dark !default;
$legend-border-color: #e5e5e5 !default;
//** Background color for textual input addons
$input-group-addon-bg: $gray-lighter !default;
//** Border color for textual input addons
$input-group-addon-border-color: $input-border !default;
//== Dropdowns
//
//## Dropdown menu container and contents.
//** Background for the dropdown menu.
$dropdown-bg: #fff !default;
//** Dropdown menu `border-color`.
$dropdown-border: rgba(0,0,0,.15) !default;
//** Dropdown menu `border-color` **for IE8**.
$dropdown-fallback-border: #ccc !default;
//** Divider color for between dropdown items.
$dropdown-divider-bg: #e5e5e5 !default;
//** Dropdown link text color.
$dropdown-link-color: $gray-dark !default;
//** Hover color for dropdown links.
$dropdown-link-hover-color: darken($gray-dark, 5%) !default;
//** Hover background for dropdown links.
$dropdown-link-hover-bg: #f5f5f5 !default;
//** Active dropdown menu item text color.
$dropdown-link-active-color: $component-active-color !default;
//** Active dropdown menu item background color.
$dropdown-link-active-bg: $component-active-bg !default;
//** Disabled dropdown menu item background color.
$dropdown-link-disabled-color: $gray-light !default;
//** Text color for headers within dropdown menus.
$dropdown-header-color: $gray-light !default;
// Note: Deprecated $dropdown-caret-color as of v3.1.0
$dropdown-caret-color: #000 !default;
//-- Z-index master list
//
// Warning: Avoid customizing these values. They're used for a bird's eye view
// of components dependent on the z-axis and are designed to all work together.
//
// Note: These variables are not generated into the Customizer.
$zindex-navbar: 1000 !default;
$zindex-dropdown: 1000 !default;
$zindex-popover: 1010 !default;
$zindex-tooltip: 1030 !default;
$zindex-navbar-fixed: 1030 !default;
$zindex-modal-background: 1040 !default;
$zindex-modal: 1050 !default;
//== Media queries breakpoints
//
//## Define the breakpoints at which your layout will change, adapting to different screen sizes.
// Extra small screen / phone
// Note: Deprecated $screen-xs and $screen-phone as of v3.0.1
$screen-xs: 480px !default;
$screen-xs-min: $screen-xs !default;
$screen-phone: $screen-xs-min !default;
// Small screen / tablet
// Note: Deprecated $screen-sm and $screen-tablet as of v3.0.1
$screen-sm: 768px !default;
$screen-sm-min: $screen-sm !default;
$screen-tablet: $screen-sm-min !default;
// Medium screen / desktop
// Note: Deprecated $screen-md and $screen-desktop as of v3.0.1
$screen-md: 992px !default;
$screen-md-min: $screen-md !default;
$screen-desktop: $screen-md-min !default;
// Large screen / wide desktop
// Note: Deprecated $screen-lg and $screen-lg-desktop as of v3.0.1
$screen-lg: 1200px !default;
$screen-lg-min: $screen-lg !default;
$screen-lg-desktop: $screen-lg-min !default;
// So media queries don't overlap when required, provide a maximum
$screen-xs-max: ($screen-sm-min - 1) !default;
$screen-sm-max: ($screen-md-min - 1) !default;
$screen-md-max: ($screen-lg-min - 1) !default;
//== Grid system
//
//## Define your custom responsive grid.
//** Number of columns in the grid.
$grid-columns: 12 !default;
//** Padding between columns. Gets divided in half for the left and right.
$grid-gutter-width: 30px !default;
// Navbar collapse
//** Point at which the navbar becomes uncollapsed.
$grid-float-breakpoint: $screen-sm-min !default;
//** Point at which the navbar begins collapsing.
$grid-float-breakpoint-max: ($grid-float-breakpoint - 1) !default;
//== Container sizes
//
//## Define the maximum width of `.container` for different screen sizes.
// Small screen / tablet
$container-tablet: ((720px + $grid-gutter-width)) !default;
//** For `$screen-sm-min` and up.
$container-sm: $container-tablet !default;
// Medium screen / desktop
$container-desktop: ((940px + $grid-gutter-width)) !default;
//** For `$screen-md-min` and up.
$container-md: $container-desktop !default;
// Large screen / wide desktop
$container-large-desktop: ((1140px + $grid-gutter-width)) !default;
//** For `$screen-lg-min` and up.
$container-lg: $container-large-desktop !default;
//== Navbar
//
//##
// Basics of a navbar
$navbar-height: 50px !default;
$navbar-margin-bottom: $line-height-computed !default;
$navbar-border-radius: $border-radius-base !default;
$navbar-padding-horizontal: floor(($grid-gutter-width / 2)) !default;
$navbar-padding-vertical: (($navbar-height - $line-height-computed) / 2) !default;
$navbar-collapse-max-height: 340px !default;
$navbar-default-color: #777 !default;
$navbar-default-bg: #f8f8f8 !default;
$navbar-default-border: darken($navbar-default-bg, 6.5%) !default;
// Navbar links
$navbar-default-link-color: #777 !default;
$navbar-default-link-hover-color: #333 !default;
$navbar-default-link-hover-bg: transparent !default;
$navbar-default-link-active-color: #555 !default;
$navbar-default-link-active-bg: darken($navbar-default-bg, 6.5%) !default;
$navbar-default-link-disabled-color: #ccc !default;
$navbar-default-link-disabled-bg: transparent !default;
// Navbar brand label
$navbar-default-brand-color: $navbar-default-link-color !default;
$navbar-default-brand-hover-color: darken($navbar-default-brand-color, 10%) !default;
$navbar-default-brand-hover-bg: transparent !default;
// Navbar toggle
$navbar-default-toggle-hover-bg: #ddd !default;
$navbar-default-toggle-icon-bar-bg: #888 !default;
$navbar-default-toggle-border-color: #ddd !default;
// Inverted navbar
// Reset inverted navbar basics
$navbar-inverse-color: $gray-light !default;
$navbar-inverse-bg: #222 !default;
$navbar-inverse-border: darken($navbar-inverse-bg, 10%) !default;
// Inverted navbar links
$navbar-inverse-link-color: $gray-light !default;
$navbar-inverse-link-hover-color: #fff !default;
$navbar-inverse-link-hover-bg: transparent !default;
$navbar-inverse-link-active-color: $navbar-inverse-link-hover-color !default;
$navbar-inverse-link-active-bg: darken($navbar-inverse-bg, 10%) !default;
$navbar-inverse-link-disabled-color: #444 !default;
$navbar-inverse-link-disabled-bg: transparent !default;
// Inverted navbar brand label
$navbar-inverse-brand-color: $navbar-inverse-link-color !default;
$navbar-inverse-brand-hover-color: #fff !default;
$navbar-inverse-brand-hover-bg: transparent !default;
// Inverted navbar toggle
$navbar-inverse-toggle-hover-bg: #333 !default;
$navbar-inverse-toggle-icon-bar-bg: #fff !default;
$navbar-inverse-toggle-border-color: #333 !default;
//== Navs
//
//##
//=== Shared nav styles
$nav-link-padding: 10px 15px !default;
$nav-link-hover-bg: $gray-lighter !default;
$nav-disabled-link-color: $gray-light !default;
$nav-disabled-link-hover-color: $gray-light !default;
$nav-open-link-hover-color: #fff !default;
//== Tabs
$nav-tabs-border-color: #ddd !default;
$nav-tabs-link-hover-border-color: $gray-lighter !default;
$nav-tabs-active-link-hover-bg: $body-bg !default;
$nav-tabs-active-link-hover-color: $gray !default;
$nav-tabs-active-link-hover-border-color: #ddd !default;
$nav-tabs-justified-link-border-color: #ddd !default;
$nav-tabs-justified-active-link-border-color: $body-bg !default;
//== Pills
$nav-pills-border-radius: $border-radius-base !default;
$nav-pills-active-link-hover-bg: $component-active-bg !default;
$nav-pills-active-link-hover-color: $component-active-color !default;
//== Pagination
//
//##
$pagination-color: $link-color !default;
$pagination-bg: #fff !default;
$pagination-border: #ddd !default;
$pagination-hover-color: $link-hover-color !default;
$pagination-hover-bg: $gray-lighter !default;
$pagination-hover-border: #ddd !default;
$pagination-active-color: #fff !default;
$pagination-active-bg: $brand-primary !default;
$pagination-active-border: $brand-primary !default;
$pagination-disabled-color: $gray-light !default;
$pagination-disabled-bg: #fff !default;
$pagination-disabled-border: #ddd !default;
//== Pager
//
//##
$pager-bg: $pagination-bg !default;
$pager-border: $pagination-border !default;
$pager-border-radius: 15px !default;
$pager-hover-bg: $pagination-hover-bg !default;
$pager-active-bg: $pagination-active-bg !default;
$pager-active-color: $pagination-active-color !default;
$pager-disabled-color: $pagination-disabled-color !default;
//== Jumbotron
//
//##
$jumbotron-padding: 30px !default;
$jumbotron-color: inherit !default;
$jumbotron-bg: $gray-lighter !default;
$jumbotron-heading-color: inherit !default;
$jumbotron-font-size: ceil(($font-size-base * 1.5)) !default;
//== Form states and alerts
//
//## Define colors for form feedback states and, by default, alerts.
$state-success-text: #3c763d !default;
$state-success-bg: #dff0d8 !default;
$state-success-border: darken(adjust-hue($state-success-bg, -10), 5%) !default;
$state-info-text: #31708f !default;
$state-info-bg: #d9edf7 !default;
$state-info-border: darken(adjust-hue($state-info-bg, -10), 7%) !default;
$state-warning-text: #8a6d3b !default;
$state-warning-bg: #fcf8e3 !default;
$state-warning-border: darken(adjust-hue($state-warning-bg, -10), 5%) !default;
$state-danger-text: #a94442 !default;
$state-danger-bg: #f2dede !default;
$state-danger-border: darken(adjust-hue($state-danger-bg, -10), 5%) !default;
//== Tooltips
//
//##
//** Tooltip max width
$tooltip-max-width: 200px !default;
//** Tooltip text color
$tooltip-color: #fff !default;
//** Tooltip background color
$tooltip-bg: #000 !default;
$tooltip-opacity: .9 !default;
//** Tooltip arrow width
$tooltip-arrow-width: 5px !default;
//** Tooltip arrow color
$tooltip-arrow-color: $tooltip-bg !default;
//== Popovers
//
//##
//** Popover body background color
$popover-bg: #fff !default;
//** Popover maximum width
$popover-max-width: 276px !default;
//** Popover border color
$popover-border-color: rgba(0,0,0,.2) !default;
//** Popover fallback border color
$popover-fallback-border-color: #ccc !default;
//** Popover title background color
$popover-title-bg: darken($popover-bg, 3%) !default;
//** Popover arrow width
$popover-arrow-width: 10px !default;
//** Popover arrow color
$popover-arrow-color: #fff !default;
//** Popover outer arrow width
$popover-arrow-outer-width: ($popover-arrow-width + 1) !default;
//** Popover outer arrow color
$popover-arrow-outer-color: fadein($popover-border-color, 5%) !default;
//** Popover outer arrow fallback color
$popover-arrow-outer-fallback-color: darken($popover-fallback-border-color, 20%) !default;
//== Labels
//
//##
//** Default label background color
$label-default-bg: $gray-light !default;
//** Primary label background color
$label-primary-bg: $brand-primary !default;
//** Success label background color
$label-success-bg: $brand-success !default;
//** Info label background color
$label-info-bg: $brand-info !default;
//** Warning label background color
$label-warning-bg: $brand-warning !default;
//** Danger label background color
$label-danger-bg: $brand-danger !default;
//** Default label text color
$label-color: #fff !default;
//** Default text color of a linked label
$label-link-hover-color: #fff !default;
//== Modals
//
//##
//** Padding applied to the modal body
$modal-inner-padding: 20px !default;
//** Padding applied to the modal title
$modal-title-padding: 15px !default;
//** Modal title line-height
$modal-title-line-height: $line-height-base !default;
//** Background color of modal content area
$modal-content-bg: #fff !default;
//** Modal content border color
$modal-content-border-color: rgba(0,0,0,.2) !default;
//** Modal content border color **for IE8**
$modal-content-fallback-border-color: #999 !default;
//** Modal backdrop background color
$modal-backdrop-bg: #000 !default;
//** Modal backdrop opacity
$modal-backdrop-opacity: .5 !default;
//** Modal header border color
$modal-header-border-color: #e5e5e5 !default;
//** Modal footer border color
$modal-footer-border-color: $modal-header-border-color !default;
$modal-lg: 900px !default;
$modal-md: 600px !default;
$modal-sm: 300px !default;
//== Alerts
//
//## Define alert colors, border radius, and padding.
$alert-padding: 15px !default;
$alert-border-radius: $border-radius-base !default;
$alert-link-font-weight: bold !default;
$alert-success-bg: $state-success-bg !default;
$alert-success-text: $state-success-text !default;
$alert-success-border: $state-success-border !default;
$alert-info-bg: $state-info-bg !default;
$alert-info-text: $state-info-text !default;
$alert-info-border: $state-info-border !default;
$alert-warning-bg: $state-warning-bg !default;
$alert-warning-text: $state-warning-text !default;
$alert-warning-border: $state-warning-border !default;
$alert-danger-bg: $state-danger-bg !default;
$alert-danger-text: $state-danger-text !default;
$alert-danger-border: $state-danger-border !default;
//== Progress bars
//
//##
//** Background color of the whole progress component
$progress-bg: #f5f5f5 !default;
//** Progress bar text color
$progress-bar-color: #fff !default;
//** Default progress bar color
$progress-bar-bg: $brand-primary !default;
//** Success progress bar color
$progress-bar-success-bg: $brand-success !default;
//** Warning progress bar color
$progress-bar-warning-bg: $brand-warning !default;
//** Danger progress bar color
$progress-bar-danger-bg: $brand-danger !default;
//** Info progress bar color
$progress-bar-info-bg: $brand-info !default;
//== List group
//
//##
//** Background color on `.list-group-item`
$list-group-bg: #fff !default;
//** `.list-group-item` border color
$list-group-border: #ddd !default;
//** List group border radius
$list-group-border-radius: $border-radius-base !default;
//** Background color of single list elements on hover
$list-group-hover-bg: #f5f5f5 !default;
//** Text color of active list elements
$list-group-active-color: $component-active-color !default;
//** Background color of active list elements
$list-group-active-bg: $component-active-bg !default;
//** Border color of active list elements
$list-group-active-border: $list-group-active-bg !default;
$list-group-active-text-color: lighten($list-group-active-bg, 40%) !default;
$list-group-link-color: #555 !default;
$list-group-link-heading-color: #333 !default;
//== Panels
//
//##
$panel-bg: #fff !default;
$panel-body-padding: 15px !default;
$panel-border-radius: $border-radius-base !default;
//** Border color for elements within panels
$panel-inner-border: #ddd !default;
$panel-footer-bg: #f5f5f5 !default;
$panel-default-text: $gray-dark !default;
$panel-default-border: #ddd !default;
$panel-default-heading-bg: #f5f5f5 !default;
$panel-primary-text: #fff !default;
$panel-primary-border: $brand-primary !default;
$panel-primary-heading-bg: $brand-primary !default;
$panel-success-text: $state-success-text !default;
$panel-success-border: $state-success-border !default;
$panel-success-heading-bg: $state-success-bg !default;
$panel-info-text: $state-info-text !default;
$panel-info-border: $state-info-border !default;
$panel-info-heading-bg: $state-info-bg !default;
$panel-warning-text: $state-warning-text !default;
$panel-warning-border: $state-warning-border !default;
$panel-warning-heading-bg: $state-warning-bg !default;
$panel-danger-text: $state-danger-text !default;
$panel-danger-border: $state-danger-border !default;
$panel-danger-heading-bg: $state-danger-bg !default;
//== Thumbnails
//
//##
//** Padding around the thumbnail image
$thumbnail-padding: 4px !default;
//** Thumbnail background color
$thumbnail-bg: $body-bg !default;
//** Thumbnail border color
$thumbnail-border: #ddd !default;
//** Thumbnail border radius
$thumbnail-border-radius: $border-radius-base !default;
//** Custom text color for thumbnail captions
$thumbnail-caption-color: $text-color !default;
//** Padding around the thumbnail caption
$thumbnail-caption-padding: 9px !default;
//== Wells
//
//##
$well-bg: #f5f5f5 !default;
$well-border: darken($well-bg, 7%) !default;
//== Badges
//
//##
$badge-color: #fff !default;
//** Linked badge text color on hover
$badge-link-hover-color: #fff !default;
$badge-bg: $gray-light !default;
//** Badge text color in active nav link
$badge-active-color: $link-color !default;
//** Badge background color in active nav link
$badge-active-bg: #fff !default;
$badge-font-weight: bold !default;
$badge-line-height: 1 !default;
$badge-border-radius: 10px !default;
//== Breadcrumbs
//
//##
$breadcrumb-padding-vertical: 8px !default;
$breadcrumb-padding-horizontal: 15px !default;
//** Breadcrumb background color
$breadcrumb-bg: #f5f5f5 !default;
//** Breadcrumb text color
$breadcrumb-color: #ccc !default;
//** Text color of current page in the breadcrumb
$breadcrumb-active-color: $gray-light !default;
//** Textual separator for between breadcrumb elements
$breadcrumb-separator: "/" !default;
//== Carousel
//
//##
$carousel-text-shadow: 0 1px 2px rgba(0,0,0,.6) !default;
$carousel-control-color: #fff !default;
$carousel-control-width: 15% !default;
$carousel-control-opacity: .5 !default;
$carousel-control-font-size: 20px !default;
$carousel-indicator-active-bg: #fff !default;
$carousel-indicator-border-color: #fff !default;
$carousel-caption-color: #fff !default;
//== Close
//
//##
$close-font-weight: bold !default;
$close-color: #000 !default;
$close-text-shadow: 0 1px 0 #fff !default;
//== Code
//
//##
$code-color: #c7254e !default;
$code-bg: #f9f2f4 !default;
$kbd-color: #fff !default;
$kbd-bg: #333 !default;
$pre-bg: #f5f5f5 !default;
$pre-color: $gray-dark !default;
$pre-border-color: #ccc !default;
$pre-scrollable-max-height: 340px !default;
//== Type
//
//##
//** Text muted color
$text-muted: $gray-light !default;
//** Abbreviations and acronyms border color
$abbr-border-color: $gray-light !default;
//** Headings small color
$headings-small-color: $gray-light !default;
//** Blockquote small color
$blockquote-small-color: $gray-light !default;
//** Blockquote font size
$blockquote-font-size: ($font-size-base * 1.25) !default;
//** Blockquote border color
$blockquote-border-color: $gray-lighter !default;
//** Page header border color
$page-header-border-color: $gray-lighter !default;
//== Miscellaneous
//
//##
//** Horizontal line color.
$hr-border: $gray-lighter !default;
//** Horizontal offset for forms and lists.
$component-offset-horizontal: 180px !default;

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,259 @@
.widget-event-news-calendar-2.w-calendar{
.w-calendar-table {
table-layout: fixed;
width: 100%;
flex: 1;
}
.height100 {
flex: 1;
display: flex;
flex-direction: column;
}
a.event-container-one{
color: inherit;
}
.close_box{
font-weight: bold;
position: relative;
float: right;
padding: 0.5em;
cursor: pointer;
}
.close_box:hover{
color: red;
}
.event-bullet-event {
width: 100%;
height: 100%;
border-radius: 50%;
}
.event-bullet-event {
width: 2em;
height: 2em;
border-radius: 1em;
}
.event-header{
width: 100%;
text-align: center;
font-size: 1.7em;
font-weight: bold;
padding: 0.35em 0;
}
.event-info{
padding-left: 15%;
}
.calendar-events{
position: relative;
background: #fbfbfb;
display: flex;
flex-direction: column;
}
.month_template{
position: relative;
height: 100%;
display: flex;
flex-direction: column;
}
flex-wrap: wrap;
margin-top: 2em;
margin-bottom: 1em;
.w-calendar-table td:hover {
background-color: #eaeaea;
color: #333;
}
.w-calendar-table td {
background: inherit;
color: inherit;
cursor: pointer;
border: 0;
vertical-align: middle;
}
.w-calendar-table td div{
display: inline-flex;
justify-content: center;
align-items: center;
margin: auto;
padding: 10%;
line-height: 1.2;
}
.w-calendar-table th {
background: unset;
color: unset;
border: 0;
padding: 1.5% 0.5%;
}
.widget-title {
padding: 0.2em;
font-size: 1.5em;
}
table.w-calendar-table td.w-calendar-toggle div, table.w-calendar-table td.w-calendar-toggle div{
background: #6f0007;
border-radius: 50%;
color: white;
}
.w-calendar-table td.w-calendar-event div{
border: 1px #6f0007 solid;
border-radius: 50%;
background: #eee;
}
.w-calendar-title{
background: rgb(146, 8, 17);
color: rgb(255, 255, 255);
padding: 0px 10%;
display: flex;
line-height: 2em;
justify-content: space-between;
font-size: 1.85em;
width: 100%;
.w-calendar-title span:last-child{
float: right;
}
}
.w-calendar-title.center{
text-align: center;
justify-content: center;
}
.calendar-dialog div.ui-dialog-content {
max-height: 20em !important;
overflow-wrap: break-word;
}
table td.w-calendar-other-month {
color: #999797;
}
.event-header{
display: flex;
background: #dadada;
cursor: default;
}
.event-header .date{
width: 30%;
}
.event.active .event-header .day{
color: #bf1f1f;
}
.event.active .event-header .date{
color: #202427;
}
.event .event-header .day{
font-size: 1.4em;
}
.event .event-header .month{
font-size: 0.7em;
}
.event .event-header .date{
color: #a08a70;
}
.event-title{
width: 70%;
display: inline-flex;
flex-direction: column;
justify-content: space-between;
}
.event-title .duration{
font-size: 0.7em;
text-align: left;
color: #a0a1a1;
}
.duration_temp,.title_temp{
display: none;
}
.event-inner-title{
line-height: 2em;
text-align: left;
}
.event-containers{
height: 0;
min-height: unset;
display: flex;
justify-content: center;
align-items: center;
position: relative;
overflow: hidden;
margin: 0 10%;
}
.event-container-one {
position: absolute;
align-items: center;
justify-content: center;
display: flex;
width: calc(100% - 0.7em);;
height: calc(100% - 0.7em);
flex-wrap: wrap;
border-radius: 10px;
margin-bottom: 1em;
cursor: pointer;
padding: 0;
margin: 0;
color: rgba(50, 50, 50, 0.45);
}
.event-container-one:hover {
background-color: #fff;
box-shadow: 0 0.1em 0.7em 0em;
}
.event-container-one .event-content{
color: #000000;
}
button.switch_button {
margin: 10%;
width: 2.5em;
height: 2.5em;
border-radius: 1.25em;
border: 0;
background: #96231a;
color: white;
outline: 0;
}
.switch_button:hover {
background: #c07b76;
}
.switch_button_wraper{
position: absolute;
right: 0%;
margin-right: 2%;
width: 3em;
margin-bottom: 2%;
bottom: 0;
display: flex;
flex-direction: column;
}
.event-wraper{
position: relative;
overflow: hidden;
flex: 1;
}
.event-container-one:not(.active) {
right: -100%;
}
.event.active .event-containers{
min-height: 13em;
height: 100%;
}
.calendar-events.width-100 .switch_button_wraper{
width: 100%;
height: 100%;
margin: 0;
flex-direction: row;
justify-content: space-between;
align-items: center;
}
.calendar-events.width-100 .switch_button{
margin: 2%;
}
.calendar-events.width-100 .event-containers{
z-index: 3;
}
.month_template .widget-title {
border: 0;
border-bottom: 0.0625em solid #ddd;
}
&>div:first-child {
box-shadow: 0em 0.1em 0.3em 0em;
margin-bottom: 0.25em;
}
.event{
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
}
}

View File

@ -0,0 +1,168 @@
.full-size-img img {
width: 100%;
}
.full-size-img {
width: 100%;
}
.s-annc__sub-img.pull-right {
margin-left: 2em;
}
.s-annc__sub-img.pull-left {
margin-right: 2em;
}
strong.carousel__description {
color: white;
}
@media (max-width: 767px){
.carousel_images{
width: 100%;
}
}
.carousel_img_item{
display: none;
float: left;
}
.controlplay {
position: absolute;
right: 1em;
top: 3%;
z-index: 200;
}
.controlplay a {
display: inline-block;
margin-right: 0.25em;
cursor: pointer;
padding: 5px 10px;
border: 1px solid rgba(255,255,255,0.5);
background: rgba(0,0,0,0.2);
}
.controlplay a i {
font-family: FontAwesome;
position: relative;
font-size: 1rem;
line-height: 1;
color: #FFF;
vertical-align: middle;
font-style: unset;
}
.controlplay .resume-slide i::before {
content: "\f04b";
}
.controlplay .pause-slide i::before {
content: "\f04c";
}
ul.button-mid .prev-button {
transition: 0.4s;
position: relative;
float: left;
left: 0.5rem;
width: 2.5rem;
height: 2.5rem;
font-size: 2.2rem;
color: #ffffff;
background: rgba(0,0,0,0.2);
text-align: center;
line-height: 2.5rem;
top: 50%;
position: absolute;
transform: translateY(-50%);
z-index: 999;
}
ul.button-mid .next-button {
float: right;
transition: 0.4s;
position: relative;
right: 0.5rem;
width: 2.5rem;
height: 2.5rem;
font-size: 2.2rem;
color: #fff;
background: rgba(0,0,0,0.2);
text-align: center;
line-height: 2.5rem;
top: 50%;
position: absolute;
transform: translateY(-50%);
z-index: 999;
}
.carousel_images_slide{
padding: 3em;
}
.carousel_img_item img{
cursor: pointer;
}
@media (max-width: 479px){
.carousel_img_item:nth-child(-n+1){
display: block;
width: 100%;
float: left;
}
.carousel_img_item{
width: 100%;
}
}
@media (min-width: 480px){
.carousel_img_item:nth-child(-n+2){
display: block;
width: 50%;
float: left;
}
.carousel_img_item{
width: 50%;
}
}
@media (min-width: 768px){
.carousel_img_item:nth-child(-n+3){
display: block;
width: 33%;
float: left;
}
.carousel_img_item{
width: 33%;
}
}
@media (min-width: 1280px){
.carousel_img_item:nth-child(-n+4){
display: block;
width: 25%;
float: left;
}
.carousel_img_item{
width: 25%;
}
}
.w-ba-banner .controlplay .resume-slide.active i{
color: #32D9C3;
}
.w-ba-banner .controlplay .pause-slide.active i{
color: #ff4500;
}
.w-ba-banner .controlplay{
width: auto;
}
.w-ba-banner .button-mid{
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
}
.next-button,.prev-button{
cursor: pointer;
}
a.orbit-hash-tag {
list-style: none;
background: #e0edff;
color: #0a84ff;
margin-right: 0.5em;
border-radius: 0.5em;
padding: 0.2em 0.5em;
margin-bottom: 0.5em;
display: inline-block;
&:hover{
background: #0a84ff;
transform: translatey(-2px);
transition: transform 0.4s;
color: #fff;
}
}

View File

@ -0,0 +1,694 @@
@charset "utf-8";
@import "../initial";
//
// Widget
//
// Recruitment widget
// ## Gerneral styles for widgets
.w-recruitment {
.w-recruitment__widget-title {
@extend .unity-title;
}
.w-recruitment__list {
margin: 0;
padding: 0;
list-style: none;
}
.w-recruitment__item {
margin-bottom: 1.875em;
}
.label {
font-size: 0.75rem;
font-weight: normal;
}
.w-recruitment__meta {
.w-recruitment__status-wrap,
.w-recruitment__postdate-wrap,
.w-recruitment__category-wrap {
display: inline-block;
margin-right: 0.2em;
font-size: 0.8125em;
color: $theme-gray;
font-weight: normal;
}
i {
color: $theme-gray;
}
}
.w-recruitment__subtitle {
font-size: 0.8125em;
color: $theme-gray;
}
.w-recruitment__entry-title {
margin-bottom: 0.625em;
}
.w-recruitment__title {
font-family: $sub-font;
color: $theme-color-main;
text-decoration: none;
font-size: 0.8125rem;
&:hover {
color: darken($theme-color-main, 10%);
}
}
}
// Widget-1
.widget-recruitment-1 {
.w-recruitment__img-wrap {
height: 12.5em;
margin: 0 0 1em 0;
}
.w-recruitment__title {
font-family: $main-font;
line-height: 1.3;
font-size: 1.2rem;
}
}
// Widget-2
.widget-recruitment-2 {
.w-recruitment__img-wrap {
height: 12.5em;
margin: 0 0 1em 0;
}
.w-recruitment__title {
font-family: $main-font;
line-height: 1.3;
font-size: 1.2rem;
}
}
// Widget-3
.widget-recruitment-3 {
.w-recruitment__img-wrap {
height: 12.5em;
margin: 0 0 1em 0;
}
.w-recruitment__title {
font-family: $main-font;
line-height: 1.3;
font-size: 1.2rem;
}
}
// Widget-4
.widget-recruitment-4 {
.w-recruitment__title {
font-family: $main-font;
line-height: 1.3;
font-size: 1.2rem;
}
.w-recruitment__list > .w-recruitment__item:nth-child(3n+1) {
clear: both;
}
.w-recruitment__img-wrap {
height: 12.5em;
margin: 0 0 1em 0;
}
}
// Widget-5
.widget-recruitment-5 {
.w-recruitment__title {
font-family: $main-font;
line-height: 1.3;
font-size: 1.2rem;
}
.w-recruitment__item {
border-bottom: 0.0625em dashed lighten($theme-gray, 65%);
padding-bottom: 1em;
margin-bottom: 1em;
}
}
// Widget-6
.widget-recruitment-6 {
.w-recruitment__item {
margin-bottom: 0.8em;
padding-bottom: 0.8em;
border-bottom: 0.0625em dashed lighten($theme-gray, 65%);
}
.w-recruitment__entry-title {
margin: 0;
}
.w-recruitment__category-wrap,
.w-recruitment__status,
.w-recruitment__title,
.w-recruitment__postdate-wrap {
font-size: 0.8125rem;
}
.w-recruitment__status {
display: inline-block;
}
}
// Widget-7
.widget-recruitment-7 {
.w-recruitment__item {
margin-bottom: 0.8em;
padding-bottom: 0.8em;
border-bottom: 0.0625em dashed lighten($theme-gray, 65%);
}
.w-recruitment__entry-title {
margin: 0;
}
.w-recruitment__category-wrap,
.w-recruitment__status,
.w-recruitment__title,
.w-recruitment__postdate-wrap {
font-size: 0.75rem;
}
.w-recruitment__status {
display: inline-block;
}
}
// ## Gerneral styles for table widgets
.w-recruitment__postdate,
.w-recruitment__category {
white-space: nowrap;
}
// Widget-8
// ## Table
.widget-recruitment-8 {
.w-recruitment__th {
color: #fff;
background: $theme-color-main;
font-size: 0.8125em;
border: none;
}
.w-recruitment__status {
display: inline-block;
font-size: 0.75rem;
}
td {
font-size: 0.8125em;
}
a:hover {
text-decoration: none;
}
}
// Widget-9
// ## Table
.widget-recruitment-9 {
.w-recruitment__th {
color: #fff;
background: $theme-color-main;
font-size: 0.8125em;
border: none;
}
.w-recruitment__status {
display: inline-block;
font-size: 0.75rem;
}
td {
font-size: 0.8125em;
}
a:hover {
text-decoration: none;
}
}
// Widget-10
.widget-recruitment-10 {
.w-recruitment__item {
margin-bottom: 0.8em;
padding-bottom: 0.8em;
border-bottom: 0.0625em dashed lighten($theme-gray, 65%);
}
.w-recruitment__entry-title {
margin: 0;
}
.w-recruitment__postdate-wrap {
font-size: 0.8125em;
}
.w-recruitment__status {
display: inline-block;
font-size: 0.75rem;
}
}
// Widget-11
.widget-recruitment-11 {
.w-recruitment__item {
margin-bottom: 0.8em;
padding-bottom: 0.8em;
border-bottom: 0.0625em dashed lighten($theme-gray, 65%);
}
.w-recruitment__entry-title {
margin: 0;
}
.w-recruitment__postdate-wrap {
font-size: 0.8125em;
}
.w-recruitment__status {
display: inline-block;
font-size: 0.75rem;
}
}
// Widget-12
// ## Table
.widget-recruitment-12 {
.w-recruitment__th {
color: #fff;
background: $theme-color-main;
font-size: 0.8125em;
border: none;
}
.w-recruitment__status {
display: inline-block;
font-size: 0.75rem;
}
td {
font-size: 0.8125em;
}
a:hover {
text-decoration: none;
}
}
// Widget-13
// ## Table
.widget-recruitment-13 {
.w-recruitment__th {
color: #fff;
background: $theme-color-main;
font-size: 0.8125em;
border: none;
}
.w-recruitment__status {
display: inline-block;
font-size: 0.75rem;
}
td {
font-size: 0.8125em;
}
a:hover {
text-decoration: none;
}
}
// Widget-14
.widget-recruitment-14 {
.w-recruitment__list {
padding: 0 0.9375em;
}
.w-recruitment__img-wrap {
height: 18.75em;
margin-bottom: 0.9375em;
@media (min-width: $screen-md) {
height: 12.5em;
margin-bottom: 0;
}
}
.w-recruitment__item {
margin-bottom: 0.8em;
padding-bottom: 0.8em;
border-bottom: 0.0625em dashed lighten($theme-gray, 65%);
}
.w-recruitment__entry-title {
margin: 0 0 0.625em 0;
@media (min-width: $screen-md) {
margin-bottom: 0;
}
}
.w-recruitment__postdate-wrap {
font-size: 0.8125em;
}
.w-recruitment__status {
display: inline-block;
}
.w-recruitment__postdate {
font-size: 0.8125rem;
}
}
// Recruitment index
// ## General style for index pages
.i-recruitment {
.i-recruitment__page-title {
@extend .unity-title;
}
.i-recruitment__list {
margin: 0;
padding: 0;
list-style: none;
}
.i-recruitment__widget-title {
@extend .unity-title;
}
.i-recruitment__item {
margin-bottom: 1.875em;
}
.i-recruitment__img {
width: 100%;
max-width: 100%;
height: auto;
}
.i-recruitment__th {
color: $theme-white;
background: $theme-color-main;
font-size: 0.8125em;
border: none;
white-space: nowrap;
}
.i-recruitment__postdate,
.i-recruitment__category,
.i-recruitment__view-count {
white-space: nowrap;
}
.i-recruitment__status-wrap {
span {
display: inline-block;
padding: .2em .6em .3em;
&:last-child {
margin: 0 0.3125em 0.1875em 0;
display: inline-block;
}
}
}
td {
font-size: 0.8125rem;
}
.i-recruitment__title:hover {
text-decoration: none;
}
.label {
font-size: 0.75rem;
font-weight: normal;
}
.i-recruitment__meta {
.i-recruitment__status-wrap,
.i-recruitment__postdate-wrap,
.i-recruitment__category-wrap {
display: inline-block;
margin-right: 0.2em;
font-size: 0.8125em;
color: $theme-gray;
font-weight: normal;
}
i {
color: $theme-gray;
}
}
.i-recruitment__subtitle {
font-size: 0.8125em;
color: $theme-gray;
}
.i-recruitment__entry-title {
margin-bottom: 0.625em;
}
.i-recruitment__title {
font-family: $sub-font;
color: $theme-color-main;
text-decoration: none;
font-size: 0.8125rem;
&:hover {
color: darken($theme-color-main, 10%);
}
}
}
// Index-1
.index-recruitment-1 {}
// Index-5
// Index-6
.index-recruitment-5,
.index-recruitment-6 {
.i-recruitment__img-wrap {
margin: 0 0 1em;
}
.i-recruitment__title {
font-family: $main-font;
font-size: 1.2rem;
line-height: 1.3;
}
}
// Index-7
.index-recruitment-7 {
.i-recruitment__title {
font-family: $main-font;
line-height: 1.3;
font-size: 1.2rem;
}
.i-recruitment__list > .i-recruitment__item:nth-child(3n+1) {
clear: both;
}
.i-recruitment__img-wrap {
height: 12.5em;
margin: 0 0 1em 0;
}
}
// Index-8
.index-recruitment-8 {
.i-recruitment__title {
font-family: $main-font;
line-height: 1.3;
font-size: 1.2rem;
}
.i-recruitment__item {
border-bottom: 0.0625em dashed lighten($theme-gray, 65%);
padding-bottom: 1em;
margin-bottom: 1em;
}
}
// Index-9
// Index-10
.index-recruitment-9,
.index-recruitment-10 {
.i-recruitment__item {
margin-bottom: 0.8em;
padding-bottom: 0.8em;
border-bottom: 0.0625em dashed lighten($theme-gray, 65%);
}
.i-recruitment__entry-title {
margin: 0;
}
.i-recruitment__category-wrap,
.i-recruitment__status,
.i-recruitment__title,
.i-recruitment__postdate-wrap {
font-size: 0.8125rem;
}
.i-recruitment__status {
display: inline-block;
}
}
// Index-11
// Index-12
.index-recruitment-11,
.index-recruitment-12 {
.i-recruitment__item {
margin-bottom: 0.8em;
padding-bottom: 0.8em;
border-bottom: 0.0625em dashed lighten($theme-gray, 65%);
}
.i-recruitment__entry-title {
margin: 0;
}
.i-recruitment__postdate-wrap {
font-size: 0.8125em;
}
.i-recruitment__status {
display: inline-block;
font-size: 0.75rem;
}
}
// Index-16
.index-recruitment-16 {
td ul {
margin: 0;
padding: 0;
list-style: none;
}
}
// Recruitment show
.s-recruitment {
.s-recruitment__show-title {
@extend .unity-title;
}
.s-recruitment__meta-wrap {
border-bottom: 0.0625em solid $theme-gray-light;
@include clearfix;
.s-recruitment__meta--item {
font-size: 0.875rem;
margin-right: 1em;
margin-bottom: 0.6em;
float: left;
i {
color: darken($theme-gray-light, 10%);
}
}
.s-recruitment__tag-wrap {
position: relative;
margin-right: 0;
padding-left: 1.6em;
clear: both;
float: none;
i {
position: absolute;
top: 0.4375em;
left: 0;
}
}
.s-recruitment__tag-wrap {
.s-recruitment__tag {
font-weight: normal;
}
}
}
.s-recruitment__post-wrap {
@include clearfix;
margin-bottom: 2em;
}
.s-recruitment__related-wrap {
padding-top: 1em;
border-top: 0.0625em dotted $theme-gray-light;
}
.s-recruitment__related-file {
margin-bottom: 0.9375em;
}
.s-recruitment__related-file,
.s-recruitment__related-link {
padding-bottom: 0.375em;
padding-left: 1.6em;
i {
margin: 0.5em 0 0 -1.6em;
float: left;
color: darken($theme-gray-light, 10%);
}
}
.s-recruitment__related-link-list,
.s-recruitment__related-file-list {
display: inline-block;
}
.s-recruitment__flie-title {
max-width: 9.375rem;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.s-recruitment__social > * {
display: inline-block;
vertical-align: top;
}
.s-recruitment__social .print-button {
color: #fff;
font-size: 0.688em;
border-radius: 0.25em;
padding: 0.125em 0.375em;
background-color: $theme-color-main;
}
.s-recruitment__social .print-button:hover {
background-color: lighten($theme-color-main, 10%);
}
}

View File

@ -679,19 +679,19 @@ class RecruitmentModsController < ApplicationController
subtitle_ann = recruitment.subtitle if recruitment.display_subtitle?
img_src = (recruitment.image.thumb.url || DefaultImgSrc) if recruitment.display_img?
img_description = recruitment.image_description if (recruitment.image_description.present?) && (recruitment.display_img?)
event_carousel_images = recruitment.event_carousel_images.map{|image| {"src"=>image.file.url,"description"=>image.description.to_s,"description_text"=>image.description_text }}
recruitment_carousel_images = recruitment.recruitment_carousel_images.map{|image| {"src"=>image.file.url,"description"=>image.description.to_s,"description_text"=>image.description_text }}
resume_btn_title = (I18n.locale.to_s =="zh_tw") ? "繼續播放" : "resume"
pause_btn_title = (I18n.locale.to_s =="zh_tw") ? "暫停播放" : "pause"
prev_btn_title = (I18n.locale.to_s =="zh_tw") ? "上一張" : "prev"
next_btn_title = (I18n.locale.to_s =="zh_tw") ? "下一張" : "next"
carousel_data = {
"event_carousel_images" => event_carousel_images,
"recruitment_carousel_images" => recruitment_carousel_images,
"resume_btn_title" => resume_btn_title,
"pause_btn_title" => pause_btn_title,
"prev_btn_title" => prev_btn_title,
"next_btn_title" => next_btn_title,
"carousel_display_style" => (event_carousel_images.count == 0 ? 'display: none' : "width: #{recruitment.carousel_image_width};margin: auto;"),
"carousel_count" => event_carousel_images.count}
"carousel_display_style" => (recruitment_carousel_images.count == 0 ? 'display: none' : "width: #{recruitment.carousel_image_width};margin: auto;"),
"carousel_count" => recruitment_carousel_images.count}
carousel_html = ""
if carousel_data["carousel_count"] != 0
carousel_image_type = recruitment.carousel_image_type
@ -754,8 +754,8 @@ class RecruitmentModsController < ApplicationController
"pause_btn_title" => pause_btn_title,
"prev_btn_title" => prev_btn_title,
"next_btn_title" => next_btn_title,
"carousel_display_style" => (event_carousel_images.count == 0 ? 'display: none' : "width: #{recruitment.carousel_image_width};margin: auto;"),
"carousel_count" => event_carousel_images.count,
"carousel_display_style" => (recruitment_carousel_images.count == 0 ? 'display: none' : "width: #{recruitment.carousel_image_width};margin: auto;"),
"carousel_count" => recruitment_carousel_images.count,
"place_text" => (recruitment.place.blank? ? "" : "#{RecruitmentCustomTitle.get_trans("place")}: #{recruitment.place}"),
"place-css" => (recruitment.place.blank? ? "display: none;" : ""),
"carousel_html" => carousel_html,
@ -826,19 +826,19 @@ class RecruitmentModsController < ApplicationController
event_date = DateTime.parse(recruitment["event_date"].to_s) rescue nil
event_end_date = DateTime.parse(recruitment["event_end_date"].to_s) rescue nil
event_time = RecruitmentSetting.event_time_formated_for_frontend(event_date, event_end_date)
event_carousel_images = Array(recruitment["event_carousel_images"])
recruitment_carousel_images = Array(recruitment["recruitment_carousel_images"])
resume_btn_title = (I18n.locale.to_s =="zh_tw") ? "繼續播放" : "resume"
pause_btn_title = (I18n.locale.to_s =="zh_tw") ? "暫停播放" : "pause"
prev_btn_title = (I18n.locale.to_s =="zh_tw") ? "上一張" : "prev"
next_btn_title = (I18n.locale.to_s =="zh_tw") ? "下一張" : "next"
carousel_data = {
"event_carousel_images" => event_carousel_images,
"recruitment_carousel_images" => recruitment_carousel_images,
"resume_btn_title" => resume_btn_title,
"pause_btn_title" => pause_btn_title,
"prev_btn_title" => prev_btn_title,
"next_btn_title" => next_btn_title,
"carousel_display_style" => (event_carousel_images.count == 0 ? 'display: none' : "width: #{RecruitmentSetting.last.carousel_image_width};margin: auto;"),
"carousel_count" => event_carousel_images.count}
"carousel_display_style" => (recruitment_carousel_images.count == 0 ? 'display: none' : "width: #{RecruitmentSetting.last.carousel_image_width};margin: auto;"),
"carousel_count" => recruitment_carousel_images.count}
carousel_html = ""
if carousel_data["carousel_count"] != 0
carousel_image_type = recruitment["carousel_image_type"].to_i
@ -871,8 +871,8 @@ class RecruitmentModsController < ApplicationController
"pause_btn_title" => pause_btn_title,
"prev_btn_title" => prev_btn_title,
"next_btn_title" => next_btn_title,
"carousel_display_style" => (event_carousel_images.count == 0 ? 'display: none' : "width: #{RecruitmentSetting.last.carousel_image_width};margin: auto;"),
"carousel_count" => event_carousel_images.count,
"carousel_display_style" => (recruitment_carousel_images.count == 0 ? 'display: none' : "width: #{RecruitmentSetting.last.carousel_image_width};margin: auto;"),
"carousel_count" => recruitment_carousel_images.count,
"place_text" => (recruitment["place"].blank? ? "" : "#{I18n.t("recruitment.place")}: #{recruitment["place"]}"),
"place-css" => (recruitment["place"].blank? ? "display: none;" : ""),
"carousel_html" => carousel_html

View File

@ -155,20 +155,6 @@ module Admin::RecruitmentHelper
value["zh_tw"] = val
anns.title_translations = value.clone
value = {}
when 13
value["en"] = val
anns.speaker_translations = value.clone
when 14
value["zh_tw"] = val
anns.speaker_translations = value.clone
value = {}
when 15
value["en"] = val
anns.host_translations = value.clone
when 16
value["zh_tw"] = val
anns.host_translations = value.clone
value = {}
when 17
value["en"] = val
anns.subtitle_translations = value.clone
@ -191,9 +177,51 @@ module Admin::RecruitmentHelper
anns.notes_translations = value.clone
value = {}
when 23
value["en"] = val
anns.education_requirement_translations = value.clone
when 24
value["zh_tw"] = val
anns.education_requirement_translations = value.clone
value = {}
when 25
value["en"] = val
anns.experience_requirement_translations = value.clone
when 26
value["zh_tw"] = val
anns.experience_requirement_translations = value.clone
value = {}
when 27
value["en"] = val
anns.skills_requirement_translations = value.clone
when 28
value["zh_tw"] = val
anns.skills_requirement_translations = value.clone
value = {}
when 29
value["en"] = val
anns.language_translations = value.clone
when 30
value["zh_tw"] = val
anns.language_translations = value.clone
value = {}
when 31
value["en"] = val
anns.salary_info_translations = value.clone
when 32
value["zh_tw"] = val
anns.salary_info_translations = value.clone
value = {}
when 33
value["en"] = val
anns.contact_info_translations = value.clone
when 34
value["zh_tw"] = val
anns.contact_info_translations = value.clone
value = {}
when 35
links = val.split(";") rescue []
desc_en = row.cells[24].value.split(";") rescue []
desc_zh_tw = row.cells[25].value.split(";") rescue []
desc_en = row.cells[36].value.split(";") rescue []
desc_zh_tw = row.cells[37].value.split(";") rescue []
links.each_with_index do |link,i|
bl = RecruitmentLink.new
bl.url = link.strip
@ -201,12 +229,12 @@ module Admin::RecruitmentHelper
bl.recruitment_id = anns.id
bl.save
end
when 26
when 38
files = val.split(";") rescue []
desc_en = row.cells[27].value.split(";") rescue []
desc_zh_tw = row.cells[28].value.split(";") rescue []
alt_en = row.cells[29].value.split(";") rescue []
alt_zh_tw = row.cells[30].value.split(";") rescue []
desc_en = row.cells[39].value.split(";") rescue []
desc_zh_tw = row.cells[40].value.split(";") rescue []
alt_en = row.cells[41].value.split(";") rescue []
alt_zh_tw = row.cells[42].value.split(";") rescue []
files.each_with_index do |file, i|
bf = RecruitmentFile.new
bf.remote_file_url = file.strip rescue nil
@ -229,7 +257,7 @@ module Admin::RecruitmentHelper
desc_en = row.cells[35].value.split(";") rescue []
desc_zh_tw = row.cells[36].value.split(";") rescue []
carousel_images.each_with_index do |image, i|
bc = EventCarouselImage.new
bc = RecruitmentCarouselImage.new
bc.remote_file_url = image.strip rescue nil
bc.description_translations = {"en" => (desc_en[i] rescue ""), "zh_tw" => (desc_zh_tw[i] rescue "")}
bc.recruitment_id = anns.id

View File

@ -511,11 +511,11 @@ module RecruitmentHelper
end
layout_types
end
def render_ad_banner(event_carousel_images,data)
def render_ad_banner(recruitment_carousel_images,data)
("<div class=\"carousel_images\">
<div class=\"w-ba-banner ba-banner-widget-1\">
<div class=\"w-ba-banner__wrap cycle-slideshow\"
data-list=\"event_carousel_images\"
data-list=\"recruitment_carousel_images\"
data-level=\"0\"
data-cycle-slides=\".event_carousel_slide\"
data-cycle-log=\"false\"
@ -527,7 +527,7 @@ module RecruitmentHelper
data-cycle-swipe=true
data-cycle-swipe-fx=\"scrollHorz\"
>" +
event_carousel_images.collect do |e|
recruitment_carousel_images.collect do |e|
"<div class=\"w-ba-banner__slide event_carousel_slide\"
data-cycle-title=\"#{e['description_text']}\"
>
@ -547,8 +547,8 @@ module RecruitmentHelper
</div>
<div style=\"position: relative;\">
<h4><span class=\"active_slide\">1</span>/#{data['carousel_count']}</h4>
<ul class=\"carousel_images_slide w-annc__list row list-unstyled\" data-level=\"0\" data-list=\"event_carousel_images\">" +
event_carousel_images.collect do |e|
<ul class=\"carousel_images_slide w-annc__list row list-unstyled\" data-level=\"0\" data-list=\"recruitment_carousel_images\">" +
recruitment_carousel_images.collect do |e|
"<li class=\"carousel_img_item col-sm-3\">
<div class=\"carousel_img-wrap\">
<img class=\"carousel_img\" src=\"#{e['src']}\" alt=\"#{e['description_text']}\">

View File

@ -107,10 +107,10 @@ class Recruitment
has_many :recruitment_links, :autosave => true, :dependent => :destroy
has_many :recruitment_files, :autosave => true, :dependent => :destroy
has_many :event_carousel_images, :autosave => true, :dependent => :destroy
has_many :recruitment_carousel_images, class_name: 'RecruitmentCarouselImage', :autosave => true, :dependent => :destroy
accepts_nested_attributes_for :recruitment_files, :allow_destroy => true
accepts_nested_attributes_for :recruitment_links, :allow_destroy => true
accepts_nested_attributes_for :event_carousel_images, :allow_destroy => true
accepts_nested_attributes_for :recruitment_carousel_images, :allow_destroy => true
before_destroy :destroy_email
before_save :calculate_is_event_expired
@ -489,10 +489,13 @@ class Recruitment
a["id"] = self.uid
a["title_translations"] = self.title_translations
a["subtitle_translations"] = self.subtitle_translations
a["speaker_translations"] = self.speaker_translations
a["host_translations"] = self.host_translations
a["place_translations"] = self.place_translations
a["notes_translations"] = self.notes_translations
a["education_requirement_translations"] = self.education_requirement_translations
a["experience_requirement_translations"] = self.experience_requirement_translations
a["skills_requirement_translations"] = self.skills_requirement_translations
a["language_translations"] = self.language_translations
a["salary_info_translations"] = self.salary_info_translations
a["contact_info_translations"] = self.contact_info_translations
a["text_translations"] = {}
text_translations = self.text_translations
text_translations.each do |l, text|
@ -522,7 +525,7 @@ class Recruitment
a["subtitle_ann"] = self.subtitle if self.display_subtitle?
a["recruitment_links"] = []
a["recruitment_files"] = []
a["event_carousel_images"] = self.event_carousel_images.map{|image| {"src"=> base_url + image.file.url,"description"=>image.description.to_s,"description_text"=>image.description_text }}
a["recruitment_carousel_images"] = self.recruitment_carousel_images.map{|image| {"src"=> base_url + image.file.url,"description"=>image.description.to_s,"description_text"=>image.description_text }}
a["external_link"] = self["is_external_link"] ? self.external_link : nil
self.tags.each do |tag|
a["tags"] << {"name_translations" => tag.name_translations}

View File

@ -1,5 +1,5 @@
# encoding: utf-8
class EventCarouselImage
class RecruitmentCarouselImage
include Mongoid::Document
include Mongoid::Timestamps

View File

@ -360,10 +360,10 @@
<%= f.text_field :custom_carousel_image_width, :placeholder => t("recruitment.custom_carousel_image_width_hint") %>
</div>
</div>
<% if (!f.object.event_carousel_images.blank? rescue false) %>
<% if (!f.object.recruitment_carousel_images.blank? rescue false) %>
<div class="exist">
<% f.object.event_carousel_images.each_with_index do |event_carousel_image, i| %>
<%= f.fields_for :event_carousel_images, event_carousel_image do |f| %>
<% f.object.recruitment_carousel_images.each_with_index do |event_carousel_image, i| %>
<%= f.fields_for :recruitment_carousel_images, event_carousel_image do |f| %>
<%= render :partial => 'form_image', :object => event_carousel_image, :locals => {:f => f, :i => i} %>
<% end %>
<% end %>
@ -374,7 +374,7 @@
<div class="add-target">
</div>
<p class="add-btn controls">
<%= hidden_field_tag 'bulletin_carousel_image_count', f.object.event_carousel_images.count %>
<%= hidden_field_tag 'bulletin_carousel_image_count', f.object.recruitment_carousel_images.count %>
<a id="add_carousel_image" class="trigger btn btn-small btn-primary"><i class="icons-plus"></i> <%= t(:add) %></a>
</p>
</div>
@ -711,11 +711,11 @@
});
$(document).on('click', '#add_carousel_image', function(){
var new_id = $(this).prev().attr('value');
var old_id = new RegExp("new_event_carousel_images", "g");
var old_id = new RegExp("new_recruitment_carousel_images", "g");
var on = $('.language-nav li.active').index();
var le = $(this).parent('.add-btn').prev('.add-target').children('.start-line').length;
$(this).prev().attr('value', parseInt(new_id) + 1);
$(this).parent().siblings('.add-target').append(("<%= escape_javascript(add_attribute 'form_image', f, :event_carousel_images) %>").replace(old_id, new_id));
$(this).parent().siblings('.add-target').append(("<%= escape_javascript(add_attribute 'form_image', f, :recruitment_carousel_images) %>").replace(old_id, new_id));
$(this).parent('.add-btn').prev('.add-target').children('.start-line').eq(le).children('.input-append').find('.tab-content').each(function() {
$(this).children('.tab-pane').eq(on).addClass('in active').siblings().removeClass('in active');
});

View File

@ -2,7 +2,7 @@
wb = xlsx_package.workbook
wb.add_worksheet(name: "EventNewsModule") do |sheet|
wb.add_worksheet(name: "RecruitmentModule") do |sheet|
heading = sheet.styles.add_style(:b => true, :locked => true)
example = sheet.styles.add_style(:i => true)
@ -78,20 +78,6 @@ wb.add_worksheet(name: "EventNewsModule") do |sheet|
row1 << "textfield"
row2 << ""
row << t("recruitment.speaker") + " - " + t("en")
row1 << "textfield"
row2 << ""
row << t("recruitment.speaker") + " - " + t("zh_tw")
row1 << "textfield"
row2 << ""
row << t("recruitment.host") + " - " + t("en")
row1 << "textfield"
row2 << ""
row << t("recruitment.host") + " - " + t("zh_tw")
row1 << "textfield"
row2 << ""
row << t("subtitle") + " - " + t("en")
row1 << "textarea"
row2 << ""
@ -113,6 +99,48 @@ wb.add_worksheet(name: "EventNewsModule") do |sheet|
row1 << "editor"
row2 << ""
row << t("recruitment.education_requirement") + " - " + t("en")
row1 << "editor"
row2 << ""
row << t("recruitment.education_requirement") + " - " + t("zh_tw")
row1 << "editor"
row2 << ""
row << t("recruitment.experience_requirement") + " - " + t("en")
row1 << "editor"
row2 << ""
row << t("recruitment.experience_requirement") + " - " + t("zh_tw")
row1 << "editor"
row2 << ""
row << t("recruitment.skills_requirement") + " - " + t("en")
row1 << "editor"
row2 << ""
row << t("recruitment.skills_requirement") + " - " + t("zh_tw")
row1 << "editor"
row2 << ""
row << t("recruitment.language") + " - " + t("en")
row1 << "editor"
row2 << ""
row << t("recruitment.language") + " - " + t("zh_tw")
row1 << "editor"
row2 << ""
row << t("recruitment.salary_info") + " - " + t("en")
row1 << "editor"
row2 << ""
row << t("recruitment.salary_info") + " - " + t("zh_tw")
row1 << "editor"
row2 << ""
row << t("recruitment.contact_info") + " - " + t("en")
row1 << "editor"
row2 << ""
row << t("recruitment.contact_info") + " - " + t("zh_tw")
row1 << "editor"
row2 << ""
row << t("link")
row1 << "textfield"
row2 << "Seperate with ';'. Example: http://rulingcom.com; http://google.com"
@ -142,12 +170,6 @@ wb.add_worksheet(name: "EventNewsModule") do |sheet|
row1 << "textfield"
row2 << "Seperate with ';' with respective to the links in the link columns. Example : example1; example2"
row << t("recruitment.place") + "-" + t("en")
row1 << "textfield"
row2 << ""
row << t("recruitment.place") + "-" + t("zh_tw")
row1 << "textfield"
row2 << ""
row << t("recruitment.event_end_date")
row1 << "datetime"
row2 << "Format: YYYY/MM/DD HH:mm, Example: 2015/12/10 15:20"

View File

@ -2,7 +2,7 @@
wb = xlsx_package.workbook
wb.add_worksheet(name: "EventNewsModule") do |sheet|
wb.add_worksheet(name: "RecruitmentModule") do |sheet|
heading = sheet.styles.add_style(:b => true, :locked => true)
example = sheet.styles.add_style(:i => true)
@ -12,31 +12,31 @@ wb.add_worksheet(name: "EventNewsModule") do |sheet|
row << t("category")
row1 << "select"
t = ""
tags_str = ""
categories = @module_app.categories.asc(:created_at)
categories.each_with_index do |cat,i|
t = t + "#{i}" + " -> " + cat.title + ", "
tags_str = tags_str + "#{i}" + " -> " + cat.title + ", "
end
if categories.count > 0
t = t + " Example : 0"
tags_str = tags_str + " Example : 0"
else
t = "Leave this field blank"
tags_str = "Leave this field blank"
end
row2 << t
row2 << tags_str
row << t("tags")
row1 << "select"
t = ""
tags_str2 = ""
tags = @module_app.tags.asc(:created_at)
tags.each_with_index do |tag,i|
t = t + "#{i}" + " -> " + tag.name + ", "
tags_str2 = tags_str2 + "#{i}" + " -> " + tag.name + ", "
end
if tags.count > 0
t = t + " Example : 0,1,2"
tags_str2 = tags_str2 + " Example : 0,1,2"
else
t = "Leave this field blank"
tags_str2 = "Leave this field blank"
end
row2 << t
row2 << tags_str2
row << t("recruitment.event_date")
row1 << "datetime"
@ -80,17 +80,13 @@ wb.add_worksheet(name: "EventNewsModule") do |sheet|
row1 << "textfield"
row2 << ""
row << t("recruitment.speaker") + " - " + t("en")
row1 << "textfield"
row2 << ""
row << t("recruitment.speaker") + " - " + t("zh_tw")
row1 << "textfield"
row2 << ""
row << t("recruitment.host") + " - " + t("en")
row1 << "textfield"
row2 << ""
row << t("recruitment.host") + " - " + t("zh_tw")
row1 << "textfield"
row2 << ""
@ -115,6 +111,48 @@ wb.add_worksheet(name: "EventNewsModule") do |sheet|
row1 << "editor"
row2 << ""
row << t("recruitment.education_requirement") + " - " + t("en")
row1 << "editor"
row2 << ""
row << t("recruitment.education_requirement") + " - " + t("zh_tw")
row1 << "editor"
row2 << ""
row << t("recruitment.experience_requirement") + " - " + t("en")
row1 << "editor"
row2 << ""
row << t("recruitment.experience_requirement") + " - " + t("zh_tw")
row1 << "editor"
row2 << ""
row << t("recruitment.skills_requirement") + " - " + t("en")
row1 << "editor"
row2 << ""
row << t("recruitment.skills_requirement") + " - " + t("zh_tw")
row1 << "editor"
row2 << ""
row << t("recruitment.language") + " - " + t("en")
row1 << "editor"
row2 << ""
row << t("recruitment.language") + " - " + t("zh_tw")
row1 << "editor"
row2 << ""
row << t("recruitment.salary_info") + " - " + t("en")
row1 << "editor"
row2 << ""
row << t("recruitment.salary_info") + " - " + t("zh_tw")
row1 << "editor"
row2 << ""
row << t("recruitment.contact_info") + " - " + t("en")
row1 << "editor"
row2 << ""
row << t("recruitment.contact_info") + " - " + t("zh_tw")
row1 << "editor"
row2 << ""
row << t("link")
row1 << "textfield"
row2 << "Seperate with ';'. Example: http://rulingcom.com; http://google.com"
@ -144,12 +182,6 @@ wb.add_worksheet(name: "EventNewsModule") do |sheet|
row1 << "textfield"
row2 << "Seperate with ';' with respective to the links in the link columns. Example : example1; example2"
row << t("recruitment.place") + "-" + t("en")
row1 << "textfield"
row2 << ""
row << t("recruitment.place") + "-" + t("zh_tw")
row1 << "textfield"
row2 << ""
row << t("recruitment.event_end_date")
row1 << "datetime"
row2 << "Format: YYYY/MM/DD HH:mm, Example: 2015/12/10 15:20"
@ -186,21 +218,29 @@ wb.add_worksheet(name: "EventNewsModule") do |sheet|
row << (anns.is_top? ? 1 : 0)
row << (anns.is_hot? ? 1 : 0)
row << (anns.is_hidden? ? 1 : 0)
row << ("http://" + request.host_with_port + anns.image.url rescue "")
row << (anns.image.try(:url) || "")
row << anns.image_description_translations["en"]
row << anns.image_description_translations["zh_tw"]
row << anns.title_translations["en"]
row << anns.title_translations["zh_tw"]
row << anns.speaker_translations["en"]
row << anns.speaker_translations["zh_tw"]
row << anns.host_translations["en"]
row << anns.host_translations["zh_tw"]
row << anns.subtitle_translations["en"]
row << anns.subtitle_translations["zh_tw"]
row << anns.text_translations["en"]
row << anns.text_translations["zh_tw"]
row << anns.notes_translations["en"]
row << anns.notes_translations["zh_tw"]
row << (anns.education_requirement_translations["en"] rescue "")
row << (anns.education_requirement_translations["zh_tw"] rescue "")
row << (anns.experience_requirement_translations["en"] rescue "")
row << (anns.experience_requirement_translations["zh_tw"] rescue "")
row << (anns.skills_requirement_translations["en"] rescue "")
row << (anns.skills_requirement_translations["zh_tw"] rescue "")
row << (anns.language_translations["en"] rescue "")
row << (anns.language_translations["zh_tw"] rescue "")
row << (anns.salary_info_translations["en"] rescue "")
row << (anns.salary_info_translations["zh_tw"] rescue "")
row << (anns.contact_info_translations["en"] rescue "")
row << (anns.contact_info_translations["zh_tw"] rescue "")
links = anns.recruitment_links.asc(:created_at)
t = links.collect{|l|l.url}
@ -211,9 +251,9 @@ wb.add_worksheet(name: "EventNewsModule") do |sheet|
row << t.join(";")
files = anns.recruitment_files.asc(:created_at)
t = files.collect{|f|("http://" + request.host_with_port + f.file.url rescue nil)}
t.delete(nil)
row << t.join(";")
file_urls = files.collect{|l|l.url}
file_urls.delete(nil)
row << file_urls.join(";")
t = files.collect{|l|l.description_translations["en"]}
row << t.join(";")
t = files.collect{|l|l.description_translations["zh_tw"]}
@ -222,14 +262,11 @@ wb.add_worksheet(name: "EventNewsModule") do |sheet|
row << t.join(";")
t = files.collect{|l|l.title_translations["zh_tw"]}
row << t.join(";")
row << anns.place_translations["en"]
row << anns.place_translations["zh_tw"]
row << (anns.event_end_date.strftime("%Y/%m/%d %H:%M") rescue "")
carousel_images = anns.event_carousel_images.asc(:created_at)
t = carousel_images.collect{|f|("http://" + request.host_with_port + f.file.url rescue nil)}
t.delete(nil)
carousel_images = anns.recruitment_carousel_images.asc(:created_at)
t = carousel_images.collect{|l|l.image.try(:url)}
row << t.join(";")
t = carousel_images.collect{|l|l.description_translations["en"]}
row << t.join(";")

View File

@ -0,0 +1,3 @@
<h3>Hello <%= @data["name"] %>,</h3>
<p><%= @data["submitter"] %> <%= t("recruitment.updated_annoucement") %>
<a href="<%= @data['url'] %>" ><%= t("recruitment.click_here_to_see") %></a>

View File

@ -0,0 +1 @@
<%= @data["html"].html_safe %>

View File

@ -24,7 +24,7 @@
data-cycle-swipe=true
data-cycle-swipe-fx="scrollHorz"
>
<%data["event_carousel_images"].each do |event_carousel_image|%>
<%data["recruitment_carousel_images"].each do |event_carousel_image|%>
<div class="w-ba-banner__slide event_carousel_slide"
data-cycle-title="<%=event_carousel_image["description_text"]%>"
>
@ -45,7 +45,7 @@
<div style="position: relative;">
<h4><span class="active_slide">1</span>/<%=data["carousel_count"]%></h4>
<ul class="carousel_images_slide w-annc__list row list-unstyled">
<%data["event_carousel_images"].each do |event_carousel_image|%>
<%data["recruitment_carousel_images"].each do |event_carousel_image|%>
<li class="carousel_img_item col-sm-3">
<div class="carousel_img-wrap">
<img class="carousel_img" src="<%=event_carousel_image["src"]%>" alt="<%=event_carousel_image["description_text"]%>">

View File

@ -4,7 +4,7 @@
}
</style>
<div class="carousel_images">
<%data["event_carousel_images"].each do |event_carousel_image|%>
<%data["recruitment_carousel_images"].each do |event_carousel_image|%>
<div class="carousel_image col-sm-6">
<a href="<%=event_carousel_image["src"]%>" title="<%=event_carousel_image["description_text"]%>"><img src="<%=event_carousel_image["src"]%>" alt="<%=event_carousel_image["description_text"]%>"></a>
<p><strong class="carousel__description"><%=event_carousel_image["description"]%></strong></p>

View File

@ -16,8 +16,8 @@ en:
manual_update_sort: Manually Update Sort
category: Category
title: Title
event_date_setting: "Event date setting"
event_date_use_default_setting: "Use default event date setting"
recruitment_date_setting: "Event date setting"
recruitment_date_use_default_setting: "Use default event date setting"
including_day_of_the_week: "Including day of the week"
including_time: "Including time"
hour_clock_24: "24 hour clock"
@ -55,8 +55,8 @@ en:
text: Job Description
unit: Unit
employer: Employer
event_date: Event Date
event_end_date: Event End Date
recruitment_date: Event Date
recruitment_end_date: Event End Date
start_date: Start date
end_date: End date
add_to_calendar: Add to calendar

View File

@ -16,8 +16,8 @@ zh_tw:
manual_update_sort: 手動更新排序
category: 類別
title: 標題
event_date_setting: "事件日期設定"
event_date_use_default_setting: "使用預設的事件日期設定"
recruitment_date_setting: "事件日期設定"
recruitment_date_use_default_setting: "使用預設的事件日期設定"
including_day_of_the_week: "包含星期幾"
including_time: "包含時間"
hour_clock_24: "24小時制"
@ -55,8 +55,8 @@ zh_tw:
text: 工作內容
unit: 公告單位
employer: 徵求單位
event_date: 事件日期
event_end_date: 事件結束日期
recruitment_date: 事件日期
recruitment_end_date: 事件結束日期
start_date: 公告日期
end_date: 截止日期
add_to_calendar: 加入行事曆

View File

@ -0,0 +1,8 @@
desc 'Remove duplicated EventNews created by preview'
namespace :recruitment do
task :remove_preview_recruitment => [:environment] do
recruitment = EventNews.where(is_preview: true)
recruitment.destroy_all
end
end

View File

@ -6,7 +6,6 @@ require "recruitment_mod/version"
require "json"
bundle_update_flag = ARGV[0]=='update' || ARGV[0]=='install'
if bundle_update_flag
require File.expand_path("../update_recruitment", __FILE__)
env_pwd = ENV['PWD']
begin
require ::File.expand_path('app/helpers/bundler_helper.rb', env_pwd)
@ -40,7 +39,6 @@ if bundle_update_flag
info_json_file = "#{folder}modules/recruitment_mod/info.json"
if File.exist?(info_json_file)
bundler_with_clean_env{system ('cp -f '+ app_path + '/modules/recruitment_mod/show.html.erb ' + "#{folder}modules/recruitment_mod/.")}
update_recruitment_template(folder)
begin
file_text = File.read(info_json_file) rescue ""
encode_file_text = file_text.encode("UTF-8", "UTF-8", invalid: :replace, replace: "???")