This commit is contained in:
Rueshyna committed 2012-11-21 10:46:33 +08:00
commit da1b871481
86 files changed
+3209 -1258

No files matched your search

+1
View File
@@ -7,6 +7,7 @@
//= require jquery
//= require jquery_ujs
//= require jquery-ui
//= require jquery.form
//= require jquery.tinyscrollbar
//= require jquery.miniColors.min
//= require bootstrap
@@ -0,0 +1,33 @@
function checkSwitch() {
$(".groups").each(function() {
$(this).find('.form-horizontal > .hide').length < $(this).find('.form-horizontal > div').length ? $(this).removeClass("disabled") : $(this).addClass("disabled")
});
// $(".groups").addClass('disabled').has('.groups > .form-horizontal > div:not(.hide)').removeClass('disabled');
}
$(document).ready(function(){
checkSwitch();
$('.onoff').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");
}else{
$(this).text("ON");
}
checkSwitch();
}
return false;
});
});
@@ -0,0 +1,15 @@
$(document).ready(function(){
$(".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:''});
}
});
})
})
});
@@ -0,0 +1,112 @@
jQuery(document).ready(function($) {
// Stuff to do as soon as the DOM is ready. Use $() w/o colliding with other libs;
var current_textarea = {};
var parent = null;
var this_modal_window = null;
var lang = <%= VALID_LOCALES.to_s %>;
$("textarea[func=input_unit]").each(function(){
var id = $(this).attr("id");
current_textarea[id] = $(this).val();
})
console.log(current_textarea);
// current_textarea['en'] = $("textarea[for=en]").val();
// current_textarea['zh_tw'] = $("textarea[for=zh_tw]").val();
$("div.controls").on("click","a.edit-btn",function(){
parent = $(this).parent();
this_modal_window = $(this).parent().parent().parent().parent().find(".modal");
choosen_lang = $(this).parent().parent().find("ul li.active").attr("for");
$(this).parents(".editMore").find(".modal_tab").removeClass("active in");
$(this).parents(".editMore").find(".modal_tab[for="+choosen_lang+"]").addClass("active in");
$(this).parents(".editMore").find(".modal-body li").removeClass("active");
$(this).parents(".editMore").find(".modal-body li[for="+choosen_lang+"]").addClass("active");
// switch($(this).parent().parent().find("ul li.active a").attr("href")){
// case ".tab1":
// $("#tab3").addClass("active in");
// $(".modal-body li").eq(0).addClass("active");
// break;
// case ".tab2":
// $("#tab4").addClass("active in");
// $(".modal-body li").eq(1).addClass("active");
// break;
$.each(lang,function(i,value){
// console.log(this_modal_window);
var sa = parent.find("input.street_address_"+lang[i]).val();
var city = parent.find("input.city_"+lang[i]).val();
var county = parent.find("input.county_"+lang[i]).val();
var zip = parent.find("input.zip_"+lang[i]).val();
var country = parent.find("input.country_"+lang[i]).val();
this_modal_window.find('.tab-content div[for='+lang[i]+'] textarea[func=street_address]').val(sa);
this_modal_window.find('.tab-content div[for='+lang[i]+'] input[func=city]').val(city);
this_modal_window.find('.tab-content div[for='+lang[i]+'] input[func=county]').val(county);
this_modal_window.find('.tab-content div[for='+lang[i]+'] input[func=zip]').val(zip);
this_modal_window.find('.tab-content div[for='+lang[i]+'] input[func=country]').val(country);
var verify = sa + city + country +county + zip;
var combined = "";
if(verify!="")
combined = sa + "\n" + city + "\n" + county + "\n" + zip + "\n" + country+"\n";
var Text0 = parent.find("div."+lang[i]+" textarea[func=input_unit]").val();
Text1 = Text0.replace(/(\r\n|\n|\r)/gm,"");
var Text2 = combined;
Text2 = Text2.replace(/(\r\n|\n|\r)/gm,"");
if(Text1 != Text2){
this_modal_window.find('.tab-content div[for='+lang[i]+'] textarea[func=street_address]').val(Text0);
this_modal_window.find("input").val("");
}
});
});
$("textarea[func=input_unit]").change(function(){
var id = $(this).attr("id");
var lang = $(this).attr("for");
if(!parent)
parent = $(this).parent().parent();
console.log(current_textarea[id]);
if(current_textarea[id] != $(this).val())
parent.find("input.indicator_"+lang).val("true");
else
parent.find("input.indicator_"+lang).val("false");
})
$(".address-edit").on("hidden",function(){
$("#tab3").removeClass("active in");
$("#tab4").removeClass("active in");
$(".modal-body li").removeClass("active");
$(".modal-body input, .modal-body textarea").val("");
})
$(".bt-save").click(function(){
for(i=0;i<2;i++){
var sa = this_modal_window.find('.tab-content div[for='+lang[i]+'] textarea[func=street_address]').val();
var city = this_modal_window.find('.tab-content div[for='+lang[i]+'] input[func=city]').val();
var county = this_modal_window.find('.tab-content div[for='+lang[i]+'] input[func=county]').val();
var zip = this_modal_window.find('.tab-content div[for='+lang[i]+'] input[func=zip]').val();
var country = this_modal_window.find('.tab-content div[for='+lang[i]+'] input[func=country]').val();
parent.find("input.street_address_"+lang[i]).val(sa);
parent.find("input.city_"+lang[i]).val(city);
parent.find("input.county_"+lang[i]).val(county);
parent.find("input.zip_"+lang[i]).val(zip);
parent.find("input.country_"+lang[i]).val(country);
var verify = sa + city + country +county + zip;
var combined = "";
if(verify!="")
combined = sa + "\n" + city + "\n" + county + "\n" + zip + "\n" + country;
parent.find("textarea[for="+lang[i]+"]").val(combined);
parent.find("input.indicator_"+lang[i]).val("false");
current_textarea[parent.find("textarea[for="+lang[i]+"]").attr("id")] = combined;
}
})
});
@@ -0,0 +1,37 @@
// var $CloneTarget ;
function checkMultipleInput() {
$(".multipleInput").each(function() {
$(this).children('.controls').length==1 ? $(this).addClass("plural") : $(this).removeClass("plural")
});
}
function removeInput(){
$(".removeInput").click(function (){
$(this).parents(".controls").remove();
checkMultipleInput();
return false;
});
}
$(document).ready(function(){
var $modalNumber = 0;
checkMultipleInput();
removeInput();
$(".addinput").click(function (){
$modalNumber+=1;
var $CloneTarget = $(this).parents(".controls").prev(".multipleInput").children('.controls:last');
$(this).parents(".controls").prev(".multipleInput").append($CloneTarget.clone());
class_to_be_removed = $(this).parents(".controls").prev(".multipleInput").attr("ext_class")
// $(this).parents(".controls").prev(".multipleInput").children('.controls:last input').val("");
$(this).parents(".controls").prev(".multipleInput").children('.controls:last').find('input').val('')
$(this).parents(".controls").prev(".multipleInput").children('.controls:last').find('.tab-pane').removeClass(class_to_be_removed).addClass("NewInput_"+$modalNumber)
btn = $(this).parents(".controls").prev(".multipleInput").children('.controls:last').find(".nav.nav-pills li")
$.each(btn,function(i,value){
old_link = $(this).children("a").attr("href");
$(this).children("a").attr("href",".NewInput_"+$modalNumber);
});
removeInput();
checkMultipleInput();
return false;
})
});
+86 -39
View File
@@ -2,6 +2,9 @@
//harry
//Inititialize function will initialize desktop
//callback-method will be called after desktop controlled ajax call;
//container=true is the area where the view will be loaded
$.extend($.expr[':'], {
'containsi': function (elem, i, match, array) {
@@ -82,7 +85,7 @@ var orbitDesktop = function(dom){
$(".docklist a").click(function(){
var target = $(this).attr("id");
var url = $(this).attr("href");
o.data_method = $(this).attr("data-method");
o.data_method = $(this).attr("callback-method");
if(o.currenthtml!=target){
if(o.desktopData[o.currentface] == "undefined")
o.desktopData[o.currentface] = "";
@@ -95,47 +98,28 @@ var orbitDesktop = function(dom){
$(o.contentHolder).empty().load(url,function(){
if(typeof o.data_method != "undefined"){
if(o.data_method != "")
window.o[o.data_method](target,url,cache);
window.o[o.data_method](target,url,cache);
}
o.sub_menu_item($(o.contentHolder).find("*[content-type=menu] a[load=true]"));
});
}else{
$(o.contentHolder).html(o.desktopData[o.currentface]);
o.sub_menu_item($(o.contentHolder).find("*[content-type=menu] a[load=true]").trigger("click"));
cache = true;
if(typeof o.data_method != "undefined"){
if(o.data_method != "")
window.o[o.data_method](target,url,cache);
window.o[o.data_method](target,url,cache);
}
}
});
}
return false;
})
$('body').on({
click: function(){
if(!$(this).hasClass('active')){
var sub_data_method = $(this).attr('data-method');
if(sub_data_method){
$("#panel_r").load($(this).attr("href"),function(){
// o.simple_drop_down();
// o.tinyscrollbar_ext({
// main: '.tinycanvas',
// fill: '.s_grid_con'
// })
if(typeof o.data_method != "undefined"){
if(o.data_method != ""){
if(typeof sub_data_method != "undefined"){
if(sub_data_method != ""){
window.o[o.data_method][sub_data_method]();
}
}
}
}
})
}
$('.s_menu a').removeClass('thmc1 thmtxt active');
$(this).addClass('thmc1 thmtxt active');
}
o.sub_menu_item($(this));
return false;
},
mouseenter: function(){
@@ -147,7 +131,23 @@ var orbitDesktop = function(dom){
var t = $(this).hasClass('active') ? '' : 'thmc1 thmtxt';
$(this).switchClass(t,'admtxt',0);
}
},'.s_menu a');
},'*[content-type=menu] a');
$("body").on("submit","form[type=ajax_form]",function(){
var callback_method = $(this).attr("callback-method");
var options = {
success:function(responseText, statusText, xhr, $form){
if(typeof callback_method != "undefined"){
if(callback_method != ""){
window.o[o.data_method][callback_method](responseText,statusText,xhr,$form);
}
}
}
}
$(this).ajaxSubmit(options);
return false;
})
$(window).resize(function(){
var ww = $(window).width();
$("img#thmbackground").attr({"width":ww});
@@ -171,6 +171,26 @@ var orbitDesktop = function(dom){
$fn_des.stop(true, true).fadeOut();
});
};
this.sub_menu_item = function(dom){
if(!dom.hasClass('active')){
var sub_data_method = dom.attr('callback-method');
if(sub_data_method){
$("div[container=true]").load(dom.attr("href"),function(){
if(typeof o.data_method != "undefined"){
if(o.data_method != ""){
if(typeof sub_data_method != "undefined"){
if(sub_data_method != ""){
window.o[o.data_method][sub_data_method]();
}
}
}
}
})
}
$('*[content-type=menu] a').removeClass('thmc1 thmtxt active');
dom.addClass('thmc1 thmtxt active');
}
}
this.initializeDesktop = function(target,url,cache){ //this is for initializing main desktops that are sections and tiles
if(!target)target = "desktop";
@@ -806,6 +826,14 @@ var orbitDesktop = function(dom){
};
this.initializeJournalPapers = function(target,url,cache){ // this init journal papers
this.initializeJournalPapers.formCallback = function(data){
if(data.success){
o.notify(data.msg,"success");
o.sub_menu_item($("div[content-type=menu] a").eq(0));
}else{
o.notify(data.msg,"alert");
}
}
this.initializeJournalPapers.list = function(){ // to open list part in journal papers page
var journalData;
@@ -817,7 +845,6 @@ var orbitDesktop = function(dom){
fill: '.list_t'
})
$("#journal_selection_options a").click(function(){
switch($(this).attr("href")){
case "all":
@@ -849,10 +876,26 @@ var orbitDesktop = function(dom){
}
return false;
})
$("div[container=true]").on("click",".journal_paper_edit",function(){
$.ajax({
url : $(this).attr("href"),
type : "get",
success : function(data){
var prev_data = $("div[container=true]").html();
$("div[container=true]").html(data);
$(".bt-cancel").click(function(){
$("div[container=true]").html(prev_data);
})
}
})
return false;
})
}
var bindSecondaryHandlers = function(){
$("#journal_p div#paper_list a").click(function(){
$("#journal_p div#paper_list a.icon-check-empty").click(function(){
if($(this).hasClass("icon-check-empty")){
$(this).switchClass("icon-check-empty","icon-check",0);
} else if($(this) .hasClass("icon-check")) {
@@ -873,7 +916,7 @@ var orbitDesktop = function(dom){
li;
$.each(journalData,function(i,journal){
$.each(journal.papers,function(j,paper){
li = $('<li class="list_t_item"><div class="list_item_action"><a href="" class="icon-check-empty"></a><a href="" class="icon-star-empty"></a></div><div class="list_t_title">'+journal.title+'</div><div class="list_t_des">'+paper.title+'</div></li>');
li = $('<li class="list_t_item"><div class="list_item_action"><a href="" class="icon-check-empty"></a><a href="" class="icon-star-empty"></a></div><div class="list_t_title">'+journal.title+'</div><div class="list_t_des">'+paper.title+'</div><a class="journal_paper_edit" href="'+paper.url_edit+'">Edit</a></li>');
column.find("ul").append(li);
if(counter%5==0){
$("#journal_p div#paper_list div.overview").append(column);
@@ -902,6 +945,7 @@ var orbitDesktop = function(dom){
var img = $('<div class="list_t_des"><a href="'+file.url+'" target="_blank" ><img src="'+file.icon+'" />'+thistitle+'</a></div>');
li.append(img);
})
li.append('<a class="journal_paper_edit" href="'+paper.url_edit+'">Edit</a>');
column.find("ul").append(li);
if(counter%5==0){
$("#journal_p div#paper_list div.overview").append(column);
@@ -920,7 +964,7 @@ var orbitDesktop = function(dom){
li;
$.each(journalData,function(i,journal){
$.each(journal.papers,function(j,paper){
li = $('<li class="list_t_item"><div class="list_item_action"><a href="" class="icon-check-empty"></a><a href="" class="icon-star-empty"></a></div><div class="list_t_title">'+paper.title+'</div><div class="list_t_des">'+paper.keywords+'</div></li>');
li = $('<li class="list_t_item"><div class="list_item_action"><a href="" class="icon-check-empty"></a><a href="" class="icon-star-empty"></a></div><div class="list_t_title">'+paper.title+'</div><div class="list_t_des">'+paper.keywords+'</div><a class="journal_paper_edit" href="'+paper.url_edit+'">Edit</a></li>');
column.find("ul").append(li);
if(counter%5==0){
$("#journal_p div#paper_list div.overview").append(column);
@@ -940,7 +984,7 @@ var orbitDesktop = function(dom){
li;
$.each(journalData,function(i,journal){
$.each(journal.papers,function(j,paper){
li = $('<li class="list_t_item"><div class="list_item_action"><a href="" class="icon-check-empty"></a><a href="" class="icon-star-empty"></a></div><div class="list_t_title">'+paper.title+'</div></li>');
li = $('<li class="list_t_item"><div class="list_item_action"><a href="" class="icon-check-empty"></a><a href="" class="icon-star-empty"></a></div><div class="list_t_title">'+paper.title+'</div><a class="journal_paper_edit" href="'+paper.url_edit+'">Edit</a></li>');
column.find("ul").append(li);
if(counter%5==0){
$("#journal_p div#paper_list div.overview").append(column);
@@ -959,7 +1003,7 @@ var orbitDesktop = function(dom){
li;
$.each(journalData,function(i,journal){
$.each(journal.papers,function(j,paper){
li = $('<li class="list_t_item" style="height:auto;"><div class="list_item_action"><a href="" class="icon-check-empty"></a><a href="" class="icon-star-empty"></a></div><div class="list_t_title">'+paper.title+'</div><div class="list_t_des">'+paper.abstract+'</div></li>');
li = $('<li class="list_t_item" style="height:auto;"><div class="list_item_action"><a href="" class="icon-check-empty"></a><a href="" class="icon-star-empty"></a></div><div class="list_t_title">'+paper.title+'</div><div class="list_t_des">'+paper.abstract+'</div><a class="journal_paper_edit" href="'+paper.url_edit+'">Edit</a></li>');
column.find("ul").append(li);
$("#journal_p div#paper_list div.overview").append(column);
column = $('<div class="g_col list_t"><ul></ul></div>');
@@ -969,11 +1013,14 @@ var orbitDesktop = function(dom){
bindSecondaryHandlers();
}
$.getJSON("/desktop/journal_pages/get_journals_json",function(journals){
journalData = eval(journals);
journalview();
bindHandlers();
})
var getData = function(){
$.getJSON("/desktop/journal_pages/get_journals_json",function(journals){
journalData = eval(journals);
journalview();
bindHandlers();
})
}
getData();
}
this.initializeJournalPapers.addpaper = function(){ // to open add pages in journal papers page
+11 -4
View File
@@ -280,7 +280,7 @@
margin-top: 8px;
}
.nav-tabs li a {
padding-right: 32px;
/*padding-right: 32px;*/
}
.user-role {
@@ -314,7 +314,8 @@
float: left;
}
.role-block .nav-pills {
margin-bottom: 0;g
margin-bottom: 0;
margin-left: 10px;
}
.role-block .nav-pills > li > a {
margin-top: 0;
@@ -345,7 +346,13 @@
-moz-border-radius: 0 3px 3px 0;
border-radius: 0 3px 3px 0;
}
.input-append > .active {
display: inline-block;
}
.input-append .active {
background-color: transparent;
border-color: transparent;
}
.language-swich .tab-pane {
margin-bottom: 5px;
margin-right: 10px;
/*margin-bottom: 5px;*/
}
+1 -1
View File
@@ -111,7 +111,7 @@
.role-block .form-horizontal .controls {
margin-left: 120px;
}
.role-block .form-horizontal .controls>.input-append {
.role-block .form-horizontal .controls .input-append {
margin-bottom: 10px;
}
.role-block .form-horizontal legend .onoff {
@@ -1,7 +1,7 @@
class Admin::AdBannersController < OrbitBackendController
layout "new_admin"
before_filter :force_order_for_visitor,:only=>[:index]
#before_filter :force_order_for_user,:except => [:index]
before_filter :force_order_for_user,:except => [:index]
before_filter :for_app_sub_manager,:except => [:index]
before_filter :for_app_manager,:except => [:index,:show,:update,:realtime_preview]
+10 -4
View File
@@ -1,7 +1,13 @@
class Admin::AdImagesController < OrbitBackendController
layout 'new_admin'
before_filter :authenticate_user!
before_filter :for_app_sub_manager
class Admin::AdImagesController < Admin::AdBannersController
# before_filter :force_order_for_user
# before_filter :for_app_sub_manager
# before_filter :for_app_manager
def initialize
super
@app_title = "ad_banner"
end
def edit
@ad_banner = AdBanner.find params[:ad_banner_id]
+1 -1
View File
@@ -52,7 +52,7 @@ class Admin::DesignsController < OrbitBackendController
case params[:type]
when 'layout', 'css_default', 'css_reset'
@object = @design.send(params[:type])
when 'image', 'javascript', 'theme'
when 'javascripts', 'themes'#, 'images'
@object = @design.send(params[:type]).find(params[:object_id])
end
+1 -7
View File
@@ -1,10 +1,4 @@
class Admin::LinksController < ApplicationController
layout "site_editor"
before_filter :authenticate_user!
before_filter :find_parent_item
before_filter :is_admin?
class Admin::LinksController < Admin::ItemsController
def show
@item ||= Link.find(params[:id])
@@ -5,6 +5,8 @@ class Admin::PagePartsController < ApplicationController
before_filter :authenticate_user!
before_filter :is_admin?
before_filter :set_current_item
helper 'admin/items'
def show
@part = PagePart.find(params[:id])
+2 -9
View File
@@ -1,11 +1,4 @@
class Admin::PagesController < ApplicationController
layout "site_editor"
before_filter :authenticate_user!
before_filter :find_parent_item
before_filter :is_admin?
before_filter :set_current_item
class Admin::PagesController < Admin::ItemsController
def show
@item = Page.find(params[:id])
@@ -40,7 +33,7 @@ class Admin::PagesController < ApplicationController
@frontend_path = @item.app_frontend_url ? @item.app_frontend_url : @module_app.widgets.keys[0]
if @module_app.widgets.any?{|b| b.class == Array}
if @module_app && @module_app.widgets && @module_app.widgets.any?{|b| b.class == Array}
@frontend_style = @module_app.widgets[@frontend_path] if !@frontend_path.blank? && !@module_app.widgets.blank?
end
@@ -78,7 +78,7 @@ class Admin::UsersNewInterfaceController < ApplicationController
# @user.attribute_values.build(value)
# }
# @user.rebuild_sub_roles_from_attribute_values!(attribute_values)
binding.pry
# binding.pry
if @user.save
flash[:notice] = t('create.success.user')
redirect_to :action => :index
@@ -103,6 +103,7 @@ class Admin::UsersNewInterfaceController < ApplicationController
def update
@user = User.find(params[:id])
@user.update_attributes(params[:user])
attribute_values_key = params[:user].has_key?('new_attribute_values') ? 'new_attribute_values' : 'attribute_values'
attribute_values = params[:user].delete(attribute_values_key)
@@ -8,6 +8,8 @@ class ApplicationController < ActionController::Base
helper :admin
before_filter :set_locale, :set_site
helper_attr :site_valid_locales
def set_current_user
User.current = current_or_guest_user
end
@@ -21,6 +21,7 @@ class Desktop::JournalPagesController < ApplicationController
respond_to do |format|
format.html { render :layout => false}
end
end
def edit
@@ -39,14 +40,19 @@ class Desktop::JournalPagesController < ApplicationController
@writing_journal = WritingJournal.new(params[:writing_journal])
if @writing_journal.save
respond_to do |format|
format.html { redirect_to desktop_journal_pages_url, :layout => false, notice: 'User was successfully created.'}
# format.json { render json: @writing_journal, status: :created, location: @writing_journal}
# format.js
end
# respond_to do |format|
# format.html { redirect_to desktop_journal_pages_url, :layout => false, notice: 'User was successfully created.'}
# # format.json { render json: @writing_journal, status: :created, location: @writing_journal}
# # format.js
# end
render :json => {"success"=>true,"msg"=>"Paper successfully saved!"}.to_json
else
render :json => {"success"=>false,"msg"=>"Saving failed!"}
end
end
end
render :json => {"success"=>true,"msg"=>"Paper successfully saved!"}.to_json
end
def update
@@ -74,19 +80,19 @@ class Desktop::JournalPagesController < ApplicationController
if not file.nil?
file_type = MIME::Types.type_for(file).first.to_s.split("/")[1]
case file_type
when "jpg", "jpeg"
type = "jpg"
when "text", "txt"
type = "txt"
when "pdf"
type = "pdf"
when "png"
type = "png"
else "readme"
end
# case file_type
# when "jpg", "jpeg"
# type = "jpg"
# when "text", "txt"
# type = "txt"
# when "pdf"
# type = "pdf"
# when "png"
# type = "png"
# else "readme"
# end
file_type = "/assets/ft-icons/#{type}/#{type}-48_32.png"
file_type = "/assets/ft-icons/#{file_type}/#{file_type}-48_32.png"
else
file_type = ""
end
+1 -1
View File
@@ -11,7 +11,7 @@ class OrbitBackendController < ApplicationController
layout 'new_admin'
def setup_vars
@app_title = controller_path.split('/')[1].singularize
@app_title ||= controller_path.split('/')[1].singularize
@module_app ||= ModuleApp.first(conditions: {:key => @app_title} )
end
+5 -2
View File
@@ -15,8 +15,11 @@ module ApplicationHelper
end
def create_guest_user
u = User.create(:name => "guest", :email => "guest_#{Time.now.to_i}#{rand(99)}@example.com")
u.admin = false
u = nil
User.without_callback(:create, :before, :initialize_desktop) do
u = User.create(:name => "guest", :email => "guest_#{Time.now.to_i}#{rand(99)}@example.com")
end
u.admin = false
u.save(:validate => false)
u
end
+167 -134
View File
@@ -1,12 +1,12 @@
#encoding: utf-8
# require ActionView::Helpers::FormTagHelper
module AttributeFieldsHelper
include ActionView::Helpers::FormTagHelper
include ActionView::Helpers::FormOptionsHelper
include ActionView::Helpers::DateHelper
include ActionView::Helpers::TagHelper
include ActionView::Helpers::RenderingHelper
include ActionView::Context
include OrbitBasis::RenderAnywhere
def block_helper(user,index,disable = false)
unless self.disabled
@@ -28,37 +28,25 @@ module AttributeFieldsHelper
end
def render_address
#NP
control_group_wrapper do |key,value|
result = '<div class="input-append">'.html_safe
value = (can_muti_lang_input? ? @prefiled_value[key] : @prefiled_value) rescue nil
key_field = can_muti_lang_input? ? "[#{key}]" : ""
place_holder= @panel_setting["placeholder"][key] rescue ''
result = text_area_tag(get_field_name_base + key_field, value,@markup_options.merge({:placeholder=>place_holder,:for=>key}))
if(add_more and value.is_a?(Array))
values = value
result << values.each_with_index.collect do |value,index|
text_field_tag(get_field_name_base + (key.nil? ? '' : "[#{key}][#{index}]"), value.last,@markup_options)
end.join.html_safe
else
result << text_field_tag(get_field_name_base + (key.nil? ? '' : "[#{key}]"), value,@markup_options)
end
result << ('<a href="#'+self.key+'-edit" class="btn" type="button" data-toggle="modal"><i class="icon-edit"></i></a>').html_safe
result << '<a href="#" class="btn" type="button"><i class="icon-trash"></i></a>'.html_safe
result << '</div>'.html_safe
result << gen_modal_dialog
add_ext= @attribute_value.address_ext[key] rescue {}
result << hidden_field_tag(get_basic_field_name_base+"[address_ext][#{key}][county]",add_ext["county"],:class=>"county_#{key}")
result << hidden_field_tag(get_basic_field_name_base+"[address_ext][#{key}][street_address]",add_ext["street_address"],:class=>"street_address_#{key}")
result << hidden_field_tag(get_basic_field_name_base+"[address_ext][#{key}][city]",add_ext["city"],:class=>"city_#{key}")
result << hidden_field_tag(get_basic_field_name_base+"[address_ext][#{key}][zip]",add_ext["zip"],:class=>"zip_#{key}")
result << hidden_field_tag(get_basic_field_name_base+"[address_ext][#{key}][country]",add_ext["country"],:class=>"country_#{key}")
result << hidden_field_tag(get_basic_field_name_base+"[address_ext][#{key}][indicator]",add_ext["indicator"],:class=>"indicator_#{key}")
end
end
def render_checkbox
@prefiled_value ||=[]
# begin
# markup_value = eval(self.markup_value)
# rescue
# markup_value = self.markup_value
# ensure
# markup_value ||= {}
# end
control_group_wrapper do
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"))
@@ -67,23 +55,15 @@ module AttributeFieldsHelper
end
def render_date
#NP
control_group_wrapper{date_select(get_field_name_base,nil,@markup_options.merge(:default=>@prefiled_value),:class=>"input-small")}
end
def render_date_durnation #Need re-write low priority
end
def render_radio_button
@prefiled_value ||=[]
# begin
# markup_value = eval(self.markup_value)
# rescue
# markup_value = self.markup_value
# ensure
# markup_value ||= {}
# end
control_group_wrapper do
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=>"control-label"))
@@ -92,106 +72,148 @@ module AttributeFieldsHelper
end
def render_select
prompt = @panel_setting[:prompt][I18n.locale] rescue nil
prompt = @panel_setting["initial"][I18n.locale.to_s] rescue nil
@markup_options.merge!(:prompt => prompt) unless prompt.nil?
# markup_value = (self.markup_value.is_a?(Hash) ? self.markup_value : eval(self.markup_value) )rescue {}
# check self[:option_list].collect{|p| [p[1][I18n.locale.to_s],p[0]]}
control_group_wrapper{select_tag( get_field_name_base,options_for_select(self.option_list.collect{|p| [p[1][I18n.locale.to_s],p[0]]},@prefiled_value),@markup_options)} rescue ""
end
def render_text_area
control_group_wrapper do |key,value|
if(add_more and value.is_a?(Hash))
values = value
values.each_with_index.collect do |value,index|
place_holder= @panel_setting["placeholder"][key]
text_area_tag(get_field_name_base + (key.nil? ? '' : "[#{key}][#{index}]"), value.last,@markup_options.merge(:placeholder=>place_holder))
end.join.html_safe
else
value = can_muti_lang_input ? @prefiled_value[key] : @prefiled_value
key = can_muti_lang_input ? "[#{key}]" : ""
value = can_muti_lang_input? ? @prefiled_value[key] : @prefiled_value
key = can_muti_lang_input? ? "[#{key}]" : ""
place_holder= @panel_setting["placeholder"][I18n.locale.to_s] rescue ''
text_area_tag(get_field_name_base + key, value,@markup_options.merge(:placeholder=>place_holder))
end
end
end
def render_text_field
control_group_wrapper do |key,value|
if(add_more)
values = value
result = ""
unless values.nil?
result = values.each_with_index.collect do |value,index|
place_holder= @panel_setting["placeholder"][key]
text_field_tag(get_field_name_base + (key.nil? ? '' : "[#{key}][#{index}]"), value.last,@markup_options.merge(:placeholder=>place_holder))
end.join.html_safe
end
result
else
value = (can_muti_lang_input ? @prefiled_value[key] : @prefiled_value) rescue nil
key_field = can_muti_lang_input ? "[#{key}]" : ""
place_holder= @panel_setting["placeholder"][key] rescue ''
text_field_tag(get_field_name_base + key_field, value,@markup_options.merge(:placeholder=>place_holder))
end
end
control_group_wrapper do |key,value|
add_more_blank = can_add_more ? "[]" : ""
key_field = can_muti_lang_input? ? "[#{key}]" : ""
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))
end
end
protected
def lang_panel_control_wrapper(&block)
result = '<div class="tabbable">'
result << '<div class="tab-content">'
result << controls_wrapper{yield}
result << '</div>'
result << '</div>'
result.html_safe
def lang_panel_tabbable_wrapper(add_more_params,&block)
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
buff = VALID_LOCALES.collect do |key|
value = @prefiled_value[key] rescue nil
div_class_ary = ["tab-pane" ,"fade",key,get_pairing_tab_class({})]
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),: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'),"#") if self.add_more
# buff << '<a href="#" class="btn removeInput" type="button"><i class="icon-trash"></i></a>' if self.add_more
buff.join("\n").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_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(I18n.t("langs."+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
def controls_wrapper(&block)
result = "<div class='controls'>"
if can_muti_lang_input
result << "<div class='tabbable'>"
result << "<div class='tab-content'>"
VALID_LOCALES.collect do |key|
value = @prefiled_value[key.to_s] rescue nil
div_class = ["tab-pane" ,"fade"].join(" ")
div_class << (key == I18n.locale.to_s ? " active in" : '')
result << content_tag(:div,yield(key,value),:class=>div_class,:id=>"tab"+id.to_s+"_#{key}")
end
result << "</div>"
result << "<ul class='nav nav-pills'>"
VALID_LOCALES.each do |key|
result << content_tag(:li,link_to(I18n.t(:_locale, :locale => key),"#tab"+id.to_s+"_#{key}",:data=>{:toggle=>"tab"}),:class=>(key == I18n.locale.to_s ? "active" : nil))
def controls_wrapper(*add_more_params,&block)
content_tag :div,:class=>'controls' do
result = ''
add_more_counter = ""
if can_add_more
add_more_counter = add_more_params[0][:counter]
add_more_value = add_more_params[0][:value]
end
result << "</ul>"
result << "</div>"
# @prefiled_value.collect do |key,value|
# result << yield(key,value)
# end
if can_muti_lang_input?
result << lang_panel_tabbable_wrapper(add_more_params,&block)
result << gen_modal_dialog if self.markup == "address"
else
result << yield
value = case can_add_more
when true
add_more_params[0]
else
@prefiled_value
end
result << yield(nil,value)
end
if can_add_more
result << '<span class="help-block">'
result << '<a href="#"><i class="icon-plus-sign"></i> Add</a>'
result << '</span>'
end
result << "</div>"
result.html_safe
end
result.html_safe
end # of controls div
end # of def controls_wrapper(&block)
def control_group_wrapper(&block)
div_class = can_muti_lang_input ? "control-group language-swich" : "control-group"
temp = label + controls_wrapper(&block)
div_class = can_muti_lang_input? ? "control-group language-swich" : "control-group"
result =""
case self.markup
when "text_field"
if can_add_more
multipleInput_ary = %w{multipleInput editMore}
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("\n").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"
result = content_tag(:div,temp,:class=>div_class)
result << end_block
address = content_tag :div,:class=>"multipleInput editMore" do
controls_wrapper(&block)
end # of div multipleInput editMore
result = label + address
else
temp = label + controls_wrapper(&block)
result = content_tag(:div,temp,:class=>div_class)
end
result << end_block
result.html_safe
end
def add_more_unt
temp_field_name = get_basic_field_name_base + '[temp]'
add_more = content_tag :div,:class=> 'controls' do
content_tag :span,:class=> 'help-block' do
content = link_to (content_tag :i,I18n.t("admin.infos.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
def end_block
if @new_attribute
hidden_field_tag(get_basic_field_name_base+"[attribute_field_id]",id,:for=>"field_#{@index}")
@@ -200,6 +222,23 @@ protected
end
end
def add_more_tab(mode,counter,key)
case mode
when :input_field
get_pairing_tab_class(:suffix=>['','tab'+counter.to_s,key].join('-'))
when :tab_btn
".#{get_pairing_tab_class(:suffix=>['','tab'+counter.to_s,key].join('-'))}"
end
end
def get_pairing_tab_class(opts)
prefix = opts[:prefix]
suffix = opts[:suffix]
str = get_basic_field_name_base.gsub("[","-").gsub("]",'')
str = prefix.nil? ? str : prefix+ str
suffix.nil? ? str : str + suffix
end
def get_basic_field_name_base
if @new_attribute
"user[new_attribute_values][#{@index}]"
@@ -216,36 +255,30 @@ protected
label_tag(key,title,:class=>"control-label",:func => "field_label")
end
def can_muti_lang_input
LIST[:markups][markup]["muti_lang_input_supprt"] #and locale
def can_muti_lang_input?
if self.markup == "address"
return true
else
LIST[:markups][markup]["muti_lang_input_supprt"] and !(get_data["cross_lang"] == "true")
end
end
def can_add_more
locale and LIST[:markups][markup]["ext_support"] && add_more
if self.markup == "address"
return false
else
locale and LIST[:markups][markup]["ext_support"] && add_more
end
end
def render_anywhere(partial, assigns)
view = ActionView::Base.new(Rails::Configuration.new.view_path, assigns)
ActionView::Base.helper_modules.each { |helper| view.extend helper }
view.extend ApplicationHelper
view.render(:partial => partial)
end
def gen_modal_dialog
result = '<div class="modal hide fade" id="address-edit" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none; ">'
result << '<div class="modal-header">'
result << '<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>'
result << '<h3 id="myModalLabel">'+title+'</h3>'
result << '</div>'
result << '<div class="modal-body">'
result << '<p>One fine body…</p>'
result << '</div>'
result << '<div class="modal-footer">'
result << '<button class="btn" data-dismiss="modal" aria-hidden="true">'+I18n.t("modal.close")+'</button>'
result << '<button class="btn btn-primary">'+I18n.t("modal.save_and_close")+'</button>'
result << '</div>'
result << '</div>'
result.html_safe
end
def gen_modal_dialog
render_anywhere("shared/attribute_field/address_modal_dialog",{
:field_name=>title,
:html_id=>"#{get_pairing_tab_class({})}_m_window",
:btn_class => "#{get_pairing_tab_class({})}",
:field_name_basic => get_basic_field_name_base
}
)
end
end
+68
View File
@@ -0,0 +1,68 @@
module AttributeValuesHelper
def show_west_calender
date = get_date
case self.attribute_field["typeC"]["format"]
when 'format1' # Y/M/D h:m
date.strftime("%Y/%m/%d %H:%M")
when 'format2' # Y/M/D
date.strftime("%Y/%m/%d")
when 'format3' # Y/M
date.strftime("%Y/%m")
when 'format4' # Y
date.strftime("%Y")
end # of case west cal format
end
def show_minguo_calendar
get_minguo
date = get_date
year_str = ""
unless date.year == 1912
m_year = (date.year - 1912).abs.to_s + I18n.t("admin.infos.date.minguo_calendar.year")
year_str = minguo_format_year(m_year)
end
get_minguo_year + minguo_m_y_d_time
end
def get_minguo_year
date = get_date
m_year = (date.year - 1911).abs
year_end = I18n.t("admin.infos.date.minguo_calendar.year")
case
when date.year <1912
I18n.t("admin.infos.date.minguo_calendar.before") + (m_year+1).to_s + year_end
when date.year ==1912
I18n.t("admin.infos.date.minguo_calendar.first_year")
when date.year >1912
I18n.t("admin.infos.date.minguo_calendar.after")+ (m_year).to_s + year_end
end # of case tw_claendar year
end
def minguo_m_y_d_time
date = get_date
case self.attribute_field["typeC"]["format"]
when 'format1' # Y/M/D h:m
date.strftime(" %m/%d %H:%M")
when 'format2' # Y/M/D
date.strftime(" %m/%d")
when 'format3' # Y/M
date.strftime(" %m#{I18n.t("admin.infos.date.minguo_calendar.month")}")
when 'format4' # Y
''
end # of case
end
def get_date_by_format
case I18n.locale
when :zh_tw
case
when self.attribute_field["typeC"]["claendar"] == "west_claendar"
show_west_calender
when self.attribute_field["typeC"]["claendar"] == "tw_claendar"
show_minguo_calendar
end #case self.attribute_field["typeC"]["claendar"]
when :en
show_west_calender
end
end
end
+2 -2
View File
@@ -11,10 +11,10 @@ class Design
has_one :css_default, as: :css, :autosave => true, :dependent => :destroy
has_one :layout, :autosave => true, :dependent => :destroy
has_one :css_reset, :autosave => true, :dependent => :destroy
has_many :images,as: :imgs, :autosave => true, :dependent => :destroy
has_many :images, as: :imgs, :autosave => true, :dependent => :destroy
has_many :javascripts, as: :js, :autosave => true, :dependent => :destroy
has_many :pages
has_many :themes, as: :css, :autosave => true, :dependent => :destroy
has_many :themes, :autosave => true, :dependent => :destroy
accepts_nested_attributes_for :images, :allow_destroy => true
accepts_nested_attributes_for :javascripts, :allow_destroy => true
+6 -1
View File
@@ -7,7 +7,12 @@ class Stylesheet < DesignFile
# self.remove_file!
# self.remove_file_orig!
names = {}
images = self.css.images
case self._type
when 'Theme'
images = self.design.images
when 'CssDefault'
images = self.css.images
end
content.scan(/(?<=url)(.*?)(?=\))/){
css_name = $1.gsub(' ','').gsub('(','')
unless names.has_key?(css_name)
+1 -1
View File
@@ -1,6 +1,6 @@
class Theme < Stylesheet
belongs_to :css, polymorphic: true
belongs_to :design
protected
+94 -65
View File
@@ -1,5 +1,4 @@
class AttributeField
include Mongoid::Document
include Mongoid::Timestamps
include ::AttributeFieldsHelper
@@ -8,28 +7,24 @@ class AttributeField
field :markup ,:default=>"text_field"
field :option_list ,:type => Hash,:default => {}
field :markup_options,:type => Hash
# field :locale, :type => Boolean, :default => true
# field :list_options, :type => Array
field :built_in, :type => Boolean, :default => false
field :disabled, :type => Boolean, :default => false
field :to_delete,:type=> Boolean,:default => false
field :typeA,:type=> Hash,:default=>{}
field :typeA,:type=> Hash,:default=>{:cross_lang=>false}
field :typeB,:type=> Hash,:default=>{}
field :typeC,:type=> Hash,:default=>{:claendar=>"west_claendar"}
field :typeD,:type=> Hash,:default=>{}
field :typeC,:type=> Hash,:default=>{:claendar=>"west_claendar",:format=>"format3"}
field :typeD,:type=> Hash,:default=>{:cross_lang=>false}
field :typeE,:type=> Hash,:default=>{}
#field :title, localize: true
field :title, localize: true
belongs_to :attribute
# belongs_to :role
has_many :attribute_values,:autosave => true, :dependent => :destroy
before_save :check_option_list
# validates_uniqueness_of :key
def markup_value
get_data["option_list"]
end
def add_more
(get_data["add_more"] == "true" ? true : false) rescue false
end
@@ -47,12 +42,6 @@ class AttributeField
(self.attribute.role.method(self[:key].pluralize.to_sym) && self.attribute.role.method(self[:key].pluralize+"_for_"+markup)) rescue false
end
def markup_value=(var)
if !self_defined_markup_options?
self[:markup_value] = (eval(var) rescue {})
end
end
def option_list
if self_defined_markup_options?
#Class need to have corresponding field and value agent
@@ -66,8 +55,6 @@ class AttributeField
end
end
def markup_options=(var)
self[:markup_options] = (eval(var) rescue {})
end
@@ -82,7 +69,7 @@ class AttributeField
end
def role
self.attribute.role
self.attribute.role
end
def panel
@@ -94,51 +81,18 @@ class AttributeField
end
# def title_translations
# if locale
# return self.locale_title_translations
# else
# return self[:neutral_title] #Hash[VALID_LOCALES.map{|d| [d,neutral_title]}]
# end
# end
# def title_translations=(var)
# if locale
# self.locale_title_translations = var
# end
# end
def typeA=(var)
check_add_more_convert(var)
check_cross_lang_convert(var,"typeA")
self["typeA"] = var
end
# def title
# if locale
# return self.locale_title
# else
# return self.neutral_title
# end
# end
def typeD=(var)
check_cross_lang_convert(var,"typeD")
self["typeD"] = var
end
# def check_title
# if locale
# self.locale_title_translations = self[:temp_title]
# else
# self.neutral_title = self[:temp_title]
# end
# self.unset("temp_title")
# end
# def title=(var)
# self["temp_title"] = var
# end
# # Convert the string list_options into an array
# def select_list_options=(var)
# self.list_options = var.gsub(' ', '').split(',')
# end
# # Convert the array list_options into a string
# def select_list_options
# self.list_options.to_a.join(', ')
# end
def is_built_in?
self.built_in
end
@@ -149,7 +103,82 @@ class AttributeField
protected
def check_option_list
self[:option_list] = self[panel]["option_list"]
self[:option_list] = self[panel]["option_list"] rescue nil
end
def add_more_convert(opt)
case opt
when :to_add_more
self.attribute_values.each do |av|
VALID_LOCALES.each do |loc|
splited_str = av[loc].split(",") rescue []
av["val"] = [] if av["val"].nil?
splited_str.each_with_index{|value,index| av["val"][index] = av["val"][index].nil? ? {loc=>value} : av["val"][index].merge(loc=>value) }
end
av.unset_all_lang_values
av.save
end #of self.attribute_values.each
when :to_no_add_more
self.attribute_values.each do |av|
VALID_LOCALES.each do |loc|
if av["val"].kind_of? Array
av[loc] = av["val"].collect{|t| t[loc]}.join(",")
else
av[loc] = av["val"]
end
end
av.unset("val")
av.save
end #of self.attribute_values.each
end
end
def cross_lang_convert(opt)
case opt
when :to_cross_lang
self.attribute_values.each do |av|
if add_more
av["val"] = av["val"].collect{|t| t.invert.keys.join(",")}
else
av["val"] = VALID_LOCALES.collect{|t| av[t]}.join(",")
av.unset_all_lang_values
end
av.save
end #of self.attribute_values.each
when :to_no_cross_lang
default_locale = I18n.default_locale.to_s
self.attribute_values.each do |av|
if add_more
av["val"] = av["val"].collect{|t| {default_locale => t} } #unless av["val"].nil?
else
av[default_locale] = av["val"]
av.unset("val")
end
av.save
end #of self.attribute_values.each
end
end
def check_add_more_convert(var)
if self["typeA"]["add_more"] != var["add_more"]
case var["add_more"]
when "true" #from no-add_more to add_more
add_more_convert(:to_add_more)
else #from add_more to no-add_more
add_more_convert(:to_no_add_more)
end # of case
end # of if
end
def check_cross_lang_convert(var,field)
if self[field]["cross_lang"] != var["cross_lang"]
case var["cross_lang"]
when "true" #from no-add_more to add_more
cross_lang_convert(:to_cross_lang)
else #from add_more to no-add_more
cross_lang_convert(:to_no_cross_lang)
end # of case
end # of if
end
end
+100 -79
View File
@@ -1,11 +1,12 @@
class AttributeValue
include Mongoid::Document
include Mongoid::Timestamps
include Mongoid::MultiParameterAttributes
include AttributeValuesHelper
field :key
field :address_ext
belongs_to :attribute_field
belongs_to :user
@@ -13,52 +14,110 @@ class AttributeValue
before_save :data_proc
# NO_MULTI_TAG = ["select","date","radio_button","checkbox","date_durnation"]
def data_proc
# binding.pry
# binding.pry if self.attribute_field.markup == 'radio_button'
# if self.attribute_field
case self.attribute_field.markup
when 'text_field','text_area'
# binding.pry
self[:temp_data].each{|key,val|
self[key] = val
} unless self[:temp_data].nil?
when 'select','date','radio_button'
self["val"] = self[:temp_data]
when 'checkbox'
self["val"] = self[:temp_data].keys rescue {}
end #end of case
else # if not locale
case self.attribute_field.markup
when 'text_field','text_area'
self["val"] = self[:temp_data]
when 'select','date','radio_button'
self["val"] = self[:temp_data]
when 'checkbox'
self["val"] = self[:temp_data].keys rescue {}
end #end of case
# end #of if self.attribute_field
self.unset('temp_data')
def add_more_counter
index_max = self["val"].count rescue 0
index_max == 0 ? 1 : index_max
end
def value
result=""
if self.attribute_field.locale && (self.attribute_field.markup == "text_field" || self.attribute_field.markup == "text_area")
result= Hash[VALID_LOCALES.collect{|lang| [lang,self[lang.to_sym]]}]
else
result = self["val"]
end
result
def value(index = nil)
result = case self.attribute_field.markup
when 'text_field','text_area'
if self.attribute_field.add_more and (self.attribute_field.markup == "text_field")
index.nil? ? self["val"] : self["val"][index]
# self.attribute_field.get_data[:cross_lang] ? Hash[VALID_LOCALES.collect{|lang| [lang,self[lang.to_sym]]}] : self["val"] #if !self.attribute_field.get_data[:cross_lang]
else
self.attribute_field.get_data["cross_lang"] =="true" ? self["val"] : Hash[VALID_LOCALES.collect{|lang| [lang,self[lang.to_sym]]}]
end
when 'select','date','radio_button','address'
self["val"]
when 'checkbox'
self["val"]
end #end of case self.attribute_field.markup
end
def value=(value)
#save everything to temp_data waiting for futher process
# binding
self[:temp_data] = value
end
def get_value_by_locale(locale,add_more_index=nil)
case self.attribute_field.markup
when "text_field"
case self.attribute_field.add_more
when true
add_more_index.nil? ? self.value.collect{|t| t[locale]}.join(",") : self.value(add_more_index)[locale]
when false
self.attribute_field.locale ? self[locale.to_s] : self.value
end
when "select"
markup_values = self.attribute_field.self_defined_markup_options? ? self.attribute_field.markup_value : self.attribute_field.markup_value
markup_values[self.value][locale.to_s] rescue 'NoData'
when "text_area"
self.attribute_field.locale ? self[locale.to_s] : self.value
when "date"
get_date_by_format
when "address"
self.value[locale.to_s]
when "radio_button"
markup_values = self.attribute_field.markup_value
markup_values[self.value][locale.to_s]
when "checkbox"
markup_values = self.attribute_field.markup_value
self.value.collect{|key| markup_values[key][locale.to_s]}.join(",")
when "date_durnation"
self.value
else
self.attribute_field.locale ? self[locale.to_s] : self.value
end
end
protected
def unset_all_lang_values
VALID_LOCALES.each{|t| self.unset t}
end
def data_proc
unless self[:temp_data].nil?
case self.attribute_field.markup
when "address"
self["val"] = self["temp_data"]
when 'text_field','text_area'
if self.attribute_field.add_more
self["val"] = self["temp_data"]
else # if not add_more
if self.attribute_field.can_muti_lang_input?
self[:temp_data].each do |key,val|
self[key] = val
end if(!self.attribute_field.get_data[:cross_lang])
else
self["val"] = self[:temp_data]
end
end # of self.attribute_field.add_more
when 'select','date','radio_button'
self["val"] = self[:temp_data]
when 'checkbox'
self["val"] = self[:temp_data].keys
end #end of case self.attribute_field.markup
end # of self[:temp_data].nil?
self.unset('temp_data')
self.unset('temp')
end #of data_proc
def check_key
self.key = attribute_field.key
end
@@ -70,48 +129,10 @@ class AttributeValue
self[(field[0].to_s.delete "=")] = field[1]
end
end
def get_value_by_locale(locale)
case self.attribute_field.markup
when "text_field"
self.attribute_field.locale ? self[locale.to_s] : self.value
when "select"
markup_values = self.attribute_field.self_defined_markup_options? ? self.attribute_field.markup_value : eval(self.attribute_field.markup_value)
markup_values[self.value][locale.to_s] rescue 'NoData'
when "text_area"
self.attribute_field.locale ? self[locale.to_s] : self.value
when "date"
Date.new(self[:val]["(1i)"].to_i,self[:val]["(2i)"].to_i,self[:val]["(3i)"].to_i) rescue nil
when "addr"
self.value
when "radio_button"
markup_values = eval(self.attribute_field.markup_value)
markup_values[:value][locale.to_s]
when "checkbox"
markup_values = self.attribute_field.markup_value
self[:value].keys.collect{|key| markup_values[key][locale.to_s]}.join(",")
when "date_durnation"
self.value
else
self.attribute_field.locale ? self[locale.to_s] : self.value
end
def get_date
Date.new(self[:val]["(1i)"].to_i,self[:val]["(2i)"].to_i,self[:val]["(3i)"].to_i) rescue nil
end
# def get_values
# unless ['select','checkbox','radio_button'].include?(self.attribute_field.markup )
# if self.attribute_field.locale && LIST[:markups][self.attribute_field.markup]["muti_lang_input_supprt"]
# return Hash[VALID_LOCALES.collect{|lang| [lang,get_value_by_locale(lang.to_sym)]}]
# else
# return get_value_by_locale("")
# end
# else
# if self.attribute_field.markup == "select"
# self[:value]
# else
# self[:value].keys rescue self[:value]
# end
# end
# end
end
-8
View File
@@ -42,14 +42,6 @@
var NewNode;
$(document).ready(function(){
// function mas(){
// $('.site-map').masonry({
// itemSelector: '.map-block',
// columnWidth: 450,
// isAnimated: true
// });
// }
function checkSwitch() {
$(".groups").addClass('disabled').has('.groups > .form-horizontal > div:not(.hide)').removeClass('disabled');
}
+2 -2
View File
@@ -34,10 +34,10 @@
<div class="tab-pane" id="css_default"><%= render :partial => 'tab_form', :locals => {:type => :css_default, :object => @design.css_default} %></div>
<div class="tab-pane" id="css_reset"><%= render :partial => 'tab_form', :locals => {:type => :css_reset, :object => @design.css_reset} %></div>
<% @design.themes.each do |theme| %>
<div class="tab-pane" id="<%= dom_id theme %>"><%= render :partial => 'tab_form', :locals => {:type => :css_reset, :object => theme} %></div>
<div class="tab-pane" id="<%= dom_id theme %>"><%= render :partial => 'tab_form', :locals => {:type => :themes, :object => theme} %></div>
<% end %>
<% @design.javascripts.each do |js| %>
<div class="tab-pane" id="<%= dom_id js %>"><%= render :partial => 'tab_form', :locals => {:type => :css_reset, :object => js} %></div>
<div class="tab-pane" id="<%= dom_id js %>"><%= render :partial => 'tab_form', :locals => {:type => :javascripts, :object => js} %></div>
<% end %>
<div class="tab-pane" id="images"><%= render :partial => 'images' %></div>
</div>
@@ -33,8 +33,8 @@
<label class="control-label"><%= t("admin.infos.options")%></label>
<div class="controls">
<label class="checkbox inline">
<%= check_box_tag("info[attribute_fields][#{attribute_field_counter}][typeA][multilingual]","true",attribute_field["typeA"]["multilingual"]) %>
<%= t("admin.infos.multilingual")%>
<%= check_box_tag("info[attribute_fields][#{attribute_field_counter}][typeA][cross_lang]","true",attribute_field["typeA"]["cross_lang"]) %>
<%= t("admin.infos.cross_lang")%>
</label>
<label class="checkbox inline">
<%= check_box_tag("info[attribute_fields][#{attribute_field_counter}][typeA][add_more]","true",attribute_field["typeA"]["add_more"]) %>
@@ -48,7 +48,12 @@
<%= content_tag :div,:class=>show_type_panel(attribute_field,"typeB") do %>
<%= render :partial=> "placeholder_block",:locals=>{:label_ext=>t("admin.infos.initial"),:values=>attribute_field["typeB"]["initial"],:field_name=>"info[attribute_fields][#{attribute_field_counter}][typeB][initial]"}%>
<%= render :partial=>"list_block",:locals=>{:values=>attribute_field["option_list"],:field_name=> "info[attribute_fields][#{attribute_field_counter}][typeB][option_list]"} %>
<% if attribute_field.self_defined_markup_options?%>
<%= render :partial=>"list_block",:locals=>{:values=>attribute_field["option_list"],:field_name=> "info[attribute_fields][#{attribute_field_counter}][attribute][role][statuses]"} %>
<%else #normal list%>
<%= render :partial=>"list_block",:locals=>{:values=>attribute_field["option_list"],:field_name=> "info[attribute_fields][#{attribute_field_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">
@@ -85,8 +90,8 @@
<label class="control-label"><%= t("admin.infos.options")%></label>
<div class="controls">
<label class="checkbox inline">
<%= check_box_tag("info[attribute_fields][#{attribute_field_counter}][typeD][multilingual]","true",attribute_field["typeD"]["multilingual"]) %>
<%= t("admin.infos.multilingual")%>
<%= check_box_tag("info[attribute_fields][#{attribute_field_counter}][typeD][cross_lang]","true",attribute_field["typeD"]["cross_lang"]) %>
<%= t("admin.infos.cross_lang")%>
</label>
</div>
</div>
+2 -2
View File
@@ -31,8 +31,8 @@
<table id='attributes' border="0" cellspacing="0" cellpadding="0">
<thead class="list_head">
<tr>
<td><%= t(:key) %></td>
<td><%= t(:multilingual) %></td>
<td><%= t('admin.key') %></td>
<td><%= t('admin.cross_lang') %></td>
<% @site_valid_locales.each do |locale| %>
<td><%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %></td>
<% end %>
@@ -1,5 +1,5 @@
$('#app_page_url').html("<%= escape_javascript(select 'page', 'app_frontend_url', @module_app.app_pages) %>");
$('#app_page_frontend_style').html("<%= escape_javascript(select 'page', 'frontend_style', @module_app.widgets[@frontend_path]) if !@frontend_path.blank? %>");
$('#app_page_category').html("<%= j (select 'page', 'category', @categories.collect{|category| [category.i18n_variable[I18n.locale], category.id]}, {:include_blank => true}) if @categories %>");
$('#app_page_category').html("<%= j (select 'page', 'category', @categories.collect{|category| [category.title, category.id]}, {:include_blank => true}) if @categories %>");
$('#app_page_tag').html("<%= j (select 'page', 'tag', @tags.collect{|tag| [tag[I18n.locale], tag.id]}, {:include_blank => true}) if @tags %>");
$('#app_page_frontend_field').html("<%= j render '../admin/pages/frontend_fields' %>")
+1 -1
View File
@@ -1,4 +1,4 @@
<%= flash_messages %>
<%#= flash_messages %>
<div id="poststuff">
<h1><%= t('editing.page') %></h1>
<%= form_for @item, :url => admin_page_path(@item), :html => { :class => 'form-horizontal edit_page' } do |f| %>
+1 -1
View File
@@ -1,4 +1,4 @@
<%= flash_messages %>
<%#= flash_messages %>
<div id="poststuff">
<h1><%= t('new.page') %></h1>
<%= form_for @item, :url => admin_pages_path, :html => { :class => 'form-horizontal edit_page' } do |f| %>
+1 -1
View File
@@ -1,4 +1,4 @@
<%= flash_messages %>
<%#= flash_messages %>
<%= page_stylesheets(@item, true).html_safe %>
+1 -1
View File
@@ -1,3 +1,3 @@
$('#back_sidebar').html("<%= escape_javascript(render(:partial => 'admin/items/site_map_left_bar')) %>");
$('#back_main').html("<%= escape_javascript(render(:partial => 'admin/pages/show')) %>");
$('#back_sidebar').html("<%= escape_javascript(render(:partial => 'admin/items/site_map_left_bar')) %>");
history.pushState(null, document.title, "<%= escape_javascript(admin_page_url(@item)) %>");
+1
View File
@@ -1,2 +1,3 @@
$('#back_main').html("<%= escape_javascript(render(:partial => 'admin/pages/show')) %>");
$('#back_sidebar').html("<%= escape_javascript(render(:partial => 'admin/items/site_map_left_bar')) %>");
history.pushState(null, document.title, "<%= escape_javascript(admin_page_url(@item)) %>");
@@ -17,91 +17,3 @@
<%= render :partial=>"infos"%>
<%= render :partial=>"roles"%>
<% content_for :page_specific_javascript do -%>
<script>
// $('.site-map').masonry({
// itemSelector: '.map-block',
// columnWidth: 450,
// isAnimated: true
// });
$(document).ready(function(){
function subrole_disable_field( triggled_object, switch_value_str){
var switch_field = triggled_object.attr("for");
$("input.subrole_disable_field[for="+switch_field+"]").val(switch_value_str)
}
function checkSwitch() {
$(".groups").each(function() {
$(this).find('.form-horizontal > .hide').length < $(this).find('.form-horizontal > div').length ? $(this).removeClass("disabled") : $(this).addClass("disabled")
});
}
function checkMultipleInput() {
$(".multipleInput").each(function() {
$(this).find('.controls').length==1 ? $(this).addClass("plural") : $(this).removeClass("plural")
});
}
function removeInput(){
$(".removeInput").click(function (){
$(this).parents(".controls").remove();
checkMultipleInput();
return false;
});
}
checkSwitch();
checkMultipleInput();
removeInput();
$(".help-block a").click(function (){
var $CloneTarget = $(this).parents(".controls").prev(".multipleInput").find('.controls:last');
$(this).parents(".controls").prev(".multipleInput").append($CloneTarget.clone());
$(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').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");
// console.log("LV1");
// console.log($(this));
}else{
$(this).text("ON");
// console.log("LV1");
// console.log($(this));
}
}
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");
console.log("LV2");
subrole_disable_field($(this),"true");
}else{
$(this).text("ON");
console.log("LV2");
subrole_disable_field($(this),"false");
}
checkSwitch();
}
return false;
});
})
</script>
<% end -%>
@@ -2,6 +2,6 @@
<% show_sub_role.attribute_fields.each do |item|%>
<tr>
<td class="span1"><%= item.title %></td>
<td><%= show_attribute_value(@user.get_attribute_value(item).get_value_by_locale(I18n.locale)) %></td>
<td><%= show_attribute_value(@user.get_attribute_value(item).get_value_by_locale(I18n.locale)) rescue '' %></td>
</tr>
<% end %>
@@ -11,6 +11,10 @@
<%= javascript_include_tag "/static/jquery.cycle.all.latest.js" %>
<%= javascript_include_tag "inc/modal-preview" %>
<%= javascript_include_tag "lib/contenteditable" %>
<%= javascript_include_tag "inc/ploy_input_field" %>
<%= javascript_include_tag "inc/input_module" %>
<%= javascript_include_tag "inc/attribute_panel_select" %>
<%= javascript_include_tag "inc/attribute_onoff" %>
<% end -%>
@@ -11,10 +11,14 @@
<%= javascript_include_tag "/static/jquery.cycle.all.latest.js" %>
<%= javascript_include_tag "inc/modal-preview" %>
<%= javascript_include_tag "lib/contenteditable" %>
<%= javascript_include_tag "inc/ploy_input_field" %>
<%= javascript_include_tag "inc/input_module" %>
<%= javascript_include_tag "inc/attribute_panel_select" %>
<%= javascript_include_tag "inc/attribute_onoff" %>
<% end -%>
<%= content_tag :div,:class=>"user-role site-map" do%>
<%= 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 %>
+4 -4
View File
@@ -8,16 +8,16 @@
<div id="holder">
<div id="panel_l" class="ph">
<div class="s_menu sm_v">
<div class="s_menu sm_v" content-type="menu">
<ul id='setting_left_nav'>
<li><a href="<%= desktop_appstore_onlinestore_path %>" data-method="onlinestore" class="admtxt hh2 w2 hp" onclick='return false;'>Online Store</a></li>
<li><a href="<%= desktop_appstore_widgets_path %>" data-method="widgets" class="admtxt hh2 w2 hp" onclick='return false;'>Widgets</a></li>
<li><a href="<%= desktop_appstore_onlinestore_path %>" callback-method="onlinestore" class="admtxt hh2 w2 hp" onclick='return false;'>Online Store</a></li>
<li><a href="<%= desktop_appstore_widgets_path %>" callback-method="widgets" class="admtxt hh2 w2 hp" onclick='return false;'>Widgets</a></li>
<li><a href="" class="admtxt hh2 w2 hp" onclick='return false;'>Apps</a></li>
<li><a href="" class="admtxt hh2 w2 hp" onclick='return false;'>Registeration</a></li>
</ul>
</div>
</div>
<div id="panel_r" class="ph pw admbg hp">
<div id="panel_r" container="true" class="ph pw admbg hp">
</div>
<div class="clear"></div>
+4 -4
View File
@@ -11,10 +11,10 @@
</div>
<div id="holder">
<div id="panel_l" class="ph">
<div class="s_menu sm_v">
<div class="s_menu sm_v" content-type="menu">
<ul id='setting_left_nav'>
<li><a href="<%= desktop_publications_books_list_path %>" data-method="harry"class="hh2 w2 hp active thmc1 thmtxt" onclick='return false;'>List</a></li>
<li><a href="<%= desktop_publications_books_add_path %>" data-method="addbook"class="admtxt hh2 w2 hp" onclick='return false;'>Add/Edit</a></li>
<li><a href="<%= desktop_publications_books_list_path %>" callback-method="harry"class="hh2 w2 hp active thmc1 thmtxt" onclick='return false;'>List</a></li>
<li><a href="<%= desktop_publications_books_add_path %>" callback-method="addbook"class="admtxt hh2 w2 hp" onclick='return false;'>Add/Edit</a></li>
<li><a href="" class="admtxt hh2 w2 hp" onclick='return false;'>Books</a></li>
<li><a href="" class="admtxt hh2 w2 hp" onclick='return false;'>Co-Authors</a></li>
<li><a href="" class="admtxt hh2 w2 hp" onclick='return false;'>Tags &amp; Keywords</a></li>
@@ -24,7 +24,7 @@
</ul>
</div>
</div>
<div id="panel_r" class="ph pw admbg hp">
<div id="panel_r" container="true" class="ph pw admbg hp">
</div>
<div class="clear"></div>
</div>
+33 -33
View File
@@ -1,64 +1,64 @@
<div id="side">
<div id="rwidget" class="wh3 thmc4">
<ul class="docklist">
<li class="d_cate"><a data-method='initializeDesktop' href="desktop/" class="widget_fn wh3 hh3" id='d_desktop' onclick="return false;"><span class="widget_icon"><img src="" alt="Home" id="home_icon" width="30" height="30"/></span></a>
<li class="d_cate"><a callback-method='initializeDesktop' href="desktop/" class="widget_fn wh3 hh3" id='d_desktop' onclick="return false;"><span class="widget_icon"><img src="" alt="Home" id="home_icon" width="30" height="30"/></span></a>
<ul class="dock_child hh3 thmc4" style="width: 180px;">
<li class="dock_item"><a data-method='initializeAppSearch' href="<%= desktop_app_manager_path %>" class="widget_fn wh3 hh3" id="d_app_manager" onclick="return false;"><span class="widget_icon"><img src="" alt="App Manager" id="app_manager_icon" width="30" height="30"/></span></a></li>
<li class="dock_item"><a data-method='initializeSectionsManager' href="<%= desktop_sections_path %>" class="widget_fn wh3 hh3" id="d_sections" onclick="return false;"><span class="widget_icon"><img src="" alt="All Sections" id="sections_icon" width="30" height="30"/></span></a></li>
<li class="dock_item"><a data-method='initializeSettings' href="<%= desktop_settings_path %>" class="widget_fn wh3 hh3" id="d_settings" onclick="return false;"><span class="widget_icon"><img src="" alt="Settings" id="settings_icon" width="30" height="30"/></span></a></li>
<li class="dock_item"><a callback-method='initializeAppSearch' href="<%= desktop_app_manager_path %>" class="widget_fn wh3 hh3" id="d_app_manager" onclick="return false;"><span class="widget_icon"><img src="" alt="App Manager" id="app_manager_icon" width="30" height="30"/></span></a></li>
<li class="dock_item"><a callback-method='initializeSectionsManager' href="<%= desktop_sections_path %>" class="widget_fn wh3 hh3" id="d_sections" onclick="return false;"><span class="widget_icon"><img src="" alt="All Sections" id="sections_icon" width="30" height="30"/></span></a></li>
<li class="dock_item"><a callback-method='initializeSettings' href="<%= desktop_settings_path %>" class="widget_fn wh3 hh3" id="d_settings" onclick="return false;"><span class="widget_icon"><img src="" alt="Settings" id="settings_icon" width="30" height="30"/></span></a></li>
</ul>
</li>
<li class="d_cate"><a data-method='' href="" class="widget_fn wh3 hh3" id='d_publication' onclick="return false;"><span class="widget_icon"><img src="" alt="Publication" id="publication_icon" width="30" height="30"/></span></a>
<li class="d_cate"><a callback-method='' href="" class="widget_fn wh3 hh3" id='d_publication' onclick="return false;"><span class="widget_icon"><img src="" alt="Publication" id="publication_icon" width="30" height="30"/></span></a>
<ul class="dock_child hh3 thmc4" style="width: 180px;">
<li class="dock_item"><a data-method='initializeJournalPapers' href="<%= desktop_publications_journal_p_path %>" class="widget_fn wh3 hh3" id='d_journal_p' onclick="return false;"><span class="widget_icon"><img src="" alt="Journal Papers" id="journal_p_icon" width="30" height="30"/></span></a></li>
<li class="dock_item"><a callback-method='initializeJournalPapers' href="<%= desktop_publications_journal_p_path %>" class="widget_fn wh3 hh3" id='d_journal_p' onclick="return false;"><span class="widget_icon"><img src="" alt="Journal Papers" id="journal_p_icon" width="30" height="30"/></span></a></li>
<li class="dock_item"><a data-method='initializeSeminar' href="<%= desktop_publications_seminar_p_path %>" class="widget_fn wh3 hh3" id='d_seminar_p' onclick="return false;"><span class="widget_icon"><img src="" alt="Seminar Papers" id="seminar_p_icon" width="30" height="30"/></span></a></li>
<li class="dock_item"><a callback-method='initializeSeminar' href="<%= desktop_publications_seminar_p_path %>" class="widget_fn wh3 hh3" id='d_seminar_p' onclick="return false;"><span class="widget_icon"><img src="" alt="Seminar Papers" id="seminar_p_icon" width="30" height="30"/></span></a></li>
<li class="dock_item"><a data-method='initializeContact' href="<%= desktop_publications_books_path %>" class="widget_fn wh3 hh3" id='d_books' onclick="return false;"><span class="widget_icon"><img src="" alt="Books" id="books_icon" width="30" height="30"/></span></a></li>
<li class="dock_item"><a callback-method='initializeContact' href="<%= desktop_publications_books_path %>" class="widget_fn wh3 hh3" id='d_books' onclick="return false;"><span class="widget_icon"><img src="" alt="Books" id="books_icon" width="30" height="30"/></span></a></li>
<li class="dock_item"><a data-method='initializeContact' href="<%= desktop_publications_books_path %>" class="widget_fn wh3 hh3" id='d_contacts' onclick="return false;"><span class="widget_icon"><img src="" alt="Books" id="books_icon" width="30" height="30"/></span></a></li>
<li class="dock_item"><a callback-method='initializeContact' href="<%= desktop_publications_books_path %>" class="widget_fn wh3 hh3" id='d_contacts' onclick="return false;"><span class="widget_icon"><img src="" alt="Books" id="books_icon" width="30" height="30"/></span></a></li>
</ul>
</li>
<li class="d_cate"><a data-method='' href="" class="widget_fn wh3 hh3" id='d_research' onclick="return false;"><span class="widget_icon"><img src="" alt="Research" id="research_icon" width="30" height="30"/></span></a>
<li class="d_cate"><a callback-method='' href="" class="widget_fn wh3 hh3" id='d_research' onclick="return false;"><span class="widget_icon"><img src="" alt="Research" id="research_icon" width="30" height="30"/></span></a>
<ul class="dock_child hh3 thmc4" style="width: 240px;">
<li class="dock_item"><a data-method='initializeResearchDomain' href="<%= desktop_research_research_d_path %>" class="widget_fn wh3 hh3" id='d_research_d' onclick="return false;"><span class="widget_icon"><img src="" alt="Research Domain" id="research_d_icon" width="30" height="30"/></span></a></li>
<li class="dock_item"><a data-method='initializeResearchProject' href="<%= desktop_research_research_p_path %>" class="widget_fn wh3 hh3" id='d_research_p' onclick="return false;"><span class="widget_icon"><img src="" alt="Research Project" id="research_p_icon" width="30" height="30"/></span></a></li>
<li class="dock_item"><a data-method='' href="" class="widget_fn wh3 hh3" id='d_patents' onclick="return false;"><span class="widget_icon"><img src="" alt="Patents" id="patents_icon" width="30" height="30"/></span></a></li>
<li class="dock_item"><a data-method='' href="labs" class="widget_fn wh3 hh3" id='d_labs' onclick="return false;"><span class="widget_icon"><img src="" alt="Labs" id="labs_icon" width="30" height="30"/></span></a></li>
<li class="dock_item"><a callback-method='initializeResearchDomain' href="<%= desktop_research_research_d_path %>" class="widget_fn wh3 hh3" id='d_research_d' onclick="return false;"><span class="widget_icon"><img src="" alt="Research Domain" id="research_d_icon" width="30" height="30"/></span></a></li>
<li class="dock_item"><a callback-method='initializeResearchProject' href="<%= desktop_research_research_p_path %>" class="widget_fn wh3 hh3" id='d_research_p' onclick="return false;"><span class="widget_icon"><img src="" alt="Research Project" id="research_p_icon" width="30" height="30"/></span></a></li>
<li class="dock_item"><a callback-method='' href="" class="widget_fn wh3 hh3" id='d_patents' onclick="return false;"><span class="widget_icon"><img src="" alt="Patents" id="patents_icon" width="30" height="30"/></span></a></li>
<li class="dock_item"><a callback-method='' href="labs" class="widget_fn wh3 hh3" id='d_labs' onclick="return false;"><span class="widget_icon"><img src="" alt="Labs" id="labs_icon" width="30" height="30"/></span></a></li>
</ul>
</li>
<li class="d_cate"><a data-method='' href="" class="widget_fn wh3 hh3" id='d_experience' onclick="return false;"><span class="widget_icon"><img src="" alt="Experience" id="experience_icon" width="30" height="30"/></span></a>
<li class="d_cate"><a callback-method='' href="" class="widget_fn wh3 hh3" id='d_experience' onclick="return false;"><span class="widget_icon"><img src="" alt="Experience" id="experience_icon" width="30" height="30"/></span></a>
<ul class="dock_child hh3 thmc4" style="width: 300px;">
<li class="dock_item"><a data-method='' href="working" class="widget_fn wh3 hh3" id='d_working' onclick="return false;"><span class="widget_icon"><img src="" alt="Working" id="working_icon" width="30" height="30"/></span></a></li>
<li class="dock_item"><a data-method='' href="education" class="widget_fn wh3 hh3" id='d_education' onclick="return false;"><span class="widget_icon"><img src="" alt="Education" id="education_icon" width="30" height="30"/></span></a></li>
<li class="dock_item"><a data-method='' href="honors" class="widget_fn wh3 hh3" id='d_honors' onclick="return false;"><span class="widget_icon"><img src="" alt="Honors" id="honors_icon" width="30" height="30"/></span></a></li>
<li class="dock_item"><a data-method='' href="activities" class="widget_fn wh3 hh3" id='d_activities' onclick="return false;"><span class="widget_icon"><img src="" alt="Activities" id="activities_icon" width="30" height="30"/></span></a></li>
<li class="dock_item"><a data-method='' href="clubs" class="widget_fn wh3 hh3" id='d_clubs' onclick="return false;"><span class="widget_icon"><img src="" alt="Clubs" id="clubs_icon" width="30" height="30"/></span></a></li>
<li class="dock_item"><a callback-method='' href="working" class="widget_fn wh3 hh3" id='d_working' onclick="return false;"><span class="widget_icon"><img src="" alt="Working" id="working_icon" width="30" height="30"/></span></a></li>
<li class="dock_item"><a callback-method='' href="education" class="widget_fn wh3 hh3" id='d_education' onclick="return false;"><span class="widget_icon"><img src="" alt="Education" id="education_icon" width="30" height="30"/></span></a></li>
<li class="dock_item"><a callback-method='' href="honors" class="widget_fn wh3 hh3" id='d_honors' onclick="return false;"><span class="widget_icon"><img src="" alt="Honors" id="honors_icon" width="30" height="30"/></span></a></li>
<li class="dock_item"><a callback-method='' href="activities" class="widget_fn wh3 hh3" id='d_activities' onclick="return false;"><span class="widget_icon"><img src="" alt="Activities" id="activities_icon" width="30" height="30"/></span></a></li>
<li class="dock_item"><a callback-method='' href="clubs" class="widget_fn wh3 hh3" id='d_clubs' onclick="return false;"><span class="widget_icon"><img src="" alt="Clubs" id="clubs_icon" width="30" height="30"/></span></a></li>
</ul>
</li>
<li class="d_cate"><a data-method='' href="" class="widget_fn wh3 hh3" id='d_landt' onclick="return false;"><span class="widget_icon"><img src="" alt="Learning & Teaching" id="landt_icon" width="30" height="30"/></span></a>
<li class="d_cate"><a callback-method='' href="" class="widget_fn wh3 hh3" id='d_landt' onclick="return false;"><span class="widget_icon"><img src="" alt="Learning & Teaching" id="landt_icon" width="30" height="30"/></span></a>
<ul class="dock_child hh3 thmc4" style="width: 180px;">
<li class="dock_item"><a data-method='' href="courses" class="widget_fn wh3 hh3" id='d_courses' onclick="return false;"><span class="widget_icon"><img src="" alt="Courses" id="courses_icon" width="30" height="30"/></span></a></li>
<li class="dock_item"><a data-method='' href="homework" class="widget_fn wh3 hh3" id='d_homework' onclick="return false;"><span class="widget_icon"><img src="" alt="Homework" id="homework_icon" width="30" height="30"/></span></a></li>
<li class="dock_item"><a data-method='' href="certification" class="widget_fn wh3 hh3" id='d_certification' onclick="return false;"><span class="widget_icon"><img src="" alt="Certification" id="certification_icon" width="30" height="30"/></span></a></li>
<li class="dock_item"><a callback-method='' href="courses" class="widget_fn wh3 hh3" id='d_courses' onclick="return false;"><span class="widget_icon"><img src="" alt="Courses" id="courses_icon" width="30" height="30"/></span></a></li>
<li class="dock_item"><a callback-method='' href="homework" class="widget_fn wh3 hh3" id='d_homework' onclick="return false;"><span class="widget_icon"><img src="" alt="Homework" id="homework_icon" width="30" height="30"/></span></a></li>
<li class="dock_item"><a callback-method='' href="certification" class="widget_fn wh3 hh3" id='d_certification' onclick="return false;"><span class="widget_icon"><img src="" alt="Certification" id="certification_icon" width="30" height="30"/></span></a></li>
</ul>
</li>
<li class="d_cate"><a data-method='' href="" class="widget_fn wh3 hh3" id='d_personal' onclick="return false;"><span class="widget_icon"><img src="" alt="Personal" id="personal_icon" width="30" height="30"/></span></a>
<li class="d_cate"><a callback-method='' href="" class="widget_fn wh3 hh3" id='d_personal' onclick="return false;"><span class="widget_icon"><img src="" alt="Personal" id="personal_icon" width="30" height="30"/></span></a>
<ul class="dock_child hh3 thmc4" style="width: 300px;">
<li class="dock_item"><a data-method='' href="mypage" class="widget_fn wh3 hh3" id='d_mypage' onclick="return false;"><span class="widget_icon"><img src="" alt="myPage" id="mypage_icon" width="30" height="30"/></span></a></li>
<li class="dock_item"><a data-method='' href="blog" class="widget_fn wh3 hh3" id='d_blog' onclick="return false;"><span class="widget_icon"><img src="" alt="Blog" id="blog_icon" width="30" height="30"/></span></a></li>
<li class="dock_item"><a data-method='' href="album" class="widget_fn wh3 hh3" id='d_album' onclick="return false;"><span class="widget_icon"><img src="" alt="Album" id="album_icon" width="30" height="30"/></span></a></li>
<li class="dock_item"><a data-method='' href="calendar" class="widget_fn wh3 hh3" id='d_calendar' onclick="return false;"><span class="widget_icon"><img src="" alt="Calendar" id="calendar_icon" width="30" height="30"/></span></a></li>
<li class="dock_item"><a data-method='' href="files" class="widget_fn wh3 hh3" id='d_files' onclick="return false;"><span class="widget_icon"><img src="" alt="Files" id="files_icon" width="30" height="30"/></span></a></li>
<li class="dock_item"><a callback-method='' href="mypage" class="widget_fn wh3 hh3" id='d_mypage' onclick="return false;"><span class="widget_icon"><img src="" alt="myPage" id="mypage_icon" width="30" height="30"/></span></a></li>
<li class="dock_item"><a callback-method='' href="blog" class="widget_fn wh3 hh3" id='d_blog' onclick="return false;"><span class="widget_icon"><img src="" alt="Blog" id="blog_icon" width="30" height="30"/></span></a></li>
<li class="dock_item"><a callback-method='' href="album" class="widget_fn wh3 hh3" id='d_album' onclick="return false;"><span class="widget_icon"><img src="" alt="Album" id="album_icon" width="30" height="30"/></span></a></li>
<li class="dock_item"><a callback-method='' href="calendar" class="widget_fn wh3 hh3" id='d_calendar' onclick="return false;"><span class="widget_icon"><img src="" alt="Calendar" id="calendar_icon" width="30" height="30"/></span></a></li>
<li class="dock_item"><a callback-method='' href="files" class="widget_fn wh3 hh3" id='d_files' onclick="return false;"><span class="widget_icon"><img src="" alt="Files" id="files_icon" width="30" height="30"/></span></a></li>
</ul>
</li>
<li class="d_cate"><a data-method='initializeOrbitTimeline' href="<%= desktop_orbit_orbit_path %>" class="widget_fn wh3 hh3" id='d_orbit' onclick="return false;"><span class="widget_icon"><img src="" alt="Orbit" id="orbit_icon" width="30" height="30"/></span></a>
<li class="d_cate"><a callback-method='initializeOrbitTimeline' href="<%= desktop_orbit_orbit_path %>" class="widget_fn wh3 hh3" id='d_orbit' onclick="return false;"><span class="widget_icon"><img src="" alt="Orbit" id="orbit_icon" width="30" height="30"/></span></a>
<ul class="dock_child hh3 thmc4" style="width: 60px;">
<li class="dock_item"><a data-method='' href="" class="widget_fn wh3 hh3" id='d_connection' onclick="return false;"><span class="widget_icon"><img src="" alt="Academia Connection" id="connection_icon" width="30" height="30"/></span></a></li>
<li class="dock_item"><a callback-method='' href="" class="widget_fn wh3 hh3" id='d_connection' onclick="return false;"><span class="widget_icon"><img src="" alt="Academia Connection" id="connection_icon" width="30" height="30"/></span></a></li>
</ul>
</li>
<li class="d_cate"><a data-method='initializeAppstore' href="<%= desktop_appstore_appstore_path %>" class="widget_fn wh3 hh3" id='d_appstore' onclick="return false;"><span class="widget_icon"><img src="" alt="AppStore" id="appstore_icon" width="30" height="30"/></span></a></li>
<li class="d_cate"><a callback-method='initializeAppstore' href="<%= desktop_appstore_appstore_path %>" class="widget_fn wh3 hh3" id='d_appstore' onclick="return false;"><span class="widget_icon"><img src="" alt="AppStore" id="appstore_icon" width="30" height="30"/></span></a></li>
</ul>
<div class="fn_des hh3 admbg admtxt"></div>
</div>
+6 -6
View File
@@ -11,12 +11,12 @@
</div>
<div id="holder">
<div id="panel_l" class="ph">
<div class="s_menu sm_v">
<div class="s_menu sm_v" content-type="menu">
<ul id='setting_left_nav'>
<li><a href="<%= desktop_journal_pages_path %>" data-method="list" class="hh2 w2 hp active thmc1 thmtxt xx" onclick='return false;'>List</a></li>
<li><a href="<%= new_desktop_journal_page_path %>" data-method="addpaper" class="admtxt hh2 w2 hp xx" onclick='return false;'>Add/Edit</a></li>
<li><a href="" class="admtxt hh2 w2 hp" onclick='return false;'>Journals</a></li>
<li><a href="<%= new_desktop_co_author_path %>" data-method="coauthor" class="admtxt hh2 w2 hp" onclick='return false;'>Co-Authors</a></li>
<li><a href="<%= desktop_journal_pages_path %>" callback-method="list" load="true" class="hh2 w2 hp thmc1 thmtxt xx" onclick='return false;'>List</a></li>
<li><a href="<%= new_desktop_journal_page_path %>" callback-method="addpaper" class="admtxt hh2 w2 hp xx" onclick='return false;'>Add/Edit</a></li>
<li><a href="" class="admtxt hh2 w2 hp" onclick='return false;'>Journals</a></li>
<li><a href="<%= new_desktop_co_author_path %>" class="admtxt hh2 w2 hp" callback-method="coauthor" onclick='return false;'>Co-Authors</a></li>
<li><a href="" class="admtxt hh2 w2 hp" onclick='return false;'>Tags &amp; Keywords</a></li>
<li><a href="" class="admtxt hh2 w2 hp" onclick='return false;'>Analysis</a></li>
<li><a href="" class="admtxt hh2 w2 hp" onclick='return false;'>Import</a></li>
@@ -24,7 +24,7 @@
</ul>
</div>
</div>
<div id="panel_r" class="ph pw admbg hp">
<div id="panel_r" container="true" class="ph pw admbg hp">
</div>
<div class="clear"></div>
</div>
@@ -1,7 +1,8 @@
<div class="toolbar hh2">
<div class="fn_g hp">
<%= button_tag "Save", name: "commit", value: "Save", class: "fn_btn hh2 thmc2 thmtxt" %>
<%= button_tag "Cancel", name: "commit", value: "Cancel", class: "fn_btn hh2 thmc2 thmtxt" %>
<%= f.submit "Save", name: "commit", value: "Save", class: "fn_btn hh2 thmc2 thmtxt" %>
<%#= button_tag "Cancel", name: "cancel", value: "Cancel", class: "fn_btn hh2 thmc2 thmtxt" %>
<%= content_tag(:button, "Cancel", :class=>"fn_btn hh2 bt-cancel thmc2 thmtxt") %>
</div>
<div class="hh2 hp sdm">
<div class="sdm_t hh2">Entry Year</div>
@@ -1,3 +1,3 @@
<%= form_for @writing_journal, url: desktop_journal_page_path(@writing_journal) do |f| %>
<%= form_for @writing_journal, url: desktop_journal_page_path(@writing_journal),html: { multipart: true ,:type=>"ajax_form", "callback-method"=>"formCallback"} do |f| %>
<%= render partial: 'desktop/journal_pages/form', locals: {:f => f} %>
<%end%>
+1 -1
View File
@@ -1,3 +1,3 @@
<%= form_for @writing_journal , url: desktop_journal_pages_path do |f| %>
<%= form_for @writing_journal, html: { multipart: true ,:type=>"ajax_form", "callback-method"=>"formCallback"} , url: desktop_journal_pages_path do |f| %>
<%= render partial: 'desktop/journal_pages/form', locals: {:f => f} %>
<%end%>
+4 -4
View File
@@ -11,10 +11,10 @@
</div>
<div id="holder">
<div id="panel_l" class="ph">
<div class="s_menu sm_v">
<div class="s_menu sm_v" content-type="menu">
<ul id='setting_left_nav'>
<li><a href="<%= desktop_research_research_d_list_path %>" data-method="list" class="hh2 w2 hp active thmc1 thmtxt" onclick='return false;'>List</a></li>
<li><a href="<%= desktop_research_research_d_add_path %>" data-method="add_this" class="admtxt hh2 w2 hp" onclick='return false;'>Add/Edit</a></li>
<li><a href="<%= desktop_research_research_d_list_path %>" callback-method="list" class="hh2 w2 hp active thmc1 thmtxt" onclick='return false;'>List</a></li>
<li><a href="<%= desktop_research_research_d_add_path %>" callback-method="add_this" class="admtxt hh2 w2 hp" onclick='return false;'>Add/Edit</a></li>
<li><a href="" class="admtxt hh2 w2 hp" onclick='return false;'>Domains</a></li>
<li><a href="" class="admtxt hh2 w2 hp" onclick='return false;'>Co-Authors</a></li>
<li><a href="" class="admtxt hh2 w2 hp" onclick='return false;'>Tags &amp; Keywords</a></li>
@@ -24,7 +24,7 @@
</ul>
</div>
</div>
<div id="panel_r" class="ph pw admbg hp">
<div id="panel_r" container="true" class="ph pw admbg hp">
</div>
<div class="clear"></div>
</div>
+4 -4
View File
@@ -11,10 +11,10 @@
</div>
<div id="holder">
<div id="panel_l" class="ph">
<div class="s_menu sm_v">
<div class="s_menu sm_v" content-type="menu">
<ul id='setting_left_nav'>
<li><a href="<%= desktop_publications_research_p_list_path %>" data-method="list" class="hh2 w2 hp active thmc1 thmtxt" onclick='return false;'>List</a></li>
<li><a href="<%= desktop_publications_research_p_add_path %>" data-method="add_this" class="admtxt hh2 w2 hp" onclick='return false;'>Add/Edit</a></li>
<li><a href="<%= desktop_publications_research_p_list_path %>" callback-method="list" class="hh2 w2 hp active thmc1 thmtxt" onclick='return false;'>List</a></li>
<li><a href="<%= desktop_publications_research_p_add_path %>" callback-method="add_this" class="admtxt hh2 w2 hp" onclick='return false;'>Add/Edit</a></li>
<li><a href="" class="admtxt hh2 w2 hp" onclick='return false;'>Projects</a></li>
<li><a href="" class="admtxt hh2 w2 hp" onclick='return false;'>Co-Authors</a></li>
<li><a href="" class="admtxt hh2 w2 hp" onclick='return false;'>Tags &amp; Keywords</a></li>
@@ -24,7 +24,7 @@
</ul>
</div>
</div>
<div id="panel_r" class="ph pw admbg hp">
<div id="panel_r" container="true" class="ph pw admbg hp">
</div>
<div class="clear"></div>
</div>
+4 -4
View File
@@ -11,10 +11,10 @@
</div>
<div id="holder">
<div id="panel_l" class="ph">
<div class="s_menu sm_v">
<div class="s_menu sm_v" content-type="menu">
<ul id='setting_left_nav'>
<li><a href="<%= desktop_publications_seminar_p_list_path %>" data-method="list" class="hh2 w2 hp active thmc1 thmtxt" onclick='return false;'>List</a></li>
<li><a href="<%= desktop_publications_seminar_p_add_path %>" data-method="addseminar" class="admtxt hh2 w2 hp" onclick='return false;'>Add/Edit</a></li>
<li><a href="<%= desktop_publications_seminar_p_list_path %>" callback-method="list" class="hh2 w2 hp active thmc1 thmtxt" onclick='return false;'>List</a></li>
<li><a href="<%= desktop_publications_seminar_p_add_path %>" callback-method="addseminar" class="admtxt hh2 w2 hp" onclick='return false;'>Add/Edit</a></li>
<li><a href="" class="admtxt hh2 w2 hp" onclick='return false;'>Seminar</a></li>
<li><a href="" class="admtxt hh2 w2 hp" onclick='return false;'>Co-Authors</a></li>
<li><a href="" class="admtxt hh2 w2 hp" onclick='return false;'>Tags &amp; Keywords</a></li>
@@ -24,7 +24,7 @@
</ul>
</div>
</div>
<div id="panel_r" class="ph pw admbg hp">
<div id="panel_r" container="true" class="ph pw admbg hp">
</div>
<div class="clear"></div>
</div>
+5 -5
View File
@@ -7,17 +7,17 @@
</div>
<div id="holder">
<div id="panel_l" class="ph">
<div class="s_menu sm_v">
<div class="s_menu sm_v" content-type="menu">
<ul id='setting_left_nav'>
<li><a href="" class="admtxt hh2 w2 hp" onclick='return false;'>Overview</a></li>
<li><a href="" class="admtxt hh2 w2 hp" onclick='return false;'>Account</a></li>
<li><a href="<%= desktop_sections_path %>" data-method="sections" class="admtxt hh2 w2 hp" onclick='return false;'>Sections</a></li>
<li><a href="<%= desktop_themes_path %>" data-method="themes" class="admtxt hh2 w2 hp" onclick='return false;'>Theme</a></li>
<li><a href="<%= desktop_connections_path %>" data-method="connection" class="admtxt hh2 w2 hp" onclick='return false;'>Connection</a></li>
<li><a href="<%= desktop_sections_path %>" callback-method="sections" class="admtxt hh2 w2 hp" onclick='return false;'>Sections</a></li>
<li><a href="<%= desktop_themes_path %>" callback-method="themes" class="admtxt hh2 w2 hp" onclick='return false;'>Theme</a></li>
<li><a href="<%= desktop_connections_path %>" callback-method="connection" class="admtxt hh2 w2 hp" onclick='return false;'>Connection</a></li>
</ul>
</div>
</div>
<div id="panel_r" class="ph pw admbg hp">
<div id="panel_r" container="true" class="ph pw admbg hp">
</div>
<div class="clear"></div>
+6 -6
View File
@@ -75,8 +75,8 @@
<%#= content_tag :li, link_to(t('admin.ad.all_banners'), admin_ad_banners_path), :class => active_for_action('ad_banners', 'index') %>
<%#= content_tag :li, link_to(t('admin.ad.new_banner'), new_admin_ad_banner_path), :class => active_for_action('ad_banners', 'new') %>
<%#= content_tag :li, link_to(t('admin.ad.new_image'), new_ad_image_admin_ad_banners_path), :class => active_for_action('ad_images', 'new') %>
<%= content_tag :li, link_to((t('gallery.categories') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, panel_gallery_back_end_gallery_categories_path), :class => active_for_action('gallery_categories','index') %>
<%= content_tag :li, link_to((t('gallery.tags') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, panel_gallery_back_end_tags_path), :class => active_for_action('/panel/gallery/back_end/tags', 'index') %>
<%= content_tag(:li, link_to((t('gallery.categories') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, panel_gallery_back_end_gallery_categories_path), :class => active_for_action('gallery_categories','index') )if (is_manager? rescue nil)%>
<%= content_tag :li, link_to((t('gallery.tags') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, panel_gallery_back_end_tags_path), :class => active_for_action('/panel/gallery/back_end/tags', 'index') if (is_manager? rescue nil) %>
<%= content_tag :li, link_to((t('admin.module.authorization') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe,admin_module_app_manager_auth_proc_path(ModuleApp.first(conditions: {key: "gallery"}))), :class => active_for_app_auth('gallery') if (is_admin? rescue nil) %>
<% end -%>
<% end %>
@@ -85,9 +85,9 @@
<%= link_to content_tag(:i, nil, :class => 'icons-asset') + content_tag(:span, t('admin.archive')), panel_archive_back_end_archive_files_path %>
<%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('archive_files', 'tags', 'archive_file_categorys')) do -%>
<%= content_tag :li, link_to((t('admin.all_articles') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, panel_archive_back_end_archive_files_path), :class => active_for_action('archive_file', 'index') %>
<%= content_tag :li, link_to((t('admin.add_new') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, new_panel_archive_back_end_archive_file_path), :class => active_for_action('archive_file', 'new') %>
<%= content_tag :li, link_to((t('admin.categories') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, panel_archive_back_end_archive_file_categorys_path), :class => active_for_action('archive_file_categorys', 'index') %>
<%= content_tag :li, link_to((t('admin.tags') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, panel_archive_back_end_tags_path), :class => active_for_action('tags', 'index') %>
<%= content_tag :li, link_to((t('admin.add_new') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, new_panel_archive_back_end_archive_file_path), :class => active_for_action('archive_file', 'new') if (is_admin? rescue nil)%>
<%= content_tag(:li, link_to((t('admin.categories') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, panel_archive_back_end_archive_file_categorys_path), :class => active_for_action('archive_file_categorys', 'index'))if (is_manager? rescue nil)%>
<%= content_tag :li, link_to((t('admin.tags') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, panel_archive_back_end_tags_path), :class => active_for_action('tags', 'index') if (is_manager? rescue nil)%>
<% end -%>
<% end -%>
@@ -98,7 +98,7 @@
<%#= content_tag :li, link_to(t('admin.ad.new_banner'), new_admin_ad_banner_path), :class => active_for_action('ad_banners', 'new') %>
<%#= content_tag :li, link_to(t('admin.ad.new_image'), new_ad_image_admin_ad_banners_path), :class => active_for_action('ad_images', 'new') %>
<%= content_tag :li, link_to((t('admin.calendars') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, new_panel_calendar_back_end_cal_path), :class => active_for_action('cals','new') %>
<%= content_tag :li, link_to(t('admin.tags'), panel_calendar_back_end_tags_path), :class => active_for_action('/panel/calendar/back_end/tags', 'index') %>
<%= content_tag :li, link_to(t('admin.tags'), panel_calendar_back_end_tags_path), :class => active_for_action('/panel/calendar/back_end/tags', 'index')if (is_manager? rescue nil) %>
<%#= content_tag :li, link_to(t('admin.module.authorization'),admin_module_app_manager_auth_proc_path(ModuleApp.first(conditions: {key: "gallery"}))), :class => active_for_app_auth('gallery') if (is_admin? rescue nil) %>
<% end -%>
<% end %>
@@ -1,13 +0,0 @@
<div class="modal hide fade" id="address-edit" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none; ">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="myModalLabel">Modal header</h3>
</div>
<div class="modal-body">
<p>One fine body…</p>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
<button class="btn btn-primary">Save changes</button>
</div>
</div>
@@ -0,0 +1,62 @@
<div class="modal hide fade address-edit <%= btn_class %>" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" id=<%= html_id%>>
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="myModalLabel"><%= (field_name rescue nil) || t("address_modal.default_title") %></h3>
</div>
<div class="modal-body">
<div class="tabbable">
<ul class="nav nav-tabs">
<% VALID_LOCALES.each do |locale|%>
<% active = (locale == I18n.locale.to_s ? ["active"] : [] ) %>
<%= content_tag :li,:class=>active.push("modal_tab","address_tab").join(' '),:for=>locale do%>
<%= link_to t("langs.#{locale}"),".#{btn_class}.address_modal.#{locale}",:data=>{:toggle=>"tab"}%>
<% end %>
<% end %>
</ul>
<div class="tab-content">
<% VALID_LOCALES.each do |locale|%>
<!-- start of lang tab context -->
<% active = (locale == I18n.locale.to_s ? "active" : "" ) %>
<div class="tab-pane <%= active %> fade in <%= "#{btn_class} address_modal #{locale}" %>" for="<%= locale %>">
<div class="control-group">
<label class="control-label" for="street_address"><%= t("address_modal.street_address") %></label>
<div class="controls">
<%= text_area_tag("#{field_name_basic}[temp][address_ext][#{locale}][street_address]",nil,:rows=>3,:func=>'street_address') %>
</div>
</div>
<div class="control-group">
<label class="control-label" for="city"><%= t("address_modal.city") %></label>
<div class="controls">
<%= text_field_tag("#{field_name_basic}[temp][address_ext][#{locale}][city]",'',:func=>'city') %>
</div>
</div>
<div class="control-group">
<label class="control-label" for="counties"><%= t("address_modal.county") %></label>
<div class="controls">
<%= text_field_tag("#{field_name_basic}[temp][address_ext][#{locale}][county]",'',:func=>'county') %>
</div>
</div>
<div class="control-group">
<label class="control-label" for="zip"><%= t("address_modal.zip") %></label>
<div class="controls">
<%= text_field_tag("#{field_name_basic}[temp][address_ext][#{locale}][zip]",nil,:class=>"input-mini",:func=>'zip') %>
</div>
</div>
<div class="control-group">
<label class="control-label" for="country"><%= t("address_modal.country") %></label>
<div class="controls">
<%= text_field_tag("#{field_name_basic}[temp][address_ext][#{locale}][country]",'',:func=>'country') %>
</div>
</div>
</div>
<!-- end of tab context -->
<% end %>
</div>
</div>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true"><%=t("modal.close")%></button>
<button href="" class="btn btn-primary bt-save" data-dismiss="modal" aria-hidden="true"><%=t("modal.save_and_close")%></button>
</div>
</div>