solved conflict for member_new_ui

This commit is contained in:
Spen 2013-08-09 15:07:05 +08:00 committed by saurabhbhatia
parent 9c7558847a
commit 6c514770bc
92 changed files with 3207 additions and 2105 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -449,9 +449,15 @@ if($.support.touch) {
}) })
if($sidebarState) { if($sidebarState) {
if(!$('.sidebar-nav').hasClass('no-sub-nav')) { if(!$('.sidebar-nav').hasClass('no-sub-nav')) {
$('.bottomnav').css({ if($('#basic-info').length) {
'left': 261, $('.bottomnav').css({
}); 'left': 631,
});
} else {
$('.bottomnav').css({
'left': 261,
});
}
} }
} }
} }
@ -559,8 +565,7 @@ $(function() {
if($('#sidebar').length) { if($('#sidebar').length) {
if(!/MSIE 8.0/g.test(navigator.userAgent)){ if(!/MSIE 8.0/g.test(navigator.userAgent)){
document.getElementById('sidebar').addEventListener('touchmove', function (e) { e.preventDefault(); }, false); document.getElementById('sidebar').addEventListener('touchmove', function (e) { e.preventDefault(); }, false);
} };
// demo_fu1();
} }
if($('#pageslide').length) { if($('#pageslide').length) {
openSlide(); openSlide();

View File

@ -709,7 +709,6 @@
clear: function(e) { clear: function(e) {
if (this.isInput) this.$element.val(null); if (this.isInput) this.$element.val(null);
else this.$element.find('input').val(null); else this.$element.find('input').val(null);
this.notifyChange();
}, },
showMode: function(dir) { showMode: function(dir) {

View File

@ -1,17 +1,17 @@
!function ($) { !function ($) {
$.fn.datetimepick = function() { $.fn.datetimepick = function() {
var $this = this, var $this = this,
$format = $this.attr('data-date-format'), $data = $this.data();
$language = $this.attr('data-language'), $this.datetimepicker({
$pickTime = ("ture" === $this.attr('data-picktime')); format: $data.dateFormat,
$this.datetimepicker({ pickTime: $data.picktime,
format: $format, language: $data.language,
pickTime: $pickTime, });
language: $language,
});
} }
}(window.jQuery); }(window.jQuery);
$(function(){ $(function(){
$('.datetimepick').datetimepick(); $('.datetimepick').each(function() {
$(this).datetimepick();
});
}); });

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,147 @@
(function( $ ) {
$.fn.muImageResize = function( params ) {
var _defaultSettings = {
width:300,
height:300,
wrap_fix:true // Let image display like in-line.
};
var _set = $.extend(_defaultSettings, params);
// var isIE7 = $.browser.msie && (7 == ~~ $.browser.version);
//var anyDynamicSource = $(this).attr("src");
//$(this).attr("src",anyDynamicSource+ "?" + new Date().getTime());
// Just bind load event once per element.
return this.one('load', function() {
// Remove all attributes and CSS rules.
this.removeAttribute( "width" );
this.removeAttribute( "height" );
this.style.width = this.style.height = "";
var ow, oh;
//[workaround] - msie need get width early
if (/MSIE/g.test($ua))
{
// Get original size for calcutation.
ow = this.width;
oh = this.height;
}
if (_set.wrap_fix) {
$(this).wrap(function(){
return '<div style="width:'+_set.width+'px; height:'+_set.height+'px; display:inline-block;" />';
});
}
if (!/MSIE/g.test($ua))
{
// Get original size for calcutation.
ow = this.width;
oh = this.height;
}
// if cannot get width or height.
if (0==ow || 0==oh){
$(this).width(_set.width);
$(this).height(_set.height);
}else{
// Merge position settings
var sh_margin_type='';
// if original image's width > height.
if (ow > oh) {
p = oh / _set.height;
oh = _set.height;
ow = ow / p;
// original image width smaller than settings.
if (ow < _set.width){
// need to resize again,
// because new image size range must can cover settings' range, than we can crop it correctly.
p = ow / _set.width;
ow = _set.width;
oh = oh / p;
// the crop range would be in the center of new image size.
sh = (oh-_set.height)/2;
t=sh+'px';
r=_set.width+'px';
b=(_set.height+sh)+'px';
l='0px';
// need to be adjust top position latter.
sh_margin_type = 'margin-top';
// original image width bigger than settings.
}else{
// new image range can cover settings' range.
sh = (ow-_set.width)/2;
t='0px';
r=(_set.width+sh)+'px';
b=_set.height+'px';
l=sh+'px';
// need to be adjust left position latter.
sh_margin_type = 'margin-left';
}
// ref above, change width to height then do same things.
}else{
p = ow / _set.width;
ow = _set.width;
oh = oh / p;
if (oh < _set.height) {
p = oh / _set.height;
oh = _set.height;
ow = ow / p;
sh = (ow-_set.width)/2;
t='0px';
r=(_set.width+sh)+'px';
b=_set.height+'px';
l=sh+'px';
sh_margin_type = 'margin-left';
}else{
sh = (oh-_set.height)/2;
t=sh+'px';
r=_set.width+'px';
b=(_set.height+sh)+'px';
l='0px';
sh_margin_type = 'margin-top';
}
}
// Resize img.
$(this).width(ow);
$(this).height(oh);
// Crop img by set clip style.
$(this).css('clip','rect('+t+' '+r+' '+b+' '+l+')');
var osh = 0;
if('auto' != $(this).css(sh_margin_type)){
osh = parseInt($(this).css(sh_margin_type));
}
if (0 < sh) {sh*=-1;}
sh += osh;
$(this).css(sh_margin_type, sh+'px');
// $(this).css('position','absolute');
}
$(this).fadeIn('slow');
})
.one( "error", function() {
//$(this).hide();
})
.each(function() {
$(this).hide();
// Trigger load event (for Gecko and MSIE)
if ( this.complete || /MSIE/g.test($ua) ) {
$( this ).trigger( "load" ).trigger( "error" );
}
});
};
})( jQuery );

View File

@ -136,9 +136,8 @@
}); });
} }
} }
console.log("ff")
$pageName = $self.closest('.item-menu').siblings('a').text(); $pageName = $self.parents('.item-title').children('a').text();
$('.page-name').text($pageName); $('.page-name').text($pageName);
} else if($('.tags-groups').length) { } else if($('.tags-groups').length) {
$(this).parents('li').addClass("active").siblings().removeClass("active").parent('ul').siblings().children('li').removeClass("active"); $(this).parents('li').addClass("active").siblings().removeClass("active").parent('ul').siblings().children('li').removeClass("active");

File diff suppressed because one or more lines are too long

View File

@ -35,7 +35,7 @@ $(function() {
checkHeight(); checkHeight();
$(window).resize(function() { $(window).resize(function() {
checkHeight(); checkHeight();
setModuleBlockWidth(); // setModuleBlockWidth();
}); });
$('#member-roles h4 > span').each(function() { $('#member-roles h4 > span').each(function() {
$(this).css('margin-left',function() { $(this).css('margin-left',function() {
@ -48,8 +48,8 @@ $(function() {
$('#module-navbar').scrollToFixed({ $('#module-navbar').scrollToFixed({
marginTop: $('#orbit-bar').outerHeight(true), marginTop: $('#orbit-bar').outerHeight(true),
}); });
$('.member-avatar').imagesLoaded(function() { // $('.member-avatar').imagesLoaded(function() {
$('#basic-info .member-avatar img').muImageResize({width: 100, height:100}); // $('#basic-info .member-avatar img').muImageResize({width: 100, height:100});
}); // });
$('#member-roles').nanoScroller({ scrollTop: 0, iOSNativeScrolling: true }); $('#member-roles').nanoScroller({ scrollTop: 0, iOSNativeScrolling: true });
}) })

View File

@ -68,7 +68,7 @@ function temporary() {
// Determine the Append input length // Determine the Append input length
function inputAppendLength() { function inputAppendLength() {
$('.add-target').each(function(i) { $('.add-target').each(function(i) {
if($(this).children('.input-append:not(:hidden)').length == 1) { if($(this).children('.input-append:not(:hidden)').length == 1 || $(this).children('.input-append').length == 1) {
$(this).children('.input-append').each(function() { $(this).children('.input-append').each(function() {
if($(this).children('div').hasClass('tab-content')) { if($(this).children('div').hasClass('tab-content')) {
var btnLength = $(this).children('.btn').length; var btnLength = $(this).children('.btn').length;
@ -96,7 +96,7 @@ function inputAppendLength() {
// Role Attribute Template Data // Role Attribute Template Data
function setData(l, type, ol) { function setData(l, type, ol) {
var fields = "role[attribute_fields]", var fields = $('#info').length ? "info[attribute_fields]" : $('#sub_role').length ? "sub_role[attribute_fields]" : "role[attribute_fields]",
data = { data = {
_add_more: ["add_more_" +l, fields+"["+l+"]["+type+"][add_more]"], _add_more: ["add_more_" +l, fields+"["+l+"]["+type+"][add_more]"],
_calendar: ["calendar_" +l, fields+"["+l+"]["+type+"][calendar]"], _calendar: ["calendar_" +l, fields+"["+l+"]["+type+"][calendar]"],
@ -122,7 +122,7 @@ function getAddressForm(trigger, element, decide) {
addressVal.length = addressArray.length = 0; addressVal.length = addressArray.length = 0;
var addressAllVal = []; var addressAllVal = [];
var inputNameArray = []; var inputNameArray = [];
trigger.parents('.input-append').find('.tab-pane').each(function() { trigger.closest('.input-append').find('.tab-pane').each(function() {
var adderssText = $(this).children('input[type="text"]').val(), var adderssText = $(this).children('input[type="text"]').val(),
addersshidden = '', addersshidden = '',
addressData = {}, addressData = {},
@ -210,7 +210,7 @@ $(function() {
$('.control-group').delegate('.btn[data-toggle="modal"]', 'click', function() { $('.control-group').delegate('.btn[data-toggle="modal"]', 'click', function() {
var $trigger = $(this); var $trigger = $(this);
addressInputId.length = 0; addressInputId.length = 0;
$(this).parents('.input-append').find('.tab-pane').each(function() { $(this).closest('.input-append').find('.tab-pane').each(function() {
addressInputId.push($(this).attr('id')); addressInputId.push($(this).attr('id'));
}); });
$('#address-field').on('show', getAddressForm($trigger, $('#address-field'), true)); $('#address-field').on('show', getAddressForm($trigger, $('#address-field'), true));
@ -220,14 +220,14 @@ $(function() {
if($(this).hasClass('disabled')) { if($(this).hasClass('disabled')) {
$(this).find('.toggle-check') $(this).find('.toggle-check')
.attr('value', 'false') .attr('value', 'false')
.parents('.attributes') .closest('.attributes')
.removeClass('disabled') .removeClass('disabled')
.find('.attributes-body') .find('.attributes-body')
.fadeIn(300); .fadeIn(300);
} else { } else {
$(this).find('.toggle-check') $(this).find('.toggle-check')
.attr('value', 'true') .attr('value', 'true')
.parents('.attributes') .closest('.attributes')
.addClass('disabled') .addClass('disabled')
.find('.attributes-body') .find('.attributes-body')
.fadeOut(300); .fadeOut(300);
@ -235,19 +235,22 @@ $(function() {
$(this).toggleClass('disabled'); $(this).toggleClass('disabled');
}; };
if($(this).hasClass('remove-input')) { if($(this).hasClass('remove-input')) {
$(this).parents('.input-append').fadeOut(300, function() { $(this).closest('.input-append').fadeOut(300, function() {
$(this).remove();
inputAppendLength(); inputAppendLength();
}); });
}; };
if($(this).hasClass('trigger')) { if($(this).hasClass('trigger')) {
appendIndex = $(this).parents('.controls').find('.input-append').length; appendIndex = $(this).closest('.controls').find('.input-append').length;
nameNumber = $(this).closest('.controls').find('.input-append:eq(0)').find('input').eq(0).attr('name');
nameNumber = nameNumber.match(/[^[\D\]]+(?=])/g)[0];
roleType = $(this).data('roles') roleType = $(this).data('roles')
if($(this).hasClass('textInput')) { if($(this).hasClass('textInput')) {
$("#template-text").tmpl().appendTo($(this).parents('.controls').find('.add-target')); $("#template-text").tmpl().appendTo($(this).closest('.controls').find('.add-target'));
} else if ($(this).hasClass('textLengInput')) { } else if ($(this).hasClass('textLengInput')) {
$("#template-text-language").tmpl().appendTo($(this).parents('.controls').find('.add-target')); $("#template-text-language").tmpl().appendTo($(this).closest('.controls').find('.add-target'));
} else if ($(this).hasClass('address')) { } else if ($(this).hasClass('address')) {
$("#template-address").tmpl().appendTo($(this).parents('.controls').find('.add-target')); $("#template-address").tmpl().appendTo($(this).closest('.controls').find('.add-target'));
} }
inputAppendLength(); inputAppendLength();
}; };
@ -256,7 +259,6 @@ $(function() {
inputAppendLength(); inputAppendLength();
} else { } else {
attributesArray = []; attributesArray = [];
attributesLength = $('#attributes-area .attributes').length;
attributesHeaderLength = null; attributesHeaderLength = null;
templateType = null; templateType = null;
attributeIndex = null; attributeIndex = null;
@ -274,9 +276,9 @@ $(function() {
$('#attributes-area').removeClass('clickHere'); $('#attributes-area').removeClass('clickHere');
}; };
attributesHeaderLength = $('.attributes:not(:hidden)').length+1; attributesHeaderLength = $('.attributes:not(:hidden)').length+1;
attributesLength = $('#attributes-area .attributes').length;
$("#template-attributes").tmpl(setData(attributesLength, templateType, appendIndex)).appendTo( "#attributes-area" ); $("#template-attributes").tmpl(setData(attributesLength, templateType, appendIndex)).appendTo( "#attributes-area" );
$('.toggle-check').togglebox(); $('.toggle-check').togglebox();
attributesLength = $('#attributes-area .attributes').length;
}); });
@ -295,9 +297,9 @@ $(function() {
switch(e) { switch(e) {
case 'text': case 'text':
var val = $(this).val(); var val = $(this).val();
if(!$(this).parents('.field-type').length) { if(!$(this).closest('.field-type').length) {
$data = attributesArray[i][$data]; $data = attributesArray[i][$data];
} else if(!$(this).parents('.add-target').length) { } else if(!$(this).closest('.add-target').length) {
$data = attributesArray[i].select[$data]; $data = attributesArray[i].select[$data];
} else { } else {
appendIndex = $(this).parent('.input-append').index() appendIndex = $(this).parent('.input-append').index()
@ -305,21 +307,21 @@ $(function() {
$data = attributesArray[i].select.option[appendIndex][optionIndex]; $data = attributesArray[i].select.option[appendIndex][optionIndex];
} }
if(val != $data) { if(val != $data) {
$(this).parents('.attributes').find('.reply').removeClass('hide'); $(this).closest('.attributes').find('.reply').removeClass('hide');
} }
break; break;
case 'radio': case 'radio':
var checked = $(this).prop("checked"); var checked = $(this).prop("checked");
$data = attributesArray[i][$data]; $data = attributesArray[i][$data];
if(checked != $data) { if(checked != $data) {
$(this).parents('.attributes').find('.reply').removeClass('hide'); $(this).closest('.attributes').find('.reply').removeClass('hide');
} }
break; break;
case 'checkbox': case 'checkbox':
var checked = $(this).prop("checked"); var checked = $(this).prop("checked");
$data = attributesArray[i].select[$data]; $data = attributesArray[i].select[$data];
if(checked != $data) { if(checked != $data) {
$(this).parents('.attributes').find('.reply').removeClass('hide'); $(this).closest('.attributes').find('.reply').removeClass('hide');
} }
break; break;
case 'select-one': case 'select-one':
@ -329,7 +331,7 @@ $(function() {
ref = $(this).attr('ref'); ref = $(this).attr('ref');
}); });
if(ref != $data) { if(ref != $data) {
$(this).parents('.attributes').find('.reply').removeClass('hide'); $(this).closest('.attributes').find('.reply').removeClass('hide');
} }
break; break;
}; };
@ -378,7 +380,7 @@ $(function() {
if($(this).hasClass('disabled')) { if($(this).hasClass('disabled')) {
$(this).find('.toggle-check') $(this).find('.toggle-check')
.attr('value', 'false') .attr('value', 'false')
.parents('.attributes') .closest('.attributes')
.removeClass('disabled') .removeClass('disabled')
.find('input, select') .find('input, select')
.removeAttr('disabled') .removeAttr('disabled')
@ -386,13 +388,13 @@ $(function() {
.find('.btn-group .btn') .find('.btn-group .btn')
.removeClass('disabled') .removeClass('disabled')
.end().find('.attribute_field_disabled').attr('value', 'false'); .end().find('.attribute_field_disabled').attr('value', 'false');
if($(this).parents('.attributes').find('.dataType').children("option:selected").attr('ref')) { if($(this).closest('.attributes').find('.dataType').children("option:selected").attr('ref')) {
$(this).parents('.attributes').find('.field-type').addClass('in').find('.control-group').delay(150).fadeIn(300); $(this).closest('.attributes').find('.field-type').addClass('in').find('.control-group').delay(150).fadeIn(300);
} }
} else { } else {
$(this).find('.toggle-check') $(this).find('.toggle-check')
.attr('value', 'true') .attr('value', 'true')
.parents('.attributes') .closest('.attributes')
.addClass('disabled') .addClass('disabled')
.find('.attributes-body input, .attributes-body select') .find('.attributes-body input, .attributes-body select')
.attr({'disabled': 'disabled'}) .attr({'disabled': 'disabled'})
@ -407,7 +409,7 @@ $(function() {
$(this).toggleClass('disabled'); $(this).toggleClass('disabled');
}; };
if($(this).hasClass('delete')) { if($(this).hasClass('delete')) {
$(this).parents('.attributes').fadeOut(300, function() { $(this).closest('.attributes').fadeOut(300, function() {
$('.attributes:not(:hidden)').each(function(i) { $('.attributes:not(:hidden)').each(function(i) {
$(this).find('.attributes-header h4 span').text(i+1); $(this).find('.attributes-header h4 span').text(i+1);
}); });
@ -418,13 +420,19 @@ $(function() {
}).find('.attribute_field_to_delete').attr('value', 'true');; }).find('.attribute_field_to_delete').attr('value', 'true');;
}; };
if($(this).hasClass('trigger')) { if($(this).hasClass('trigger')) {
appendIndex = $(this).parents('.controls').find('.input-append').length; // appendIndex = $(this).closest('.controls').find('.input-append').length;
attributeIndex = $(this).parents('.attributes').index(); appendIndex = $(this).closest('.controls').find('.input-append:last-child').children('input:first-child').attr('name');
$("#template-input-append").tmpl(setData(attributesLength, templateType, appendIndex)).appendTo($(this).parents('.controls').find('.add-target')); appendIndex = appendIndex.split("][");
appendIndex = parseInt(appendIndex[appendIndex.length-2])+1;
attributeIndex = $(this).closest('.attributes').index();
templateType = $(this).closest('.attributes').find('.dataType').children("option:selected").attr('ref');
$("#template-input-append").tmpl(setData(attributeIndex, templateType, appendIndex)).appendTo($(this).closest('.controls').find('.add-target'));
inputAppendLength(); inputAppendLength();
}; };
if($(this).hasClass('remove-input')) { if($(this).hasClass('remove-input')) {
$(this).parent('.input-append').fadeOut(300, function() { $(this).parent('.input-append').fadeOut(300, function() {
$(this).remove()
inputAppendLength(); inputAppendLength();
}); });
@ -433,20 +441,21 @@ $(function() {
}); });
$('#attributes-area').delegate('.dataType', 'change', function() { $('#attributes-area').delegate('.dataType', 'change', function() {
$(this).children("option:selected").each(function () { $(this).children("option:selected").each(function () {
var target = $(this).parents('.attributes').find('.field-type').not('.default'); var target = $(this).closest('.attributes').find('.field-type').not('.default');
attributeIndex = $(this).parents('.attributes').index(); attributeIndex = $(this).closest('.attributes').index();
appendIndex = $(this).parents('.attributes').find('.add-target').find('.input-append').length; appendIndex = 0
if($(this).parents('.attributes').hasClass('default')){ // $(this).closest('.attributes').find('.add-target').find('.input-append').length;
var i = $(this).parents('.attributes').index() if($(this).closest('.attributes').hasClass('default')){
var i = $(this).closest('.attributes').index()
if($(this).attr('ref') == attributesArray[i].select.name) { if($(this).attr('ref') == attributesArray[i].select.name) {
$(this).parents('.attributes').find('.field-type.default').show() $(this).closest('.attributes').find('.field-type.default').show()
target.empty().hide(); target.empty().hide();
} else { } else {
$(this).parents('.attributes').find('.field-type.default').hide() $(this).closest('.attributes').find('.field-type.default').hide()
if($(this).attr('ref')) { if($(this).attr('ref')) {
templateType = $(this).attr('ref'); templateType = $(this).attr('ref');
target.removeAttr('class').addClass('field-type fade in ' + templateType).empty(); target.removeAttr('class').addClass('field-type fade in ' + templateType).empty();
$("#template-type").tmpl(setData(attributesLength, templateType, appendIndex)).appendTo(target); $("#template-type").tmpl(setData(attributeIndex, templateType, appendIndex)).appendTo(target);
if(templateType == 'typeB' || templateType == 'typeE' || templateType == 'typeF') { if(templateType == 'typeB' || templateType == 'typeE' || templateType == 'typeF') {
inputAppendLength(); inputAppendLength();
} }
@ -460,7 +469,7 @@ $(function() {
if($(this).attr('ref')) { if($(this).attr('ref')) {
templateType = $(this).attr('ref'); templateType = $(this).attr('ref');
target.removeAttr('class').addClass('field-type fade in ' + templateType).empty(); target.removeAttr('class').addClass('field-type fade in ' + templateType).empty();
$("#template-type").tmpl(setData(attributesLength, templateType, appendIndex)).appendTo(target); $("#template-type").tmpl(setData(attributeIndex, templateType, appendIndex)).appendTo(target);
if(templateType == 'typeB' || templateType == 'typeE' || templateType == 'typeF') { if(templateType == 'typeB' || templateType == 'typeE' || templateType == 'typeF') {
inputAppendLength(); inputAppendLength();
} }

View File

@ -0,0 +1,6 @@
//= require basic
//= require lib/footable-0.1.js
//= require lib/all-list
//= require lib/jquery.fastLiveFilter.js
//= require lib/checkbox.card.js
//= require lib/jquery.form.js

View File

@ -0,0 +1,193 @@
/* Main List */
.main-list {
margin-bottom: 10px;
}
.main-list tbody {
border: 1px solid #dddddd;
}
.main-list thead {
border: 1px solid #454545;
}
.main-list thead th {
vertical-align: middle;
background-color: #454545;
white-space: nowrap;
color: #FFFFFF;
}
.main-list tbody tr.disable td {
color: #C5C5C5;
background-color: #eeeeee;
}
.main-list tbody tr.disable td .label-info {
background-color: #999999;
}
.main-list tbody tr.active td:first-child {
position: relative;
}
.main-list tbody tr.active td:first-child:before {
content: "";
width: 0px;
height: 0px;
left: -21px;
top: 50%;
margin-top: -6px;
position: absolute;
border-style: solid;
border-width: 6px 0 6px 6px;
border-color: transparent transparent transparent #333333;
}
.main-list td {
background-color: #FFFFFF;
}
.main-list td.action {
vertical-align: middle;
text-align: right;
}
.main-list td.preview img {
width: 100%;
}
.main-list td .banner-link {
width: 100px;
max-width: 120px;
display: inline-block;
text-overflow: ellipsis;
overflow: hidden;
}
.main-list td .file-list {
display: inline-block;
margin: 0 0 -6px;
}
.main-list td .file-list:after {
content: "";
clear: both;
display: block;
height: 0;
visibility: hidden;
}
.main-list td .file-type {
position: relative;
list-style: none;
float: left;
display: inline-block;
}
.main-list td .file-type a {
background-color: #A6A6A6;
color: #FFFFFF;
margin-right: 10px;
padding: 2px 5px 2px 3px;
border-radius: 3px;
text-decoration: none;
text-shadow: 0px -1px 0px rgba(100, 100, 100, .6);
}
.main-list td .file-type i,
.main-forms fieldset .input-area .controls .file-type i {
width: 16px;
height: 16px;
margin-bottom: -1px;
display: inline-block;
}
.main-list td .file-type[class^="type-"] i,
.main-list td .file-type[class*=" type-"] i,
.main-forms fieldset .input-area .controls .file-type[class*=" type-"] i,
.main-forms fieldset .input-area .controls .file-type[class^="type-"] i {
background-image: url(/orbit_4.0.1/assets/images/file_type.png);
}
.file-type.type-pdf i {background-position: 0px 0px;}
.file-type.type-psd i {background-position: -16px 0px;}
.file-type.type-ai i {background-position: -32px 0px;}
.file-type.type-fla i {background-position: -48px 0px;}
.file-type.type-in i {background-position: -64px 0px;}
.file-type.type-acc i {background-position: 0px -16px;}
.file-type.type-do i {background-position: -16px -16px;}
.file-type.type-xl i {background-position: -32px -16px;}
.file-type.type-pp i {background-position: -48px -16px;}
.file-type.type-zip i {background-position: -64px -16px;}
.file-type.type-txt i {background-position: 0px -32px;}
.file-type.type-jp i {background-position: -16px -32px;}
.file-type.type-gif i {background-position: -32px -32px;}
.file-type.type-png i {background-position: -48px -32px;}
.file-type.type-audio i {background-position: -64px -32px;}
.main-list td .quick-edit {
height: 24px;
margin-top: 5px;
}
.main-list td .quick-edit .nav {
display: none;
margin-bottom: 0;
}
.main-list tr:hover .quick-edit .nav {
display: block;
}
.main-list td .quick-edit .nav > li > a {
padding-top: 4px;
padding-bottom: 4px;
margin-top: 0px;
margin-bottom: 0px;
border: 1px dotted #d1d1d1;
}
.main-list td .quick-edit .nav > li > a:hover {
border: 1px dotted transparent;
}
.main-list thead tr.sort-header th a {
padding: 8px;
margin: -8px;
display: block;
color: #FFFFFF;
text-decoration: none;
}
.main-list thead tr.sort-header th.active a {
padding-bottom: 4px;
border-bottom: 4px solid #08c;
}
.main-list .footable-row-detail td {
padding: 0;
border-top: none;
}
.main-list .footable-row-detail td .footable-row-detail-inner {
display: none;
padding: 8px;
position: relative;
border-radius: 5px;
margin: 0 8px 8px;
background-color: #ededed;
}
.main-list .footable-row-detail td .footable-row-detail-inner:after {
display: block;
height: 0px;
width: 0px;
position: absolute;
top: -6px;
left: 50%;
margin-left: -3px;
content: "";
border-style: solid;
border-width: 0 6px 6px 6px;
border-color: transparent transparent #ededed transparent;
}
.main-list .footable-row-detail td .footable-row-detail-inner div {
margin: 10px 0;
}
#preview .preview {
margin: 0 auto;
}
/* For Retina */
@media screen and (-webkit-min-device-pixel-ratio: 2), screen and (max--moz-device-pixel-ratio: 2) {
.main-list td .file-type[class^="type-"] i,
.main-list td .file-type[class*=" type-"] i,
.main-forms fieldset .input-area .controls .file-type[class*=" type-"] i,
.main-forms fieldset .input-area .controls .file-type[class^="type-"] i {
background-image: url(/orbit_4.0.1/assets/images/file_type@2x.png);
background-size: 80px 48px;
}
}
/* Responsive */
@media (max-width: 480px) {
.main-list td .quick-edit .nav {
display: block;
}
}

View File

@ -11,10 +11,13 @@
padding: 0; padding: 0;
} }
#list-view #member-list td.gender-man { #list-view #member-list td.gender-man {
background-color: #34ADFF background-color: #34ADFF;
} }
#list-view #member-list td.gender-woman { #list-view #member-list td.gender-woman {
background-color: #FF3196 background-color: #FF3196;
}
#list-view #member-list td.gender-none {
background-color: #DDDDDD;
} }
/* Abstract */ /* Abstract */
@ -53,12 +56,15 @@
left: 0; left: 0;
z-index: 1; z-index: 1;
} }
#list-view #member-abstract .gender-men { #list-view #member-abstract .gender-man {
border-color: #34ADFF transparent transparent transparent; border-color: #34ADFF transparent transparent transparent;
} }
#list-view #member-abstract .gender-women { #list-view #member-abstract .gender-woman {
border-color: #FF3196 transparent transparent transparent; border-color: #FF3196 transparent transparent transparent;
} }
#list-view #member-abstract .gender-none {
border-color: #DDDDDD transparent transparent transparent;
}
#list-view #member-abstract .member-avatar { #list-view #member-abstract .member-avatar {
position: relative; position: relative;
-webkit-border-radius: 5px 5px 0 0; -webkit-border-radius: 5px 5px 0 0;
@ -171,12 +177,15 @@
left: 0; left: 0;
top: 0; top: 0;
} }
#list-view #member-card .member-avatar.gender-men { #list-view #member-card .member-avatar.gender-man {
border-color: #34ADFF; border-color: #34ADFF;
} }
#list-view #member-card .member-avatar.gender-women { #list-view #member-card .member-avatar.gender-woman {
border-color: #FF3196; border-color: #FF3196;
} }
#list-view #member-card .member-avatar.gender-none {
border-color: #DDDDDD;
}
#list-view #member-card .member-avatar img { #list-view #member-card .member-avatar img {
/*width: 100%;*/ /*width: 100%;*/
max-width: none; max-width: none;
@ -248,9 +257,9 @@
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
#profile #basic-info .basic-profile .btn { #profile #basic-info .basic-profile .btn-group {
display: block; display: block;
margin-top: 40px; margin-top: 20px;
} }
#profile #basic-info .member-avatar { #profile #basic-info .member-avatar {
width: 106px; width: 106px;
@ -262,12 +271,15 @@
width: 100%; width: 100%;
max-width: none; max-width: none;
} }
#profile #basic-info .member-avatar.gender-men img { #profile #basic-info .member-avatar.gender-man img {
border-color: #34ADFF; border-color: #34ADFF;
} }
#profile #basic-info .member-avatar.gender-women img { #profile #basic-info .member-avatar.gender-woman img {
border-color: #FF3196; border-color: #FF3196;
} }
#profile #basic-info .member-avatar.gender-none img {
border-color: #DDDDDD;
}
#profile #member-roles { #profile #member-roles {
clear: both; clear: both;
margin-top: 30px; margin-top: 30px;

View File

@ -44,6 +44,9 @@
.bottomnav .pagination { .bottomnav .pagination {
margin: 0; margin: 0;
} }
#module-content .bottomnav {
left: 451px;
}
/* Breadcrumb */ /* Breadcrumb */
.topnav .breadcrumb { .topnav .breadcrumb {

View File

@ -0,0 +1,7 @@
/*
*= require basic
*= require lib/wrap-nav
*= require lib/main-list
*= require lib/filter
*= require lib/pageslide
*/

View File

@ -1,4 +1,4 @@
class Admin::InfosController < OrbitBackendController class Admin::InfosController < OrbitMemberController
before_filter :authenticate_user! before_filter :authenticate_user!
before_filter :is_admin? before_filter :is_admin?

View File

@ -1,8 +1,8 @@
class Admin::RoleFiltersController < OrbitBackendController class Admin::RoleFiltersController < OrbitMemberController
include OrbitControllerLib::DivisionForDisable include OrbitControllerLib::DivisionForDisable
layout "new_admin" # layout "new_admin"
before_filter :authenticate_user! before_filter :authenticate_user!
before_filter :is_admin? before_filter :is_admin?
@ -50,12 +50,21 @@ class Admin::RoleFiltersController < OrbitBackendController
@role_filter = @types.new(:display => 'List') @role_filter = @types.new(:display => 'List')
# @url = polymorphic_path([:admin, @role_filter])
if @app_type == 'role_statuses'
@url = eval("admin_#{@app_type}_path(:role_id=>params[:role_id])")
else
@url = eval("admin_#{@app_type}s_path(:role_id=>params[:role_id])")
end
@verb = :post @verb = :post
respond_to do |format| render layout: false
format.html # new.html.erb # respond_to do |format|
format.js # format.html # new.html.erb
end # format.js
# end
end end
@ -69,12 +78,13 @@ class Admin::RoleFiltersController < OrbitBackendController
@verb = :put @verb = :put
respond_to do |format| render layout: false
format.html
format.js
end
end
# respond_to do |format|
# format.html
# format.js
# end
end
def create def create
@ -82,11 +92,18 @@ class Admin::RoleFiltersController < OrbitBackendController
@role_filter = @types.new(params[:role_filter]) @role_filter = @types.new(params[:role_filter])
respond_to do |format| if @app_type == 'role_statuses'
if @role_filter.save @url = eval("admin_#{@app_type}_path(:role_id=>params[:role_filter][:role_id])")
format.html { redirect_to(admin_role_filter_url(params[:role_filter][:role_id])) } else
format.js @url = eval("admin_#{@app_type}s_path(:role_id=>params[:role_filter][:role_id])")
end end
if @role_filter.save
redirect_to @url
else
@role_filter = @types.new(params[:role_filter])
flash.now[:error] = t('create.error.category')
render action: :new
end end
end end
@ -102,16 +119,21 @@ class Admin::RoleFiltersController < OrbitBackendController
# @url = eval("admin_role_filter_#{@app_type}_path(#{@role_filter})") # @url = eval("admin_role_filter_#{@app_type}_path(#{@role_filter})")
@url = polymorphic_path([:admin, @role_filter]) @url = polymorphic_path([:admin, @role_filter])
respond_to do |format| if @app_type == 'role_statuses'
if @role_filter.update_attributes(params[:role_filter]) @url = eval("admin_#{@app_type}_path(:role_id=>@role_filter.role_id)")
format.html { redirect_to(admin_role_filter_role_filters_url(params[:role_id]), :notice => t('role_filter.update_role_filter_success')) } else
# format.xml { head :ok } @url = eval("admin_#{@app_type}s_path(:role_id=>@role_filter.role_id)")
format.js
else
format.html { render :action => "edit" }
format.js { render :action => "edit" }
end
end end
@role_filter = @types.find(params[:id])
if @role_filter.update_attributes(params[:role_filter])
redirect_to @url
else
flash.now[:error] = t('update.error.category')
render action: :edit
end
end end
@ -135,6 +157,26 @@ class Admin::RoleFiltersController < OrbitBackendController
end end
def toggle
get_types
if @app_type == 'role_statuses'
@role_filter = @types.find(params[:role_status_id])
@url = eval("admin_#{@app_type}_path(:role_id=>@role_filter.role_id)")
else
@role_filter = @types.find(params[:role_category_id])
@url = eval("admin_#{@app_type}s_path(:role_id=>@role_filter.role_id)")
end
@role_filter.disable = @role_filter.disable ? false : true
@role_filter.save!
redirect_to @url
end
protected protected
def get_types def get_types

View File

@ -1,4 +1,4 @@
class Admin::RolesController < OrbitBackendController class Admin::RolesController < OrbitMemberController
before_filter :authenticate_user! before_filter :authenticate_user!
before_filter :is_admin? before_filter :is_admin?
@ -6,7 +6,7 @@ class Admin::RolesController < OrbitBackendController
helper Admin::AttributeValuesViewHelper helper Admin::AttributeValuesViewHelper
def index def index
@attributes = Role.all.entries @attributes = Role.all.asc("_id").entries
render :template => 'admin/attributes/index' render :template => 'admin/attributes/index'
end end
@ -36,7 +36,7 @@ class Admin::RolesController < OrbitBackendController
@sub_attribute = SubRole.new @sub_attribute = SubRole.new
@sub_attribute.role_id = params[:role_id] @sub_attribute.role_id = params[:role_id]
render layout: false
end end
def edit_sub_role def edit_sub_role
@ -46,7 +46,7 @@ class Admin::RolesController < OrbitBackendController
@attribute = Role.find(@sub_attribute.role_id) @attribute = Role.find(@sub_attribute.role_id)
@sub_attribute.role_id = @sub_attribute.role_id @sub_attribute.role_id = @sub_attribute.role_id
render layout: false
end end
def sub_role_field def sub_role_field
@ -95,19 +95,49 @@ class Admin::RolesController < OrbitBackendController
end end
# def get_variables_for_new
# @designs = Design.all.entries
# @themes = Design.first.themes
# @module_apps = ModuleApp.for_frontend_select
# @app_frontend_urls = nil
# @categories = nil
# @tags = nil
# @page_frontend_data_counts = nil
# @frontend_styles = nil
# @selected={
# :design => @designs.first,
# :theme=> @themes.first,
# :module_app=>nil,#@module_apps.first
# :app_frontend_url=> nil, #@module_apps.first
# :category=>nil,
# :tag=>nil,
# :page_frontend_data_count=>nil,
# :frontend_style => nil
# }
# end
# def new
# @item = Page.new(params[:page])
# @item.parent = Item.find(params[:parent_id]) rescue nil
# get_variables_for_new
# render layout: false
# end
def new def new
@attribute = Role.new @attribute = Role.new
if !params[:parent_id] # if !params[:parent_id]
render :template => 'admin/attributes/new' # render :template => 'admin/attributes/new'
end # end
render layout: false
end end
def edit def edit
@attribute = Role.find(params[:id]) @attribute = Role.find(params[:id])
@attribute_fields_upper_object = @attribute.sub_roles @attribute_fields_upper_object = @attribute.sub_roles
render :template => 'admin/attributes/edit' # render :template => 'admin/attributes/edit'
render layout: false
end end
def create def create
@ -118,18 +148,28 @@ class Admin::RolesController < OrbitBackendController
# @sub_role.role_id = params[:id] # @sub_role.role_id = params[:id]
respond_to do |format|
if @sub_role.save if @sub_role.save
format.html { redirect_to(admin_role_sub_role_url(params[:sub_role][:role_id])) } redirect_to admin_role_sub_role_url(params[:sub_role][:role_id])
end else
@sub_role = SubRole.new(params[:sub_role])
flash.now[:error] = t('create.error.category')
render action: :new
end end
else else
@attribute = Role.new(params[:role]) @attribute = Role.new(params[:role])
@attribute.save # if @attribute.save
redirect_to :action => :index # redirect_to :action => :index
# end
if @attribute.save
redirect_to admin_roles_url
else
@attribute = Role.new(params[:role])
flash.now[:error] = t('create.error.category')
render action: :new
end
end end
end end
@ -139,21 +179,35 @@ class Admin::RolesController < OrbitBackendController
if params[:sub_role] if params[:sub_role]
@sub_role = SubRole.find(params[:sub_role][:id]) @sub_role = SubRole.find(params[:sub_role][:id])
@sub_role.update_attributes(params[:sub_role]) if @sub_role.update_attributes(params[:sub_role])
@sub_role.attribute_fields.each{|t| t.destroy if t["to_delete"] == true} @sub_role.attribute_fields.each{|t| t.destroy if t["to_delete"] == true}
respond_to do |format| # respond_to do |format|
format.html { redirect_to(admin_role_sub_role_url(@sub_role.role_id)) } # format.html { redirect_to(admin_role_sub_role_url(@sub_role.role_id)) }
format.js { render 'toggle_enable' } # format.js { render 'toggle_enable' }
# end
redirect_to admin_role_sub_role_url(@sub_role.role_id)
else
flash.now[:error] = t('update.error.category')
render action: :edit
end end
else else
@attribute = Role.find(params[:id]) @attribute = Role.find(params[:id])
@attribute.update_attributes(params[:role]) # @attribute.update_attributes(params[:role])
@attribute.attribute_fields.each{|t| t.destroy if t["to_delete"] == true} # @attribute.attribute_fields.each{|t| t.destroy if t["to_delete"] == true}
respond_to do |format| # respond_to do |format|
format.html { redirect_to :action => :index } # format.html { redirect_to :action => :index }
format.js { render 'admin/attributes/toggle_enable' } # format.js { render 'admin/attributes/toggle_enable' }
# end
if @attribute.update_attributes(params[:role])
@attribute.attribute_fields.each{|t| t.destroy if t["to_delete"] == true}
redirect_to admin_roles_url
else
flash.now[:error] = t('update.error.category')
render action: :edit
end end
end end
@ -164,11 +218,12 @@ class Admin::RolesController < OrbitBackendController
if params[:sub_role] if params[:sub_role]
@sub_role = SubRole.find(params[:sub_role][:id]) @attribute = SubRole.find(params[:sub_role][:id])
respond_to do |format| respond_to do |format|
if @sub_role.destroy if @attribute.destroy
format.html { redirect_to(admin_role_sub_role_url(@sub_role.role_id)) } format.html { redirect_to(admin_role_sub_role_url(@attribute.role_id)) }
format.js
end end
end end
@ -176,12 +231,33 @@ class Admin::RolesController < OrbitBackendController
@attribute = Role.find(params[:id]) @attribute = Role.find(params[:id])
@attribute.destroy @attribute.destroy
redirect_to :action => :index respond_to do |format|
format.html { redirect_to admin_roles_url }
format.js { render 'admin/attributes/destroy' }
end
end end
end end
def toggle
@attribute = Role.find(params[:role_id])
@attribute.disabled = @attribute.disabled ? false : true
@attribute.save!
redirect_to action: :index
end
def sub_role_toggle
@sub_attribute = SubRole.find(params[:role_id])
@sub_attribute.disabled = @sub_attribute.disabled ? false : true
@sub_attribute.save!
redirect_to admin_role_sub_role_url(@sub_attribute.role_id)
end
protected protected
def set_attribute def set_attribute

View File

@ -1,4 +1,4 @@
class Admin::UsersNewInterfaceController < OrbitBackendController class Admin::UsersNewInterfaceController < OrbitMemberController
helper MemberHelper helper MemberHelper
@ -19,20 +19,62 @@ class Admin::UsersNewInterfaceController < OrbitBackendController
get_tags get_tags
get_sub_roles get_sub_roles
@roles = Role.excludes('disabled' => true).asc("_id")
page_num = params[:page] || 1 page_num = params[:page] || 1
@users = [] @users = []
render case params[:at]
when 'summary' @filter = params[:filter]
@users=User.not_guest_user.page(page_num).per(12).asc("_id").includes('avatar') new_filter = params[:new_filter]
"index_summary"
when 'thumbnail' if @filter && params[:clear]
@users=User.not_guest_user.page(page_num).per(36).asc("_id").includes('avatar') @filter.delete(params[:type])
"index_thumbnail" elsif @filter && new_filter
if @filter.has_key?(new_filter[:type]) && @filter[new_filter[:type]].include?(new_filter[:id].to_s)
@filter[new_filter[:type]].delete(new_filter[:id].to_s)
elsif @filter.has_key?(new_filter[:type])
@filter[new_filter[:type]] << new_filter[:id].to_s
else else
@users=User.not_guest_user.page(page_num).per(10).asc("_id").includes('avatar') @filter.merge!({new_filter[:type] => [new_filter[:id].to_s]})
"index" end
elsif new_filter
@filter = {new_filter[:type] => [new_filter[:id].to_s]}
end end
if @filter.blank?
render case params[:at]
when 'summary'
@users=User.not_guest_user.page(page_num).per(12).asc("_id").includes('avatar')
"index_summary"
when 'thumbnail'
@users=User.not_guest_user.page(page_num).per(36).asc("_id").includes('avatar')
"index_thumbnail"
else
@users=User.not_guest_user.page(page_num).per(10).asc("_id").includes('avatar')
"index"
end
else
render case params[:at]
when 'summary'
@users=User.not_guest_user.any_in(:role_ids=>@filter['role']).page(page_num).per(12).asc("_id").includes('avatar')
"index_summary"
when 'thumbnail'
@users=User.not_guest_user.any_in(:role_ids=>@filter['role']).page(page_num).per(36).asc("_id").includes('avatar')
"index_thumbnail"
else
@users=User.not_guest_user.any_in(:role_ids=>@filter['role']).page(page_num).per(10).asc("_id").includes('avatar')
"index"
end
end
end end
def show def show

View File

@ -0,0 +1,54 @@
class OrbitMemberController < ApplicationController
include OrbitCategory::Categorizing
include OrbitCoreLib::AppBackendUtility
include OrbitCoreLib::PermissionUtility
include OrbitTag::Tagging
include AdminHelper
include ApplicationHelper
helper :default_index
layout "member"
def setup_vars
@app_title ||= controller_path.split('/')[1].singularize
@module_app ||= ModuleApp.first(conditions: {:key => @app_title} )
raise ModuleAppError, 'Can not find ModuleApp' if @module_app.nil?
end
def get_statuses
status = []
status << 'is_top'
status << 'is_hot'
status << 'is_hidden' unless is_guest?
if @module_app.is_approvable && is_manager?
status << 'is_pending'
status << 'is_checked'
status << 'is_rejected'
end
status
end
private
def force_order_for_visitor
check_backend_openness
setup_vars
set_current_user
end
def force_order_for_user
setup_vars
set_current_user
authenticate_user!
check_user_can_use
end
def check_user_can_use
unless check_permission
#redirect_to polymorphic_path(['panel',@app_title,'back_end','public'])
redirect_to root_url
end
end
end

View File

@ -8,6 +8,8 @@ module AttributeFieldsHelper
include ActionView::Context include ActionView::Context
include OrbitBasis::RenderAnywhere include OrbitBasis::RenderAnywhere
include OrbitFormHelper
def block_helper(user,index,disable = false) def block_helper(user,index,disable = false)
unless self.disabled unless self.disabled
@index = index @index = index
@ -49,24 +51,82 @@ module AttributeFieldsHelper
@prefiled_value ||=[] @prefiled_value ||=[]
control_group_wrapper do control_group_wrapper do
a = self[:option_list].collect do |key,value| a = self[:option_list].collect do |key,value|
label_tag(key,check_box_tag(get_field_name_base+"[#{key}]", true , (@prefiled_value.include?(key) ? true : false), {})+value[I18n.locale.to_s],@markup_options.merge(:class=>"control-label")) label_tag(key,check_box_tag(get_field_name_base+"[#{key}]", true , (@prefiled_value.include?(key) ? true : false), {})+value[I18n.locale.to_s],@markup_options.merge(:class=>"checkbox inline"))
end.join rescue "" end.join rescue ""
end end
end end
def render_date def render_date
d = DateTime.now()
if date_is_range? if date_is_range?
fill_from = @attribute_value.get_date(:from) rescue nil # fill_from = @attribute_value.get_date(:from) rescue nil
fill_to = @attribute_value.get_date(:to) rescue nil # fill_to = @attribute_value.get_date(:to) rescue nil
control_group_wrapper do control_group_wrapper do
buf = date_select(get_field_name_base+'[from]',nil,@markup_options.merge(:default=>fill_from),:class=>"input-small")
buf << ' ~ ' case self.typeC['format']
buf << date_select(get_field_name_base+'[to]',nil,@markup_options.merge(:default=>fill_to),:class=>"input-small") when 'format1'
fill_from = (@prefiled_value && @prefiled_value["from"] ) ? @prefiled_value["from"] : d.strftime("%Y/%m/%d %H:%M")
fill_to = (@prefiled_value && @prefiled_value["to"] ) ? @prefiled_value["to"] : d.strftime("%Y/%m/%d %H:%M")
buf = datetime_picker(get_field_name_base+'[from]', fill_from, 'yyyy/MM/dd hh:mm', true)
buf << ' ~ '
buf << datetime_picker(get_field_name_base+'[to]', fill_to, 'yyyy/MM/dd hh:mm', true)
when 'format2'
fill_from = (@prefiled_value && @prefiled_value["from"] ) ? @prefiled_value["from"] : d.strftime("%Y/%m/%d")
fill_to = (@prefiled_value && @prefiled_value["to"] ) ? @prefiled_value["to"] : d.strftime("%Y/%m/%d")
buf = datetime_picker(get_field_name_base+'[from]', fill_from, 'yyyy/MM/dd')
buf << ' ~ '
buf << datetime_picker(get_field_name_base+'[to]', fill_to, 'yyyy/MM/dd')
when 'format3'
fill_from = (@prefiled_value && @prefiled_value["from"] ) ? @prefiled_value["from"] : d.strftime("%Y/%m")
fill_to = (@prefiled_value && @prefiled_value["to"] ) ? @prefiled_value["to"] : d.strftime("%Y/%m/")
buf = datetime_picker(get_field_name_base+'[from]', fill_from, 'yyyy/MM')
buf << ' ~ '
buf << datetime_picker(get_field_name_base+'[to]', fill_to, 'yyyy/MM')
when 'format4'
fill_from = (@prefiled_value && @prefiled_value["from"] ) ? @prefiled_value["from"] : d.strftime("%Y")
fill_to = (@prefiled_value && @prefiled_value["to"] ) ? @prefiled_value["to"] : d.strftime("%Y")
buf = datetime_picker(get_field_name_base+'[from]', fill_from, 'yyyy')
buf << ' ~ '
buf << datetime_picker(get_field_name_base+'[to]', fill_to, 'yyyy')
end
# buf = date_select(get_field_name_base+'[from]',nil,@markup_options.merge(:default=>fill_from),:class=>"input-small")
# buf << ' ~ '
# buf << date_select(get_field_name_base+'[to]',nil,@markup_options.merge(:default=>fill_to),:class=>"input-small")
buf buf
end end
else else
@prefiled_value = @attribute_value.get_date # @prefiled_value = @attribute_value.get_date
control_group_wrapper{date_select(get_field_name_base,nil,@markup_options.merge(:default=>@prefiled_value),:class=>"input-small")} # @prefiled_value = @attribute_value.get_date
case self.typeC['format']
when 'format1'
tmp = datetime_picker(get_field_name_base, (@prefiled_value ? @prefiled_value : d.strftime("%Y/%m/%d %H:%M")), 'yyyy/MM/dd hh:mm', true)
when 'format2'
tmp = datetime_picker(get_field_name_base, (@prefiled_value ? @prefiled_value : d.strftime("%Y/%m/%d")), 'yyyy/MM/dd')
when 'format3'
tmp = datetime_picker(get_field_name_base, (@prefiled_value ? @prefiled_value : d.strftime("%Y/%m")), 'yyyy/MM')
when 'format4'
tmp = datetime_picker(get_field_name_base, (@prefiled_value ? @prefiled_value : d.strftime("%Y")), 'yyyy')
end
control_group_wrapper{tmp}
# control_group_wrapper{date_select(get_field_name_base,nil,@markup_options.merge(:default=>@prefiled_value),:class=>"input-small")}
end
end
def datetime_picker(object_name, value, format, time=false)
content_tag :div, :class => "input-append datetimepick", "data-date-format"=>format, "data-picktime"=>"#{time}" do
concat text_field_tag(object_name, value, :placeholder=>format)
concat (content_tag :span, :class => 'add-on clearDate' do
content_tag :i, nil, :class => 'icons-cross-3'
end)
concat (content_tag :span, :class => 'add-on iconbtn' do
content_tag :i, nil, 'data-time-icon' => 'icons-clock', 'data-date-icon' => 'icons-calendar', :class=>"icons-calendar"
end)
end end
end end
@ -78,7 +138,7 @@ module AttributeFieldsHelper
@prefiled_value ||=[] @prefiled_value ||=[]
control_group_wrapper do control_group_wrapper do
self[:option_list].collect do |key,value| self[:option_list].collect do |key,value|
label_tag(key,radio_button_tag(get_field_name_base, key , (@prefiled_value.include?(key) ? true : false), {})+value[I18n.locale.to_s],@markup_options.merge(:class=>" radio inline")) label_tag(key,radio_button_tag(get_field_name_base, key , (@prefiled_value.include?(key) ? true : false), {})+value[I18n.locale.to_s],@markup_options.merge(:class=>"radio inline"))
end.join end.join
end end
end end
@ -100,64 +160,134 @@ module AttributeFieldsHelper
def render_text_field def render_text_field
a = control_group_wrapper do |key,value| a = control_group_wrapper do |key,value|
add_more_blank = can_add_more ? "[]" : "" add_more_blank = can_add_more ? "[]" : ""
key_field = can_muti_lang_input? ? "[#{key}]" : "" key_field = can_muti_lang_input? ? "[#{key}]" : ""
place_holder= @panel_setting["placeholder"][key] rescue '' place_holder= @panel_setting["placeholder"][key] rescue ''
text_field_tag([get_field_name_base,add_more_blank,key_field].join, value,@markup_options.merge(:placeholder=>place_holder)) text_field_tag([get_field_name_base,add_more_blank,key_field].join, value,@markup_options.merge(:placeholder=>place_holder))
end end
end
def date_is_range?
is_range = "false"
data = get_data
if !data.nil?
is_range = data['is_range'] if data.has_key? "is_range"
end end
is_range == "true"
end def date_is_range?
is_range = "false"
data = get_data
if !data.nil?
is_range = data['is_range'] if data.has_key? "is_range"
end
is_range == "true"
end
protected protected
def lang_panel_tabbable_wrapper(add_more_params,&block) def lang_panel_tabbable_wrapper(add_more_params,&block)
add_more_counter = '' add_more_counter = ''
content_tag :div,:class=>"tabbable" do
tmp = content_tag :div,:class=> (add_more || self.markup=='address') ? "tab-content input-append" : "tab-content" do if self.markup=='text_area' or self.markup=='address'
buff = VALID_LOCALES.collect do |key|
value = @prefiled_value[key] rescue nil tmp1 = VALID_LOCALES.collect do |key|
div_class_ary = ["tab-pane" ,"fade",key,get_pairing_tab_class({})] value = @prefiled_value[key] rescue nil
# div_class_ary = ["tab-pane" ,"fade","#{get_pairing_tab_class({})}_#{key}"]
div_class_ary = ["tab-pane" ,"fade"]
div_id = "#{get_pairing_tab_class({})}_#{key}"
if can_add_more
add_more_value = add_more_params[0][:value]
add_more_counter = add_more_params[0][:counter]
value = add_more_value[key] rescue nil
div_class_ary << "add_more_item_#{add_more_counter}"
end
div_class = div_class_ary.join(" ")
div_class << (key == I18n.locale.to_s ? " active in" : '')
content_tag(:div,yield(key,value), :id=>div_id,:class=>div_class)
end# of VALID_LOCALES.collect for tabed input
if can_add_more tmp2 = content_tag(:div,:class => 'btn-group', :data=>{:toggle=>"buttons-radio"}) do
add_more_value = add_more_params[0][:value] buff2 = VALID_LOCALES.each.collect do |key|
add_more_counter = add_more_params[0][:counter]
value = add_more_value[key] rescue nil
div_class_ary << "add_more_item_#{add_more_counter}"
end
div_class = div_class_ary.join(" ")
div_class << (key == I18n.locale.to_s ? " active in" : '')
content_tag(:div,yield(key,value),:class=>div_class)
end# of VALID_LOCALES.collect for tabed input
buff << link_to((content_tag :i,'',:class=>'icon-edit'),"##{get_pairing_tab_class({})}_m_window",:class=>'btn edit-btn',:type=>'button',:data=>{:toggle=>"modal"}) if self.markup == 'address'
buff << link_to((content_tag :i,'',:class=>'icon-trash'),"#",:class=>"btn removeInput") if self.add_more
buff.join('').html_safe
end
tmp << content_tag(:ul,:class=> 'nav nav-pills') do
VALID_LOCALES.each.collect do |key|
# link_entry = self.add_more ? "#{add_more_tab(:tab_btn,loop_counter,key)}" : "#tab"+id.to_s+"_#{key}" # link_entry = self.add_more ? "#{add_more_tab(:tab_btn,loop_counter,key)}" : "#tab"+id.to_s+"_#{key}"
link_entry_ary = [".#{get_pairing_tab_class({})}",".#{key}"] link_entry_ary = ["##{get_pairing_tab_class({})}","_#{key}"]
link_entry_ary << ".add_more_item_#{add_more_counter}" if can_add_more link_entry_ary << ".add_more_item_#{add_more_counter}" if can_add_more
link_entry = link_entry_ary.join link_entry = link_entry_ary.join
content_tag(:li,link_to(I18nVariable.from_locale(key),link_entry,:data=>{:toggle=>"tab"}),:class=>(key == I18n.locale.to_s ? "active" : nil),:for=>key) link_to(I18nVariable.from_locale(key),link_entry,:data=>{:toggle=>"tab"},:class=>"btn #{(key == I18n.locale.to_s ? "active" : nil)}",:for=>key)
end.join.html_safe # of VALID_LOCALES.collect for tabs end # of VALID_LOCALES.collect for tabs
end # of content ul
buff2 << link_to((content_tag :i,'',:class=>'icon-edit'),"##{get_pairing_tab_class({})}_m_window", :role=>"button",:class=>'btn',:data=>{:toggle=>"modal"}) if self.markup == 'address'
buff2 << link_to((content_tag :i,'',:class=>'icon-trash'),"#",:class=>"btn remove-input") if self.add_more
buff2.join.html_safe
end # of content ul
tmp = content_tag :div,:class=> "tab-content textarea-lang" do
tmp2 << tmp1.join('').html_safe
end
else
# tmp = content_tag :div,:class=> (add_more || self.markup=='address') ? "input-append" : "tab-content" do
tmp1 =
content_tag :div,:class=> "tab-content" do
buff = VALID_LOCALES.collect do |key|
value = @prefiled_value[key] rescue nil
# div_class_ary = ["tab-pane" ,"fade","#{get_pairing_tab_class({})}_#{key}"]
div_class_ary = ["tab-pane" ,"fade"]
div_id = "#{get_pairing_tab_class({})}_#{key}"
if can_add_more
add_more_value = add_more_params[0][:value]
add_more_counter = add_more_params[0][:counter]
value = add_more_value[key] rescue nil
div_class_ary << "add_more_item_#{add_more_counter}"
end
div_class = div_class_ary.join(" ")
div_class << (key == I18n.locale.to_s ? " active in" : '')
content_tag(:div,yield(key,value), :id=>div_id,:class=>div_class)
end# of VALID_LOCALES.collect for tabed input
buff.join('').html_safe
end
tmp2 = content_tag(:div,:class => 'btn-group', :data=>{:toggle=>"buttons-radio"}) do
buff2 = VALID_LOCALES.each.collect do |key|
# link_entry = self.add_more ? "#{add_more_tab(:tab_btn,loop_counter,key)}" : "#tab"+id.to_s+"_#{key}"
link_entry_ary = ["##{get_pairing_tab_class({})}","_#{key}"]
link_entry_ary << ".add_more_item_#{add_more_counter}" if can_add_more
link_entry = link_entry_ary.join
link_to(I18nVariable.from_locale(key),link_entry,:data=>{:toggle=>"tab"},:class=>"btn #{(key == I18n.locale.to_s ? "active" : nil)}",:for=>key)
end # of VALID_LOCALES.collect for tabs
buff2 << link_to((content_tag :i,'',:class=>'icon-edit'),"##{get_pairing_tab_class({})}_m_window", :role=>"button",:class=>'btn',:data=>{:toggle=>"modal"}) if self.markup == 'address'
buff2 << link_to((content_tag :i,'',:class=>'icon-trash'),"#",:class=>"btn remove-input") if self.add_more
buff2.join.html_safe
end # of content ul
tmp = content_tag :div,:class=> "input-append" do
tmp1 << tmp2
end
# tmp << content_tag(:ul,:class=> 'nav nav-pills') do
# VALID_LOCALES.each.collect do |key|
# # link_entry = self.add_more ? "#{add_more_tab(:tab_btn,loop_counter,key)}" : "#tab"+id.to_s+"_#{key}"
# link_entry_ary = [".#{get_pairing_tab_class({})}",".#{key}"]
# link_entry_ary << ".add_more_item_#{add_more_counter}" if can_add_more
# link_entry = link_entry_ary.join
# content_tag(:li,link_to(I18nVariable.from_locale(key),link_entry,:data=>{:toggle=>"tab"}),:class=>(key == I18n.locale.to_s ? "active" : nil),:for=>key)
# end.join.html_safe # of VALID_LOCALES.collect for tabs
# end # of content ul
end end
end end
def controls_wrapper(*add_more_params,&block) def controls_wrapper(*add_more_params,&block)
content_tag :div,:class=>'controls' do
result = '' result = ''
add_more_counter = "" add_more_counter = ""
@ -171,12 +301,15 @@ protected
if can_muti_lang_input? if can_muti_lang_input?
result << lang_panel_tabbable_wrapper(add_more_params,&block) result << lang_panel_tabbable_wrapper(add_more_params,&block)
result << gen_modal_dialog if self.markup == "address" result << gen_modal_dialog if self.markup == "address"
# result << add_more_unt if can_add_more
else #cross lang field else #cross lang field
case can_add_more case can_add_more
when true when true
value = add_more_params[0][:value] value = add_more_params[0][:value]
result << content_tag(:div,:class=>"input-append"){yield(nil,value) + link_to((content_tag :i,'',:class=>'icon-trash'),"#",:class=>"btn removeInput") } result << content_tag(:div,:class=>"input-append"){yield(nil,value) + link_to((content_tag :i,'',:class=>'icon-trash'),"#",:class=>"btn remove-input") }
# result << add_more_unt
else else
value = @prefiled_value value = @prefiled_value
result << yield(nil,value) result << yield(nil,value)
@ -186,54 +319,77 @@ protected
end end
result.html_safe result.html_safe
end # of controls div
end # of def controls_wrapper(&block) end # of def controls_wrapper(&block)
def control_group_wrapper(&block) def control_group_wrapper(&block)
div_class = can_muti_lang_input? ? "control-group language-swich" : "control-group" div_class = can_muti_lang_input? ? "control-group" : "control-group"
# div_class = can_muti_lang_input? ? "control-group language-swich" : "control-group"
result ="" result =""
case self.markup
when "text_field"
if can_add_more
multipleInput_ary = %w{multipleInput}
add_more_seri = "add_more_group_#{id}"
multipleInputs = content_tag :div,:class=> multipleInput_ary.join(' ') ,:ext_class=>get_pairing_tab_class({}) do
@attribute_value.add_more_counter.times.collect do |t|
controls_wrapper(:value=>(@prefiled_value[t] rescue nil),:counter=>t,&block)
end.join('').html_safe # of add_more fields
end # of div multipleInput editMore
result = label + multipleInputs + add_more_unt
# result = label + 一堆的輸入框(要用 multipleInput editMore 包起來) + add_more btn + hidden_fields
else
temp = label + controls_wrapper(&block)
result = content_tag(:div,temp,:class=>div_class)
end
when "address"
address = content_tag :div,:class=>"multipleInput editMore" do case self.markup
controls_wrapper(&block)
end # of div multipleInput editMore when "text_field"
result = label + address
if can_add_more
multipleInputs =
content_tag(:div,:class=>"add-target") do
@attribute_value.add_more_counter.times.collect do |t|
controls_wrapper(:value=>(@prefiled_value[t] rescue nil),:counter=>t,&block)
end.join('').html_safe # of add_more fields
end
temp = label + content_tag(:div, multipleInputs + add_more_unt, :class=>'controls add-input')
result = content_tag(:div,temp,:class=>div_class)
# result = label + multipleInputs + add_more_unt
# result = label + 一堆的輸入框(要用 multipleInput editMore 包起來) + add_more btn + hidden_fields
else
temp = label + content_tag(:div, controls_wrapper(&block), :class=>'controls')
result = content_tag(:div,temp,:class=>div_class)
end
when "address"
# address = content_tag :div,:class=>"multipleInput editMore" do
address = content_tag :div,:class=>"control-group" do
label + content_tag(:div, controls_wrapper(&block), :class=>'controls')
end # of div multipleInput editMore
result = address
else else
temp = label + controls_wrapper(&block) temp = label + content_tag(:div, controls_wrapper(&block), :class=>'controls')
result = content_tag(:div,temp,:class=>div_class) result = content_tag(:div,temp,:class=>div_class)
end end
result << end_block result << end_block
result.html_safe result.html_safe
end end
def add_more_unt def add_more_unt
temp_field_name = get_basic_field_name_base + '[temp]' temp_field_name = get_basic_field_name_base + '[temp]'
add_more = content_tag :div,:class=> 'controls' do add_more = content_tag :p,:class=> 'add-btn' do
content_tag :span,:class=> 'help-block' do content = link_to (content_tag :i,I18n.t(:add),:class=>"icon-plus"),"#","data-roles"=>"role_a",:class=>"trigger #{can_muti_lang_input? ? 'textLengInput' : 'textInput' } btn btn-small btn-primary"
content = link_to (content_tag :i,I18n.t(:add),:class=>"icon-plus-sign"),"#",:class=>'addinput'
content << hidden_field_tag("#{temp_field_name}[count]",@attribute_value.add_more_counter ,:class=>"list_count") content << hidden_field_tag("#{temp_field_name}[count]",@attribute_value.add_more_counter ,:class=>"list_count")
content << hidden_field_tag("#{temp_field_name}[count]",get_basic_field_name_base,:class=>"field_name") content << hidden_field_tag("#{temp_field_name}[count]",get_basic_field_name_base,:class=>"field_name")
content content
end # of span
end # of div end # of div
# add_more = content_tag :div,:class=> 'controls' do
# content_tag :span,:class=> 'help-block' do
# content = link_to (content_tag :i,I18n.t(:add),:class=>"icon-plus-sign"),"#",:class=>'addinput'
# content << hidden_field_tag("#{temp_field_name}[count]",@attribute_value.add_more_counter ,:class=>"list_count")
# content << hidden_field_tag("#{temp_field_name}[count]",get_basic_field_name_base,:class=>"field_name")
# content
# end # of span
# end # of div
end end
def end_block def end_block
@ -256,7 +412,7 @@ protected
def get_pairing_tab_class(opts) def get_pairing_tab_class(opts)
prefix = opts[:prefix] prefix = opts[:prefix]
suffix = opts[:suffix] suffix = opts[:suffix]
str = get_basic_field_name_base.gsub("[","-").gsub("]",'') str = get_basic_field_name_base.gsub("[","_").gsub("]",'')
str = prefix.nil? ? str : prefix+ str str = prefix.nil? ? str : prefix+ str
suffix.nil? ? str : str + suffix suffix.nil? ? str : str + suffix
end end
@ -274,7 +430,7 @@ protected
end end
def label def label
label_tag(key,title,:class=>"control-label",:func => "field_label") label_tag(key,title,:class=>"control-label muted",:func => "field_label")
end end
def can_muti_lang_input? def can_muti_lang_input?

View File

@ -9,20 +9,21 @@ module AttributeValuesHelper
date = get_date date = get_date
end end
case self.attribute_field["typeC"]["format"] # case self.attribute_field["typeC"]["format"]
when 'format1' # Y/M/D h:m # when 'format1' # Y/M/D h:m
date.strftime("%Y/%m/%d %H:%M") # date.strftime("%Y/%m/%d %H:%M")
when 'format2' # Y/M/D # when 'format2' # Y/M/D
date.strftime("%Y/%m/%d") # date.strftime("%Y/%m/%d")
when 'format3' # Y/M # when 'format3' # Y/M
date.strftime("%Y/%m") # date.strftime("%Y/%m")
when 'format4' # Y # when 'format4' # Y
date.strftime("%Y") # date.strftime("%Y")
end # of case west cal format # end # of case west cal format
end end
def show_minguo_calendar(from_to=nil) def show_minguo_calendar(from_to=nil)
get_minguo get_minguo
case from_to case from_to
when :to when :to
date = get_date(:to) date = get_date(:to)
@ -31,37 +32,62 @@ module AttributeValuesHelper
when nil when nil
date = get_date date = get_date
end end
@date = date.split('/')
date_year = @date[0].to_i
year_str = "" year_str = ""
unless date.year == 1912 unless date_year == 1912
m_year = (date.year - 1912).abs.to_s + I18n.t("date.minguo_calendar.year") m_year = (date_year - 1912).abs.to_s + I18n.t("date.minguo_calendar.year")
year_str = minguo_format_year(m_year) year_str = minguo_format_year(m_year)
end end
get_minguo_year + minguo_m_y_d_time get_minguo_year(from_to) + minguo_m_y_d_time(from_to)
end end
def get_minguo_year def get_minguo_year(from_to=nil)
date = get_date case from_to
m_year = (date.year - 1911).abs when :to
date = get_date(:to)
when :from
date = get_date(:from)
when nil
date = get_date
end
@date = date.split('/')
date_year = @date[0].to_i
m_year = (date_year - 1911).abs
year_end = I18n.t("date.minguo_calendar.year") year_end = I18n.t("date.minguo_calendar.year")
case case
when date.year <1912 when date_year <1912
I18n.t("date.minguo_calendar.before") + (m_year+1).to_s + year_end I18n.t("date.minguo_calendar.before") + (m_year+1).to_s + year_end
when date.year ==1912 when date_year ==1912
I18n.t("date.minguo_calendar.first_year") I18n.t("date.minguo_calendar.first_year")
when date.year >1912 when date_year >1912
I18n.t("date.minguo_calendar.after")+ (m_year).to_s + year_end I18n.t("date.minguo_calendar.after")+ (m_year).to_s + year_end
end # of case tw_calendar year end # of case tw_calendar year
end end
def minguo_m_y_d_time def minguo_m_y_d_time(from_to=nil)
date = get_date case from_to
when :to
date = get_date(:to)
when :from
date = get_date(:from)
when nil
date = get_date
end
@date = date.split('/')
case self.attribute_field["typeC"]["format"] case self.attribute_field["typeC"]["format"]
when 'format1' # Y/M/D h:m when 'format1' # Y/M/D h:m
date.strftime(" %m/%d %H:%M") "/#{@date[1]}/#{@date[2]}"
when 'format2' # Y/M/D when 'format2' # Y/M/D
date.strftime(" %m/%d") "/#{@date[1]}/#{@date[2]}"
when 'format3' # Y/M when 'format3' # Y/M
date.strftime(" %m#{I18n.t("date.minguo_calendar.month")}")
"/#{@date[1]}#{I18n.t("date.minguo_calendar.month")}"\
when 'format4' # Y when 'format4' # Y
'' ''
end # of case end # of case

View File

@ -30,8 +30,14 @@ class AttributeValue
else else
self.attribute_field.get_data["cross_lang"] =="true" ? self["val"] : Hash[VALID_LOCALES.collect{|lang| [lang,self[lang.to_sym]]}] self.attribute_field.get_data["cross_lang"] =="true" ? self["val"] : Hash[VALID_LOCALES.collect{|lang| [lang,self[lang.to_sym]]}]
end end
when 'select','date','radio_button','address' when 'select','radio_button','address'
self["val"] self["val"]
when 'date'
if !self["val"].blank? and !self["val"]['(1i)'].blank?
"#{self["val"]['(1i)']}/#{self["val"]['(2i)']}/#{self["val"]['(3i)']}"
else
self["val"]
end
when 'checkbox' when 'checkbox'
self["val"] self["val"]
end #end of case self.attribute_field.markup end #end of case self.attribute_field.markup
@ -50,7 +56,7 @@ class AttributeValue
case self.attribute_field.add_more case self.attribute_field.add_more
when true when true
if self.attribute_field.locale if self.attribute_field.locale
add_more_index.nil? ? self.value.collect{|t| t[locale]}.join(",") : self.value(add_more_index)[locale] add_more_index.nil? ? self.value.collect{|t| t[locale.to_s]}.join(",") : self.value(add_more_index)[locale]
else else
add_more_index.nil? ? self.value.join(",") : self.value(add_more_index) add_more_index.nil? ? self.value.join(",") : self.value(add_more_index)
end end
@ -69,8 +75,10 @@ class AttributeValue
when "date" when "date"
if self.attribute_field.date_is_range? if self.attribute_field.date_is_range?
get_date_by_format(:from) + ' ~ ' + get_date_by_format(:to) get_date_by_format(:from) + ' ~ ' + get_date_by_format(:to)
# self.value["from"] + ' ~ ' + self.value["to"]
else else
get_date_by_format get_date_by_format
# self.value
end end
when "address" when "address"
@ -95,13 +103,17 @@ class AttributeValue
def get_date(item = nil) def get_date(item = nil)
case item case item
when :from when :from
data = self[:val]["from"] # data = self[:val]["from"]
data = self.value["from"]
when :to when :to
data = self[:val]["to"] # data = self[:val]["to"]
data = self.value["to"]
when nil when nil
data = self[:val] # data = self[:val]
data = self.value
end end
Date.new(data["(1i)"].to_i,data["(2i)"].to_i,data["(3i)"].to_i) rescue nil
# Date.new(data["(1i)"].to_i,data["(2i)"].to_i,data["(3i)"].to_i) rescue nil
end end

View File

@ -0,0 +1,31 @@
<tr id="<%= dom_id attribute %>" class="<%= attribute.disabled ? 'disable' : '' %>">
<td>
<span class="label label-info"><%= attribute.title %></span>
<div class="quick-edit">
<ul class="nav nav-pills">
<li><%= link_to t(:edit), eval("edit_admin_#{@attribute_type}_path(attribute)"), :class=>"open-slide" %></li>
<% if @attribute_type == 'role' %>
<li><%= link_to t(:role_field), eval("admin_#{@attribute_type}_role_field_path(attribute)") %></li>
<li><%= link_to t(:sub_role), eval("admin_#{@attribute_type}_sub_role_path(attribute)") %></li>
<li><%= link_to t(:status), eval("admin_role_statuses_path(:role_id=>attribute)") %></li>
<li><%= link_to t(:category), eval("admin_role_categorys_path(:role_id=>attribute)") %></li>
<% end %>
<li><%#= link_to attribute.disabled ? t(:disable) : t(:enable) , eval("admin_#{@attribute_type}_toggle_path(attribute)"), method: :post, remote: true, class: "switch" %></li>
</ul>
</div>
</td>
<td class="action span3">
<div class="toggle-control" style="float: right;">
<div class="togglebox <%= attribute.disabled ? 'disabled' : '' %>">
<%= link_to (check_box_tag 'accept', false , :class => 'toggle-check', :data=>{:deploy=>"right"}) , eval("admin_#{@attribute_type}_toggle_path(attribute)"), method: :post, remote: true, class: "switch" %>
<label><b></b></label>
</div>
</div>
<% if !attribute.is_built_in? %>
<%= link_to (content_tag :i,'',:class=>'icon-trash')+t(:delete_), eval("admin_#{@attribute_type}_path(attribute)"), :type=>"button", :class => 'btn btn-mini btn-danger', :confirm => t('sure?'), :method => :delete, :remote => true %>
<% end %>
</td>
</tr>

View File

@ -0,0 +1,12 @@
<table class="table main-list" id="roles_index">
<thead>
<tr class="sort-header">
<th colspan="2" class="span4 active"><a href="#"><%= t("#{@attribute_type}") %><b class="icons-arrow-down-4"></b></a></th>
</tr>
</thead>
<tbody>
<%= render partial: 'admin/attributes/attribute', collection: @attributes %>
</tbody>
</table>

View File

@ -0,0 +1 @@
$("#<%= dom_id @attribute %>").remove();

View File

@ -1,162 +1,78 @@
<% content_for :side_bar do %> <% content_for :side_bar do %>
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member_), :link_url => admin_site_site_info_path(@site), :icon => 'icons-group', :side_bar_content => 'admin/users_new_interface/side_bar'} %> <%= render :partial => 'admin/users_new_interface/side_bar' %>
<% end %> <% end %>
<%= form_for @attribute,:url => eval("admin_#{@attribute_type}_path(@attribute)") ,:class=> "form-horizontal" do |f| %>
<div class="site-map role-block">
<div class="map-block back">
<h4><span><%= t(eval(":#{@attribute_type}"))%></span></h4>
<div class="form-horizontal">
<div class="clear">
<div class="control-group pull-left">
<label class="control-label" for="key"><%= t(:key) %></label>
<div class="controls">
<% if @attribute.new_record? %>
<%= f.text_field :key, :placeholder => t(:key) %>
<% else %>
<div><%= @attribute.key%></div>
<% end %>
</div>
</div>
<%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:values=>@attribute.title_translations,:class_ext=>"pull-left",:label_ext=>t(:item_name),:field_name=>"#{@attribute_type}[title_translations]"}%>
<div class="control-group pull-left">
<label class="control-label" for="key"><%= t(:to_search) %></label>
<div class="controls">
<label class="radio inline">
<%= f.radio_button :to_search, true %>
Yes
</label>
<label class="radio inline">
<%= f.radio_button :to_search, false %>
No
</label>
</div>
</div>
</div>
</div>
</div>
<% if @attribute._type == "Info" %>
<div class="map-block back attributes">
<h4><span><%= @attribute.title+ t(:field)%></span></h4>
<div id="attribute_field_list">
<%= render :partial=>"shared/attribute_field/attribute_field",:collection=>@attribute.attribute_fields%>
</div>
</div>
<div class="add-attributes form-actions pagination-right">
<%= ( link_to content_tag(:i,t(:add_attribute_field),:class=>"icon-plus icon-white"),admin_info_add_attribute_field_path(@attribute),:class=>"btn btn-primary",:remote => true )%>
</div>
<% end %>
</div>
<div class="form-actions form-fixed pagination-right">
<%= f.submit t(:submit),:class=>"btn btn-primary"%>
<%= link_to t('cancel'), get_go_back, :class=>"btn" %>
</div>
<% end %>
<% content_for :page_specific_css do -%> <% content_for :page_specific_css do -%>
<%= stylesheet_link_tag "member" %> <%= stylesheet_link_tag "lib/wrap-nav.css" %>
<%= stylesheet_link_tag "site-map" %> <%= stylesheet_link_tag "lib/pageslide.css" %>
<% end %> <%= stylesheet_link_tag "lib/main-forms.css" %>
<%= stylesheet_link_tag "lib/togglebox.css" %>
<% end -%>
<% content_for :page_specific_javascript do -%> <% content_for :page_specific_javascript do -%>
<script> <%= javascript_include_tag "lib/jquery.tmpl.min.js" %>
var CloneTarget ; <%= javascript_include_tag "lib/member/role-forms.js" %>
var NewNode;
$(document).ready(function(){
function checkSwitch() {
$(".groups").addClass('disabled').has('.groups > .form-horizontal > div:not(.hide)').removeClass('disabled');
}
function checkMultipleInput() {
$(".multipleInput").each(function() {
$(this).find('.controls').length==1 ? $(this).addClass("plural") : $(this).removeClass("plural")
});
}
function removeInput(){
$(".removeInput").live('click',function (){
$(this).parents(".controls").remove();
checkMultipleInput();
return false;
});
}
checkSwitch();
checkMultipleInput();
removeInput();
$(".remove_attribute").live('click',function(){
$(this).siblings(".attribute_field_to_delete").val("true");
$(this).parents(".form-horizontal").fadeOut("slow", function () { $(this).hide(); });
});
$(".help-block a").live('click',function (){
CloneTarget = $(this).parents(".controls").prev(".multipleInput").find('.controls:last');
NewNode = CloneTarget.clone();
var index;
NewNode.find("input").each(function(k,v){
index = CloneTarget.parents("div.control-group").find(".list_count").val()
field_name = CloneTarget.parents("div.control-group").find(".field_name").val()
ori_str = $(v).attr("name").replace(field_name,"");
lang = ori_str.match(/\[\D*\]/);
new_field_name = (field_name+"[" + (parseInt(index)+1) + "]" + lang);
$(v).attr("name",new_field_name);
})
$(this).parents("div.control-group").find(".list_count").val(parseInt(index)+1)
$(this).parents(".controls").prev(".multipleInput").append(NewNode);
$(this).parents(".controls").prev(".multipleInput").find('.controls:last input').val("");
removeInput();
checkMultipleInput();
return false;
})
$(".status select").each(function (i) {
$(this).change(function () {
$(".status option:selected").eq(i).each(function () {
if($(this).attr("value")=="alumna") {
$(this).parents(".status").nextAll(".graduated").removeClass("hide");
$(this).parents(".status").nextAll(".graduated").find("select").removeAttr("disabled");
}else{
$(this).parents(".status").nextAll(".graduated").addClass("hide");
$(this).parents(".status").nextAll(".graduated").find("select").attr({disabled:''});
}
});
})
})
$('.onoff').live('click',function () {
if($(this).parents("h4").length==1) {
$(this).parents(".map-block").toggleClass("disabled");
$(this).parents(".map-block").find(".form-horizontal").toggleClass("hide");
if($(this).parents(".map-block").hasClass("disabled")){
$(this).text("OFF");
}else{
$(this).text("ON");
}
}
if($(this).parents("legend").length==1) {
$(this).toggleClass("disabled");
$(this).parents("legend").next("div").toggleClass("hide");
if($(this).parents("legend").next("div").hasClass("hide")){
$(this).text("OFF");
$(this).siblings(".attribute_field_disabled").val("true");
}else{
$(this).text("ON");
$(this).siblings(".attribute_field_disabled").val("false");
}
checkSwitch();
}
return false;
});
$(".dataType").change(function () {
$(this).parents("legend").next("div").find("div[class^='type']").addClass("hide");
$(this).parents("legend").next("div").find("."+$(this).find("option:selected").attr("ref")).removeClass("hide");
})
});
</script>
<% end -%> <% end -%>
<%= form_for @attribute,:url => eval("admin_#{@attribute_type}_path(@attribute)") , :html => { :class=> "form-horizontal main-forms", :id=>'info' } do |f| %>
<h3><%= t(eval(":#{@attribute_type}"))%></h3>
<fieldset>
<div id="basic-area" class="input-area">
<div class="basic">
<div class="attributes-header clearfix">
<h4>Basic</h4>
</div>
<div class="attributes-body">
<div class="control-group">
<label class="control-label muted" for="key_0">Key</label>
<div class="controls">
<% if @attribute.new_record? %>
<%= f.text_field :key, :placeholder => t(:key) %>
<% else %>
<div><%= @attribute.key %></div>
<% end %>
</div>
</div>
<%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:values=>@attribute.title_translations,:class_ext=>"pull-left",:label_ext=>t(:item_name),:field_name=>"#{@attribute_type}[title_translations]"}%>
<div class="control-group">
<label class="control-label muted" for=""><%= t(:to_search) %></label>
<div class="controls">
<label class="radio inline">
<%= f.radio_button :to_search, true %>
<%= t(:yes_)%>
</label>
<label class="radio inline">
<%= f.radio_button :to_search, false %>
<%= t(:no_)%>
</label>
</div>
</div>
</div>
</div>
</div>
</fieldset>
<h3><%= @attribute.title %></h3>
<fieldset>
<div id="attributes-area" class="input-area">
<%= render :partial=>"shared/attribute_field/attribute_field",:collection=>@attribute.attribute_fields%>
</div>
<div class="form-actions">
<button type="button" class="btn btn-success add-attributes"><%= t(:add_attribute_field) %></button>
<%= hidden_field_tag 'id', params[:role_id] if !params[:role_id].blank? %>
<%= f.submit t(:submit),:class=>"btn btn-primary"%>
<%= link_to t('cancel'), get_go_back, :class=>"btn" %>
</div>
</fieldset>
<% end %>
<% content_for :page_specific_javascript do -%>
<%= render 'js/support_member_form_js' %>
<% end -%>

View File

@ -1,60 +1,25 @@
<% content_for :side_bar do %> <% content_for :side_bar do %>
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member_), :link_url => admin_site_site_info_path(@site), :icon => 'icons-group', :side_bar_content => 'admin/users_new_interface/side_bar'} %> <%= render :partial => 'admin/users_new_interface/side_bar' %>
<% end %> <% end %>
<% content_for :page_specific_css do -%>
<%= stylesheet_link_tag "lib/wrap-nav.css" %>
<%= stylesheet_link_tag "lib/pageslide.css" %>
<%= stylesheet_link_tag "lib/main-forms.css" %>
<%= stylesheet_link_tag "lib/togglebox.css" %>
<% end -%>
<div class="bottomnav clearfix">
<div class="subnav"> <div class="action pull-right">
<div id="accordion"> <%= link_to content_tag(:i,t("new.#{@attribute_type}"),:class=>"icon-plus"),eval("new_admin_#{@attribute_type}_path"),:class=>"btn btn-primary open-slide"%>
<div class="accordion-group filters"> </div>
<div class="table-label">
<table class="table main-list">
<thead>
<tr class="sort-header">
<th id="sort-name" class="sort span1-2 select active"><span><a href="#"><%= t("#{@attribute_type}") %><b class="web-symbol"></b></a></span></th>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>
<table class="table main-list member-list">
<thead>
<tr>
<th class="span1-2"></th>
</tr>
</thead>
<tbody>
<% @attributes.each do |attribute| %>
<tr class="with_action">
<td class="span1-2">
<%= attribute.title %>
<div class="quick-edit">
<ul class="nav nav-pills hide">
<li><%= link_to t(:edit), eval("edit_admin_#{@attribute_type}_path(attribute)") %></li>
<% if @attribute_type == 'role' %>
<li><%= link_to t(:role_field), eval("admin_#{@attribute_type}_role_field_path(attribute)") %></li>
<li><%= link_to t(:sub_role), eval("admin_#{@attribute_type}_sub_role_path(attribute)") %></li>
<li><%= link_to t(:status), eval("admin_role_statuses_path(:role_id=>attribute)") %></li>
<li><%= link_to t(:category), eval("admin_role_categorys_path(:role_id=>attribute)") %></li>
<% end %>
<li><%= link_to t(:enable), eval("admin_#{@attribute_type}_path(attribute, :authenticity_token => form_authenticity_token, :#{@attribute_type} => {:disabled => true})"), :remote => true, :method => :put, :id => "disable_#{attribute.id}", :style => "display:#{attribute.is_disabled? ? 'none' : ''}", :class => 'switch' %></li>
<li><%= link_to t(:disable), eval("admin_#{@attribute_type}_path(attribute, :authenticity_token => form_authenticity_token, :#{@attribute_type} => {:disabled => false})"), :remote => true, :method => :put, :id => "enable_#{attribute.id}", :style => "display:#{attribute.is_disabled? ? '' : 'none'}", :class => 'switch' %></li>
<% if !attribute.is_built_in? %>
<li><%= link_to t(:delete_), eval("admin_#{@attribute_type}_path(attribute)"), :class => 'delete', :confirm => t('sure?'), :method => :delete %></li>
<% end %>
</ul>
</div>
</td>
</tr>
<% end %>
</tbody>
</table>
<div class="form-actions form-fixed pagination-right">
<%= link_to content_tag(:i,t("new.#{@attribute_type}"),:class=>"icon-plus icon-white"),eval("new_admin_#{@attribute_type}_path"),:class=>"btn btn-primary pull-right"%>
</div> </div>
<div id="attributes_index">
<%= render 'admin/attributes/index' %>
</div>
<%#= link_to content_tag(:i, nil, class: "icon-edit"), eval("edit_admin_#{node.class.to_s.downcase}_path(node)"), class: "open-slide tip", title: t(:edit) %>
<%#= link_to content_tag(:i, nil, class: "icons-newspaper"), new_admin_page_path(:parent_id => node.id), class: "open-slide tip", title: t(:add_page) if node.class.to_s.eql?('Page') %>
<%#= javascript_include_tag "lib/jquery.pageslide.js" %>

View File

@ -0,0 +1,3 @@
$("#attributes_index").html("<%= j render 'admin/attributes/index' %>")
$.pageslide.close();
openSlide();

View File

@ -10,11 +10,11 @@
<div class="controls"> <div class="controls">
<label class="radio inline"> <label class="radio inline">
<%= f.radio_button :to_search, true %> <%= f.radio_button :to_search, true %>
Yes <%= t(:yes_)%>
</label> </label>
<label class="radio inline"> <label class="radio inline">
<%= f.radio_button :to_search, false %> <%= f.radio_button :to_search, false %>
No <%= t(:no_)%>
</label> </label>
</div> </div>
</div> </div>
@ -29,7 +29,14 @@
<% end %> <% end %>
</div> </div>
</div> </div>
<%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:values=>@attribute.title_translations,:class_ext=>"pull-left",:label_ext=>t(:item_name),:field_name=>"#{@attribute_type}[title_translations]"}%>
<% @site_valid_locales.each_with_index do |locale, i| %>
<label class="muted" for="name-en"><%= t(:item_name) %>(<%= I18nVariable.from_locale(locale) %>)</label>
<input id="name-<%= locale %>" type="text" class="input-large" placeholder="<%= t(:item_name) %>" name="<%="#{@attribute_type}[title_translations][#{locale}]"%>">
<% end %>
<%#= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:values=>@attribute.title_translations,:class_ext=>"pull-left",:label_ext=>t(:item_name),:field_name=>"#{@attribute_type}[title_translations]"}%>
</div> </div>
</div> </div>
</div> </div>

View File

@ -0,0 +1,11 @@
<%= form_for(:role_filter, :remote => true, :url => @url, :method => @verb, :html => { :id => 'form_role_filter' } ) do |f| %>
<fieldset>
<legend>Edit</legend>
<%= render :partial => 'form', :locals => {:f => f} %>
</fieldset>
<div class="form-actions">
<a href="javascript:$.pageslide.close()" class="btn btn-small"><%= t(:cancel) %></a>
<%= f.submit t(:update_), class: 'btn btn-primary btn-small' %>
</div>
<% end %>

View File

@ -1,31 +1,14 @@
<% # encoding: utf-8 %>
<%= form_for(:role_filter, :remote => true, :url => @url, :method => @verb, :html => { :id => 'form_role_filter' } ) do |f| %> <%= flash_messages %>
<%= f.error_messages %>
<h2><%= (@role_filter.new_record? ? 'Add' : 'Edit') %></h2> <%= label_tag "key","key", :class=>"muted" %>
<%= f.text_field :key, :class=>"input-large" %>
<div id="widget-title">
<%= f.label :key %>
<%= f.text_field :key %>
</div>
<div id="widget-title">
<%= f.fields_for :title_translations do |f| %>
<% @site_valid_locales.each do |locale| %>
<div class="control-group">
<%= label_tag "name-#{locale}", "Name-#{I18nVariable.from_locale(locale)}", :class => 'control-label' %>
<div class="controls">
<%= f.text_field locale, :class =>' input-xxlarge', :value => (@role_filter.title_translations[locale] rescue nil) %>
</div>
</div>
<% end %>
<% end %>
</div>
<div class="form-actions">
<%= f.hidden_field :role_id, :value => params[:role_id] if !params[:role_id].blank? %>
<%= f.submit 'Submit/送出', :class=>'btn btn-primary' %>
</div>
<%= f.fields_for :title_translations do |f| %>
<% @site_valid_locales.each do |locale| %>
<%= label_tag "name-#{locale}", "#{t(:name)} (#{I18nVariable.from_locale(locale)})" %>
<%= f.text_field locale, :class => 'input-large', :value => (@role_filter.title_translations[locale] rescue ''), placeholder: t(:name) %>
<% end %>
<% end %> <% end %>
<%= f.hidden_field :role_id, :value => params[:role_id] if !params[:role_id].blank? %>

View File

@ -0,0 +1,18 @@
<table class="table main-list">
<thead>
<tr class="sort-header">
<th class="span3 active"><a href="#">Key<b class="icons-arrow-down-4"></b></a></th>
<% @site_valid_locales.each do |locale| %>
<th><%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %></th>
<% end %>
<th class="span1"></th>
</tr>
</thead>
<tbody>
<%= render :partial => 'role_filter', :collection => @role_filters %>
</tbody>
</table>

View File

@ -0,0 +1,11 @@
<%= form_for(:role_filter, :remote => true, :url => @url, :method => @verb, :html => { :id => 'form_role_filter' } ) do |f| %>
<fieldset>
<legend>Add</legend>
<%= render :partial => 'form', :locals => {:f => f} %>
</fieldset>
<div class="form-actions">
<a href="javascript:$.pageslide.close()" class="btn btn-small"><%= t(:cancel) %></a>
<%= f.submit t(:create_), class: 'btn btn-primary btn-small' %>
</div>
<% end %>

View File

@ -1,23 +1,32 @@
<tr id="<%= dom_id role_filter %>" class="with_action"> <tr id="<%= dom_id role_filter %>" class="<% role_filter.disable ? 'disable' : '' %>">
<td> <td><span class="label label-info"><%= role_filter.key %></span></td>
<%= role_filter.key %> <% if @types.is_localized?(:title) %>
<div class="quick-edit"> <% @site_valid_locales.each_with_index do |locale, i| %>
<ul class="nav nav-pills hide"> <td>
<% if is_admin?%> <%= role_filter.title_translations[locale] rescue nil %>
<li><%= link_to t('role_filter.edit'), <% if i == 0 %>
polymorphic_path([:admin, role_filter], {:action => :edit}), :remote => true %></li> <div class="quick-edit">
<li><%= link_to show_toggle_archive_btn(role_filter), <ul class="nav nav-pills">
polymorphic_path([:admin, role_filter]), :confirm => t('sure?'), :method => :delete, :remote => true,:class=>"archive_toggle" %></li> <li><%= link_to t(:edit), polymorphic_path([:admin, role_filter], {:action => :edit}), :class=>"open-slide" %></li>
<% end %> </ul>
</ul> </div>
</div> <% end %>
</td> </td>
<% if @types.is_localized?(:title) %> <% end %>
<% @site_valid_locales.each do |locale| %> <% else %>
<td><%= role_filter.title_translations[locale] rescue nil %></td> <td><%= role_filter.title %></td>
<% end %> <% end %>
<% else %>
<td><%= role_filter.title %></td> <td class="action">
<% end %> <%#= link_to role_filter.disable ? t(:disable) : t(:enable), polymorphic_path([:admin, role_filter]), :confirm => t('sure?'), :method => :delete, :remote => true,:class=>"btn btn-mini btn-success", :type=>"button" %>
</tr>
<div class="toggle-control" style="float: right;">
<div class="togglebox <%= role_filter.disable ? 'disabled' : '' %>">
<%= link_to (check_box_tag 'accept', false , :class => 'toggle-check', :data=>{:deploy=>"right"}) , eval("admin_#{@app_type == 'role_statuses' ? 'role_status' : @app_type }_toggle_path(role_filter)"), method: :post, remote: true, class: "switch" %>
<label><b></b></label>
</div>
</div>
</td>
</tr>

View File

@ -0,0 +1 @@
<%= render 'edit' %>

View File

@ -1,49 +1,30 @@
<% content_for :side_bar do %> <% content_for :side_bar do %>
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member_), :link_url => admin_site_site_info_path(@site), :icon => 'icons-group', :side_bar_content => 'admin/users_new_interface/side_bar'} %> <%= render :partial => 'admin/users_new_interface/side_bar' %>
<% end %> <% end %>
<div class="subnav"> <% content_for :page_specific_css do -%>
<ul class="breadcrumb"> <%= stylesheet_link_tag "lib/wrap-nav.css" %>
<li><%= link_to( t("role"), admin_roles_path ) %> <span class="divider">/</span></li> <%= stylesheet_link_tag "lib/pageslide.css" %>
<li class="active">( <%= @role.title %> ) <%= t(@app_type_name) %></li> <%= stylesheet_link_tag "lib/main-list.css" %>
</ul> <%= stylesheet_link_tag "lib/togglebox.css" %>
<div id="accordion"> <% end -%>
<div class="accordion-group filters">
<div class="table-label">
<table class="table main-list">
<thead>
<tr class="sort-header">
<th id="sort-name" class="sort span1-2 select"><span><a href="#"><%= t('role_filters.key') %><b class="web-symbol"></b></a></span></th> <div id="filter" class="topnav clearfix">
<% @site_valid_locales.each do |locale| %> <ul class="breadcrumb text-info pull-left">
<th id="sort-name" class="sort span1-2 select"><span><a href="#"><%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %><b class="web-symbol"></b></a></span></th> <li><%= link_to( t("role"), admin_roles_path ) %> <span class="divider">/</span></li>
<% end %> <li class="active">( <%= @role.title %> ) <%= t(@app_type_name) %></a></li>
</ul>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div> </div>
<table id="role_filters" class="table main-list">
<thead>
<tr>
<th class="span1-2"></th>
<% @site_valid_locales.each do |locale| %>
<th class="span1-2"></th>
<% end %>
</tr>
</thead>
<tbody>
<%= render :partial => 'role_filter', :collection => @role_filters %> <div class="bottomnav clearfix">
<div class="action pull-right">
<%= link_to content_tag(:i, nil, class: "icons-plus") + " " + t(:add), eval("new_admin_#{@app_type == 'role_statuses' ? 'role_status' : @app_type }_path(:role_id=>params[:role_id])"), class: "btn btn-primary open-slide" %>
</div>
</div>
</tbody> <div id="role_filters_index">
</table> <%= render 'index' %>
</div>
<div id="form"><%= render :partial => "form" %></div>

View File

@ -0,0 +1,3 @@
$("#role_filters_index").html("<%= j render 'index' %>")
$.pageslide.close();
openSlide();

View File

@ -0,0 +1 @@
<%= render 'new' %>

View File

@ -1,125 +1,130 @@
<div class="form-horizontal <%= attribute_field.disabled ? 'disabled' : ''%>"> <div class="attributes default <%= attribute_field.disabled ? 'disabled' : ''%>">
<% <%
attribute_field.af_count ? @af_counter = attribute_field_counter + attribute_field.af_count : @af_counter = attribute_field_counter attribute_field.af_count ? @af_counter = attribute_field_counter + attribute_field.af_count : @af_counter = attribute_field_counter
%> %>
<%= @af_counter + 1 %> <div class="attributes-header clearfix">
<%#= attribute_field_counter %> <div class="toggle-control" style="float: right;">
<legend> <div class="togglebox <%= attribute_field.disabled ? 'disabled' : ''%>">
<button class="onoff pull-right <%= attribute_field.disabled ? 'disabled' : ''%>"><%= attribute_field.disabled ? 'OFF' : 'ON'%></button> <%= hidden_field "#{@field_name}[attribute_fields][#{@af_counter}]","disabled",:value=>attribute_field.disabled,:class=>"toggle-check", :data=>{:deploy=>"right"} %>
<%= hidden_field "#{@field_name}[attribute_fields][#{@af_counter}]","disabled",:value=>attribute_field.disabled,:class=>"attribute_field_disabled"%> <label><b></b></label>
<%= hidden_field "#{@field_name}[attribute_fields][#{@af_counter}]","to_delete",:value=>false,:class=>"attribute_field_to_delete"%>
<a class="btn btn-small pull-right btn-danger remove_attribute"><i class="icon-trash icon-large"></i> <%= t(:delete_)%></a>
<div class="clear">
<div class="control-group pull-left">
<label class="control-label" for="key"><%= t(:key) %></label>
<div class="multipleInput">
<div class="controls">
<%= text_field "#{@field_name}[attribute_fields][#{@af_counter}]","key",:value=>attribute_field.key%>
</div>
</div>
</div>
<%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:values=>attribute_field.title_translations,:class_ext=>"pull-left",:label_ext=>t(:name),:field_name=>"#{@field_name}[attribute_fields][#{@af_counter}][title_translations]"}%>
<div class="control-group">
<label class="control-label" for="key"><%= t(:to_search) %></label>
<div class="controls">
<label class="radio inline">
<%= radio_button("#{@field_name}[attribute_fields][#{@af_counter}]", "to_search", "true",:checked => (attribute_field.to_search == true ? true : false)) %><%= t(:yes_)%>
</label>
<label class="radio inline">
<%= radio_button("#{@field_name}[attribute_fields][#{@af_counter}]", "to_search", "false",:checked => (attribute_field.to_search == false ? true : false)) %><%= t(:no_)%>
</label>
</div>
</div>
<div class="control-group pull-left">
<label class="control-label" for=""><%= t(:type)%></label>
<div class="controls">
<%#= select_tag "#{@field_name}[attribute_fields][#{@af_counter}][markup]" do %>
<select class="dataType" name=<%= "#{@field_name}[attribute_fields][#{@af_counter}][markup]"%>>
<%LIST[:markups].each do |key,val|%>
<option value="<%= key %>" <%= attribute_field.markup == key ? 'selected="selected"' : '' %> ref="<%=val["panel"]%>"><%=t("lists.markups."+key)%></option >
<% end %>
</select>
</div>
</div>
</div>
</legend>
<div class="<%= attribute_field.disabled ? 'hide' : ''%>">
<%= content_tag :div,:class=>show_type_panel(attribute_field,"typeA") do%>
<div class="control-group">
<label class="control-label"><%= t(:enabled_for)%></label>
<div class="controls">
<label class="checkbox inline">
<%= check_box_tag("#{@field_name}[attribute_fields][#{@af_counter}][typeA][cross_lang]","true",attribute_field["typeA"]["cross_lang"]) %>
<%= t(:cross_lang)%>
</label>
<label class="checkbox inline">
<%= check_box_tag("#{@field_name}[attribute_fields][#{@af_counter}][typeA][add_more]","true",attribute_field["typeA"]["add_more"]) %>
<%= t(:add_more)%>
</label>
</div>
</div>
<%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:values=>attribute_field["typeA"]["placeholder"],:field_name=>"#{@field_name}[attribute_fields][#{@af_counter}][typeA][placeholder]"}%>
<% end %>
<%= content_tag :div,:class=>show_type_panel(attribute_field,"typeB") do %>
<%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:label_ext=>t(:initial),:values=>attribute_field["typeB"]["initial"],:field_name=>"#{@field_name}[attribute_fields][#{@af_counter}][typeB][initial]"}%>
<% if attribute_field.self_defined_markup_options?%>
<%= render :partial=>"shared/attribute_field/list_block",:locals=>{:values=>attribute_field["option_list"],:field_name=> "#{@field_name}[attribute_fields][#{@af_counter}][attribute][role][statuses]"} %>
<%else #normal list%>
<%= render :partial=>"shared/attribute_field/list_block",:locals=>{:values=>attribute_field["option_list"],:field_name=> "#{@field_name}[attribute_fields][#{@af_counter}][typeB][option_list]"} %>
<% end #of self_defined_markup_options?%>
<% end %>
<%= content_tag :div,:class=>show_type_panel(attribute_field,"typeC") do %>
<div class="control-group">
<label class="control-label"><%= t("date.format")%></label>
<div class="controls">
<%= select "#{@field_name}[attribute_fields][#{@af_counter}][typeC]","format",Admin::AttributeValuesViewHelper::OPT,:class=>"dataType",:selected=>attribute_field["typeC"]["format"] %>
</div>
</div>
<div class="control-group">
<label class="control-label"><%= t("date.range")%></label>
<div class="controls">
<label class="radio inline">
<%= radio_button("#{@field_name}[attribute_fields][#{@af_counter}][typeC]", "is_range", "false",:checked => (!attribute_field.date_is_range? ? true : false)) %><%= t(:yes_)%>
</label>
<label class="radio inline">
<%= radio_button("#{@field_name}[attribute_fields][#{@af_counter}][typeC]", "is_range", "true",:checked => (attribute_field.date_is_range? ? true : false)) %><%= t(:no_)%>
</label>
</div>
</div>
<div class="control-group">
<label class="control-label"><%= t("date.calendar")%></label>
<div class="controls">
<label class="radio inline">
<%= radio_button("#{@field_name}[attribute_fields][#{@af_counter}][typeC]", "calendar", "west_calendar",:checked =>(attribute_field["typeC"]["calendar"]== "west_calendar" ? true : false)) %><%= t("date.west_calendar")%>
</label>
<label class="radio inline">
<%= radio_button("#{@field_name}[attribute_fields][#{@af_counter}][typeC]", "calendar", "tw_calendar",:checked =>(attribute_field["typeC"]["calendar"]== "tw_calendar" ? true : false)) %><%= t("date.tw_calendar")%>
</label>
</div>
</div>
<% end %>
<%= content_tag :div,:class=>show_type_panel(attribute_field,"typeD") do%>
<div class="control-group">
<label class="control-label"><%= t(:enabled_for)%></label>
<div class="controls">
<label class="checkbox inline">
<%= check_box_tag("#{@field_name}[attribute_fields][#{@af_counter}][typeD][cross_lang]","true",attribute_field["typeD"]["cross_lang"]) %>
<%= t(:cross_lang)%>
</label>
</div>
</div>
<%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:field_name=>"#{@field_name}[attribute_fields][#{@af_counter}][typeD][placeholder]",:values=>attribute_field["typeD"]["placeholder"]} %>
<% end %>
<%= content_tag :div,:class=>show_type_panel(attribute_field,"typeE") do%>
<%= render :partial=>"shared/attribute_field/list_block",:locals=>{:field_name=>"#{@field_name}[attribute_fields][#{@af_counter}][typeE][option_list]",:values=>attribute_field["option_list"]}%>
<% end %>
</div> </div>
<%= hidden_field "#{@field_name}[attribute_fields][#{@af_counter}]","id",:value=>attribute_field.id%> </div>
<a class="btn btn-mini pull-right btn-danger delete" href="#"><i class="icon-trash"></i> <%= t(:delete_)%></a>
<%= hidden_field "#{@field_name}[attribute_fields][#{@af_counter}]","to_delete",:value=>false,:class=>"attribute_field_to_delete"%>
<a class="btn btn-mini pull-right btn-inverse reply hide" href="#"><i class="icons-reply"></i> Reset</a>
<h4>Attributes <span><%= @af_counter + 1 %></span></h4>
</div> </div>
<div class="attributes-body">
<div class="control-group">
<label class="control-label muted" for="key_<%= @af_counter %>"><%= t(:key) %></label>
<div class="controls">
<%= text_field "#{@field_name}[attribute_fields][#{@af_counter}]","key",:value=>attribute_field.key, :data=>{:type=>"key"} %>
</div>
</div>
<%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:values=>attribute_field.title_translations,:class_ext=>"pull-left",:label_ext=>t(:name),:field_name=>"#{@field_name}[attribute_fields][#{@af_counter}][title_translations]"}%>
<div class="control-group">
<label class="control-label muted" for=""><%= t(:to_search) %></label>
<div class="controls">
<label class="radio inline">
<%= radio_button("#{@field_name}[attribute_fields][#{@af_counter}]", "to_search", "true",:checked => (attribute_field.to_search == true ? true : false), :data=>{:type=>"search_true"}) %><%= t(:yes_)%>
</label>
<label class="radio inline">
<%= radio_button("#{@field_name}[attribute_fields][#{@af_counter}]", "to_search", "false",:checked => (attribute_field.to_search == false ? true : false), :data=>{:type=>"search_false"}) %><%= t(:no_)%>
</label>
</div>
</div>
<div class="control-group">
<label class="control-label muted" for=""><%= t(:type)%></label>
<div class="controls">
<select class="dataType" data-type="select" name=<%= "#{@field_name}[attribute_fields][#{@af_counter}][markup]"%>>
<%LIST[:markups].each do |key,val|%>
<option value="<%= key %>" <%= attribute_field.markup == key ? 'selected="selected"' : '' %> ref="<%=val["panel"]%>"><%=t("lists.markups."+key)%></option >
<% end %>
</select>
</div>
</div>
</div>
<div class="field-type fade"></div>
<%= content_tag :div,:class=>"field-type default fade in #{show_type_panel(attribute_field,"typeA")}" do%>
<div class="control-group">
<label class="control-label muted"><%= t(:enabled_for)%></label>
<div class="controls">
<label class="checkbox inline">
<%= check_box_tag("#{@field_name}[attribute_fields][#{@af_counter}][typeA][cross_lang]","true",attribute_field["typeA"]["cross_lang"],:data=>{:type=>"cross_lang"}) %>
<%= t(:cross_lang) %>
</label>
<label class="checkbox inline">
<%= check_box_tag("#{@field_name}[attribute_fields][#{@af_counter}][typeA][add_more]","true",attribute_field["typeA"]["add_more"],:data=>{:type=>"add_more"}) %>
<%= t(:add_more)%>
</label>
</div>
</div>
<%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:values=>attribute_field["typeA"]["placeholder"],:field_name=>"#{@field_name}[attribute_fields][#{@af_counter}][typeA][placeholder]"}%>
<% end if show_type_panel(attribute_field,"typeA") != 'typeA hide' %>
<%= content_tag :div,:class=>"field-type default fade in #{show_type_panel(attribute_field,"typeB")}" do %>
<%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:label_ext=>t(:initial),:values=>attribute_field["typeB"]["initial"],:field_name=>"#{@field_name}[attribute_fields][#{@af_counter}][typeB][initial]"}%>
<% if attribute_field.self_defined_markup_options?%>
<%= render :partial=>"shared/attribute_field/list_block",:locals=>{:values=>attribute_field["option_list"],:field_name=> "#{@field_name}[attribute_fields][#{@af_counter}][attribute][role][statuses]"} %>
<%else #normal list%>
<%= render :partial=>"shared/attribute_field/list_block",:locals=>{:values=>attribute_field["option_list"],:field_name=> "#{@field_name}[attribute_fields][#{@af_counter}][typeB][option_list]"} %>
<% end #of self_defined_markup_options?%>
<% end if show_type_panel(attribute_field,"typeB") != 'typeB hide' %>
<%= content_tag :div,:class=>"field-type default fade in #{show_type_panel(attribute_field,"typeC")}" do %>
<div class="control-group">
<label class="control-label"><%= t("date.format")%></label>
<div class="controls">
<%= select "#{@field_name}[attribute_fields][#{@af_counter}][typeC]","format",Admin::AttributeValuesViewHelper::OPT,:class=>"dataType",:selected=>attribute_field["typeC"]["format"] %>
</div>
</div>
<div class="control-group">
<label class="control-label"><%= t("date.range")%></label>
<div class="controls">
<label class="radio inline">
<%= radio_button("#{@field_name}[attribute_fields][#{@af_counter}][typeC]", "is_range", "false",:checked => (!attribute_field.date_is_range? ? true : false)) %><%= t(:yes_)%>
</label>
<label class="radio inline">
<%= radio_button("#{@field_name}[attribute_fields][#{@af_counter}][typeC]", "is_range", "true",:checked => (attribute_field.date_is_range? ? true : false)) %><%= t(:no_)%>
</label>
</div>
</div>
<div class="control-group">
<label class="control-label"><%= t("date.calendar")%></label>
<div class="controls">
<label class="radio inline">
<%= radio_button("#{@field_name}[attribute_fields][#{@af_counter}][typeC]", "calendar", "west_calendar",:checked =>(attribute_field["typeC"]["calendar"]== "west_calendar" ? true : false)) %><%= t("date.west_calendar")%>
</label>
<label class="radio inline">
<%= radio_button("#{@field_name}[attribute_fields][#{@af_counter}][typeC]", "calendar", "tw_calendar",:checked =>(attribute_field["typeC"]["calendar"]== "tw_calendar" ? true : false)) %><%= t("date.tw_calendar")%>
</label>
</div>
</div>
<% end if show_type_panel(attribute_field,"typeC") != 'typeC hide' %>
<%= content_tag :div,:class=>"field-type default fade in #{show_type_panel(attribute_field,"typeD")}" do%>
<div class="control-group">
<label class="control-label"><%= t(:enabled_for)%></label>
<div class="controls">
<label class="checkbox inline">
<%= check_box_tag("#{@field_name}[attribute_fields][#{@af_counter}][typeD][cross_lang]","true",attribute_field["typeD"]["cross_lang"]) %>
<%= t(:cross_lang)%>
</label>
</div>
</div>
<%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:field_name=>"#{@field_name}[attribute_fields][#{@af_counter}][typeD][placeholder]",:values=>attribute_field["typeD"]["placeholder"]} %>
<% end if show_type_panel(attribute_field,"typeD") != 'typeD hide' %>
<%= content_tag :div,:class=>"field-type default fade in #{show_type_panel(attribute_field,"typeE")}" do%>
<%= render :partial=>"shared/attribute_field/list_block",:locals=>{:field_name=>"#{@field_name}[attribute_fields][#{@af_counter}][typeE][option_list]",:values=>attribute_field["option_list"]}%>
<% end if show_type_panel(attribute_field,"typeE") != 'typeE hide' %>
<%= hidden_field "#{@field_name}[attribute_fields][#{@af_counter}]","id",:value=>attribute_field.id%>
</div>

View File

@ -0,0 +1,24 @@
<tr id="<%= dom_id sub_role_attribute %>" class="<%= sub_role_attribute.disabled ? 'disable' : '' %>">
<td>
<span class="label label-info"><%= sub_role_attribute.title %></span>
<div class="quick-edit">
<ul class="nav nav-pills">
<li><%= link_to t(:edit), eval("admin_#{@attribute_type}_edit_sub_role_path(sub_role_attribute)"), :class=>"open-slide" %></li>
<li><%= link_to t(:sub_role_field), eval("admin_#{@attribute_type}_sub_role_field_path(sub_role_attribute)"), :class => 'edit' %></li>
</ul>
</div>
</td>
<td class="action span3">
<div class="toggle-control" style="float: right;">
<div class="togglebox <%= sub_role_attribute.disabled ? 'disabled' : '' %>">
<%= link_to (check_box_tag 'accept', false , :class => 'toggle-check', :data=>{:deploy=>"right"}) , eval("admin_role_sub_role_toggle_path(sub_role_attribute)"), method: :post, remote: true, class: "switch" %>
<label><b></b></label>
</div>
</div>
<% if !sub_role_attribute.is_built_in? %>
<%= link_to (content_tag :i,'',:class=>'icon-trash')+t(:delete_), eval("admin_#{@attribute_type}_path(sub_role_attribute, :sub_role => {:id => sub_role_attribute })"), :type=>"button", :class => 'btn btn-mini btn-danger', :confirm => t('sure?'), :method => :delete, :remote => true %>
<% end %>
</td>
</tr>

View File

@ -0,0 +1,12 @@
<table class="table main-list" id="roles_index">
<thead>
<tr class="sort-header">
<th colspan="2" class="span4 active"><a href="#"><%= t("sub_role") %><b class="icons-arrow-down-4"></b></a></th>
</tr>
</thead>
<tbody>
<%= render partial: 'sub_role_attribute', collection: @attribute_fields_upper_object %>
</tbody>
</table>

View File

@ -1,57 +1,33 @@
<%= form_for @sub_attribute,:url => eval("admin_#{@attribute_type}s_path") ,:class=> "form-horizontal", :id=>"new_bulletin_category", remote: true do |f| %>
<fieldset>
<legend><%= t(eval(":#{@attribute_type}"))%>:<%= @attribute.title %></legend>
<label class="muted" for="key"><%= t(:key) %></label>
<% if @sub_attribute.new_record? %>
<%= f.text_field :key, :class => "input-large", :placeholder => t(:key) %>
<% else %>
<div><%= @sub_attribute.key%></div>
<% end %>
<% content_for :side_bar do %> <% @site_valid_locales.each_with_index do |locale, i| %>
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member_), :link_url => admin_site_site_info_path(@site), :icon => 'icons-group', :side_bar_content => 'admin/users_new_interface/side_bar'} %>
<% end %> <label class="muted" for="name-en"><%= t(:item_name) %>(<%= I18nVariable.from_locale(locale) %>)</label>
<input id="name-<%= locale %>" type="text" class="input-large" placeholder="<%= t(:item_name) %>" name="<%="sub_role[title_translations][#{locale}]"%>">
<%= form_for @sub_attribute,:url => eval("admin_#{@attribute_type}s_path") ,:class=> "form-horizontal" do |f| %> <% end %>
<div class="site-map role-block">
<div class="map-block back"> <label class="muted" for="name-zh-tw"><%= t(:to_search) %></label>
<h4><span><%= t(eval(":#{@attribute_type}"))%>:<%= @attribute.title %></span></h4> <label class="radio inline">
<div class="form-horizontal"> <%= f.radio_button :to_search, true %>
<div class="clear"> Yes
</label>
<div class="control-group pull-left"> <label class="radio inline">
<label class="control-label" for="key"><%= t(:to_search) %></label> <%= f.radio_button :to_search, false %>
<div class="controls"> No
<label class="radio inline"> </label>
<%= f.radio_button :to_search, true %> <div class="form-actions">
Yes <%= f.hidden_field :role_id, :value => params[:role_id] if !params[:role_id].blank? %>
</label> <%= f.submit t('submit'), :class=>'btn btn-primary btn-small' %>
<label class="radio inline"> <%= link_to t('cancel'), 'javascript:$.pageslide.close()', :class=>" btn-small" %>
<%= f.radio_button :to_search, false %> </div>
No </fieldset>
</label>
</div>
</div>
<div class="control-group pull-left">
<label class="control-label" for="key"><%= t(:key) %></label>
<div class="controls">
<% if @sub_attribute.new_record? %>
<%= f.text_field :key, :placeholder => t(:key) %>
<% else %>
<div><%= @sub_attribute.key%></div>
<% end %>
</div>
</div>
<%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:values=>@sub_attribute.title_translations,:class_ext=>"pull-left",:label_ext=>t(:item_name),:field_name=>"sub_role[title_translations]"}%>
</div>
</div>
</div>
</div>
<div class="form-actions form-fixed pagination-right">
<%#= hidden_field_tag 'id', params[:role_id] if !params[:role_id].blank? %>
<%= f.hidden_field :role_id, :value => params[:role_id] if !params[:role_id].blank? %>
<%= f.submit t('submit'), :class=>'btn btn-primary' %>
<%= link_to t('cancel'), get_go_back, :class=>"btn" %>
</div>
<% end %>
<% content_for :page_specific_css do -%>
<%= stylesheet_link_tag "member" %>
<%= stylesheet_link_tag "site-map" %>
<% end %> <% end %>

View File

@ -0,0 +1 @@
$("#<%= dom_id @attribute %>").remove();

View File

@ -0,0 +1,32 @@
<%= form_for @attribute,:url => eval("admin_#{@attribute_type}_path(@attribute)") ,:class=> "form-horizontal", :id=>"new_bulletin_category", remote: true do |f| %>
<fieldset>
<legend><%= t(eval(":#{@attribute_type}"))%></legend>
<label class="muted" for="key"><%= t(:key) %></label>
<% if @attribute.new_record? %>
<%= f.text_field :key, :class => "input-large", :placeholder => t(:key) %>
<% else %>
<div><%= @attribute.key%></div>
<% end %>
<% @site_valid_locales.each_with_index do |locale, i| %>
<label class="muted" for="name-en"><%= t(:item_name) %>(<%= I18nVariable.from_locale(locale) %>)</label>
<input id="name-<%= locale %>" type="text" class="input-large" placeholder="<%= t(:item_name) %>" name="<%="#{@attribute_type}[title_translations][#{locale}]"%>" value="<%= @attribute.title_translations[locale] rescue nil %>">
<% end %>
<label class="muted" for="name-zh-tw"><%= t(:to_search) %></label>
<label class="radio inline">
<%= f.radio_button :to_search, true %>
<%= t(:yes_)%>
</label>
<label class="radio inline">
<%= f.radio_button :to_search, false %>
<%= t(:no_)%>
</label>
<div class="form-actions">
<%= f.submit t('submit'), :class=>'btn btn-primary btn-small' %>
<%= link_to t('cancel'), 'javascript:$.pageslide.close()', :class=>" btn-small" %>
</div>
</fieldset>
<% end %>

View File

@ -1,59 +1,33 @@
<%= form_for @sub_attribute,:url => eval("admin_#{@attribute_type}_path(@attribute)") ,:class=> "form-horizontal", :id=>"new_bulletin_category", remote: true do |f| %>
<fieldset>
<legend><%= t(eval(":#{@attribute_type}"))%>:<%= @attribute.title %></legend>
<label class="muted" for="key"><%= t(:key) %></label>
<% if @sub_attribute.new_record? %>
<%= f.text_field :key, :class => "input-large", :placeholder => t(:key) %>
<% else %>
<div><%= @sub_attribute.key%></div>
<% end %>
<% content_for :side_bar do %> <% @site_valid_locales.each_with_index do |locale, i| %>
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member_), :link_url => admin_site_site_info_path(@site), :icon => 'icons-group', :side_bar_content => 'admin/users_new_interface/side_bar'} %>
<% end %> <label class="muted" for="name-en"><%= t(:item_name) %>(<%= I18nVariable.from_locale(locale) %>)</label>
<input id="name-<%= locale %>" type="text" class="input-large" placeholder="<%= t(:item_name) %>" name="<%="sub_role[title_translations][#{locale}]"%>" value="<%= @sub_attribute.title_translations[locale] rescue nil %>">
<%= form_for @sub_attribute,:url => eval("admin_#{@attribute_type}_path(@attribute)") ,:class=> "form-horizontal" do |f| %> <% end %>
<div class="site-map role-block">
<div class="map-block back"> <label class="muted" for="name-zh-tw"><%= t(:to_search) %></label>
<h4><span><%= t(eval(":#{@attribute_type}"))%>:<%= @attribute.title %></span></h4> <label class="radio inline">
<div class="form-horizontal"> <%= f.radio_button :to_search, true %>
<div class="clear"> Yes
</label>
<div class="control-group pull-left"> <label class="radio inline">
<label class="control-label" for="key"><%= t(:key) %></label> <%= f.radio_button :to_search, false %>
<div class="controls"> No
<% if @sub_attribute.new_record? %> </label>
<%= f.text_field :key, :placeholder => t(:key) %> <div class="form-actions">
<% else %> <%= f.hidden_field :id %>
<div><%= @sub_attribute.key%></div> <%= f.submit t('submit'), :class=>'btn btn-primary btn-small' %>
<% end %> <%= link_to t('cancel'), 'javascript:$.pageslide.close()', :class=>" btn-small" %>
</div> </div>
</div> </fieldset>
<%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:values=>@sub_attribute.title_translations,:class_ext=>"pull-left",:label_ext=>t(:item_name),:field_name=>"sub_role[title_translations]"}%>
<div class="control-group pull-left">
<label class="control-label" for="key"><%= t(:to_search) %></label>
<div class="controls">
<label class="radio inline">
<%= f.radio_button :to_search, true %>
Yes
</label>
<label class="radio inline">
<%= f.radio_button :to_search, false %>
No
</label>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="form-actions form-fixed pagination-right">
<%#= hidden_field_tag 'id', params[:role_id] if !params[:role_id].blank? %>
<%= f.hidden_field :id %>
<%#= f.hidden_field :role_id, :value => @attribute.id if !params[:role_id].blank? %>
<%= f.submit t('submit'), :class=>'btn btn-primary' %>
<%= link_to t('cancel'), get_go_back, :class=>"btn" %>
</div>
<% end %>
<% content_for :page_specific_css do -%>
<%= stylesheet_link_tag "member" %>
<%= stylesheet_link_tag "site-map" %>
<% end %> <% end %>

View File

@ -1 +1,35 @@
111 <%= form_for @attribute,:url => eval("admin_#{@attribute_type}s_path") ,:class=> "form-horizontal", :id=>"new_bulletin_category", remote: true do |f| %>
<fieldset>
<legend><%= t(eval(":#{@attribute_type}"))%></legend>
<label class="muted" for="key"><%= t(:key) %></label>
<% if @attribute.new_record? %>
<%= f.text_field :key, :class => "input-large", :placeholder => t(:key) %>
<% else %>
<div><%= @attribute.key%></div>
<% end %>
<% @site_valid_locales.each_with_index do |locale, i| %>
<label class="muted" for="name-en"><%= t(:item_name) %>(<%= I18nVariable.from_locale(locale) %>)</label>
<input id="name-<%= locale %>" type="text" class="input-large" placeholder="<%= t(:item_name) %>" name="<%="#{@attribute_type}[title_translations][#{locale}]"%>">
<% end %>
<label class="muted" for="name-zh-tw"><%= t(:to_search) %></label>
<label class="radio inline">
<%= f.radio_button :to_search, true %>
<%= t(:yes_)%>
</label>
<label class="radio inline">
<%= f.radio_button :to_search, false %>
<%= t(:no_)%>
</label>
<div class="form-actions">
<%= f.submit t('submit'), :class=>'btn btn-primary btn-small' %>
<%= link_to t('cancel'), 'javascript:$.pageslide.close()', :class=>" btn-small" %>
</div>
</fieldset>
<% end %>

View File

@ -1,128 +1,40 @@
<% content_for :side_bar do %> <% content_for :side_bar do %>
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member_), :link_url => admin_site_site_info_path(@site), :icon => 'icons-group', :side_bar_content => 'admin/users_new_interface/side_bar'} %> <%= render :partial => 'admin/users_new_interface/side_bar' %>
<% end %> <% end %>
<%= form_for @attribute,:url => eval("admin_#{@attribute_type}_path(@attribute)") ,:class=> "form-horizontal" do |f| %>
<div class="site-map role-block">
<div class="map-block back attributes">
<h4><span><%= @attribute.title + t(:role)%></span></h4>
<div id="attribute_field_list">
<%= render :partial=>"attribute_field",:collection=>@attribute.attribute_fields%>
</div>
</div>
<div class="add-attributes form-actions pagination-right">
<%= link_to content_tag(:i,t(:add_attribute_field),:class=>"icon-plus icon-white"),admin_role_add_attribute_field_path(@attribute),:class=>"btn btn-primary",:remote => true%>
</div>
</div>
<div class="form-actions form-fixed pagination-right">
<%#= f.hidden_field :id, :value => params[:role_id] if !params[:role_id].blank? %>
<%= hidden_field_tag 'id', params[:role_id] if !params[:role_id].blank? %>
<%= f.submit t(:submit),:class=>"btn btn-primary"%>
<%= link_to t('cancel'), get_go_back, :class=>"btn" %>
</div>
<% end %>
<% content_for :page_specific_css do -%> <% content_for :page_specific_css do -%>
<%= stylesheet_link_tag "member" %> <%= stylesheet_link_tag "lib/wrap-nav.css" %>
<%= stylesheet_link_tag "site-map" %> <%= stylesheet_link_tag "lib/pageslide.css" %>
<% end %> <%= stylesheet_link_tag "lib/main-forms.css" %>
<%= stylesheet_link_tag "lib/togglebox.css" %>
<% end -%>
<% content_for :page_specific_javascript do -%> <% content_for :page_specific_javascript do -%>
<script> <%= javascript_include_tag "lib/jquery.tmpl.min.js" %>
var CloneTarget ; <%= javascript_include_tag "lib/member/role-forms.js" %>
var NewNode;
$(document).ready(function(){
function checkSwitch() {
$(".groups").addClass('disabled').has('.groups > .form-horizontal > div:not(.hide)').removeClass('disabled');
}
function checkMultipleInput() {
$(".multipleInput").each(function() {
$(this).find('.controls').length==1 ? $(this).addClass("plural") : $(this).removeClass("plural")
});
}
function removeInput(){
$(".removeInput").live('click',function (){
$(this).parents(".controls").remove();
checkMultipleInput();
return false;
});
}
checkSwitch();
checkMultipleInput();
removeInput();
$(".remove_attribute").live('click',function(){
$(this).siblings(".attribute_field_to_delete").val("true");
$(this).parents(".form-horizontal").fadeOut("slow", function () { $(this).hide(); });
});
$(".help-block a").live('click',function (){
CloneTarget = $(this).parents(".controls").prev(".multipleInput").find('.controls:last');
NewNode = CloneTarget.clone();
var index;
NewNode.find("input").each(function(k,v){
index = CloneTarget.parents("div.control-group").find(".list_count").val()
field_name = CloneTarget.parents("div.control-group").find(".field_name").val()
ori_str = $(v).attr("name").replace(field_name,"");
lang = ori_str.match(/\[\D*\]/);
new_field_name = (field_name+"[" + (parseInt(index)+1) + "]" + lang);
$(v).attr("name",new_field_name);
})
$(this).parents("div.control-group").find(".list_count").val(parseInt(index)+1)
$(this).parents(".controls").prev(".multipleInput").append(NewNode);
$(this).parents(".controls").prev(".multipleInput").find('.controls:last input').val("");
removeInput();
checkMultipleInput();
return false;
})
$(".status select").each(function (i) {
$(this).change(function () {
$(".status option:selected").eq(i).each(function () {
if($(this).attr("value")=="alumna") {
$(this).parents(".status").nextAll(".graduated").removeClass("hide");
$(this).parents(".status").nextAll(".graduated").find("select").removeAttr("disabled");
}else{
$(this).parents(".status").nextAll(".graduated").addClass("hide");
$(this).parents(".status").nextAll(".graduated").find("select").attr({disabled:''});
}
});
})
})
$('.onoff').live('click',function () {
if($(this).parents("h4").length==1) {
$(this).parents(".map-block").toggleClass("disabled");
$(this).parents(".map-block").find(".form-horizontal").toggleClass("hide");
if($(this).parents(".map-block").hasClass("disabled")){
$(this).text("OFF");
}else{
$(this).text("ON");
}
}
if($(this).parents("legend").length==1) {
$(this).toggleClass("disabled");
$(this).parents("legend").next("div").toggleClass("hide");
if($(this).parents("legend").next("div").hasClass("hide")){
$(this).text("OFF");
$(this).siblings(".attribute_field_disabled").val("true");
}else{
$(this).text("ON");
$(this).siblings(".attribute_field_disabled").val("false");
}
checkSwitch();
}
return false;
});
$(".dataType").change(function () {
$(this).parents("legend").next("div").find("div[class^='type']").addClass("hide");
$(this).parents("legend").next("div").find("."+$(this).find("option:selected").attr("ref")).removeClass("hide");
})
});
</script>
<% end -%> <% end -%>
<%= form_for @attribute,:url => eval("admin_#{@attribute_type}_path(@attribute)") , :html => { :class=> "form-horizontal main-forms" } do |f| %>
<h3><%= @attribute.title + t(:role)%></h3>
<fieldset>
<div id="attributes-area" class="input-area">
<%= render :partial=>"attribute_field",:collection=>@attribute.attribute_fields.asc(:_id)%>
</div>
<div class="form-actions">
<button type="button" class="btn btn-success add-attributes"><%= t(:add_attribute_field) %></button>
<%= hidden_field_tag 'id', params[:role_id] if !params[:role_id].blank? %>
<%= f.submit t(:submit),:class=>"btn btn-primary"%>
<%= link_to t('cancel'), get_go_back, :class=>"btn" %>
</div>
</fieldset>
<% end %>
<% content_for :page_specific_javascript do -%>
<%= render 'js/support_member_form_js' %>
<% end -%>

View File

@ -1,60 +1,28 @@
<% # encoding: utf-8 %>
<% content_for :side_bar do %> <% content_for :side_bar do %>
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member_), :link_url => admin_site_site_info_path(@site), :icon => 'icons-group', :side_bar_content => 'admin/users_new_interface/side_bar'} %> <%= render :partial => 'admin/users_new_interface/side_bar' %>
<% end %> <% end %>
<div class="subnav"> <% content_for :page_specific_css do -%>
<ul class="breadcrumb"> <%= stylesheet_link_tag "lib/wrap-nav.css" %>
<li><%= link_to( t("#{@attribute_type}"), admin_roles_path ) %> <span class="divider">/</span></li> <%= stylesheet_link_tag "lib/pageslide.css" %>
<li class="active"><%= @attribute.title %></li> <%= stylesheet_link_tag "lib/main-forms.css" %>
</ul> <%= stylesheet_link_tag "lib/togglebox.css" %>
<div id="accordion"> <% end -%>
<div class="accordion-group filters">
<div class="table-label"> <div id="filter" class="topnav clearfix">
<table class="table main-list"> <ul class="breadcrumb text-info pull-left">
<thead> <li><%= link_to( t("#{@attribute_type}"), admin_roles_path ) %>/</span></li>
<tr class="sort-header"> <li class="active"><%= @attribute.title %></a></li>
<th id="sort-name" class="sort span1-2 select active"><span><a href="#">Name<b class="web-symbol"></b></a></span></th> </ul>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div> </div>
<table class="table main-list member-list">
<thead>
<tr>
<th class="span1-2"></th>
</tr>
</thead>
<tbody>
<% @attribute_fields_upper_object.each do |attribute| %> <div class="bottomnav clearfix">
<tr class="with_action"> <div class="action pull-right">
<td class="span1-2"> <%= link_to content_tag(:i,t("new.sub_role"),:class=>"icon-plus"),eval("admin_#{@attribute_type}_add_sub_role_path(@attribute)"),:class=>"btn btn-primary open-slide"%>
<%= attribute.title %> </div>
<div class="quick-edit"> </div>
<ul class="nav nav-pills hide">
<li><%= link_to t(:edit), eval("admin_#{@attribute_type}_edit_sub_role_path(attribute)") %></li> <div id="sub_roles_index">
<li><%= link_to t(:sub_role_field), eval("admin_#{@attribute_type}_sub_role_field_path(attribute)"), :class => 'edit' %></li> <%= render 'sub_role_index' %>
<li><%= link_to t(:enable), eval("admin_#{@attribute_type}_path(attribute, :authenticity_token => form_authenticity_token, :sub_role => {:disabled => true, :id => attribute })"), :remote => true, :method => :put, :id => "disable_#{attribute.id}", :style => "display:#{attribute.is_disabled? ? 'none' : ''}", :class => 'switch' %></li>
<li><%= link_to t(:disable), eval("admin_#{@attribute_type}_path(attribute, :authenticity_token => form_authenticity_token, :sub_role => {:disabled => false, :id => attribute })"), :remote => true, :method => :put, :id => "enable_#{attribute.id}", :style => "display:#{attribute.is_disabled? ? '' : 'none'}", :class => 'switch' %></li>
<% if !attribute.is_built_in? %>
<li><%= link_to t(:delete_), eval("admin_#{@attribute_type}_path(attribute, :sub_role => {:id => attribute })"), :class => 'delete', :confirm => t('sure?'), :method => :delete %></li>
<% end %>
</ul>
</div>
</td>
</tr>
<% end %>
</tbody>
</table>
<div class="form-actions form-fixed pagination-right">
<%= link_to content_tag(:i,t("new.sub_role"),:class=>"icon-plus icon-white"),eval("admin_#{@attribute_type}_add_sub_role_path(@attribute)"),:class=>"btn btn-primary pull-right"%>
</div> </div>

View File

@ -0,0 +1,3 @@
$("#sub_roles_index").html("<%= j render 'sub_role_index' %>")
$.pageslide.close();
openSlide();

View File

@ -1,128 +1,41 @@
<% content_for :side_bar do %> <% content_for :side_bar do %>
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member_), :link_url => admin_site_site_info_path(@site), :icon => 'icons-group', :side_bar_content => 'admin/users_new_interface/side_bar'} %> <%= render :partial => 'admin/users_new_interface/side_bar' %>
<% end %> <% end %>
<%= form_for @attribute,:url => eval("admin_#{@attribute_type}_path(@attribute)") ,:class=> "form-horizontal" do |f| %>
<div class="site-map role-block">
<div class="map-block back attributes">
<h4><span><%= @attribute.title+ t(:role)%> - <%= @sub_attribute.title %></span></h4>
<div id="attribute_field_list">
<%= render :partial=>"attribute_field",:collection=>@sub_attribute.attribute_fields%>
</div>
</div>
<div class="add-attributes form-actions pagination-right">
<%= link_to content_tag(:i,t(:add_attribute_field),:class=>"icon-plus icon-white"),admin_role_add_attribute_field_path(@sub_attribute, :sub_role => {:id => @sub_attribute }),:class=>"btn btn-primary",:remote => true%>
</div>
</div>
<div class="form-actions form-fixed pagination-right">
<%#= f.hidden_field :id, :value => params[:role_id] if !params[:role_id].blank? %>
<%= hidden_field_tag 'sub_role[id]', params[:role_id] if !params[:role_id].blank? %>
<%= f.submit t(:submit),:class=>"btn btn-primary"%>
<%= link_to t('cancel'), get_go_back, :class=>"btn" %>
</div>
<% end %>
<% content_for :page_specific_css do -%> <% content_for :page_specific_css do -%>
<%= stylesheet_link_tag "member" %> <%= stylesheet_link_tag "lib/wrap-nav.css" %>
<%= stylesheet_link_tag "site-map" %> <%= stylesheet_link_tag "lib/pageslide.css" %>
<% end %> <%= stylesheet_link_tag "lib/main-forms.css" %>
<%= stylesheet_link_tag "lib/togglebox.css" %>
<% end -%>
<% content_for :page_specific_javascript do -%> <% content_for :page_specific_javascript do -%>
<script> <%= javascript_include_tag "lib/jquery.tmpl.min.js" %>
var CloneTarget ; <%= javascript_include_tag "lib/member/role-forms.js" %>
<% end -%>
var NewNode;
$(document).ready(function(){ <%= form_for @attribute,:url => eval("admin_#{@attribute_type}_path(@attribute)") , :html => { :class=> "form-horizontal main-forms" , :id=>'sub_role'} do |f| %>
function checkSwitch() { <h3><%= @attribute.title+ t(:role)%> - <%= @sub_attribute.title %></h3>
$(".groups").addClass('disabled').has('.groups > .form-horizontal > div:not(.hide)').removeClass('disabled'); <fieldset>
}
function checkMultipleInput() { <div id="attributes-area" class="input-area">
$(".multipleInput").each(function() {
$(this).find('.controls').length==1 ? $(this).addClass("plural") : $(this).removeClass("plural") <%= render :partial=>"attribute_field",:collection=>@sub_attribute.attribute_fields.asc(:_id)%>
});
} </div>
function removeInput(){
$(".removeInput").live('click',function (){ <div class="form-actions">
$(this).parents(".controls").remove(); <button type="button" class="btn btn-success add-attributes"><%= t(:add_attribute_field) %></button>
checkMultipleInput(); <%= hidden_field_tag 'sub_role[id]', params[:role_id] if !params[:role_id].blank? %>
return false; <%= f.submit t(:submit),:class=>"btn btn-primary"%>
}); <%= link_to t('cancel'), get_go_back, :class=>"btn" %>
} </div>
checkSwitch(); </fieldset>
checkMultipleInput(); <% end %>
removeInput();
$(".remove_attribute").live('click',function(){
$(this).siblings(".attribute_field_to_delete").val("true");
$(this).parents(".form-horizontal").fadeOut("slow", function () { $(this).hide(); }); <% content_for :page_specific_javascript do -%>
}); <%= render 'js/support_member_form_js' %>
$(".help-block a").live('click',function (){
CloneTarget = $(this).parents(".controls").prev(".multipleInput").find('.controls:last');
NewNode = CloneTarget.clone();
var index;
NewNode.find("input").each(function(k,v){
index = CloneTarget.parents("div.control-group").find(".list_count").val()
field_name = CloneTarget.parents("div.control-group").find(".field_name").val()
ori_str = $(v).attr("name").replace(field_name,"");
lang = ori_str.match(/\[\D*\]/);
new_field_name = (field_name+"[" + (parseInt(index)+1) + "]" + lang);
$(v).attr("name",new_field_name);
})
$(this).parents("div.control-group").find(".list_count").val(parseInt(index)+1)
$(this).parents(".controls").prev(".multipleInput").append(NewNode);
$(this).parents(".controls").prev(".multipleInput").find('.controls:last input').val("");
removeInput();
checkMultipleInput();
return false;
})
$(".status select").each(function (i) {
$(this).change(function () {
$(".status option:selected").eq(i).each(function () {
if($(this).attr("value")=="alumna") {
$(this).parents(".status").nextAll(".graduated").removeClass("hide");
$(this).parents(".status").nextAll(".graduated").find("select").removeAttr("disabled");
}else{
$(this).parents(".status").nextAll(".graduated").addClass("hide");
$(this).parents(".status").nextAll(".graduated").find("select").attr({disabled:''});
}
});
})
})
$('.onoff').live('click',function () {
if($(this).parents("h4").length==1) {
$(this).parents(".map-block").toggleClass("disabled");
$(this).parents(".map-block").find(".form-horizontal").toggleClass("hide");
if($(this).parents(".map-block").hasClass("disabled")){
$(this).text("OFF");
}else{
$(this).text("ON");
}
}
if($(this).parents("legend").length==1) {
$(this).toggleClass("disabled");
$(this).parents("legend").next("div").toggleClass("hide");
if($(this).parents("legend").next("div").hasClass("hide")){
$(this).text("OFF");
$(this).siblings(".attribute_field_disabled").val("true");
}else{
$(this).text("ON");
$(this).siblings(".attribute_field_disabled").val("false");
}
checkSwitch();
}
return false;
});
$(".dataType").change(function () {
$(this).parents("legend").next("div").find("div[class^='type']").addClass("hide");
$(this).parents("legend").next("div").find("."+$(this).find("option:selected").attr("ref")).removeClass("hide");
})
});
</script>
<% end -%> <% end -%>

View File

@ -0,0 +1,3 @@
<div class="filter-clear">
<%= link_to content_tag(:i, nil, :class => 'icons-cycle') + t(:clear), url_for(:filter => @filter, :sort => params[:sort], :direction => params[:direction], :clear => true, :type => type), :class => "btn btn-link btn-small" %>
</div>

View File

@ -1,80 +1,10 @@
<div class="subnav">
<div class="btn-group pull-right view-mode">
<form action="" method="get">
<button class="btn <%= "active" if params[:at].blank? %>"><i class="icon-align-justify"></i> <%= t("show_mode.index")%></button> <div class="accordion-inner pagination-right" data-toggle="buttons-checkbox">
<button name="at" value="summary" class="btn <%= "active" if params[:at] == "summary" %>"><i class="icon-th-list"></i> <%= t("show_mode.summary")%></button> <% @roles.each do |role| %>
<button name="at" value="thumbnail" class="btn <%= "active" if params[:at] == "thumbnail" %>"><i class="icon-th-large"></i> <%= t("show_mode.thumbnail")%></button> <%#= link_to role.title, url_for(:filter => @filter, :new_filter => {:type => 'role', :id => role.id}, :sort => params[:sort], :direction => params[:direction], :sort_options => params[:sort_options]), :class => "btn btn-small #{is_filter_active?('role', role.id)}" %>
</form> <%= link_to role.title, url_for(:filter => @filter, :new_filter => {:type => 'role', :id => role.id}, :sort => params[:sort], :direction => params[:direction], :sort_options => params[:sort_options]), :class => "btn btn-small #{' active' if (@filter['role'].include?(role.id) rescue nil)}" %>
</div> <% end %>
<ul class="nav nav-pills filter">
<li class="accordion-group"> <%= render :partial => 'clear_filters', :locals => {:type => 'role'} %>
<div class="accordion-heading">
<a href="#collapse-status" data-toggle="collapse" data-parent=".filters" class="accordion-toggle"><%= t(:status)%> <b class="web-symbol"></b></a>
</div>
</li>
<li class="accordion-group">
<div class="accordion-heading">
<a href="#collapse-category" data-toggle="collapse" data-parent=".filters" class="accordion-toggle"><%= t(:category)%> <b class="web-symbol"></b></a>
</div>
</li>
<li class="accordion-group">
<div class="accordion-heading">
<a href="#collapse-tags" data-toggle="collapse" data-parent=".filters" class="accordion-toggle"><%= t(:tags)%> <b class="web-symbol"></b></a>
</div>
</li>
</ul>
<div class="filters">
<div class="accordion-body collapse" id="collapse-status">
<div class="accordion-inner" data-toggle="buttons-checkbox">
<a href="#" class="btn">Full-Time</a>
<a href="#" class="btn">Part-time</a>
<a href="#" class="btn">Adjunct</a>
<a href="#" class="btn">Distinguished</a>
</div>
<div class="filter-clear">
<a href="#" class="btn"><i class="icons-cycle"></i><%= t(:clear)%></a>
</div>
</div>
<div class="accordion-body collapse" id="collapse-category">
<div class="accordion-inner" data-toggle="buttons-checkbox">
<% @sub_roles.each do |sr|%>
<a href="#" class="btn"><%= sr.title%></a>
<% end -%>
</div>
<div class="filter-clear">
<a href="#" class="btn"><i class="icons-cycle"></i><%= t(:clear)%></a>
</div>
</div>
<div class="accordion-body collapse" id="collapse-tags">
<div class="accordion-inner" data-toggle="buttons-checkbox">
<% @sub_role_tags.each do |sr_tag|%>
<a href="#" class="btn"><%= sr_tag.name %></a>
<% end -%>
</div>
<div class="filter-clear">
<a href="#" class="btn"><i class="icons-cycle"></i><%= t(:clear)%></a>
</div>
</div>
<% if params[:at].blank? #header for index%>
<div class="table-label">
<table class="table main-list">
<thead>
<tr>
<th class="span1">
<% if is_admin? %>
<input type="checkbox">
<a href class="list-remove"><i class="icon-minus-sign"></i></a>
<%end%>
</th>
<th id="sort-roles" class="sort span3"><%= t(:roles)%><b class="web-symbol"></b></th>
<th id="sort-name" class="sort span1-2 select active"><%= t(:name)%><b class="web-symbol"></b></th>
<th id="sort-email" class="sort span2"><%= t(:publications)%><b class="web-symbol"></b></th>
<th id="sort-admin" class="sort span2"><%= t(:courses)%><b class="web-symbol"></b></th>
<th id="sort-admin" class="sort span2"><%= t(:followers)%><b class="web-symbol"></b></th>
</tr>
</thead>
</table>
</div>
<% end -%>
</div>
</div>

View File

@ -1,19 +1,79 @@
<div class="user-info">
<div class="user-avatar pull-left">
<p class="reflective"></p>
<% if @user.avatar? %>
<%= image_tag(@user.avatar.thumb.url) %>
<% else %>
<%= image_tag "person.png" %>
<% end %>
<%= file_field_tag 'file' %>
<%= hidden_field_tag :avatar_cache %>
</div>
<label>
<%= f.check_box :admin %>
<span><%= t("admin") %></span>
</label>
</div>
<%= render :partial=>"infos"%> <%= render :partial=>"infos"%>
<%= render :partial=>"roles"%> <%= render :partial=>"roles"%>
<% content_for :page_specific_javascript do -%>
<% ( params[:id].blank? ? @fname = 'new_attribute_values' : @fname = 'attribute_values' ) %>
<!-- Text -->
<script id="template-text" type="text/x-tmpl">
<div class="input-append">
<input type="text" id="${roleType+'_text_'+appendIndex}" name="${'user[<%= @fname %>]['+nameNumber+'][value][]'}" class="input-medium" placeholder="">
<a href="#" class="btn remove-input">
<i class="icon-trash"></i>
</a>
</div>
</script>
<!-- Text Language -->
<script id="template-text-language" type="text/x-tmpl">
<div class="input-append">
<div class="tab-content">
<% VALID_LOCALES.collect do |locale| %>
<% active = (locale == @site_valid_locales.first ? "active" : "") %>
<div class="tab-pane fade <%= active %> in" id="${roleType+'_text_language_<%= locale %>_'+appendIndex}">
<input type="text" name="${'user[<%= @fname %>]['+nameNumber+'][value][][<%= locale %>]'}" placeholder="<%= I18nVariable.from_locale(locale) %>" value="">
</div>
<% end %>
</div>
<div class="btn-group" data-toggle="buttons-radio">
<% VALID_LOCALES.collect do |locale| %>
<% active = (locale == @site_valid_locales.first ? "active" : "") %>
<a class="btn <%= active %>" href="${'#'+roleType+'_text_language_<%= locale %>_'+appendIndex}" data-toggle="tab"><%= I18nVariable.from_locale(locale) %></a>
<% end %>
<a href="#" class="btn remove-input"><i class="icon-trash"></i></a>
</div>
</div>
</script>
<!-- Address -->
<script id="template-address" type="text/x-tmpl">
<div class="input-append">
<div class="tab-content">
<div class="tab-pane fade active in" id="${roleType+'_address_en_'+appendIndex}">
<input type="text" name="${'user[new_attribute_values]['+nameNumber+'][value][en]'}" placeholder="Address" value="">
<input type="hidden" id="${roleType+'_street_address_en_'+appendIndex}" name="${'user[new_attribute_values]['+nameNumber+'][address_ext][en][street_address]'}" value="">
<input type="hidden" id="${roleType+'_cityarea_en_'+appendIndex}" name="${'user[new_attribute_values]['+nameNumber+'][address_ext][en][county]'}" value="">
<input type="hidden" id="${roleType+'_city_en_'+appendIndex}" name="${'user[new_attribute_values]['+nameNumber+'][address_ext][en][city]'}" value="">
<input type="hidden" id="${roleType+'_zip_en_'+appendIndex}" name="${'user[new_attribute_values]['+nameNumber+'][address_ext][en][zip]'}" value="">
<input type="hidden" id="${roleType+'_county_en_'+appendIndex}" name="${'user[new_attribute_values]['+nameNumber+'][address_ext][en][country]'}" value="">
<input type="hidden" id="${roleType+'_indicator_en_'+appendIndex}" name="${'user[new_attribute_values]['+nameNumber+'][address_ext][en][indicator]'}" value="">
</div>
<div class="tab-pane fade" id="${roleType+'_address_zh_tw_'+appendIndex}">
<input type="text" name="${'user[new_attribute_values]['+nameNumber+'][value][zh_tw]'}" placeholder="地址" value="">
<input type="hidden" id="${roleType+'_street_address_zh_tw_'+appendIndex}" name="${'user[new_attribute_values]['+nameNumber+'][address_ext][zh_tw][street_address]'}" value="">
<input type="hidden" id="${roleType+'_cityarea_zh_tw_'+appendIndex}" name="${'user[new_attribute_values]['+nameNumber+'][address_ext][zh_tw][county]'}" value="">
<input type="hidden" id="${roleType+'_city_zh_tw_'+appendIndex}" name="${'user[new_attribute_values]['+nameNumber+'][address_ext][zh_tw][city]'}" value="">
<input type="hidden" id="${roleType+'_zip_zh_tw_'+appendIndex}" name="${'user[new_attribute_values]['+nameNumber+'][address_ext][zh_tw][zip]'}" value="">
<input type="hidden" id="${roleType+'_county_zh_tw_'+appendIndex}" name="${'user[new_attribute_values]['+nameNumber+'][address_ext][zh_tw][country]'}" value="">
<input type="hidden" id="${roleType+'_indicator_zh_tw_'+appendIndex}" name="${'user[new_attribute_values]['+nameNumber+'][address_ext][zh_tw][indicator]'}" value="">
</div>
</div>
<div class="btn-group" data-toggle="buttons-radio">
<a class="btn active" href="${'#'+roleType+'_address_en_'+appendIndex}" data-toggle="tab">English</a>
<a class="btn" href="${'#'+roleType+'_address_zh_tw_'+appendIndex}" data-toggle="tab">Chinese</a>
<a class="btn" href="#address-field" role="button" data-toggle="modal"><i class="icon-edit"></i></a>
<a href="#" class="btn remove-input"><i class="icon-trash"></i></a>
</div>
</div>
</script>
<% end -%>

View File

@ -1,10 +1,12 @@
<div class="form-actions form-fixed pagination-right"> <div class="bottomnav clearfix">
<div class="action pull-right">
<% if is_admin? %> <% if is_admin? %>
<%= link_to(new_admin_users_new_interface_path,:class=> "btn btn-primary pull-right") do%> <%= link_to(new_admin_users_new_interface_path,:class=> "btn btn-primary pull-right") do%>
<i class="icon-plus icon-white"></i><%= t(:add)%> <i class="icon-plus"></i><%= t(:add)%>
<% end -%> <% end -%>
<%end -%> <%end -%>
<div class="paginationFixed" id="user_pagination"> </div>
<%= paginate @users, :params => {:inner => false}%> <div class="pagination pagination-centered">
</div> <%= paginate @users, :params => {:inner => false}%>
</div>
</div> </div>

View File

@ -1,12 +1,13 @@
<div class="map-block back"> <div class="attributes">
<h4><span><%= info.title %></span></h4> <div class="attributes-header clearfix">
<div class="form-horizontal"> <h4><%= info.title %></h4>
</div>
<div class="attributes-body">
<% info.attribute_fields.each do |af|%> <% info.attribute_fields.each do |af|%>
<%= af.block_helper(@user,@form_index)%> <%= af.block_helper(@user,@form_index)%>
<% @form_index = @form_index +1 %> <% @form_index = @form_index +1 %>
<% end %> <% end %>
</div>
</div>
</div> </div>

View File

@ -1,7 +1,14 @@
<% content_for :page_specific_css do -%> <% content_for :page_specific_css do -%>
<%= stylesheet_link_tag "member" %> <%#= stylesheet_link_tag "member" %>
<%= stylesheet_link_tag "item"%> <%#= stylesheet_link_tag "item"%>
<%= stylesheet_link_tag "lib/wrap-nav" %>
<%= stylesheet_link_tag "lib/main-list" %>
<%= stylesheet_link_tag "lib/member" %>
<% end -%> <% end -%>
<% content_for :page_specific_javascript do -%> <% content_for :page_specific_javascript do -%>
<%#= javascript_include_tag "/static/jquery.cycle.all.latest.js" %> <%#= javascript_include_tag "/static/jquery.cycle.all.latest.js" %>
<%= javascript_include_tag "lib/jquery.mu.image.resize.js" %>
<%#= javascript_include_tag "lib/member/list-view.js" %>
<% end -%> <% end -%>

View File

@ -1,63 +1,101 @@
<% role_disable = @user.roles.include?(role) ? false : true %> <div id="roles-area" class="input-area">
<% role_disable = @user.roles.include?(role) ? false : true %>
<div class="groups map-block back <%= role_disable ? 'disabled' : '' %>"> <div class="attributes <%= role_disable ? 'disabled' : '' %>">
<h4> <div class="attributes-header clearfix">
<button for=<%=@form_index%> class="onoff pull-right"><%= role_disable ? 'OFF' : 'ON' %></button><span><%= role.title %><%= t(:role_info)%></span> <div class="toggle-control" style="float: right;">
<%= hidden_field_tag("user[disable_role][id][#{role.id}]",role_disable,:for=>@form_index,:class=>"subrole_disable_field",:value=>role_disable)%> <div class="togglebox <%= role_disable ? 'disabled' : '' %>">
</h4> <%= hidden_field_tag("user[disable_role][id][#{role.id}]",role_disable,:for=>@form_index,"data-deploy"=>"right",:class=>"toggle-check",:value=>role_disable)%>
<label><b></b></label>
<div class="form-horizontal <%= role_disable ? 'hide' : '' %>"> </div>
</div>
<% @form_index = @form_index +1 %> <h4><%= role.title %><%= t(:role_info)%></h4>
<div class="control-group">
<%= label_tag t(:status), nil, {:func=>"field_label", :for=>"1", :class=>"control-label"} %>
<% role.role_statuses.where(:disable => false).each_with_index do |rrs, i|%>
<%= hidden_field_tag("user[role_status][id][#{rrs.id}]", false,:for=>"#{@form_index}")%>
<%= label_tag(i,check_box_tag( "user[role_status][id][#{rrs.id}]", true, @user.role_statuses.include?(rrs))+rrs.title,:class=>"control-label") %>
<% end %>
</div> </div>
<% @form_index = @form_index +1 %> <div class="attributes-body" style="display: <%= role_disable ? 'none' : 'block' %>;" >
<div class="control-group"> <% @form_index = @form_index +1 %>
<%= label_tag t(:category), nil, {:func=>"field_label", :for=>"1", :class=>"control-label"} %>
<% role.role_categorys.where(:disable => false).each_with_index do |rrcg, i|%> <div class="control-group">
<%= hidden_field_tag("user[role_category][id][#{rrcg.id}]", false,:for=>"#{@form_index}")%> <%= label_tag t(:status), nil, {:func=>"field_label", :for=>"1", :class=>"control-label muted"} %>
<%= label_tag(i,check_box_tag( "user[role_category][id][#{rrcg.id}]", true, @user.role_categorys.include?(rrcg))+rrcg.title,:class=>"control-label") %> <div class="controls">
<% end %> <% role.role_statuses.where(:disable => false).each_with_index do |rrs, i|%>
</div> <%= hidden_field_tag("user[role_status][id][#{rrs.id}]", false,:for=>"#{@form_index}")%>
<%= label_tag(i,check_box_tag( "user[role_status][id][#{rrs.id}]", true, @user.role_statuses.include?(rrs))+rrs.title,:class=>"checkbox inline") %>
<% end %>
</div>
</div>
<% role.attribute_fields.each do |rf|%> <% @form_index = @form_index +1 %>
<div class="control-group">
<%= label_tag t(:category), nil, {:func=>"field_label", :for=>"1", :class=>"control-label muted"} %>
<div class="controls">
<% role.role_categorys.where(:disable => false).each_with_index do |rrcg, i|%>
<%= hidden_field_tag("user[role_category][id][#{rrcg.id}]", false,:for=>"#{@form_index}")%>
<%= label_tag(i,check_box_tag( "user[role_category][id][#{rrcg.id}]", true, @user.role_categorys.include?(rrcg))+rrcg.title,:class=>"checkbox inline") %>
<% end %>
</div>
</div>
<% role.attribute_fields.asc(:_id).each do |rf|%>
<%= rf.block_helper(@user,@form_index)%>
<% @form_index = @form_index +1 %>
<% end %>
<% @form_index = @form_index +1 %>
<div id="roles-area" class="input-area">
<% role.sub_roles.where(:disabled=>false).asc("_id").each do |sub_role| %>
<% sub_role_disable = @user.sub_roles.include?(sub_role) ? false : true %>
<div class="attributes <%= sub_role_disable ? 'disabled' : '' %>">
<div class="attributes-header clearfix">
<div class="toggle-control" style="float: right;">
<div class="togglebox <%= sub_role_disable ? 'disabled' : '' %>">
<%= hidden_field_tag("user[disable_sub_role][id][#{sub_role.id}]",sub_role_disable,:for=>@form_index,"data-deploy"=>"right",:class=>"toggle-check",:value=>sub_role_disable)%>
<label><b></b></label>
</div>
</div>
<h4><%= sub_role.title %><%= t(:role_info)%></h4>
</div>
<div class="attributes-body" style="display: <%= sub_role_disable ? 'none' : 'block' %>;">
<% sub_role.attribute_fields.asc(:_id).each do |af|%>
<%= af.block_helper(@user,@form_index)%>
<% @form_index = @form_index +1 %>
<% end %>
</div>
</div>
<% end %>
</div>
<%= rf.block_helper(@user,@form_index)%>
<% @form_index = @form_index +1 %>
<% end %>
<% @form_index = @form_index +1 %>
<% role.sub_roles.where(:disabled=>false).each do |sub_role| %>
<% sub_role_disable = @user.sub_roles.include?(sub_role) ? false : true %>
<%# sub_role_disable = !sub_role.disabled ? false : true %>
<%#= hidden_field_tag("[user][new_attribute_values][sub_role][disable][#{sub_role.id}]",sub_role_disable)%>
<legend>
<button for=<%=@form_index%> class="onoff pull-right <%= sub_role_disable ? 'disabled' : '' %> "><%= t(:on_upcase) %></button><%= sub_role.title %>
<%= hidden_field_tag("user[disable_sub_role][id][#{sub_role.id}]",sub_role_disable,:for=>@form_index,:class=>"subrole_disable_field",:value=>sub_role_disable)%>
</legend>
<div class="controls-block <%= sub_role_disable ? 'hide' : '' %>" >
<% sub_role.attribute_fields.each do |af|%>
<%= af.block_helper(@user,@form_index)%>
<% @form_index = @form_index +1 %>
<% end %>
</div> </div>
<% end %>
</div> </div>
</div> </div>

View File

@ -1 +1 @@
<%=render :partial=>"role",:collection=>Role.all%> <%=render :partial=>"role",:collection=>Role.all.asc("_id")%>

View File

@ -1,25 +1,15 @@
<div class="roles <%= show_roles.key %>">
<%= show_roles.title %><%= t(:role_info)%>
<div class="label-line"> <div class="roles">
<hr /> <h4><span><%= show_roles.title %><%= t(:role_info)%></span></h4>
</div> <dl>
<table class="table"> <dt><%= t('status') %></dt>
<tbody> <dd><%= show_attribute_value(@user.role_statuses.where(:role_id=>show_roles.id).map{|t|t.title.to_s}.join(',')) rescue '' %></dd>
<tr> <dt><%= t('category') %></dt>
<td class="span1"><%= t('status') %></td> <dd><%= show_attribute_value(@user.role_categorys.where(:role_id=>show_roles.id).map{|t|t.title.to_s}.join(',')) rescue '' %></dd>
<td><%= show_attribute_value(@user.role_statuses.where(:role_id=>show_roles.id).map{|t|t.title.to_s}.join(',')) rescue '' %></td> <% show_roles.attribute_fields.where(:disabled=>false).asc(:_id).each do |rf| %>
</tr> <dt><%= rf.title %></dt>
<tr> <dd><%= nl2br(show_attribute_value(@user.get_attribute_value(rf).get_value_by_locale(I18n.locale))) rescue '' %></dd>
<td class="span1"><%= t('category') %></td> <% end -%>
<td><%= show_attribute_value(@user.role_categorys.where(:role_id=>show_roles.id).map{|t|t.title.to_s}.join(',')) rescue '' %></td> </dl>
</tr> </div>
<% show_roles.attribute_fields.where(:disabled=>false).each do |rf| %>
<tr>
<td class="span1"><%= rf.title %></td>
<td><%= nl2br(show_attribute_value(@user.get_attribute_value(rf).get_value_by_locale(I18n.locale))) rescue '' %></td>
</tr>
<% end -%>
<%= render :partial => 'show_sub_role',:collection=> @user.get_sub_roles_by_role(show_roles)%>
</tbody>
</table>
</div>

View File

@ -1,26 +1,54 @@
<%= content_tag :li, :class => active_for_controllers('users_new_interface') do -%> <nav id="sidebar">
<%= link_to content_tag(:i, nil, :class => 'icons-user')+ content_tag(:span, t(:member_)), admin_users_new_interface_index_path %> <h2 class="position">
<%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('users_new_interface')) do -%> <%= link_to content_tag(:i, nil, :class => "icons-users"), admin_site_site_info_path(@site) %>
<%= content_tag :li, link_to((t(:all_member) + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, admin_users_new_interface_index_path), :class => active_for_action('users_new_interface', 'index') %> </h2>
<%= content_tag :li, link_to((t(:add_member) + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, new_admin_users_new_interface_path), :class => active_for_action('users_new_interface', 'new') if (is_admin? rescue nil) %> <div id="sidebar-menu">
<%= content_tag :li, link_to((t(:member_authorization) + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, '#'), :class => active_for_action('users_new_interfacexx', 'index') if (is_admin? rescue nil) %> <div class="scroller">
<%= content_tag :li, link_to((t(:member_registration) + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, '#'), :class => active_for_action('users_new_interfacexx', 'index') if (is_admin? rescue nil) %> <%= content_tag :ul, :class => "sidebar-nav" do -%>
<%= content_tag :li, link_to((t(:member_role) + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe,admin_roles_path ), :class => active_for_action('users_new_interfacexx', 'index') if (is_admin? rescue nil) %> <%= content_tag :li, :class => active_for_controllers('users_new_interface') do -%>
<%= content_tag :li, link_to((t(:member_info) + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, edit_admin_info_path(Info.first.id.to_s)), :class => active_for_action('users_new_interfacexx', 'index') if (is_admin? rescue nil) and Info.first %> <%= link_to( ( content_tag(:span, content_tag(:i, nil, :class => 'icons-user'))), admin_users_new_interface_index_path) %>
<% end -%> <% end -%>
<% end -%> <%= content_tag :li, :class => active_for_controllers('plugins') do -%>
<%= link_to( ( content_tag(:span, content_tag(:i, nil, :class => 'icons-graduation'))), admin_plugins_path) %>
<% end -%>
<%= content_tag :li, :class => active_for_controllers('plugins') do -%>
<%= link_to( ( content_tag(:span, content_tag(:i, nil, :class => 'icons-pie'))), '#') %>
<% end -%>
<%= content_tag :li, :class => active_for_controllers('plugins') do -%>
<%= link_to( ( content_tag(:span, content_tag(:i, nil, :class => 'icons-layout'))), '#') %>
<% end -%>
<% end -%>
</div>
</div>
<div class="sub-nav-block-list">
<div class="sub-nav-block" data-icons="&#xe00d;">
<h4><%= t(:member_) %></h4>
<%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('users_new_interface', 'roles', 'role_statuses', 'role_categorys','infos','plugins')) do -%>
<%= content_tag :li, link_to((content_tag(:span, t(:all_member))), admin_users_new_interface_index_path), :class => active_for_action('users_new_interface', 'index') %>
<%= content_tag :li, link_to((content_tag(:span, t(:add_member))), new_admin_users_new_interface_path), :class => active_for_action('users_new_interface', 'new') if (is_admin? rescue nil) %>
<%= content_tag :li, link_to((content_tag(:span, t(:member_authorization))), '#'), :class => active_for_action('users_new_interfacexx', 'index') if (is_admin? rescue nil) %>
<%= content_tag :li, link_to((content_tag(:span, t(:member_registration))), '#'), :class => active_for_action('users_new_interfacexx', 'index') if (is_admin? rescue nil) %>
<%= content_tag :li, link_to((content_tag(:span, t(:member_role))),admin_roles_path ), :class => active_for_action('users_new_interfacexx', 'index') if (is_admin? rescue nil) %>
<%= content_tag :li, link_to((content_tag(:span, t(:member_info))), edit_admin_info_path(Info.first.id.to_s)), :class => active_for_action('users_new_interfacexx', 'index') if (is_admin? rescue nil) and Info.first %>
<% end -%>
</div>
<div class="sub-nav-block" data-icons="&#xe070;">
<h4><%= t(:academic_info) %></h4>
<%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('users_new_interface', 'roles', 'role_statuses', 'role_categorys','infos','plugins')) do -%>
<%= content_tag :li, link_to((content_tag(:span, t(:list_))), admin_plugins_path), :class => active_for_action('users_new_interface', 'index') %>
<% end -%>
</div>
<div class="sub-nav-block" data-icons="&#xe070;">
<h4><%= t(:analysis) %></h4>
<%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('users_new_interface', 'roles', 'role_statuses', 'role_categorys','infos','plugins')) do -%>
<% end -%>
</div>
<div class="sub-nav-block" data-icons="&#xe070;">
<h4><%= t(:groups) %></h4>
<%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('users_new_interface', 'roles', 'role_statuses', 'role_categorys','infos','plugins')) do -%>
<% end -%>
</div>
</div>
<div class="sub-nav-arrow"></div>
</nav>
<%= content_tag :li, :class => active_for_controllers('plugins') do -%>
<%= link_to content_tag(:i, nil, :class => 'icons-graduation')+ content_tag(:span, t(:academic_info)), admin_plugins_path %>
<%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('plugins')) do -%>
<%= content_tag :li, link_to((t(:list_) + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, admin_plugins_path), :class => active_for_action('users_new_interface', 'index') %>
<% end -%>
<% end -%>
<%= content_tag :li, :class => active_for_controllers('plugins') do -%>
<%= link_to content_tag(:i, nil, :class => 'icons-pie')+ content_tag(:span, t(:analysis)), '#' %>
<% end -%>
<%= content_tag :li, :class => active_for_controllers('plugins') do -%>
<%= link_to content_tag(:i, nil, :class => 'icons-layout')+ content_tag(:span, t(:groups)), '#' %>
<% end -%>

View File

@ -1,120 +1,133 @@
<%#= devise_error_messages! %> <%#= devise_error_messages! %>
<div class="map-block back"> <div class="attributes">
<h4><span><%=t(:sys_basic_form)%></span></h4> <div class="attributes-header clearfix">
<h4><%=t(:sys_basic_form)%></h4>
<div class="form-horizontal">
<div class="controls-block" >
<div class="control-group language-swich">
<%= f.label t("users.first_name"),{:class=>"control-label", :func=>"field_label"} %>
<div class="controls">
<div class="tabbable">
<div class="tab-content">
<% @site_valid_locales.each_with_index do |locale, i| %>
<div class="tab-pane fade <%= locale %> user-attribute_values-first_name <%= ( i == 0 ) ? "in active" : '' %>">
<%= f.fields_for :first_name_translations do |f| %>
<%= f.text_field locale, :func=>'input_unit', :value => (@user.first_name_translations[locale] rescue nil) %>
<% end %>
</div>
<% end %>
</div>
<ul class="nav nav-pills">
<% @site_valid_locales.each_with_index do |locale, i| %>
<li <%= ( i == 0 ) ? "class=active" : '' %> for="<%= locale %>">
<a data-toggle="tab" href=".user-attribute_values-first_name.<%= locale %>"><%= I18nVariable.from_locale(locale) %></a></li>
<% end %>
</ul>
</div>
</div>
</div>
</div>
</div> </div>
<div class="attributes-body">
<div class="form-horizontal"> <!-- Avatar -->
<div class="controls-block" > <div class="control-group">
<div class="control-group language-swich"> <%= f.label t("users.avatar"),:class=>"control-label muted" %>
<%= f.label t("users.last_name"),{:class=>"control-label", :func=>"field_label"} %> <div class="controls">
<div class="controls"> <!-- if this page editing please add class "fileupload-edit" -->
<div class="tabbable"> <div class="fileupload fileupload-new clearfix <%= 'fileupload-edit' if @user.avatar.file %>" data-provides="fileupload">
<div class="tab-content"> <div class="fileupload-new thumbnail pull-left">
<% @site_valid_locales.each_with_index do |locale, i| %> <% if @user.avatar? %>
<div class="tab-pane fade <%= locale %> user-attribute_values-last_name <%= ( i == 0 ) ? "in active" : '' %>"> <%= image_tag(@user.avatar.thumb.url) %>
<%= f.fields_for :last_name_translations do |f| %> <% else %>
<%= f.text_field locale, :func=>'input_unit', :value => (@user.last_name_translations[locale] rescue nil) %> <%= image_tag "person.png" %>
<% end %>
</div>
<% end %>
</div>
<ul class="nav nav-pills">
<% @site_valid_locales.each_with_index do |locale, i| %>
<li <%= ( i == 0 ) ? "class=active" : '' %> for="<%= locale %>">
<a data-toggle="tab" href=".user-attribute_values-last_name.<%= locale %>"><%= I18nVariable.from_locale(locale) %></a></li>
<% end %>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="form-horizontal">
<div class="control-group">
<%= f.label t("users.email"),:class=>"control-label" %>
<div class="controls">
<%= f.email_field :email %>
</div>
</div>
</div>
<div class="form-horizontal">
<div class="control-group">
<%= f.label t("users.sid"),:class=>"control-label" %>
<div class="controls">
<%= f.text_field :sid %>
<span>( <%= t("users.sid_note")%> )</span>
</div>
</div>
</div>
<div class="form-horizontal">
<div class="control-group">
<%= f.label t("users.office_tel"),:class=>"control-label" %>
<div class="controls">
<%= f.text_field :office_tel %>
<span>( <%= t("users.office_tel_note")%> )</span>
</div>
</div>
</div>
<div class="form-horizontal">
<div class="control-group">
<%= f.label t("users.avatar"),:class=>"control-label" %>
<div class="controls">
<%= f.file_field :avatar %>
<% if @user.avatar.file %>
<%= f.check_box :remove_avatar %>
<%= t('delete.file') %>
<% end %> <% end %>
</div> </div>
</div> <div class="fileupload-preview fileupload-exists thumbnail pull-left"></div>
</div> <span class="btn btn-file">
<span class="fileupload-new"><%= t(:select_image) %></span>
<div class="form-horizontal"> <span class="fileupload-exists"><%= t(:change) %></span>
<div class="control-group"> <%= f.file_field :avatar %>
<%= f.label t("users.sex"),:class=>"control-label" %> </span>
<div class="controls"> <a href="#" class="btn fileupload-exists" data-dismiss="fileupload"><%= t(:cancel) %></a>
<label func="input_unit" for="0" class=" radio inline"> <div class="controls" data-toggle="buttons-checkbox">
<%= f.radio_button :sex, "male" %><%= t('users.male')%> <label class="checkbox inline btn btn-danger fileupload-remove">
</label> <%= f.check_box :remove_avatar %><%= t(:remove) %>
<label func="input_unit" for="1" class=" radio inline">
<%= f.radio_button :sex, "female" %><%= t('users.female')%>
</label>
<label func="input_unit" for="2" class=" radio inline">
<%= f.radio_button :sex, "unknown" %><%= t('users.unknown')%>
</label> </label>
</div> </div>
</div>
</div> </div>
</div> </div>
</div> <!-- First Name -->
<div class="control-group">
<%= f.label t("users.first_name"),{:class=>"control-label muted", :func=>"field_label"} %>
<div class="controls add-input">
<div class="add-target">
<div class="input-append">
<div class="tab-content">
<% @site_valid_locales.each_with_index do |locale, i| %>
<div class="tab-pane fade <%= ( i == 0 ) ? "active in" : '' %>" id="first_name_<%= locale %>">
<%= f.fields_for :first_name_translations do |f| %>
<%= f.text_field locale, :value => (@user.first_name_translations[locale] rescue nil), :placeholder=>"#{t("users.first_name")}" %>
<% end %>
</div>
<% end %>
</div>
<div class="btn-group" data-toggle="buttons-radio">
<% @site_valid_locales.each_with_index do |locale, i| %>
<a class="btn <%= ( i == 0 ) ? "active" : '' %>" href="#first_name_<%= locale %>" data-toggle="tab"><%= I18nVariable.from_locale(locale) %></a>
<% end %>
<a href="#" class="btn remove-input"><i class="icon-trash"></i></a>
</div>
</div>
</div>
</div>
</div>
<!-- Last Name -->
<div class="control-group">
<%= f.label t("users.last_name"),{:class=>"control-label muted", :func=>"field_label"} %>
<div class="controls add-input">
<div class="add-target">
<div class="input-append">
<div class="tab-content">
<% @site_valid_locales.each_with_index do |locale, i| %>
<div class="tab-pane fade <%= ( i == 0 ) ? "active in" : '' %>" id="last_name_<%= locale %>">
<%= f.fields_for :last_name_translations do |f| %>
<%= f.text_field locale, :value => (@user.last_name_translations[locale] rescue nil), :placeholder=>"#{t("users.last_name")}" %>
<% end %>
</div>
<% end %>
</div>
<div class="btn-group" data-toggle="buttons-radio">
<% @site_valid_locales.each_with_index do |locale, i| %>
<a class="btn <%= ( i == 0 ) ? "active" : '' %>" href="#last_name_<%= locale %>" data-toggle="tab"><%= I18nVariable.from_locale(locale) %></a>
<% end %>
<a href="#" class="btn remove-input"><i class="icon-trash"></i></a>
</div>
</div>
</div>
</div>
</div>
<!-- Mail -->
<div class="control-group">
<%= f.label t("users.email"),:class=>"control-label muted" %>
<div class="controls add-input">
<%= f.email_field :email %>
</div>
</div>
<!-- ID Number -->
<div class="control-group">
<%= f.label t("users.sid"),:class=>"control-label muted" %>
<div class="controls add-input">
<%= f.text_field :sid %>
<span class="help-block"><%= t("users.sid_note")%></span>
</div>
</div>
<!-- Office Tel Number -->
<div class="control-group">
<%= f.label t("users.office_tel"),:class=>"control-label muted" %>
<div class="controls add-input">
<%= f.text_field :office_tel %>
<span class="help-block"><%= t("users.office_tel_note")%></span>
</div>
</div>
<!-- Gender -->
<div class="control-group">
<%= f.label t("users.sex"),:class=>"control-label muted" %>
<div class="controls">
<label class="radio inline">
<%= f.radio_button :sex, "male" %><%= t('users.male')%>
</label>
<label class="radio inline">
<%= f.radio_button :sex, "female" %><%= t('users.female')%>
</label>
<label class="radio inline">
<%= f.radio_button :sex, "unknown" %><%= t('users.unknown')%>
</label>
</div>
</div>
</div>
</div>

View File

@ -1,36 +1,54 @@
<%#= devise_error_messages! %> <%#= devise_error_messages! %>
<%= flash_messages %> <%= flash_messages %>
<div class="map-block back"> <div class="attributes">
<h4><span><%=t(:sys_basic_id_form)%></span></h4> <div class="attributes-header clearfix">
<h4><%=t(:sys_basic_id_form)%></h4>
<div class="form-horizontal">
<div class="control-group">
<%= f.label t("users.user_id"),:class=>"control-label" %>
<%#= f.label t(:user_id),:class=>"control-label" %>
<div class="controls">
<%= f.text_field :user_id %>
<span>( <%= t("users.user_id_note")%> )</span>
</div>
</div>
</div> </div>
<div class="attributes-body">
<div class="form-horizontal"> <!-- Account -->
<div class="control-group"> <div class="control-group">
<%= f.label t("users.new_password"),:class=>"control-label" %> <label class="control-label muted" for="account">
<div class="controls"> <%= f.label t("users.user_id"),:class=>"control-label" %>
<%= f.password_field :password %> </label>
<span>( <%= t("users.new_password_note")%> )</span> <div class="controls add-input">
</div> <%= f.text_field :user_id, :class=>"input-medium", :id=>"account", :placeholder=>"#{t('users.user_id')}" %>
<span class="help-block"><%= t("users.user_id_note")%></span>
</div> </div>
</div> </div>
<div class="form-horizontal"> <!-- Password -->
<div class="control-group"> <div class="control-group">
<%= f.label t("users.new_password_confirmation"),:class=>"control-label" %> <label class="control-label muted" for="password">
<div class="controls"> <%= f.label t("users.new_password"),:class=>"control-label" %>
<%= f.password_field :password_confirmation %> </label>
</div> <div class="controls add-input">
<%= f.password_field :password, :class=>"input-medium", :id=>"password" %>
<span class="help-block"><%= t("users.new_password_note")%></span>
</div> </div>
</div>
<!-- Confirm Password -->
<div class="control-group">
<label class="control-label muted" for="confirm_password">
<%= f.label t("users.new_password_confirmation"),:class=>"control-label" %>
</label>
<div class="controls add-input">
<%= f.password_field :password_confirmation, :class=>"input-medium", :id=>"confirm_password" %>
</div>
</div>
<!-- Chec Admin -->
<div class="control-group">
<label class="control-label muted" for="">Administrator</label>
<div class="controls">
<label class="checkbox inline">
<%= f.check_box :admin %>
<%= t("admin") %>
</label>
</div>
</div>
</div> </div>
</div> </div>

View File

@ -1,23 +1,29 @@
<tr class="with_action"> <%
<td class="span1"><% if is_admin? %><input type="checkbox"><% end%></td> if user_for_listing.sex == 'male'
<td class="span3"> @user_sex = 'gender-man'
<div class="label-group"> elsif user_for_listing.sex == 'female'
<div class="label-td"> @user_sex = 'gender-woman'
<% user_for_listing.roles.each do |rf| %> else
<% @roledata = Role.find(rf.id) %> @user_sex = 'gender-none'
<span class="label label-<%= @roledata.key %>"><%= @roledata.title %></span> end
<% end %> %>
</div> <tr>
</div> <td class="<%= @user_sex %>"></td>
</td> <td>
<td class="span1-2"> <% user_for_listing.roles.each do |rf| %>
<%= link_to user_for_listing.name,admin_users_new_interface_path(user_for_listing) %> <% @roledata = Role.find(rf.id) %>
<%#= render "deled_quick_edit"%> <span class="label label-info"><%= @roledata.title %></span>
</td> <% end %>
<td class="span2"><%= Random.rand(1000)%></td> </td>
<td class="span2"><%= Random.rand(10)%></td> <td>
<td class="span2"> <%= link_to user_for_listing.name,admin_users_new_interface_path(user_for_listing) %>
<%= Random.rand(10000)%> <div class="quick-edit">
<p class="gender male"></p> <ul class="nav nav-pills">
</td> <%= content_tag(:li, link_to(t(:edit),edit_admin_users_new_interface_path(user_for_listing))) if is_admin? %>
</tr> <li><a href="#">Permissions</a></li>
<li><a href="#" class="text-error">Delete</a></li>
</ul>
</div>
</td>
<td><%= user_for_listing.email %></td>
</tr>

View File

@ -1,33 +1,35 @@
<li class="pull-left"> <li>
<table class="rolesTag"> <div class="member-avatar">
<tbody> <div class="action">
<tr> <%= link_to("<i class='icon-edit'></i>".html_safe,edit_admin_users_new_interface_path(user_for_summary),:class=>"edit" ) if is_admin?%>
<td class="teacher"></td> <a class="key" href="#"><i class="icon-key"></i></a>
<td class="staff"></td> <a class="trash" href="#"><i class="icon-trash"></i></a>
</tr> </div>
</tbody> <span></span>
</table> <%= show_avatar(user_for_summary) %>
<div class="clear user"> </div>
<p class="gender male"></p> <div class="member-info">
<div class="user-avatar pull-left"> <h4 class="member-name"><%= link_to user_for_summary.name,admin_users_new_interface_path(user_for_summary)%></h4>
<p class="reflective"></p> <div class="member-mail muted"><%= user_for_summary.email%></div>
<%= show_avatar(user_for_summary) %> <hr>
</div> <ul class="member-roles">
<div class="user-meta"> <% user_for_summary.roles.each do |rf| %>
<p class="user-name"> <% @roledata = Role.find(rf.id) %>
<%= link_to user_for_summary.name,admin_users_new_interface_path(user_for_summary)%> <li>
</p> <span class="label label-info"><%= @roledata.title %></span>
<div class="user-title"> <span class="member-staturs muted"><i class="icon-angle-right"></i> Full Time</span>
<% user_for_summary.roles.each do |rf| %> </li>
<% @roledata = Role.find(rf.id) %> <% end %>
<span><%= @roledata.title %></span> </ul>
<% end %> </div>
</div> <%
<ul class="user-itemborder clear"> if user_for_summary.sex == 'male'
<li class="pull-left"><span>#TODO 258</span>Publications</li> @user_sex = 'gender-man'
<li class="pull-left"><span>#TODO 16</span>Courses</li> elsif user_for_summary.sex == 'female'
<li class="pull-left"><span>#TODO 10,578</span>Followers</li> @user_sex = 'gender-woman'
</ul> else
</div> @user_sex = 'gender-none'
</div> end
</li> %>
<p class="<%= @user_sex%>"></p>
</li>

View File

@ -1,22 +1,21 @@
<li class="pull-left"> <%
<table class="rolesTag"> if user_for_thumbnail.sex == 'male'
<tbody> @user_sex = 'gender-man'
<tr> elsif user_for_thumbnail.sex == 'female'
<td class="teacher"></td> @user_sex = 'gender-woman'
<td class="staff"></td> else
</tr> @user_sex = 'gender-none'
</tbody> end
</table> %>
<div class="user"> <li>
<p class="gender male"></p> <div class="member-avatar <%= @user_sex %>">
<div class="user-avatar"> <div class="action">
<p class="reflective"></p> <%= link_to("<i class='icon-edit'></i>".html_safe,edit_admin_users_new_interface_path(user_for_thumbnail),:class=>"edit" ) if is_admin?%>
<%= show_avatar(user_for_thumbnail) %> <a class="key" href="#"><i class="icon-key"></i></a>
</div> <a class="trash" href="#"><i class="icon-trash"></i></a>
<div class="user-meta"> </div>
<p class="user-name"> <span></span>
<%= link_to user_for_thumbnail.name,admin_users_new_interface_path(user_for_thumbnail)%> <%= show_avatar(user_for_thumbnail) %>
</p> </div>
</div> <h4 class="member-name text-center"><%= link_to user_for_thumbnail.name,admin_users_new_interface_path(user_for_thumbnail)%></h4>
</div> </li>
</li>

View File

@ -1,42 +1,24 @@
<div class="roles <%= role_class %>">
<div class="label-line"> <div class="roles">
<hr /> <h4><span><%= t(i18n)%></span></h4>
<span><%= t(i18n)%></span> <dl>
</div> <dt><%= t('users.first_name')%></dt>
<table class="table"> <dd><%= @user.first_name %></dd>
<tbody> <dt><%= t('users.last_name')%></dt>
<tr> <dd><%= @user.last_name %></dd>
<td class="span1"><%= t('users.first_name')%></td> <dt><%= t('users.email')%></dt>
<td><%= @user.first_name %></td> <dd><%= @user.email %></dd>
</tr> <% if !@user.sid.blank? %>
<tr> <dt><%= t('users.sid')%></dt>
<td class="span1"><%= t('users.last_name')%></td> <dd><%= @user.sid %></dd>
<td><%= @user.last_name %></td> <dt><%= t('users.office_tel')%></dt>
</tr> <dd><%= @user.office_tel %></dd>
<tr> <% end %>
<td class="span1"><%= t('users.email')%></td> <dt><%= t('users.sex')%></dt>
<td><%= @user.email %></td> <dd><%= t("users.#{@user.sex}") %></dd>
</tr> <% items.each do |item| %>
<% if !@user.sid.blank? %> <dt><%= item[:name] %></dt>
<tr> <dd><%= show_attribute_value(item[:value]) %></dd>
<td class="span1"><%= t('users.sid')%></td> <% end -%>
<td><%= @user.sid %></td> </dl>
</tr> </div>
<tr>
<td class="span1"><%= t('users.office_tel')%></td>
<td><%= @user.office_tel %></td>
</tr>
<% end %>
<tr>
<td class="span1"><%= t('users.sex')%></td>
<td><%= t("users.#{@user.sex}") %></td>
</tr>
<% items.each do |item| %>
<tr>
<td class="span1"><%= item[:name] %></td>
<td><%= show_attribute_value(item[:value]) %></td>
</tr>
<% end -%>
</tbody>
</table>
</div>

View File

@ -1,32 +1,42 @@
<% content_for :side_bar do %> <% content_for :side_bar do %>
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member_), :link_url => admin_site_site_info_path(@site), :icon => 'icons-users', :side_bar_content => 'admin/users_new_interface/side_bar'} %> <%= render :partial => 'admin/users_new_interface/side_bar' %>
<% end %> <% end %>
<% content_for :page_specific_css do -%> <% content_for :page_specific_css do -%>
<%= stylesheet_link_tag "member" %> <%= stylesheet_link_tag "lib/wrap-nav.css" %>
<%= stylesheet_link_tag "site-map" %> <%= stylesheet_link_tag "lib/pageslide.css" %>
<%= stylesheet_link_tag "lib/main-forms.css" %>
<%= stylesheet_link_tag "lib/fileupload.css" %>
<%= stylesheet_link_tag "lib/togglebox.css" %>
<% end -%> <% end -%>
<% content_for :page_specific_javascript do -%> <% content_for :page_specific_javascript do -%>
<%= javascript_include_tag "/static/jquery.cycle.all.latest.js" %> <%= javascript_include_tag "lib/jquery-ui-1.10.3.custom.min.js" %>
<%= javascript_include_tag "inc/modal-preview" %> <%= javascript_include_tag "lib/jquery.tmpl.min.js" %>
<%= javascript_include_tag "lib/contenteditable" %> <%= javascript_include_tag "lib/bootstrap-fileupload.js" %>
<%= javascript_include_tag "inc/ploy_input_field" %> <%= javascript_include_tag "lib/bootstrap-datetimepicker.js" %>
<%= javascript_include_tag "inc/input_module" %> <%= javascript_include_tag "lib/datetimepicker/date.time.picker.js" %>
<%= javascript_include_tag "inc/attribute_panel_select" %> <%= javascript_include_tag "lib/member/role-forms.js" %>
<%= javascript_include_tag "inc/attribute_onoff" %> <%= javascript_include_tag "lib/member/textarea-lang-btn.js" %>
<% end -%> <% end -%>
<%= content_tag :div,:class=>"user-role site-map role-block" do%> <%= form_for @user, :url => admin_users_new_interface_path(@user), :html => { :multipart => true , :class=>"form-horizontal main-forms", :id=>"new-user-forms"} do |f| %>
<%= form_for @user, :url => admin_users_new_interface_path(@user), :html => { :multipart => true } do |f| %> <fieldset>
<%= f.error_messages %> <div id="basic-area" class="input-area">
<%= render :partial => 'user_basic', :locals => {:f => f}%>
<%= render :partial => 'form', :locals => { :f => f } %> <%= f.error_messages %>
<div class="button_bar"> <%= render :partial => 'user_basic', :locals => {:f => f}%>
<%= link_back %> <%= render :partial => 'form', :locals => { :f => f } %>
<%= link_to t(:update_), "#", :onclick=>"$('#edit_user_#{@user.id}').submit()" %>
</div> </div>
<% end -%>
<div class="form-actions">
<%= link_to t(:update_), "#", :class=>"btn btn-primary returnDecide", :onclick=>"$('#new-user-forms').submit()" %>
<%= link_back('btn') %>
</div>
</fieldset>
<% end -%> <% end -%>

View File

@ -1,32 +1,39 @@
<% content_for :side_bar do %> <% content_for :side_bar do %>
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member_), :link_url => admin_site_site_info_path(@site), :icon => 'icons-users', :side_bar_content => 'admin/users_new_interface/side_bar'} %> <%= render :partial => 'admin/users_new_interface/side_bar' %>
<% end %> <% end %>
<% content_for :page_specific_css do -%> <% content_for :page_specific_css do -%>
<%= stylesheet_link_tag "member" %> <%= stylesheet_link_tag "lib/wrap-nav.css" %>
<%= stylesheet_link_tag "site-map" %> <%= stylesheet_link_tag "lib/pageslide.css" %>
<%= stylesheet_link_tag "lib/main-forms.css" %>
<%= stylesheet_link_tag "lib/fileupload.css" %>
<%= stylesheet_link_tag "lib/togglebox.css" %>
<% end -%> <% end -%>
<% content_for :page_specific_javascript do -%> <% content_for :page_specific_javascript do -%>
<%= javascript_include_tag "/static/jquery.cycle.all.latest.js" %> <%= javascript_include_tag "lib/jquery.tmpl.min.js" %>
<%= javascript_include_tag "inc/modal-preview" %> <%= javascript_include_tag "lib/bootstrap-fileupload.js" %>
<%= javascript_include_tag "lib/contenteditable" %> <%= javascript_include_tag "lib/member/role-forms.js" %>
<%= javascript_include_tag "inc/ploy_input_field" %> <%= javascript_include_tag "lib/member/textarea-lang-btn.js" %>
<%= javascript_include_tag "inc/input_module" %>
<%= javascript_include_tag "inc/attribute_panel_select" %>
<%= javascript_include_tag "inc/attribute_onoff" %>
<% end -%> <% end -%>
<%= content_tag :div,:class=>"user-role site-map role-block" do%> <%= form_for @user, :url => admin_users_new_interface_path(@user), :html => { :multipart => true , :class=>"form-horizontal main-forms"} do |f| %>
<%= form_for @user, :url => admin_users_new_interface_path(@user), :html => { :multipart => true } do |f| %> <fieldset>
<%= f.error_messages %> <div id="basic-area" class="input-area">
<%= render :partial => 'user_basic_passwd', :locals => {:f => f}%>
<div class="button_bar"> <%= f.error_messages %>
<%= link_back %> <%= render :partial => 'user_basic_passwd', :locals => {:f => f}%>
<%= hidden_field_tag 'edit_type', 'edit_passwd' %>
<%= link_to t(:update_), "#", :onclick=>"$('#edit_user_#{@user.id}').submit()" %> </div>
</div>
<% end -%>
<div class="form-actions">
<%= link_back('btn') %>
<%= hidden_field_tag 'edit_type', 'edit_passwd' %>
<%= link_to t(:update_), "#", :class=>"btn btn-primary returnDecide", :onclick=>"$('#edit_user_#{@user.id}').submit()" %>
</div>
</fieldset>
<% end -%> <% end -%>

View File

@ -1,24 +1,57 @@
<% content_for :side_bar do %> <% content_for :side_bar do %>
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member_), :link_url => admin_site_site_info_path(@site), :icon => 'icons-users', :side_bar_content => 'admin/users_new_interface/side_bar'} %> <%= render :partial => 'admin/users_new_interface/side_bar' %>
<% end %> <% end %>
<%= render :partial => "js_and_css"%> <%= render :partial => "js_and_css"%>
<%= render :partial => "filter"%>
<table class="table main-list member-list"> <div id="filter" class="topnav clearfix">
<div class="view-switch btn-group pull-right" data-toggle="buttons-radio">
<form action="" method="get">
<button class="btn btn-small <%= "active" if params[:at].blank? %>"><i class="icon-list"></i> <%= t("show_mode.index")%></button>
<button name="at" value="summary" class="btn btn-small <%= "active" if params[:at] == "summary" %>"><i class="icon-th-list"></i> <%= t("show_mode.summary")%></button>
<button name="at" value="thumbnail" class="btn btn-small <%= "active" if params[:at] == "thumbnail" %>"><i class="icon-th"></i> <%= t("show_mode.thumbnail")%></button>
</form>
</div>
<div class="searchClear pull-right">
<form>
<input id="filter-input" class="search-query input-medium" type="text" placeholder="Search" value="">
</form>
</div>
<ul class="nav nav-pills filter-nav pull-right">
<li class="accordion-group">
<div class="accordion-heading">
<a href="#collapse-status" data-toggle="collapse" data-parent="#filter" class="accordion-toggle">Roles</a>
</div>
</li>
</ul>
<div class="filter-group accordion-group">
<div class="accordion-body collapse" id="collapse-status">
<%= render :partial => "filter"%>
</div>
</div>
</div>
<div id="list-view">
<table id="member-list" class="table main-list">
<thead> <thead>
<tr> <tr class="sort-header">
<th class="span1"></th> <th class="gender"></th>
<th class="span3"></th> <th class="span3"><a href="#">Roles</a></th>
<th class="span1-2"></th> <th class="span4"><a href="#">Name <b class="icons-arrow-down-4"></b></a></th>
<th class="span2"></th> <th><a href="#">Mail</a></th>
<th class="span2"></th>
<th class="span2"></th>
</tr> </tr>
</thead> </thead>
<tbody id="tbody_users"> <tbody>
<%= render :partial => "user_for_listing",:collection=> @users%> <%= render :partial => "user_for_listing",:collection=> @users%>
</tbody> </tbody>
</table> </table>
</div>
<%= render :partial=> "index_paginator" %> <%= render :partial=> "index_paginator" %>

View File

@ -1,13 +1,45 @@
<% content_for :side_bar do %> <% content_for :side_bar do %>
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member_), :link_url => admin_site_site_info_path(@site), :icon => 'icons-users', :side_bar_content => 'admin/users_new_interface/side_bar'} %> <%= render :partial => 'admin/users_new_interface/side_bar' %>
<% end %> <% end %>
<%= render :partial => "js_and_css"%> <%= render :partial => "js_and_css"%>
<%= render :partial => "filter"%>
<div class="member-abstract"> <div id="filter" class="topnav clearfix">
<ul class="clear" id="summary_block_users"> <div class="view-switch btn-group pull-right" data-toggle="buttons-radio">
<%= render :partial=>"user_for_summary",:collection=> @users%>
</ul> <form action="" method="get">
<button class="btn btn-small <%= "active" if params[:at].blank? %>"><i class="icon-list"></i> <%= t("show_mode.index")%></button>
<button name="at" value="summary" class="btn btn-small <%= "active" if params[:at] == "summary" %>"><i class="icon-th-list"></i> <%= t("show_mode.summary")%></button>
<button name="at" value="thumbnail" class="btn btn-small <%= "active" if params[:at] == "thumbnail" %>"><i class="icon-th"></i> <%= t("show_mode.thumbnail")%></button>
</form>
</div>
<div class="searchClear pull-right">
<form>
<input id="filter-input" class="search-query input-medium" type="text" placeholder="Search" value="">
</form>
</div>
<ul class="nav nav-pills filter-nav pull-right">
<li class="accordion-group">
<div class="accordion-heading">
<a href="#collapse-status" data-toggle="collapse" data-parent="#filter" class="accordion-toggle">Roles</a>
</div>
</li>
</ul>
<div class="filter-group accordion-group">
<div class="accordion-body collapse" id="collapse-status">
<%= render :partial => "filter"%>
</div> </div>
</div>
</div>
<div id="list-view">
<ul id="member-abstract" class="clearfix">
<%= render :partial=>"user_for_summary",:collection=> @users%>
</ul>
</div>
<%= render :partial=> "index_paginator" %> <%= render :partial=> "index_paginator" %>

View File

@ -1,12 +1,45 @@
<% content_for :side_bar do %> <% content_for :side_bar do %>
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member_), :link_url => admin_site_site_info_path(@site), :icon => 'icons-users', :side_bar_content => 'admin/users_new_interface/side_bar'} %> <%= render :partial => 'admin/users_new_interface/side_bar' %>
<% end %> <% end %>
<%= render :partial => "js_and_css"%> <%= render :partial => "js_and_css"%>
<%= render :partial => "filter"%>
<div class="member-large"> <div id="filter" class="topnav clearfix">
<ul class="clear" id="thumbnail_block_users"> <div class="view-switch btn-group pull-right" data-toggle="buttons-radio">
<%= render :partial=>"user_for_thumbnail",:collection=> @users%>
</div> <form action="" method="get">
<button class="btn btn-small <%= "active" if params[:at].blank? %>"><i class="icon-list"></i> <%= t("show_mode.index")%></button>
<button name="at" value="summary" class="btn btn-small <%= "active" if params[:at] == "summary" %>"><i class="icon-th-list"></i> <%= t("show_mode.summary")%></button>
<button name="at" value="thumbnail" class="btn btn-small <%= "active" if params[:at] == "thumbnail" %>"><i class="icon-th"></i> <%= t("show_mode.thumbnail")%></button>
</form>
</div>
<div class="searchClear pull-right">
<form>
<input id="filter-input" class="search-query input-medium" type="text" placeholder="Search" value="">
</form>
</div>
<ul class="nav nav-pills filter-nav pull-right">
<li class="accordion-group">
<div class="accordion-heading">
<a href="#collapse-status" data-toggle="collapse" data-parent="#filter" class="accordion-toggle">Roles</a>
</div>
</li>
</ul>
<div class="filter-group accordion-group">
<div class="accordion-body collapse" id="collapse-status">
<%= render :partial => "filter"%>
</div>
</div>
</div>
<div id="list-view">
<ul id="member-card" class="clearfix">
<%= render :partial=>"user_for_thumbnail",:collection=> @users%>
</ul>
</div>
<%= render :partial=> "index_paginator" %> <%= render :partial=> "index_paginator" %>

View File

@ -1,34 +1,42 @@
<% content_for :side_bar do %> <% content_for :side_bar do %>
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member_), :link_url => admin_site_site_info_path(@site), :icon => 'icons-users', :side_bar_content => 'admin/users_new_interface/side_bar'} %> <%= render :partial => 'admin/users_new_interface/side_bar' %>
<% end %> <% end %>
<% content_for :page_specific_css do -%> <% content_for :page_specific_css do -%>
<%= stylesheet_link_tag "member" %> <%= stylesheet_link_tag "lib/wrap-nav.css" %>
<%= stylesheet_link_tag "site-map" %> <%= stylesheet_link_tag "lib/pageslide.css" %>
<%= stylesheet_link_tag "lib/main-forms.css" %>
<%= stylesheet_link_tag "lib/fileupload.css" %>
<%= stylesheet_link_tag "lib/togglebox.css" %>
<% end -%> <% end -%>
<% content_for :page_specific_javascript do -%> <% content_for :page_specific_javascript do -%>
<%= javascript_include_tag "/static/jquery.cycle.all.latest.js" %> <%= javascript_include_tag "lib/jquery-ui-1.10.3.custom.min.js" %>
<%= javascript_include_tag "inc/modal-preview" %> <%= javascript_include_tag "lib/jquery.tmpl.min.js" %>
<%= javascript_include_tag "lib/contenteditable" %> <%= javascript_include_tag "lib/bootstrap-fileupload.js" %>
<%= javascript_include_tag "inc/ploy_input_field" %> <%= javascript_include_tag "lib/bootstrap-datetimepicker.js" %>
<%= javascript_include_tag "inc/input_module" %> <%= javascript_include_tag "lib/datetimepicker/date.time.picker.js" %>
<%= javascript_include_tag "inc/attribute_panel_select" %> <%= javascript_include_tag "lib/member/role-forms.js" %>
<%= javascript_include_tag "inc/attribute_onoff" %> <%= javascript_include_tag "lib/member/textarea-lang-btn.js" %>
<% end -%> <% end -%>
<%= content_tag :div,:class=>"user-role site-map role-block" do%>
<%= form_for @user, :url => admin_users_new_interface_index_path, :html => { :multipart => true },:method => :post do |f| %>
<%= f.error_messages %> <%= form_for @user, :url => admin_users_new_interface_index_path, :html => { :multipart => true, :class=>"form-horizontal main-forms", :id=>"new-user-forms" },:method => :post do |f| %>
<%= render :partial => 'user_basic_passwd', :locals => {:f => f}%> <fieldset>
<%= render :partial => 'user_basic', :locals => {:f => f}%> <div id="basic-area" class="input-area">
<%= render :partial => 'form', :locals => { :f => f } %>
<div class="button_bar">
<%#= link_back %>
<%#= link_to t(:update_), "#", :onclick=>"$('#edit_user_#{@user.id}').submit()" %>
<%= f.submit%>
</div>
<% end -%>
<%= f.error_messages %>
<%= render :partial => 'user_basic_passwd', :locals => {:f => f}%>
<%= render :partial => 'user_basic', :locals => {:f => f}%>
<%= render :partial => 'form', :locals => { :f => f } %>
</div>
<div class="form-actions">
<%#= f.submit%>
<%= link_to t(:new_), "#", :class=>"btn btn-primary returnDecide", :onclick=>"$('#new-user-forms').submit()" %>
<%= link_back('btn') %>
</div>
</fieldset>
<% end -%> <% end -%>

View File

@ -1,64 +1,61 @@
<% content_for :side_bar do %> <% content_for :side_bar do %>
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member_), :link_url => admin_site_site_info_path(@site), :icon => 'icons-users', :side_bar_content => 'admin/users_new_interface/side_bar'} %> <%= render :partial => 'admin/users_new_interface/side_bar' %>
<% end %> <% end %>
<%= render :partial => "js_and_css"%> <%= render :partial => "js_and_css"%>
<div id="isotope" class="user-data"> <% content_for :page_specific_javascript do -%>
<div id="module-nav"> <%= javascript_include_tag "lib/jquery-scrolltofixed-min.js" %>
<div class="arrow_next pull-right"><i class="icon-chevron-right"></i></div> <%= javascript_include_tag "lib/member/member.js" %>
<div class="arrow_prev pull-left"><i class="icon-chevron-left"></i></div> <%= javascript_include_tag "lib/footable-0.1.js" %>
<div class="module-nav-view"> <% end -%>
<ul class="nav nav-pills">
<%= content_tag :li, :class=>(params[:show_plugin_profile].nil? ? "active" : nil) do %> <div id="profile" class="clearfix">
<%= link_to t(:all_plugin_summary)%>
<% end -%> <div id="basic-info" class="clearfix">
<% @plugins.each do |plugin| %> <div class="member-avatar gender-men">
<%= content_tag :li, :class=>(params[:show_plugin_profile] == plugin.name ? "active" : nil) do %> <%= show_avatar(@user) %>
<%= link_to plugin.name, :show_plugin_profile => plugin.name %> </div>
<% end -%> <div class="basic-profile">
<h4><%= @user.name%></h4>
<small class="muted"><%= @user.email %></small>
<%= link_to("<i class='icon-edit'></i>#{t(:edit)}".html_safe,edit_admin_users_new_interface_path(@user),:class=>"btn btn-mini" ) if is_admin?%>
<%= link_to("<i class='icons-cycle'></i>#{t("users.change_passwd")}".html_safe,admin_users_new_interface_edit_passwd_path(@user),:class=>"btn btn-mini" ) if is_admin?%>
</div>
<div id="member-roles" class="nano">
<div class="content">
<%= render :partial=> "user_role",:locals=>{:role_class=>"basic",:i18n=>"profile",:items=>@profile_data} %>
<%= render :partial=> "show_roles",:collection=>@user.roles %>
</div>
</div>
</div>
<div id="member-module">
<div id="module-navbar">
<div class="navbar">
<div class="navbar-inner">
<ul class="nav">
<%= content_tag :li, :class=>(params[:show_plugin_profile].nil? ? "active" : nil) do %>
<%= link_to t(:all_plugin_summary)%>
<% end -%>
<% @plugins.each do |plugin| %>
<%= content_tag :li, :class=>(params[:show_plugin_profile] == plugin.name ? "active" : nil) do %>
<%= link_to plugin.name, :show_plugin_profile => plugin.name %>
<% end -%> <% end -%>
<% end -%>
</ul>
</ul>
</div> </div>
</div>
</div> </div>
<%=render :partial => @right_partial %>
</div> <div id="module-content">
<div class="user-info"> <%=render :partial => @right_partial %>
<div id="brand" class="clear"> </div>
<p class="gender male"></p> </div>
<div class="user-avatar pull-left">
<p class="reflective"></p>
<%= show_avatar(@user) %>
</div>
<p class="user-name">
<%= @user.name%>
</p>
<p class="user-mail">
<%= @user.email %>
</p>
<%= link_to("<i class='icon-pencil'></i>#{t(:edit)}".html_safe,edit_admin_users_new_interface_path(@user),:class=>"btn btn-small" ) if is_admin?%>
<%= link_to("<i class='icon-pencil'></i>#{t("users.change_passwd")}".html_safe,admin_users_new_interface_edit_passwd_path(@user),:class=>"btn btn-small" ) if is_admin?%>
</div>
<div class="user-roles my_scroll">
<div class="scrollbar">
<div class="track">
<div class="thumb">
<div class="end"></div>
</div>
</div>
</div>
<div class="viewport">
<div class="overview">
<%= render :partial=> "user_role",:locals=>{:role_class=>"basic",:i18n=>"profile",:items=>@profile_data} %>
<%= render :partial=> "show_roles",:collection=>@user.roles %>
<%# @user.sub_roles.each{|sr| render :partial=> "user_role",:locals=>{:role_class=>sr.key.to_s,:i18n=>"admin.new_admin.users.roles.#{sr.key.to_s}",:items=>sr} }%>
<%#= render :partial=> "user_role",:locals=>{:role_class=>"teacher",:i18n=>"admin.new_admin.users.roles.teacher",:items=>@teacher_data} %>
<%#= render :partial=> "user_role",:locals=>{:role_class=>"student",:i18n=>"admin.new_admin.users.roles.student",:items=>@student_data}%>
<%#= render :partial=> "user_role",:locals=>{:role_class=>"staff",:i18n=>"admin.new_admin.users.roles.staff",:items=>@staff_data} %>
</div>
<div>
</div>
</div> </div>

View File

@ -0,0 +1,266 @@
<%#= encoding: utf-8 %>
<script id="template-attributes" type="text/x-tmpl">
<div class="attributes">
<div class="attributes-header clearfix">
<input class="toggle-check" data-deploy="right" id="${_disabled[0]}" name="${_disabled[1]}" type="hidden" value="false">
<a class="btn btn-mini pull-right btn-danger delete" href="#"><i class="icon-trash"></i> Delete</a>
<a class="btn btn-mini pull-right btn-inverse reply hide" href="#"><i class="icons-reply"></i> Reply</a>
<input class="attribute_field_to_delete" id="${_to_delete[0]}" name="${_to_delete[1]}" type="hidden" value="false">
<h4>Attributes <span>${attributesHeaderLength}</span></h4>
</div>
<div class="attributes-body">
<div class="control-group">
<label class="control-label muted" for="${_key[0]}"><%= t(:key) %></label>
<div class="controls">
<input type="text" data-type="key" id="${_key[0]}" name="${_key[1]}" placeholder="<%= t(:key) %>">
</div>
</div>
<div class="control-group">
<label class="control-label muted" for=""><%= t(:name) %></label>
<div class="controls">
<div class="input-append">
<div class="tab-content">
<% @site_valid_locales.each do |locale| %>
<% active = (locale == @site_valid_locales.first ? "active" : "") %>
<div class="tab-pane <%= active %> fade in" id="${_title_translations[0]+'_<%= locale%>'}">
<input type="text" data-type="lang_<%= locale%>" name="${_title_translations[1]+'[<%= locale%>]'}" placeholder="<%= I18nVariable.from_locale(locale) %>">
</div>
<% end %>
</div>
<div class="btn-group" data-toggle="buttons-radio">
<% @site_valid_locales.each do |locale| %>
<% active = (locale == @site_valid_locales.first ? "active" : "") %>
<a class="btn <%= active %>" href="${'#'+_title_translations[0]+'_<%= locale%>'}" data-toggle="tab"><%= I18nVariable.from_locale(locale) %></a>
<% end %>
</div>
</div>
</div>
</div>
<div class="control-group">
<label class="control-label muted" for=""><%= t(:to_search) %></label>
<div class="controls">
<label class="radio inline">
<input type="radio" data-type="search_true" id="${_to_search[0]+'_true'}" name="${_to_search[1]}" value="true"> <%= t(:yes_)%>
</label>
<label class="radio inline">
<input type="radio" data-type="search_false" id="${_to_search[0]+'_false'}" name="${_to_search[1]}" value="false" checked=""> <%= t(:no_)%>
</label>
</div>
</div>
<div class="control-group">
<label class="control-label muted" for=""><%= t(:type)%></label>
<div class="controls">
<select class="dataType" data-type="select" name="${_markup}">
<%LIST[:markups].each do |key,val|%>
<option value="<%= key %>" ref="<%=val["panel"]%>"><%=t("lists.markups."+key)%></option >
<% end %>
</select>
</div>
</div>
</div>
<div class="field-type fade in typeA">
<div class="control-group">
<label class="control-label muted"><%= t(:enabled_for)%></label>
<div class="controls">
<label class="checkbox inline">
<input type="checkbox" data-type="enable_monolingual" id="${_cross_lang[0]}" name="${_cross_lang[1]}" value="true">
<%= t(:cross_lang) %>
</label>
<label class="checkbox inline">
<input type="checkbox" data-type="extendable_field" id="${_add_more[0]}" name="${_add_more[1]}" value="true">
<%= t(:add_more)%>
</label>
</div>
</div>
<div class="control-group">
<label class="control-label muted"><%= t(:placeholder) %></label>
<div class="controls">
<div class="input-append">
<div class="tab-content">
<% @site_valid_locales.each do |locale| %>
<% active = (locale == @site_valid_locales.first ? "active" : "") %>
<div class="tab-pane <%= active %> fade in" id="${_placeholder[0]+'_<%= locale %>'}">
<input type="text" data-type="lang_<%= locale %>" placeholder="<%= I18nVariable.from_locale(locale) %>" name="${_placeholder[1]+'[<%= locale %>]'}">
</div>
<% end %>
</div>
<div class="btn-group" data-toggle="buttons-radio">
<% @site_valid_locales.each do |locale| %>
<% active = (locale == @site_valid_locales.first ? "active" : "") %>
<a class="btn <%= active %>" href="${'#'+_placeholder[0]+'_<%= locale %>'}" data-toggle="tab"><%= I18nVariable.from_locale(locale) %></a>
<% end %>
</div>
</div>
</div>
</div>
</div>
</div>
</script>
<script id="template-type" type="text/x-tmpl">
{{if templateType == 'typeA' || templateType == 'typeD' || templateType == 'typeG'}}
<div class="control-group">
<label class="control-label muted"><%= t(:enabled_for)%></label>
<div class="controls">
{{if templateType == 'typeA' || templateType == 'typeD'}}
<label class="checkbox inline">
<input type="checkbox" data-type="enable_monolingual" id="${_cross_lang[0]}" name="${_cross_lang[1]}" value="true">
<%= t(:cross_lang) %>
</label>
{{/if}}
{{if templateType == 'typeA' || templateType == 'typeG'}}
<label class="checkbox inline">
<input type="checkbox" data-type="extendable_field" id="${_add_more[0]}" name="${_add_more[1]}" value="true">
<%= t(:add_more)%>
</label>
{{/if}}
</div>
</div>
{{/if}}
{{if templateType == 'typeA' || templateType == 'typeB' || templateType == 'typeD'}}
<div class="control-group">
<label class="control-label muted">
{{if templateType == 'typeB'}}
<%= t(:initial) %>
{{else}}
<%= t(:placeholder) %>
{{/if}}
</label>
<div class="controls">
<div class="input-append">
<div class="tab-content">
<% @site_valid_locales.each do |locale| %>
<% active = (locale == @site_valid_locales.first ? "active" : "") %>
<div class="tab-pane <%= active %> fade in" id=
{{if templateType == 'typeB'}}
"${_initial[0]+'_<%= locale %>'}"
{{else}}
"${_placeholder[0]+'_<%= locale %>'}"
{{/if}}
>
<input type="text" data-type="lang_<%= locale %>" placeholder="<%= I18nVariable.from_locale(locale) %>" name=
{{if templateType == 'typeB'}}
"${_initial[1]+'[<%= locale %>]' }"
{{else}}
"${_placeholder[1]+'[<%= locale %>]'}"
{{/if}}
>
</div>
<% end %>
</div>
<div class="btn-group" data-toggle="buttons-radio">
<% @site_valid_locales.each do |locale| %>
<% active = (locale == @site_valid_locales.first ? "active" : "") %>
<a class="btn <%= active %>" href=
{{if templateType == 'typeB'}}
"${'#'+_initial[0]+'_<%= locale %>'}"
{{else}}
"${'#'+_placeholder[0]+'_<%= locale %>'}"
{{/if}}
data-toggle="tab"><%= I18nVariable.from_locale(locale) %></a>
<% end %>
</div>
</div>
</div>
</div>
{{/if}}
{{if templateType == 'typeB' || templateType == 'typeE' || templateType == 'typeF'}}
<div class="control-group">
<label class="control-label muted" for=""><%= t(:options)%></label>
<div class="controls add-input">
<div class="add-target single">
<%= content_tag :div,:class=>"input-append" do%>
<% @site_valid_locales.each do |locale| %>
<% last = (locale == @site_valid_locales.last ? true : false) %>
<input type="text" data-type="${_option_list[2]+'_<%= locale %>' }" id="${_option_list[0]+'_<%= locale %>'}" name="${_option_list[1]+'[<%= locale %>]'}" class="input-medium" placeholder="<%= I18nVariable.from_locale(locale) %>">
<% if last %>
<a href="#" class="btn remove-input"> <i class="icon-trash"></i> </a>
<% end %>
<% end %>
<% end %>
</div>
<p class="add-btn">
<a href="#" class="${templateType+' trigger btn btn-mini btn-primary'}"><i class="icons-plus"></i> Add</a>
</p>
</div>
</div>
{{/if}}
{{if templateType == 'typeC'}}
<div class="control-group">
<label class="control-label muted" for=""><%= t("date.format")%></label>
<div class="controls">
<select data-type="date" id="${_format[0]}" name="${_format[1]}">
<option value="format1">YYYY / MM / DD hh : mm</option>
<option value="format2">YYYY / MM / DD</option>
<option value="format3">YYYY / MM</option>
<option value="format4">YYYY</option>
</select>
</div>
</div>
<div class="control-group">
<label class="control-label muted" for=""><%= t("date.range")%></label>
<div class="controls">
<label class="radio inline">
<input type="radio" data-type="time_period_flase" id="${_is_range[0]+'_false'}" name="${_is_range[1]}" value="false" checked="checked"> <%= t(:yes_)%>
</label>
<label class="radio inline">
<input type="radio" data-type="time_period_true" id="${_is_range[0]+'_true'}" name="${_is_range[1]}" value="true"> <%= t(:no_)%>
</label>
</div>
</div>
<div class="control-group">
<label class="control-label muted" for=""><%= t("date.calendar")%></label>
<div class="controls">
<label class="radio inline">
<input type="radio" data-type="calendar_ac" id="${_calendar[0]+'_west_calendar'}" name="${_calendar[1]}" value="west_calendar" checked="checked"> <%= t("date.west_calendar")%>
</label>
<label class="radio inline">
<input type="radio" data-type="calendar_roc" id="${_calendar[0]+'_tw_calendar'}" name="${_calendar[1]}" value="tw_calendar"> <%= t("date.tw_calendar")%>
</label>
</div>
</div>
{{/if}}
</script>
<script id="template-input-append" type="text/x-tmpl">
<%= content_tag :div,:class=>"input-append" do%>
<% @site_valid_locales.each do |locale| %>
<% last = (locale == @site_valid_locales.last ? true : false) %>
<input type="text" data-type="${_option_list[2]+'_<%= locale %>' }" id="${_option_list[0]+'_<%= locale %>'}" name="${_option_list[1]+'[<%= locale %>]'}" class="input-medium" placeholder="<%= I18nVariable.from_locale(locale) %>">
<% if last %>
<a href="#" class="btn remove-input"> <i class="icon-trash"></i> </a>
<% end %>
<% end %>
<% end %>
</script>
<script id="template-text" type="text/x-tmpl">
<div class="input-append">
<input type="text" id="${'text'+_text[0]}" name="${_text[1]+'[text]'}" class="input-medium" placeholder="Text">
<a href="#" class="btn remove-input">
<i class="icon-trash"></i>
</a>
</div>
</script>

View File

@ -0,0 +1,43 @@
<!DOCTYPE HTML>
<html>
<head>
<title><%= @title || APP_CONFIG['orbit'] %></title>
<%= render 'layouts/meta' %>
<%= render 'layouts/google_font' %>
<%= stylesheet_link_tag "member" %>
<%= stylesheet_link_tag params[:controller] %>
<%= yield :page_specific_css %>
<%= render 'layouts/ie_html5_fix' %>
<%= javascript_include_tag "member" %>
<%= javascript_include_tag params[:controller] %>
<%= yield :page_specific_javascript %>
<%= csrf_meta_tag %>
</head>
<body id="users">
<%= render 'layouts/orbit_bar' unless @no_orbit_bar %>
<% if !(yield :side_bar).blank? %>
<%= yield :side_bar %>
<% else %>
<%= render 'layouts/side_bar' %>
<% end unless @no_side_bar %>
<section id="main-wrap">
<div class="wrap-inner">
<div id="filter" class="topnav clearfix">
<ul class="breadcrumb pull-left">
<li><a href="/orbit_4.0.1/admin/dashboards/dashboards.shtml">Dashboard</a> <span class="divider">/</span></li>
<li class="active">All</li>
</ul>
<%= yield :right_nav %>
</div>
<%= yield %>
<div id="pageslide">
<div id="view-page" class="nano" style="display:none">
<div class="content">
</div>
</div>
</div>
<%= javascript_include_tag "lib/jquery.pageslide.js" %>
</div>
</section>
</body>
</html>

View File

@ -1,124 +1,130 @@
<div class="form-horizontal"> <div class="attributes default <%= attribute_field.disabled ? 'disabled' : ''%>">
<% <%
attribute_field.af_count ? @af_counter = attribute_field_counter + attribute_field.af_count : @af_counter = attribute_field_counter attribute_field.af_count ? @af_counter = attribute_field_counter + attribute_field.af_count : @af_counter = attribute_field_counter
%> %>
<%= @af_counter + 1 %> <div class="attributes-header clearfix">
<%#= attribute_field_counter %> <div class="toggle-control" style="float: right;">
<legend> <div class="togglebox <%= attribute_field.disabled ? 'disabled' : ''%>">
<button class="onoff pull-right <%= attribute_field.disabled ? 'disabled' : ''%>">ON</button> <%= hidden_field "info[attribute_fields][#{@af_counter}]","disabled",:value=>attribute_field.disabled,:class=>"toggle-check", :data=>{:deploy=>"right"} %>
<%= hidden_field "info[attribute_fields][#{@af_counter}]","disabled",:value=>attribute_field.disabled,:class=>"attribute_field_disabled"%> <label><b></b></label>
<%= hidden_field "info[attribute_fields][#{@af_counter}]","to_delete",:value=>false,:class=>"attribute_field_to_delete"%>
<a class="btn btn-small pull-right btn-danger remove_attribute"><i class="icon-trash icon-large"></i> <%= t(:delete_)%></a>
<div class="clear">
<div class="control-group pull-left">
<label class="control-label" for="key"><%= t(:key) %></label>
<div class="multipleInput">
<div class="controls">
<%= text_field "info[attribute_fields][#{@af_counter}]","key",:value=>attribute_field.key%>
</div>
</div>
</div>
<%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:values=>attribute_field.title_translations,:class_ext=>"pull-left",:label_ext=>t(:name),:field_name=>"info[attribute_fields][#{@af_counter}][title_translations]"}%>
<div class="control-group">
<label class="control-label" for="key"><%= t(:to_search) %></label>
<div class="controls">
<label class="radio inline">
<%= radio_button("info[attribute_fields][#{@af_counter}]", "to_search", "true",:checked => (attribute_field.to_search == true ? true : false)) %><%= t(:yes_)%>
</label>
<label class="radio inline">
<%= radio_button("info[attribute_fields][#{@af_counter}]", "to_search", "false",:checked => (attribute_field.to_search == false ? true : false)) %><%= t(:no_)%>
</label>
</div>
</div>
<div class="control-group pull-left">
<label class="control-label" for=""><%= t(:type)%></label>
<div class="controls">
<%#= select_tag "info[attribute_fields][#{@af_counter}][markup]" do %>
<select class="dataType" name=<%= "info[attribute_fields][#{@af_counter}][markup]"%>>
<%LIST[:markups].each do |key,val|%>
<option value="<%= key %>" <%= attribute_field.markup == key ? 'selected="selected"' : '' %> ref="<%=val["panel"]%>"><%=t("lists.markups."+key)%></option >
<% end %>
</select>
</div>
</div>
</div>
</legend>
<div class="<%= attribute_field.disabled ? 'hide' : ''%>">
<%= content_tag :div,:class=>show_type_panel(attribute_field,"typeA") do%>
<div class="control-group">
<label class="control-label"><%= t(:enabled_for)%></label>
<div class="controls">
<label class="checkbox inline">
<%= check_box_tag("info[attribute_fields][#{@af_counter}][typeA][cross_lang]","true",attribute_field["typeA"]["cross_lang"]) %>
<%= t(:cross_lang)%>
</label>
<label class="checkbox inline">
<%= check_box_tag("info[attribute_fields][#{@af_counter}][typeA][add_more]","true",attribute_field["typeA"]["add_more"]) %>
<%= t(:add_more)%>
</label>
</div>
</div>
<%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:values=>attribute_field["typeA"]["placeholder"],:field_name=>"info[attribute_fields][#{@af_counter}][typeA][placeholder]"}%>
<% end %>
<%= content_tag :div,:class=>show_type_panel(attribute_field,"typeB") do %>
<%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:label_ext=>t(:initial),:values=>attribute_field["typeB"]["initial"],:field_name=>"info[attribute_fields][#{@af_counter}][typeB][initial]"}%>
<% if attribute_field.self_defined_markup_options?%>
<%= render :partial=>"shared/attribute_field/list_block",:locals=>{:values=>attribute_field["option_list"],:field_name=> "info[attribute_fields][#{@af_counter}][attribute][role][statuses]"} %>
<%else #normal list%>
<%= render :partial=>"shared/attribute_field/list_block",:locals=>{:values=>attribute_field["option_list"],:field_name=> "info[attribute_fields][#{@af_counter}][typeB][option_list]"} %>
<% end #of self_defined_markup_options?%>
<% end %>
<%= content_tag :div,:class=>show_type_panel(attribute_field,"typeC") do %>
<div class="control-group">
<label class="control-label"><%= t("date.format")%></label>
<div class="controls">
<%= select "info[attribute_fields][#{@af_counter}][typeC]","format",Admin::AttributeValuesViewHelper::OPT,:class=>"dataType",:selected=>attribute_field["typeC"]["format"] %>
</div>
</div>
<div class="control-group">
<label class="control-label"><%= t("date.range")%></label>
<div class="controls">
<label class="radio inline">
<%= radio_button("info[attribute_fields][#{@af_counter}][typeC]", "is_range", "false",:checked => (!attribute_field.date_is_range? ? true : false)) %><%= t(:yes_)%>
</label>
<label class="radio inline">
<%= radio_button("info[attribute_fields][#{@af_counter}][typeC]", "is_range", "true",:checked => (attribute_field.date_is_range? ? true : false)) %><%= t(:no_)%>
</label>
</div>
</div>
<div class="control-group">
<label class="control-label"><%= t("date.calendar")%></label>
<div class="controls">
<label class="radio inline">
<%= radio_button("info[attribute_fields][#{@af_counter}][typeC]", "calendar", "west_calendar",:checked =>(attribute_field["typeC"]["calendar"]== "west_calendar" ? true : false)) %><%= t("date.west_calendar")%>
</label>
<label class="radio inline">
<%= radio_button("info[attribute_fields][#{@af_counter}][typeC]", "calendar", "tw_calendar",:checked =>(attribute_field["typeC"]["calendar"]== "tw_calendar" ? true : false)) %><%= t("date.tw_calendar")%>
</label>
</div>
</div>
<% end %>
<%= content_tag :div,:class=>show_type_panel(attribute_field,"typeD") do%>
<div class="control-group">
<label class="control-label"><%= t(:enabled_for)%></label>
<div class="controls">
<label class="checkbox inline">
<%= check_box_tag("info[attribute_fields][#{@af_counter}][typeD][cross_lang]","true",attribute_field["typeD"]["cross_lang"]) %>
<%= t(:cross_lang)%>
</label>
</div>
</div>
<%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:field_name=>"info[attribute_fields][#{@af_counter}][typeD][placeholder]",:values=>attribute_field["typeD"]["placeholder"]} %>
<% end %>
<%= content_tag :div,:class=>show_type_panel(attribute_field,"typeE") do%>
<%= render :partial=>"shared/attribute_field/list_block",:locals=>{:field_name=>"info[attribute_fields][#{@af_counter}][typeE][option_list]",:values=>attribute_field["option_list"]}%>
<% end %>
</div> </div>
<%= hidden_field "info[attribute_fields][#{@af_counter}]","id",:value=>attribute_field.id%> </div>
<a class="btn btn-mini pull-right btn-danger delete" href="#"><i class="icon-trash"></i> <%= t(:delete_)%></a>
<%= hidden_field "info[attribute_fields][#{@af_counter}]","to_delete",:value=>false,:class=>"attribute_field_to_delete"%>
<a class="btn btn-mini pull-right btn-inverse reply hide" href="#"><i class="icons-reply"></i> Reset</a>
<h4>Attributes <span><%= @af_counter + 1 %></span></h4>
</div> </div>
<div class="attributes-body">
<div class="control-group">
<label class="control-label muted" for="key_<%= @af_counter %>"><%= t(:key) %></label>
<div class="controls">
<%= text_field "info[attribute_fields][#{@af_counter}]","key",:value=>attribute_field.key, :data=>{:type=>"key"} %>
</div>
</div>
<%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:values=>attribute_field.title_translations,:class_ext=>"pull-left",:label_ext=>t(:name),:field_name=>"info[attribute_fields][#{@af_counter}][title_translations]"}%>
<div class="control-group">
<label class="control-label muted" for=""><%= t(:to_search) %></label>
<div class="controls">
<label class="radio inline">
<%= radio_button("info[attribute_fields][#{@af_counter}]", "to_search", "true",:checked => (attribute_field.to_search == true ? true : false), :data=>{:type=>"search_true"}) %><%= t(:yes_)%>
</label>
<label class="radio inline">
<%= radio_button("info[attribute_fields][#{@af_counter}]", "to_search", "false",:checked => (attribute_field.to_search == false ? true : false), :data=>{:type=>"search_false"}) %><%= t(:no_)%>
</label>
</div>
</div>
<div class="control-group">
<label class="control-label muted" for=""><%= t(:type)%></label>
<div class="controls">
<select class="dataType" data-type="select" name=<%= "info[attribute_fields][#{@af_counter}][markup]"%>>
<%LIST[:markups].each do |key,val|%>
<option value="<%= key %>" <%= attribute_field.markup == key ? 'selected="selected"' : '' %> ref="<%=val["panel"]%>"><%=t("lists.markups."+key)%></option >
<% end %>
</select>
</div>
</div>
</div>
<div class="field-type fade"></div>
<%= content_tag :div,:class=>"field-type default fade in #{show_type_panel(attribute_field,"typeA")}" do%>
<div class="control-group">
<label class="control-label muted"><%= t(:enabled_for)%></label>
<div class="controls">
<label class="checkbox inline">
<%= check_box_tag("info[attribute_fields][#{@af_counter}][typeA][cross_lang]","true",attribute_field["typeA"]["cross_lang"],:data=>{:type=>"cross_lang"}) %>
<%= t(:cross_lang) %>
</label>
<label class="checkbox inline">
<%= check_box_tag("info[attribute_fields][#{@af_counter}][typeA][add_more]","true",attribute_field["typeA"]["add_more"],:data=>{:type=>"add_more"}) %>
<%= t(:add_more)%>
</label>
</div>
</div>
<%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:values=>attribute_field["typeA"]["placeholder"],:field_name=>"info[attribute_fields][#{@af_counter}][typeA][placeholder]"}%>
<% end if show_type_panel(attribute_field,"typeA") != 'typeA hide' %>
<%= content_tag :div,:class=>"field-type default fade in #{show_type_panel(attribute_field,"typeB")}" do %>
<%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:label_ext=>t(:initial),:values=>attribute_field["typeB"]["initial"],:field_name=>"info[attribute_fields][#{@af_counter}][typeB][initial]"}%>
<% if attribute_field.self_defined_markup_options?%>
<%= render :partial=>"shared/attribute_field/list_block",:locals=>{:values=>attribute_field["option_list"],:field_name=> "info[attribute_fields][#{@af_counter}][attribute][role][statuses]"} %>
<%else #normal list%>
<%= render :partial=>"shared/attribute_field/list_block",:locals=>{:values=>attribute_field["option_list"],:field_name=> "info[attribute_fields][#{@af_counter}][typeB][option_list]"} %>
<% end #of self_defined_markup_options?%>
<% end if show_type_panel(attribute_field,"typeB") != 'typeB hide' %>
<%= content_tag :div,:class=>"field-type default fade in #{show_type_panel(attribute_field,"typeC")}" do %>
<div class="control-group">
<label class="control-label"><%= t("date.format")%></label>
<div class="controls">
<%= select "info[attribute_fields][#{@af_counter}][typeC]","format",Admin::AttributeValuesViewHelper::OPT,:class=>"dataType",:selected=>attribute_field["typeC"]["format"] %>
</div>
</div>
<div class="control-group">
<label class="control-label"><%= t("date.range")%></label>
<div class="controls">
<label class="radio inline">
<%= radio_button("info[attribute_fields][#{@af_counter}][typeC]", "is_range", "false",:checked => (!attribute_field.date_is_range? ? true : false)) %><%= t(:yes_)%>
</label>
<label class="radio inline">
<%= radio_button("info[attribute_fields][#{@af_counter}][typeC]", "is_range", "true",:checked => (attribute_field.date_is_range? ? true : false)) %><%= t(:no_)%>
</label>
</div>
</div>
<div class="control-group">
<label class="control-label"><%= t("date.calendar")%></label>
<div class="controls">
<label class="radio inline">
<%= radio_button("info[attribute_fields][#{@af_counter}][typeC]", "calendar", "west_calendar",:checked =>(attribute_field["typeC"]["calendar"]== "west_calendar" ? true : false)) %><%= t("date.west_calendar")%>
</label>
<label class="radio inline">
<%= radio_button("info[attribute_fields][#{@af_counter}][typeC]", "calendar", "tw_calendar",:checked =>(attribute_field["typeC"]["calendar"]== "tw_calendar" ? true : false)) %><%= t("date.tw_calendar")%>
</label>
</div>
</div>
<% end if show_type_panel(attribute_field,"typeC") != 'typeC hide' %>
<%= content_tag :div,:class=>"field-type default fade in #{show_type_panel(attribute_field,"typeD")}" do%>
<div class="control-group">
<label class="control-label"><%= t(:enabled_for)%></label>
<div class="controls">
<label class="checkbox inline">
<%= check_box_tag("info[attribute_fields][#{@af_counter}][typeD][cross_lang]","true",attribute_field["typeD"]["cross_lang"]) %>
<%= t(:cross_lang)%>
</label>
</div>
</div>
<%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:field_name=>"info[attribute_fields][#{@af_counter}][typeD][placeholder]",:values=>attribute_field["typeD"]["placeholder"]} %>
<% end if show_type_panel(attribute_field,"typeD") != 'typeD hide' %>
<%= content_tag :div,:class=>"field-type default fade in #{show_type_panel(attribute_field,"typeE")}" do%>
<%= render :partial=>"shared/attribute_field/list_block",:locals=>{:field_name=>"info[attribute_fields][#{@af_counter}][typeE][option_list]",:values=>attribute_field["option_list"]}%>
<% end if show_type_panel(attribute_field,"typeE") != 'typeE hide' %>
<%= hidden_field "info[attribute_fields][#{@af_counter}]","id",:value=>attribute_field.id%>
</div>

View File

@ -1,45 +1,41 @@
<% temp_field_name = field_name.gsub /\[\D*\]$/,'[temp]'%> <% temp_field_name = field_name.gsub /\[\D*\]$/,'[temp]'%>
<div class="control-group"> <div class="control-group">
<%= hidden_field_tag "#{temp_field_name}[count]",((values.keys.collect{|t| t.to_i}.max rescue nil) || 0 ),:class=>"list_count"%> <%= hidden_field_tag "#{temp_field_name}[count]",((values.keys.collect{|t| t.to_i}.max rescue nil) || 0 ),:class=>"list_count"%>
<%= hidden_field_tag "#{temp_field_name}[name]",field_name,:class=>"field_name"%> <%= hidden_field_tag "#{temp_field_name}[name]",field_name,:class=>"field_name"%>
<label class="control-label" ><%= t(:options)%></label> <label class="control-label muted" for=""><%= t(:options)%></label>
<div class="multipleInput"> <div class="controls add-input">
<%if values.blank? %> <div class="add-target single">
<div class="controls">
<% @site_valid_locales.each do |locale| %> <%if values.blank? %>
<% last = (locale == @site_valid_locales.last ? true : false) %> <%= content_tag :div,:class=>"input-append" do%>
<% p_value = value[locale.to_s] rescue nil%> <% @site_valid_locales.each do |locale| %>
<%= content_tag :div,:class=>"input-append #{"unRadius" if last }" do%> <% last = (locale == @site_valid_locales.last ? true : false) %>
<%= text_field("#{field_name}[0]", locale,:placeholder=>I18nVariable.from_locale(locale)) %> <% p_value = value[locale.to_s] rescue nil%>
<% if last %> <%= text_field("#{field_name}[0]", locale,:placeholder=>I18nVariable.from_locale(locale),:class=>"input-medium",:data=>{:type=>"option_lang_0_#{locale}"}) %>
<a href="#" class="btn removeInput" type="button"><i class="icon-trash"></i></a> <% if last %>
<% end %> <a href="#" class="btn remove-input"> <i class="icon-trash"></i> </a>
<% end %> <% end %>
<% end %> <% end %>
</div> <% end %>
<%else%> <%else%>
<%values.each do |index,value|%> <%values.each do |index,value|%>
<div class="controls"> <%= content_tag :div,:class=>"input-append" do%>
<% @site_valid_locales.each do |locale| %>
<% @site_valid_locales.each do |locale| %> <% last = (locale == @site_valid_locales.last ? true : false) %>
<% last = (locale == @site_valid_locales.last ? true : false) %> <% p_value = value[locale.to_s] rescue nil%>
<% p_value = value[locale.to_s] rescue nil%> <%= text_field("#{field_name}[#{index}]", locale,:value=>p_value,:placeholder=>I18nVariable.from_locale(locale),:class=>"input-medium", :data=>{:type=>"option_lang_#{index}_#{locale}"}) %>
<%= content_tag :div,:class=>"input-append #{"unRadius" if last }" do%> <% if last %>
<%= text_field("#{field_name}[#{index}]", locale,:value=>p_value,:placeholder=>I18nVariable.from_locale(locale)) %> <a href="#" class="btn remove-input"> <i class="icon-trash"></i> </a>
<% if last %> <% end %>
<a href="#" class="btn removeInput" type="button"><i class="icon-trash"></i></a>
<% end %>
<% end %>
<% end %> <% end %>
<% end %>
</div>
<% end %> <% end %>
<% end %> <% end %>
</div>
<div class="controls"> </div>
<span class="help-block">
<a href="#"><i class="icon-plus-sign"></i><%= t(:add) %></a> <p class="add-btn"> <a href="#" class="typeB trigger btn btn-mini btn-primary"><i class="icons-plus"></i> <%= t(:add) %></a> </p>
</span>
</div>
</div> </div>
</div>

View File

@ -1,25 +1,25 @@
<% values ||=[]%> <% values ||=[]%>
<%= content_tag :div,:class=>"control-group language-swich #{class_ext rescue "" }" do%> <%= content_tag :div,:class=>"control-group" do%>
<label class="control-label" for=""><%= (defined? label_ext) ? label_ext : t(:placeholder) %></label> <label class="control-label muted" for=""><%= (defined? label_ext) ? label_ext : t(:placeholder) %></label>
<div class="controls"> <div class="controls">
<div class="tabbable"> <div class="input-append">
<div class="tab-content"> <div class="tab-content">
<% @site_valid_locales.each do |locale| %> <% @site_valid_locales.each do |locale| %>
<% active = (locale == @site_valid_locales.first ? "active in" : "'") %> <% active = (locale == @site_valid_locales.first ? "active in" : "'") %>
<%= content_tag :div,:class=>"tab-pane fade #{active}",:id=>"#{name_to_id(field_name)}_#{locale}" do%> <%= content_tag :div,:class=>"tab-pane fade #{active}",:id=>"#{name_to_id(field_name)}_#{locale}" do%>
<% locale_value = values[locale.to_s] rescue nil%> <% locale_value = values[locale.to_s] rescue nil%>
<%= text_field(field_name, locale,:value=>locale_value,:placeholder=>I18nVariable.from_locale(locale)) %> <%= text_field(field_name, locale,:value=>locale_value,:placeholder=>I18nVariable.from_locale(locale),:data=>{:type=>"lang_#{locale}"}) %>
<% end %> <% end %>
<% end %> <% end %>
</div> </div>
<ul class="nav nav-pills ">
<% @site_valid_locales.each do |locale| %> <div class="btn-group" data-toggle="buttons-radio">
<% active = (locale == @site_valid_locales.first ? "active" : "'") %> <% @site_valid_locales.each do |locale| %>
<%=content_tag :li,:class=>active do %> <% active = (locale == @site_valid_locales.first ? "active" : "") %>
<%= link_to I18nVariable.from_locale(locale),"##{name_to_id(field_name)}_#{locale}",:data=>{:toggle=>"tab"}%> <%= link_to I18nVariable.from_locale(locale),"##{name_to_id(field_name)}_#{locale}",:class=>"btn #{active}",:data=>{:toggle=>"tab"}%>
<% end %> <% end %>
<% end %> </div>
</ul>
</div> </div>
</div> </div>
<% end %> <% end %>

View File

@ -171,11 +171,21 @@ Orbit::Application.routes.draw do
get 'add_sub_role' get 'add_sub_role'
get 'edit_sub_role' get 'edit_sub_role'
get 'add_attribute_field' get 'add_attribute_field'
post 'toggle'
post 'sub_role_toggle'
end end
resources :role_filters resources :role_filters do
resources :role_statuses post 'toggle'
resources :role_categorys end
resources :role_statuses do
post 'toggle'
end
resources :role_categorys do
post 'toggle'
end
resources :sites do resources :sites do
get 'mail_setting' get 'mail_setting'

View File

@ -25,37 +25,34 @@
%> %>
<table class="table main-list"> <table class="table table-condensed table-striped">
<thead> <thead>
<tr> <tr>
<th class="span1"><%= t('writing_book.year') %></th> <th class="span1"><%= t('writing_book.year') %></th>
<th class="span3"><%= t('writing_book.title') %></th> <th><%= t('writing_book.title') %></th>
</tr> </tr>
</thead> </thead>
<tbody id="tbody_writing_books" class="sort-holder"> <tbody>
<% @writing_books.each do |writing_book| %> <% @writing_books.each do |writing_book| %>
<tr id="<%= dom_id writing_book %>" class="with_action"> <tr>
<td><%= writing_book.year %></td> <td><%= writing_book.year %></td>
<td> <td>
<%= link_to writing_book.create_link, panel_personal_book_front_end_writing_book_path(writing_book) %> <%= link_to writing_book.create_link, panel_personal_book_front_end_writing_book_path(writing_book) %>
</td> </td>
</tr> </tr>
<% end %> <% end %>
</tbody>
</tbody>
</table> </table>
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_book_back_end_writing_book_path(:user_id => @user.id), :class => 'btn btn-primary pull-right' %> <div class="bottomnav clearfix">
<div class="action pull-right">
<%= link_to content_tag(:i, nil, :class => 'icon-plus') + t('announcement.add_new'), new_panel_personal_book_back_end_writing_book_path(:user_id => @user.id), :class => 'btn btn-primary' %>
<div class="form-actions form-fixed pagination-right"> </div>
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_book_plugin_writing_book_path, :class => 'btn btn-primary pull-right' %> <div class="pagination pagination-centered">
<div id="writing_book_pagination" class="paginationFixed"> <%= paginate @writing_books, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
<%= paginate @writing_books, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
</div> </div>
</div> </div>

View File

@ -26,37 +26,34 @@
%> %>
<table class="table main-list"> <table class="table table-condensed table-striped">
<thead> <thead>
<tr> <tr>
<th class="span1"><%= t('writing_conference.year') %></th> <th class="span1"><%= t('writing_conference.year') %></th>
<th class="span3"><%= t('writing_conference.title') %></th> <th><%= t('writing_conference.title') %></th>
</tr> </tr>
</thead> </thead>
<tbody id="tbody_writing_conferences" class="sort-holder"> <tbody>
<% @writing_conferences.each do |writing_conference| %> <% @writing_conferences.each do |writing_conference| %>
<tr id="<%= dom_id writing_conference %>" class="with_action"> <tr>
<td><%= writing_conference.year %></td> <td><%= writing_conference.year %></td>
<td> <td>
<%= link_to writing_conference.create_link, panel_personal_conference_front_end_writing_conference_path(writing_conference) %> <%= link_to writing_conference.create_link, panel_personal_conference_front_end_writing_conference_path(writing_conference) %>
</td> </td>
</tr> </tr>
<% end %> <% end %>
</tbody>
</tbody>
</table> </table>
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_conference_back_end_writing_conference_path(:user_id => @user.id), :class => 'btn btn-primary pull-right' %> <div class="bottomnav clearfix">
<div class="action pull-right">
<%= link_to content_tag(:i, nil, :class => 'icon-plus') + t('announcement.add_new'), new_panel_personal_conference_back_end_writing_conference_path(:user_id => @user.id), :class => 'btn btn-primary' %>
<div class="form-actions form-fixed pagination-right"> </div>
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_conference_plugin_writing_conference_path, :class => 'btn btn-primary pull-right' %> <div class="pagination pagination-centered">
<div id="writing_conference_pagination" class="paginationFixed"> <%= paginate @writing_conferences, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
<%= paginate @writing_conferences, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
</div> </div>
</div> </div>

View File

@ -25,37 +25,34 @@
%> %>
<table class="table main-list"> <table class="table table-condensed table-striped">
<thead> <thead>
<tr> <tr>
<th class="span1"><%= t('diploma.date') %></th> <th class="span2"><%= t('diploma.date') %></th>
<th class="span3"><%= t('diploma.school_name') %></th> <th><%= t('diploma.school_name') %></th>
</tr> </tr>
</thead> </thead>
<tbody id="tbody_diplomas" class="sort-holder"> <tbody>
<% @diplomas.each do |diploma| %> <% @diplomas.each do |diploma| %>
<tr id="<%= dom_id diploma %>" class="with_action"> <tr>
<td><%= diploma.start_date.strftime("%Y.%m") %> ~ <%= diploma.end_date.strftime("%Y.%m") %></td> <td><%= diploma.start_date.strftime("%Y.%m") %> ~ <%= diploma.end_date.strftime("%Y.%m") %></td>
<td> <td>
<%= link_to diploma.school_name, panel_personal_diploma_front_end_diploma_path(diploma) %> <%= link_to diploma.school_name, panel_personal_diploma_front_end_diploma_path(diploma) %>
</td> </td>
</tr> </tr>
<% end %> <% end %>
</tbody>
</tbody>
</table> </table>
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_diploma_back_end_diploma_path(:user_id => @user.id), :class => 'btn btn-primary pull-right' %> <div class="bottomnav clearfix">
<div class="action pull-right">
<%= link_to content_tag(:i, nil, :class => 'icon-plus') + t('announcement.add_new'), new_panel_personal_diploma_back_end_diploma_path(:user_id => @user.id), :class => 'btn btn-primary' %>
<div class="form-actions form-fixed pagination-right"> </div>
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_diploma_plugin_diploma_path, :class => 'btn btn-primary pull-right' %> <div class="pagination pagination-centered">
<div id="diploma_pagination" class="paginationFixed"> <%= paginate @diplomas, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
<%= paginate @diplomas, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
</div> </div>
</div> </div>

View File

@ -26,37 +26,33 @@
%> %>
<table class="table main-list"> <table class="table table-condensed table-striped">
<thead> <thead>
<tr> <tr>
<th class="span1"><%= t('experience.date') %></th> <th class="span2"><%= t('experience.date') %></th>
<th class="span3"><%= t('experience.organizationt_title') %></th> <th><%= t('experience.organizationt_title') %></th>
</tr> </tr>
</thead> </thead>
<tbody id="tbody_experiences" class="sort-holder"> <tbody>
<% @experiences.each do |experience| %> <% @experiences.each do |experience| %>
<tr id="<%= dom_id experience %>" class="with_action"> <tr>
<td><%= experience.start_date.strftime("%Y.%m") %> ~ <%= experience.end_date.strftime("%Y.%m") %></td> <td><%= experience.start_date.strftime("%Y.%m") %> ~ <%= experience.end_date.strftime("%Y.%m") %></td>
<td> <td>
<%= link_to experience.organizationt_title, panel_personal_experience_front_end_experience_path(experience) %> <%= link_to experience.organizationt_title, panel_personal_experience_front_end_experience_path(experience) %>
</td> </td>
</tr> </tr>
<% end %> <% end %>
</tbody>
</tbody>
</table> </table>
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_experience_back_end_experience_path(:user_id => @user.id), :class => 'btn btn-primary pull-right' %> <div class="bottomnav clearfix">
<div class="action pull-right">
<%= link_to content_tag(:i, nil, :class => 'icon-plus') + t('announcement.add_new'), new_panel_personal_experience_back_end_experience_path(:user_id => @user.id), :class => 'btn btn-primary' %>
<div class="form-actions form-fixed pagination-right">
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_experience_plugin_experience_path, :class => 'btn btn-primary pull-right' %>
<div id="experience_pagination" class="paginationFixed">
<%= paginate @experiences, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
</div> </div>
<div class="pagination pagination-centered">
<%= paginate @experiences, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %> </div>
</div> </div>

View File

@ -26,37 +26,34 @@
%> %>
<table class="table main-list"> <table class="table table-condensed table-striped">
<thead> <thead>
<tr> <tr>
<th class="span1"><%= t('honor.year') %></th> <th class="span1"><%= t('honor.year') %></th>
<th class="span3"><%= t('honor.award_name') %></th> <th><%= t('honor.award_name') %></th>
</tr> </tr>
</thead> </thead>
<tbody id="tbody_honors" class="sort-holder"> <tbody>
<% @honors.each do |honor| %> <% @honors.each do |honor| %>
<tr id="<%= dom_id honor %>" class="with_action"> <tr>
<td><%= honor.year %></td> <td><%= honor.year %></td>
<td> <td>
<%= link_to honor.award_name, panel_personal_honor_front_end_honor_path(honor) %> <%= link_to honor.award_name, panel_personal_honor_front_end_honor_path(honor) %>
</td> </td>
</tr> </tr>
<% end %> <% end %>
</tbody>
</tbody>
</table> </table>
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_honor_back_end_honor_path(:user_id => @user.id), :class => 'btn btn-primary pull-right' %> <div class="bottomnav clearfix">
<div class="action pull-right">
<%= link_to content_tag(:i, nil, :class => 'icon-plus') + t('announcement.add_new'), new_panel_personal_honor_back_end_honor_path(:user_id => @user.id), :class => 'btn btn-primary' %>
<div class="form-actions form-fixed pagination-right"> </div>
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_honor_plugin_honor_path, :class => 'btn btn-primary pull-right' %> <div class="pagination pagination-centered">
<div id="honor_pagination" class="paginationFixed"> <%= paginate @honors, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
<%= paginate @honors, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
</div> </div>
</div> </div>

View File

@ -24,43 +24,40 @@
%> %>
<table class="table main-list"> <table class="table table-condensed table-striped">
<thead> <thead>
<tr> <tr>
<th class="span1"><%= t('writing_journal.year') %></th> <th class="span1"><%= t('writing_journal.year') %></th>
<th class="span3"><%= t('writing_journal.title') %></th> <th><%= t('writing_journal.title') %></th>
<% if not @user%> <% if not @user%>
<th class="span3"><%= t('writing_journal.authors') %></th> <th><%= t('writing_journal.authors') %></th>
<% end %> <% end %>
</tr> </tr>
</thead> </thead>
<tbody id="tbody_writing_journals" class="sort-holder"> <tbody>
<% @writing_journals.each do |writing_journal| %> <% @writing_journals.each do |writing_journal| %>
<tr id="<%= dom_id writing_journal %>" class="with_action"> <tr>
<td><%= writing_journal.year %></td> <td><%= writing_journal.year %></td>
<td> <td>
<%= link_to writing_journal.create_link, panel_personal_journal_front_end_writing_journal_path(writing_journal) %> <%= link_to writing_journal.create_link, panel_personal_journal_front_end_writing_journal_path(writing_journal) %>
</td> </td>
<% if not @user%> <% if not @user%>
<td><%= writing_journal.authors %></td> <td><%= writing_journal.authors %></td>
<% end %> <% end %>
</tr> </tr>
<% end %> <% end %>
</tbody>
</tbody>
</table> </table>
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_journal_back_end_writing_journal_path(:user_id => @user.id), :class => 'btn btn-primary pull-right' %> <div class="bottomnav clearfix">
<div class="action pull-right">
<%= link_to content_tag(:i, nil, :class => 'icon-plus') + t('announcement.add_new'), new_panel_personal_journal_back_end_writing_journal_path(:user_id => @user.id), :class => 'btn btn-primary' %>
<div class="form-actions form-fixed pagination-right"> </div>
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_journal_plugin_writing_journal_path, :class => 'btn btn-primary pull-right' %> <div class="pagination pagination-centered">
<div id="writing_journal_pagination" class="paginationFixed"> <%= paginate @writing_journals, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
<%= paginate @writing_journals, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
</div> </div>
</div> </div>

View File

@ -135,10 +135,10 @@
<%= f.text_field :issue_no %> <%= f.text_field :issue_no %>
</div> </div>
<div class="title"> <div class="title">
<%= f.label :form_to, t("personal_journal.form_to") %> <%= f.label :form_to, t("personal_journal.form_to") %>
<%= f.text_field :form_to %> <%= f.text_field :form_to_start, :class=>'span1' %> ~ <%= f.text_field :form_to_end, :class=>'span1' %>
</div> </div>
<div class="title"> <div class="title">
<%= f.label :total_pages, t("personal_journal.total_pages") %> <%= f.label :total_pages, t("personal_journal.total_pages") %>

View File

@ -26,39 +26,36 @@
%> %>
<table class="table main-list"> <table class="table table-condensed table-striped">
<thead> <thead>
<tr> <tr>
<th class="span1"><%= t('lab.year') %></th> <th class="span1"><%= t('lab.year') %></th>
<th class="span3"><%= t('lab.lab_title') %></th> <th><%= t('lab.lab_title') %></th>
<th class="span3"><%= t('lab.location') %></th> <th><%= t('lab.location') %></th>
</tr> </tr>
</thead> </thead>
<tbody id="tbody_labs" class="sort-holder"> <tbody>
<% @labs.each do |lab| %> <% @labs.each do |lab| %>
<tr id="<%= dom_id lab %>" class="with_action"> <tr>
<td><%= lab.year %></td> <td><%= lab.year %></td>
<td> <td>
<%= link_to lab.lab_title, panel_personal_lab_front_end_lab_path(lab) %> <%= link_to lab.lab_title, panel_personal_lab_front_end_lab_path(lab) %>
</td> </td>
<td><%= lab.location %></td> <td><%= lab.location %></td>
</tr> </tr>
<% end %> <% end %>
</tbody>
</tbody>
</table> </table>
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_lab_back_end_lab_path(:user_id => @user.id), :class => 'btn btn-primary pull-right' %> <div class="bottomnav clearfix">
<div class="action pull-right">
<%= link_to content_tag(:i, nil, :class => 'icon-plus') + t('announcement.add_new'), new_panel_personal_lab_back_end_lab_path(:user_id => @user.id), :class => 'btn btn-primary' %>
<div class="form-actions form-fixed pagination-right"> </div>
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_lab_plugin_lab_path, :class => 'btn btn-primary pull-right' %> <div class="pagination pagination-centered">
<div id="lab_pagination" class="paginationFixed"> <%= paginate @labs, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
<%= paginate @labs, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
</div> </div>
</div> </div>

View File

@ -26,37 +26,35 @@
%> %>
<table class="table main-list">
<thead>
<tr>
<th class="span1"><%= t('writing_patent.publish_date') %></th>
<th class="span3"><%= t('writing_patent.title') %></th>
</tr>
</thead>
<tbody id="tbody_writing_patents" class="sort-holder">
<table class="table table-condensed table-striped">
<thead>
<tr>
<th class="span2"><%= t('writing_patent.publish_date') %></th>
<th><%= t('writing_patent.title') %></th>
</tr>
</thead>
<tbody>
<% @writing_patents.each do |writing_patent| %> <% @writing_patents.each do |writing_patent| %>
<tr id="<%= dom_id writing_patent %>" class="with_action"> <tr>
<td><%= writing_patent.publish_date.strftime("%Y.%m") %></td> <td><%= writing_patent.publish_date.strftime("%Y.%m") %></td>
<td> <td>
<%= link_to writing_patent.patent_title, panel_personal_patent_front_end_writing_patent_path(writing_patent) %> <%= link_to writing_patent.patent_title, panel_personal_patent_front_end_writing_patent_path(writing_patent) %>
</td> </td>
</tr> </tr>
<% end %> <% end %>
</tbody>
</tbody>
</table> </table>
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_patent_back_end_writing_patent_path(:user_id => @user.id), :class => 'btn btn-primary pull-right' %> <div class="bottomnav clearfix">
<div class="action pull-right">
<%= link_to content_tag(:i, nil, :class => 'icon-plus') + t('announcement.add_new'), new_panel_personal_patent_back_end_writing_patent_path(:user_id => @user.id), :class => 'btn btn-primary' %>
<div class="form-actions form-fixed pagination-right"> </div>
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_patent_plugin_writing_patent_path, :class => 'btn btn-primary pull-right' %> <div class="pagination pagination-centered">
<div id="writing_patent_pagination" class="paginationFixed"> <%= paginate @writing_patents, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
<%= paginate @writing_patents, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
</div> </div>
</div> </div>

View File

@ -26,37 +26,34 @@
%> %>
<table class="table main-list"> <table class="table table-condensed table-striped">
<thead> <thead>
<tr> <tr>
<th class="span1"><%= t('project.period') %></th> <th class="span2"><%= t('project.period') %></th>
<th class="span3"><%= t('project.project_title') %></th> <th><%= t('project.project_title') %></th>
</tr> </tr>
</thead> </thead>
<tbody id="tbody_projects" class="sort-holder"> <tbody>
<% @projects.each do |project| %> <% @projects.each do |project| %>
<tr id="<%= dom_id project %>" class="with_action"> <tr>
<td><%= project.period_start_date.strftime("%Y.%m") %> ~ <%= project.period_end_date.strftime("%Y.%m") %></td> <td><%= project.period_start_date.strftime("%Y.%m") %> ~ <%= project.period_end_date.strftime("%Y.%m") %></td>
<td> <td>
<%= link_to project.project_title, panel_personal_project_front_end_project_path(project) %> <%= link_to project.project_title, panel_personal_project_front_end_project_path(project) %>
</td> </td>
</tr> </tr>
<% end %> <% end %>
</tbody>
</tbody>
</table> </table>
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_project_back_end_project_path(:user_id => @user.id), :class => 'btn btn-primary pull-right' %> <div class="bottomnav clearfix">
<div class="action pull-right">
<%= link_to content_tag(:i, nil, :class => 'icon-plus') + t('announcement.add_new'), new_panel_personal_project_back_end_project_path(:user_id => @user.id), :class => 'btn btn-primary' %>
<div class="form-actions form-fixed pagination-right"> </div>
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_project_plugin_project_path, :class => 'btn btn-primary pull-right' %> <div class="pagination pagination-centered">
<div id="project_pagination" class="paginationFixed"> <%= paginate @projects, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
<%= paginate @projects, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
</div> </div>
</div> </div>

View File

@ -25,37 +25,34 @@
%> %>
<table class="table main-list"> <table class="table table-condensed table-striped">
<thead> <thead>
<tr> <tr>
<th class="span1"><%= t('research.publish_date') %></th> <th class="span2"><%= t('research.publish_date') %></th>
<th class="span3"><%= t('research.title') %></th> <th><%= t('research.title') %></th>
</tr> </tr>
</thead> </thead>
<tbody id="tbody_researchs" class="sort-holder"> <tbody>
<% @researchs.each do |research| %> <% @researchs.each do |research| %>
<tr id="<%= dom_id research %>" class="with_action"> <tr>
<td><%= research.publish_date.strftime("%Y.%m") %></td> <td><%= research.publish_date.strftime("%Y.%m") %></td>
<td> <td>
<%= link_to research.research_title, panel_personal_research_front_end_research_path(research) %> <%= link_to research.research_title, panel_personal_research_front_end_research_path(research) %>
</td> </td>
</tr> </tr>
<% end %> <% end %>
</tbody>
</tbody>
</table> </table>
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_research_back_end_research_path(:user_id => @user.id), :class => 'btn btn-primary pull-right' %> <div class="bottomnav clearfix">
<div class="action pull-right">
<%= link_to content_tag(:i, nil, :class => 'icon-plus') + t('announcement.add_new'), new_panel_personal_research_back_end_research_path(:user_id => @user.id), :class => 'btn btn-primary' %>
<div class="form-actions form-fixed pagination-right"> </div>
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_research_plugin_research_path, :class => 'btn btn-primary pull-right' %> <div class="pagination pagination-centered">
<div id="research_pagination" class="paginationFixed"> <%= paginate @researchs, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
<%= paginate @researchs, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
</div> </div>
</div> </div>