Merge branch 'design_team' into ldap
Conflicts: config/locales/zh_tw.yml vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletin_categorys_controller.rb
This commit is contained in:
commit
2b9190a49e
101 files changed
+1269
-689
No files matched your search
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 3.0 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 18 KiB |
@@ -1,6 +1,5 @@
|
||||
var viewportwidth,
|
||||
viewportheight;
|
||||
console.log($(window).height())
|
||||
function resize() {
|
||||
viewportheight=$(window).height();
|
||||
viewportwidth=$(window).width();
|
||||
@@ -15,9 +14,9 @@ $(document).ready(function(){
|
||||
placement: "left"
|
||||
});
|
||||
|
||||
|
||||
$(document).on('click', '.privacy', function() {
|
||||
|
||||
console.log($(this).val());
|
||||
switch ($(this).val()) {
|
||||
case 'true':
|
||||
$(this).parents('.controls').children('.select-role').slideUp(300);
|
||||
@@ -53,15 +52,12 @@ $(document).ready(function(){
|
||||
$orbitBar = $('#orbit-bar').height(),
|
||||
$mainSidebar = $('#main-sidebar').width()+5,
|
||||
$formActionPadding = parseInt($('.form-fixed').css("padding-left"))+parseInt($('.form-fixed').css("padding-right"));
|
||||
console.log($orbitBar);
|
||||
console.log("ready"+$(window).height());
|
||||
$('#main-sidebar').css("height", viewportheight-$orbitBar);
|
||||
$('#main-sidebar .viewport').css("height", viewportheight-$orbitBar);
|
||||
$('#post-body').css("width", viewportwidth-$mainWrapMarginLeft-$subWiget);
|
||||
$('.post-title').css("width", viewportwidth-$mainWrapMarginLeft-$subWiget-16);
|
||||
$('#main-wrap .subnav').css("width", viewportwidth-$mainWrapMarginLeft);
|
||||
$('.form-fixed').css("width", viewportwidth-$mainWrapMarginLeft-$formActionPadding);
|
||||
$('#bulletin_pagination').css("width", viewportwidth-$mainSidebar);
|
||||
$('#main-sidebar').tinyscrollbar({size:(viewportheight-$orbitBar-4)});
|
||||
$('.detal-list').tinyscrollbar();
|
||||
mainTablePosition();
|
||||
@@ -82,14 +78,12 @@ $(window).resize(function(){
|
||||
$orbitBar = $('#orbit-bar').height(),
|
||||
$mainSidebar = $('#main-sidebar').width()+5,
|
||||
$formActionPadding = parseInt($('.form-fixed').css("padding-left"))+parseInt($('.form-fixed').css("padding-right"));
|
||||
console.log(viewportheight);
|
||||
$('#main-sidebar').css("height", viewportheight-$orbitBar);
|
||||
$('#main-sidebar .viewport').css("height", viewportheight-$orbitBar);
|
||||
$('#post-body').css("width", viewportwidth-$mainWrapMarginLeft-$subWiget);
|
||||
$('.post-title').css("width", viewportwidth-$mainWrapMarginLeft-$subWiget-16);
|
||||
$('#main-wrap .subnav').css("width", viewportwidth-$mainWrapMarginLeft);
|
||||
$('.form-fixed').css("width", viewportwidth-$mainWrapMarginLeft-$formActionPadding);
|
||||
$('#bulletin_pagination').css("width", viewportwidth-$mainSidebar);
|
||||
$('#main-sidebar').tinyscrollbar({size:(viewportheight-$orbitBar-4)});
|
||||
mainTablePosition();
|
||||
});
|
||||
@@ -118,5 +112,4 @@ $(window).scroll(function () {
|
||||
$(".table-label").css({left:$winLeft*-1} );
|
||||
//$(".table-label").css({left:$mainWrapMarginLeft+($winLeft*-1)} );
|
||||
//$("#main-wrap > .subnav").css({width:$subnavWidth+($winLeft)} );
|
||||
//console.log($mainWrapMarginLeft+($winLeft*-1)+5);
|
||||
});
|
||||
@@ -1,3 +1,9 @@
|
||||
|
||||
$(document).ready(function(){
|
||||
$('.search').tooltip({
|
||||
placement: "bottom"
|
||||
});
|
||||
});
|
||||
$(document).on('click', '.orbit-bar-search', function (){
|
||||
if ($(this).parents('.search').hasClass('visible')){
|
||||
$(this).parents('.search').stop().animate({
|
||||
|
||||
@@ -4,4 +4,4 @@ $(document).ready(function() {
|
||||
$('body').prepend($(this).html());
|
||||
$(this).remove();
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -2701,8 +2701,11 @@ button.btn.small, input[type="submit"].btn.small {
|
||||
.pagination .current{
|
||||
border-left-width: 1px;
|
||||
}
|
||||
.pagination a {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
.pagination a:hover, .pagination .active a {
|
||||
background-color: #f5f5f5;
|
||||
background-color: #e8e8e8;
|
||||
}
|
||||
.pagination .active a {
|
||||
color: #999999;
|
||||
|
||||
@@ -10,22 +10,25 @@
|
||||
}
|
||||
.checkbox{
|
||||
padding: 5px;
|
||||
margin: 5px 5px 10px;
|
||||
margin: 0;
|
||||
display: inline-block;
|
||||
color:#777777;
|
||||
text-shadow: 0 1px 0px rgba(255,255,255,.4);
|
||||
border-radius: 3px;
|
||||
-moz-border-radius: 3px;
|
||||
-webkit-border-radius: 3px;
|
||||
height: 30px;
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #ededed), color-stop(1, #dfdfdf) );
|
||||
border-style: solid;
|
||||
border-width: 0px 1px 1px 0;
|
||||
border-color: #dfdfdf;
|
||||
/*background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #ededed), color-stop(1, #dfdfdf) );
|
||||
background:-moz-linear-gradient( center top, #ededed 5%, #dfdfdf 100% );
|
||||
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ededed', endColorstr='#dfdfdf');
|
||||
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
|
||||
-moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
|
||||
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
|
||||
border-radius: 3px;
|
||||
-moz-border-radius: 3px;
|
||||
-webkit-border-radius: 3px;*/
|
||||
}
|
||||
.checkbox .check-icon {
|
||||
display: none;
|
||||
@@ -40,7 +43,7 @@
|
||||
cursor: pointer;
|
||||
font-family: helvetica;
|
||||
font-size: 12px;
|
||||
line-height: 30px;
|
||||
line-height: 15px;
|
||||
padding: 0 10px 0 40px;
|
||||
color: #333333;
|
||||
display: inline-block;
|
||||
|
||||
@@ -70,9 +70,8 @@
|
||||
}
|
||||
.main-list .label-td:hover {
|
||||
height: auto;
|
||||
text-align: center;
|
||||
padding: 5px 5px 8px;
|
||||
left: -6px;
|
||||
left: -40px;
|
||||
top: -6px;
|
||||
border: 1px solid rgba(0, 0, 0, 0.2);
|
||||
box-shadow: 0px 5px 10px rgba(0,0,0,0.2);
|
||||
@@ -82,6 +81,7 @@
|
||||
-webkit-border-radius: 3px;
|
||||
-moz-border-radius: 3px;
|
||||
z-index: 5;
|
||||
width: 200px;
|
||||
}
|
||||
.qe-edit-div .table-condensed {
|
||||
background-color: #F2F2F2;
|
||||
@@ -188,10 +188,16 @@ legend {
|
||||
}
|
||||
.form-fixed {
|
||||
position: fixed;
|
||||
margin-bottom: 0;
|
||||
margin: 0;
|
||||
padding: 10px;
|
||||
bottom: 0;
|
||||
z-index: 10;
|
||||
z-index: 2;
|
||||
}
|
||||
.form-fixed .btn {
|
||||
margin-top: 4px;
|
||||
}
|
||||
.paginationFixed {
|
||||
margin-bottom: 25px;
|
||||
}
|
||||
.paginationFixed .pagination {
|
||||
margin-top: 0 !important;
|
||||
}
|
||||
@@ -10,7 +10,7 @@
|
||||
}
|
||||
.login-logo {
|
||||
text-indent: -9999px;
|
||||
background: url(<%= asset_path 'sign-in-logo.png' %>) no-repeat center 40px;
|
||||
background: url(<%= asset_path 'sign-in-logo.png' %>) no-repeat center 80px;
|
||||
padding-top: 40px;
|
||||
height: 160px;
|
||||
}
|
||||
@@ -61,8 +61,8 @@
|
||||
margin-right: -20px;
|
||||
}
|
||||
#orbit-bar .search-query {
|
||||
padding: 4px 9px;
|
||||
height: 12px;
|
||||
padding: 7px 9px 5px;
|
||||
height: 10px;
|
||||
margin-top: 3px;
|
||||
border: 1px solid #333333;
|
||||
font-size: 11px;
|
||||
@@ -119,7 +119,8 @@
|
||||
background-position: -10px -10px;
|
||||
}
|
||||
#orbit-bar .nav > li > a.orbit-bar-desktop {
|
||||
background-position: -106px -9px;
|
||||
background-position: -73px -42px;
|
||||
width: 48px;
|
||||
}
|
||||
#orbit-bar .nav > li > a.orbit-bar-member {
|
||||
background-position: -4px -37px;
|
||||
@@ -635,6 +636,22 @@
|
||||
.adbanner-action {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.textarea-height-s {
|
||||
resize: none;
|
||||
max-height: 150px;
|
||||
}
|
||||
.textarea-height-m {
|
||||
resize: none;
|
||||
max-height: 250px;
|
||||
}
|
||||
.textarea-height-l {
|
||||
resize: none;
|
||||
max-height: 350px;
|
||||
}
|
||||
.textarea-height-xl {
|
||||
resize: none;
|
||||
max-height: 500px;
|
||||
}
|
||||
[class^="icons-"] {
|
||||
display: inline-block;
|
||||
width: 16px;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
class Admin::AdBannersController < ApplicationController
|
||||
class Admin::AdBannersController < OrbitBackendController
|
||||
layout "new_admin"
|
||||
before_filter :authenticate_user!
|
||||
before_filter :is_admin?
|
||||
before_filter :for_app_manager
|
||||
|
||||
def destroy
|
||||
@ad_banner = AdBanner.find(params[:id])
|
||||
|
||||
@@ -2,7 +2,7 @@ class Admin::DashboardsController < ApplicationController
|
||||
|
||||
layout "new_admin"
|
||||
before_filter :authenticate_user!
|
||||
before_filter :is_admin?
|
||||
# before_filter :is_admin?
|
||||
|
||||
def index
|
||||
end
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
class Admin::DesignsController < ApplicationController
|
||||
class Admin::DesignsController < OrbitBackendController
|
||||
require "net/http"
|
||||
require "uri"
|
||||
require 'zip/zip'
|
||||
|
||||
layout "new_admin"
|
||||
before_filter :authenticate_user!
|
||||
before_filter :is_admin?
|
||||
before_filter :is_admin?
|
||||
before_filter :for_admin_only
|
||||
|
||||
def upload_package
|
||||
if !params[:design].nil?
|
||||
@@ -24,7 +25,7 @@ class Admin::DesignsController < ApplicationController
|
||||
end
|
||||
|
||||
def index
|
||||
@designs = Design.all.entries
|
||||
@designs = params[:sort] ? get_sorted_and_filtered("designs") : Design.all
|
||||
end
|
||||
|
||||
def new
|
||||
@@ -83,6 +84,13 @@ class Admin::DesignsController < ApplicationController
|
||||
render :action => 'new'
|
||||
end
|
||||
end
|
||||
|
||||
def delete
|
||||
if params[:to_delete]
|
||||
designs = Design.any_in(:_id => params[:to_delete]).delete_all
|
||||
end
|
||||
redirect_to admin_designs_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options])
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
|
||||
@@ -1,16 +1,48 @@
|
||||
class Admin::SitesController < ApplicationController
|
||||
|
||||
layout "admin"
|
||||
layout "new_admin"
|
||||
before_filter :authenticate_user!
|
||||
before_filter :is_admin?
|
||||
before_filter :get_site
|
||||
|
||||
def index
|
||||
@site = Site.first
|
||||
redirect_to :action => :new unless @site
|
||||
# def index
|
||||
# @site = Site.first
|
||||
# # redirect_to :action => :new unless @site
|
||||
# end
|
||||
|
||||
# def new
|
||||
# @site = Site.new
|
||||
# end
|
||||
|
||||
def update
|
||||
@site.update_attributes(params[:site])
|
||||
redirect_to :back
|
||||
end
|
||||
|
||||
def new
|
||||
@site = Site.new
|
||||
|
||||
def site_info
|
||||
|
||||
end
|
||||
|
||||
def system_info
|
||||
|
||||
end
|
||||
|
||||
def language
|
||||
|
||||
end
|
||||
|
||||
def mail_setting
|
||||
|
||||
end
|
||||
|
||||
def ui_theme
|
||||
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def get_site
|
||||
@site ||= Site.first
|
||||
end
|
||||
|
||||
end
|
||||
@@ -39,15 +39,65 @@ class ApplicationController < ActionController::Base
|
||||
@parent_item = Item.first(:conditions => { :id => BSON::ObjectId(params[:parent_id]) }) rescue nil
|
||||
end
|
||||
|
||||
def auth_failed_in_backend
|
||||
#redirect_to admin_dashboards_url
|
||||
redirect_to root_path
|
||||
end
|
||||
|
||||
# Check if the current_user is admin
|
||||
def is_admin?
|
||||
redirect_to root_url unless current_user.admin?
|
||||
current_user.admin? ? true : auth_failed_in_backend
|
||||
end
|
||||
|
||||
def is_manager?
|
||||
@module_app.managing_users.include?(current_user) || is_admin?
|
||||
end
|
||||
|
||||
def for_admin_only
|
||||
if is_admin?
|
||||
true
|
||||
else
|
||||
flash[:error] = t("admin.access.denied.not_admin")
|
||||
auth_failed_in_backend
|
||||
end
|
||||
end
|
||||
|
||||
def for_app_manager
|
||||
if is_manager?
|
||||
true
|
||||
else
|
||||
flash[:error] = t("admin.access.denied.app.not_manager")
|
||||
auth_failed_in_backend
|
||||
end
|
||||
end
|
||||
|
||||
def for_app_sub_manager
|
||||
if (@module_app.sub_managing_users.include?(current_user) || is_manager?)
|
||||
true
|
||||
else
|
||||
flash[:error] = t("admin.access.denied.app.not_sub_manager")
|
||||
auth_failed_in_backend
|
||||
end
|
||||
end
|
||||
|
||||
def for_app_user
|
||||
if (@module_app.app_auth.auth_users.include?(current_user) || for_app_sub_manager )
|
||||
true
|
||||
else
|
||||
flash[:error] = t("admin.access.denied.app.not_authed_user")
|
||||
auth_failed_in_backend
|
||||
end
|
||||
end
|
||||
|
||||
def check_object_premission(obj,title)
|
||||
flash[:error] = t("admin.access.denied.object")
|
||||
auth_failed_in_backend unless (obj.get_object_auth_by_title(title).auth_users.include?(current_user) || is_manager? || is_admin? )
|
||||
end
|
||||
|
||||
# Render the page
|
||||
def render_page(id = nil)
|
||||
def render_page(param={})
|
||||
if @item
|
||||
render :text => process_page(@item, id), :layout => 'page_layout'
|
||||
render :text => process_page(@item, param[:id], param), :layout => 'page_layout'
|
||||
else
|
||||
render :text => '404 Not Found'
|
||||
end
|
||||
@@ -78,8 +128,8 @@ class ApplicationController < ActionController::Base
|
||||
# set site if exist or create site
|
||||
@site = Site.first || Site.create({:valid_locales => [], :in_use_locales => []})
|
||||
session[:site] = @site.id
|
||||
@site_in_use_locales = @site.in_use_locales
|
||||
@site_valid_locales = @site.valid_locales
|
||||
@site_in_use_locales = site_locales_default_head(@site.in_use_locales)
|
||||
@site_valid_locales = site_locales_default_head(@site.valid_locales)
|
||||
end
|
||||
|
||||
def set_current_item
|
||||
@@ -114,4 +164,14 @@ class ApplicationController < ActionController::Base
|
||||
end
|
||||
end
|
||||
|
||||
def site_locales_default_head(locales)
|
||||
if locales[0].eql? I18n.locale.to_s
|
||||
locales
|
||||
else
|
||||
a = Array.new(locales)
|
||||
shift_out = a.delete(I18n.locale.to_s)
|
||||
[shift_out] + a
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
@@ -27,9 +27,13 @@ class OrbitBackendController< ApplicationController
|
||||
end
|
||||
end
|
||||
|
||||
def get_sorted_and_filtered(object_class)
|
||||
def get_sorted_and_filtered(object_class, query=nil)
|
||||
object_class = object_class.classify.constantize
|
||||
objects = object_class.all
|
||||
if query
|
||||
objects = object_class.all.where(query)
|
||||
else
|
||||
objects = object_class.all
|
||||
end
|
||||
|
||||
if !params[:sort].blank?
|
||||
options = params[:sort_options]
|
||||
@@ -62,30 +66,23 @@ class OrbitBackendController< ApplicationController
|
||||
case key
|
||||
when 'status'
|
||||
a = Array.new
|
||||
objects.each do |bulletin|
|
||||
objects.each do |object|
|
||||
value.each do |v|
|
||||
case v
|
||||
when 'pending'
|
||||
a << bulletin if bulletin.is_checked.nil?
|
||||
when 'rejected'
|
||||
a << bulletin if bulletin.is_checked.eql?(false)
|
||||
else
|
||||
a << bulletin if bulletin[v]
|
||||
end
|
||||
a << object if object[v]
|
||||
end
|
||||
end
|
||||
objects = a.uniq
|
||||
when 'categories'
|
||||
a = Array.new
|
||||
objects.each do |bulletin|
|
||||
a << bulletin if value.include?(bulletin.bulletin_category.id.to_s)
|
||||
objects.each do |object|
|
||||
a << object if value.include?(object.send("#{object.class.to_s.underscore}_category").id.to_s)
|
||||
end
|
||||
objects = a.uniq
|
||||
when 'tags'
|
||||
a = Array.new
|
||||
objects.each do |bulletin|
|
||||
bulletin.tags.each do |tag|
|
||||
a << bulletin if value.include?(tag.id.to_s)
|
||||
objects.each do |object|
|
||||
object.tags.each do |tag|
|
||||
a << object if value.include?(tag.id.to_s)
|
||||
end
|
||||
end
|
||||
objects = a.uniq
|
||||
@@ -150,7 +147,7 @@ class OrbitBackendController< ApplicationController
|
||||
|
||||
def get_with_nil(objects, option, sorted_objects)
|
||||
tmp = Array.new
|
||||
objects.each { |object| tmp << [get_string_value_from_object(object), object] if (object.send(option).count == 0) }
|
||||
objects.each { |object| tmp << [get_string_value_from_object(object), object] if (object.send(option).blank? || (object.send(option).size == 0 rescue nil)) }
|
||||
sorted = params[:direction].eql?('asc') ? tmp.sort : tmp.sort.reverse!
|
||||
sorted_tmp = sorted.collect {|a| a[1] }
|
||||
a = params[:direction].eql?('asc') ? (sorted_tmp + sorted_objects) : (sorted_objects + sorted_tmp)
|
||||
|
||||
@@ -16,10 +16,10 @@ class PagesController < ApplicationController
|
||||
def show
|
||||
#begin
|
||||
@item = Item.first(:conditions => {:full_name => params[:page_name]})
|
||||
if @item && @item.is_published
|
||||
if @item && @item.is_published && (@item.enabled_for.nil? ? true : @item.enabled_for.include?(I18n.locale.to_s))
|
||||
case @item._type
|
||||
when 'Page'
|
||||
render_page(params[:id])
|
||||
render_page(params)
|
||||
when 'Link'
|
||||
redirect_to "http://#{@item[:url]}"
|
||||
end
|
||||
@@ -40,7 +40,9 @@ class PagesController < ApplicationController
|
||||
end
|
||||
|
||||
def show_from_link
|
||||
redirect_to "/#{@item.full_name}?id=#{params[:id]}"
|
||||
# debugger
|
||||
# a=1
|
||||
redirect_to "/#{@item.full_name}?id=#{params[:id]}&preview=#{params[:preview]}"
|
||||
end
|
||||
|
||||
def load_orbit_bar
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
module Admin::AdImagesHelper
|
||||
|
||||
def active_when_default_locale_eq locale
|
||||
locale.to_sym == I18n.default_locale ? 'active': ''
|
||||
end
|
||||
|
||||
end
|
||||
@@ -28,12 +28,15 @@ module Admin::ItemHelper
|
||||
end
|
||||
|
||||
def render_children(parent)
|
||||
if children = parent.children
|
||||
children = parent.ordered_children
|
||||
if !children.entries.blank?
|
||||
ret = ''
|
||||
children.each do |child|
|
||||
ret << render_node_and_children(child)
|
||||
end
|
||||
ret
|
||||
else
|
||||
''
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -2,12 +2,6 @@ module ApplicationHelper
|
||||
|
||||
FLASH_NOTICE_KEYS = [:error, :notice, :warning]
|
||||
|
||||
def site_valid_locales_default_head
|
||||
index = @site_valid_locales.rindex I18n.default_locale.to_s
|
||||
shift_out = @site_valid_locales.shift(index)
|
||||
@site_valid_locales += shift_out
|
||||
end
|
||||
|
||||
def colorize_in_use_locale(locale)
|
||||
@site_in_use_locales.include?(locale)? 'green' : 'red'
|
||||
end
|
||||
@@ -74,6 +68,15 @@ module ApplicationHelper
|
||||
end
|
||||
end
|
||||
|
||||
def active_sys_call_for_app(controller_name,action_name,app_title)
|
||||
unless active_for_action(controller_name,action_name).nil?
|
||||
app = ModuleApp.find params[:id]
|
||||
app.title == app_title ? 'active' : nil
|
||||
else
|
||||
nil
|
||||
end
|
||||
end
|
||||
|
||||
def active_for_controllers(*controller_names)
|
||||
(controller_names.include?(controller.controller_name) || controller_names.include?(request.fullpath)) ? 'active' : nil
|
||||
end
|
||||
@@ -87,21 +90,38 @@ module ApplicationHelper
|
||||
((controller.controller_name.eql?(controller_name) || request.fullpath.eql?(controller_name)) && controller.action_name.eql?(action_name)) ? 'active' : nil
|
||||
end
|
||||
|
||||
def process_page(page, id)
|
||||
parse_page_noko(page, id)
|
||||
def process_page(page, id, params)
|
||||
parse_page_noko(page, id, params)
|
||||
end
|
||||
|
||||
def page_metas(page)
|
||||
tmp_meta = {}
|
||||
metas = ''
|
||||
@site.page_metas.each do |meta|
|
||||
@site.site_metas.each do |meta|
|
||||
name, content = meta.get_name_content
|
||||
metas << "<meta name=#{name} content=#{content} />\n"
|
||||
tmp_meta.merge!(name => content)
|
||||
end rescue nil
|
||||
return metas
|
||||
page.page_metas.each do |meta|
|
||||
name, content = meta.get_name_content
|
||||
tmp_meta.merge!(name => content)
|
||||
end rescue nil
|
||||
tmp_meta.each_pair{|name, content|
|
||||
metas << "<meta name='#{name}' content='#{content}' />\n"
|
||||
} if !tmp_meta.blank?
|
||||
metas
|
||||
end
|
||||
|
||||
def page_title(page)
|
||||
"<title>#{page.title ? page.title[I18n.locale] : page.i18n_variable[I18n.locale]}</title>\n"
|
||||
res = "<title>"
|
||||
page_title = page.title ? page.title[I18n.locale] : page.i18n_variable[I18n.locale]
|
||||
if page.is_home? && @site.title
|
||||
res << @site.title[I18n.locale]
|
||||
elsif @site.title && @site.title_always_on
|
||||
res << @site.title[I18n.locale] + ' - ' + page_title
|
||||
else
|
||||
res << page_title
|
||||
end
|
||||
res << "</title>\n"
|
||||
end
|
||||
|
||||
def page_stylesheets(page, edit=nil)
|
||||
@@ -112,6 +132,7 @@ module ApplicationHelper
|
||||
stylesheets << "<link href='/assets/style.css' rel='stylesheet' type='text/css' />\n"
|
||||
end
|
||||
stylesheets << "<link href='#{page.design.reset_css.file.url}' rel='stylesheet' type='text/css' />\n" if page.design.reset_css
|
||||
# stylesheets << "<link href='/assets/menu.css' rel='stylesheet' type='text/css' />\n"
|
||||
stylesheets << "<link href='#{page.design.default_css.file.url}' rel='stylesheet' type='text/css' />\n" if page.design.default_css
|
||||
theme = page.design.themes.detect{ |d| d.id == page.theme_id }
|
||||
stylesheets << "<link href='#{theme.file.url}' rel='stylesheet' type='text/css' />\n" if theme
|
||||
@@ -126,8 +147,8 @@ module ApplicationHelper
|
||||
javascripts << "<script type='text/javascript' src='/assets/jquery.tinyscrollbar.min.js'></script>\n"
|
||||
javascripts << "<script type='text/javascript' src='/assets/jquery.isotope.min.js'></script>\n"
|
||||
javascripts << "<script type='text/javascript' src='/assets/orbit-bar-member.js'></script>\n"
|
||||
javascripts << "<script type='text/javascript' src='/assets/orbit-bar-search.js'></script>\n"
|
||||
javascripts << "<script type='text/javascript' src='/assets/orbit_bar.js'></script>\n"
|
||||
javascripts << "<script type='text/javascript' src='/assets/orbit-bar-search.js'></script>\n"
|
||||
end
|
||||
javascripts << "<script type='text/javascript' src='/static/jquery.cycle.all.latest.js'></script>\n"
|
||||
javascripts << "<script type='text/javascript' src='/static/kernel.js'></script>\n"
|
||||
@@ -138,4 +159,8 @@ module ApplicationHelper
|
||||
javascripts
|
||||
end
|
||||
|
||||
def active_when_current_locale_eq(locale)
|
||||
locale.to_sym == I18n.locale ? 'active in': ''
|
||||
end
|
||||
|
||||
end
|
||||
@@ -25,9 +25,9 @@ module OrbitBackendHelper
|
||||
content_tag :thead do
|
||||
content_tag :tr, :class => "sort-header" do
|
||||
concat (content_tag :th, :class => "span1 strong" do
|
||||
concat check_box_tag :check_all
|
||||
concat link_to content_tag(:i, nil, :class => "icon-trash"), '#', :class => "list-remove"
|
||||
end) if delete_all
|
||||
concat check_box_tag :check_all
|
||||
concat link_to content_tag(:i, nil, :class => "icon-trash"), '#', :class => "list-remove"
|
||||
end) if (delete_all && (is_admin? || (is_manager? rescue nil)))
|
||||
titles.each do |title|
|
||||
concat render_title(title[0], title[1], title[2], title[3])
|
||||
end
|
||||
|
||||
@@ -3,10 +3,10 @@ class Design
|
||||
include Mongoid::Timestamps
|
||||
include ParserLayout
|
||||
|
||||
field :title
|
||||
field :author
|
||||
field :intro
|
||||
field :version
|
||||
field :title, :type => String
|
||||
field :author, :type => String
|
||||
field :intro, :type => String
|
||||
field :version, :type => String
|
||||
|
||||
has_many :pages
|
||||
|
||||
|
||||
@@ -7,6 +7,8 @@ class Item
|
||||
field :full_name, :index => true
|
||||
field :position, :type => Integer
|
||||
field :is_published, :type => Boolean, :default => false, :index => true
|
||||
field :enabled_for, :type => Array, :default => nil
|
||||
field :menu_enabled_for, :type => Array, :default => nil
|
||||
|
||||
validates_format_of :name, :with => /^[0-9a-zA-Z\-_]+$/
|
||||
validates :name, :exclusion => { :in => LIST[:forbidden_item_names] }
|
||||
@@ -35,6 +37,21 @@ class Item
|
||||
urls = ancestors.map{ |a| a.name } << self.name
|
||||
urls.join("/")
|
||||
end
|
||||
|
||||
def ordered_children
|
||||
self.children.asc(:position)
|
||||
end
|
||||
|
||||
def ordered_and_visible_children
|
||||
objects = ordered_children
|
||||
a = []
|
||||
if objects
|
||||
objects.each do |object|
|
||||
a << object if object.menu_enabled_for.nil? ? true : object.menu_enabled_for.include?(I18n.locale.to_s)
|
||||
end
|
||||
end
|
||||
a
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
class Meta
|
||||
|
||||
include Mongoid::Document
|
||||
include Mongoid::Timestamps
|
||||
|
||||
field :key
|
||||
field :value, :default => nil
|
||||
|
||||
has_one :i18n_variable, :as => :language_value, :autosave => true, :dependent => :destroy
|
||||
|
||||
def get_name_content
|
||||
[self.key, self.value ? self.value : self.i18n_variable[I18n.locale]]
|
||||
end
|
||||
|
||||
end
|
||||
@@ -7,5 +7,13 @@ class Meta
|
||||
field :value, :default => nil
|
||||
|
||||
has_one :i18n_variable, :as => :language_value, :autosave => true, :dependent => :destroy
|
||||
|
||||
def get_name_content
|
||||
[self.key, get_content]
|
||||
end
|
||||
|
||||
def get_content
|
||||
self.value ? self.value : self.i18n_variable[I18n.locale]
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,5 +1,7 @@
|
||||
class Site
|
||||
|
||||
METAS = ['description', 'keywords']
|
||||
|
||||
include Mongoid::Document
|
||||
include Mongoid::Timestamps
|
||||
|
||||
@@ -9,12 +11,17 @@ class Site
|
||||
field :roaming_id
|
||||
field :private_key, :type => Binary
|
||||
field :public_key, :type => Binary
|
||||
field :title_always_on, :type => Boolean, :default => false
|
||||
|
||||
field :school
|
||||
field :department
|
||||
|
||||
has_one :title, :class_name => "I18nVariable", :as => :language_value, :autosave => true, :dependent => :destroy
|
||||
has_one :footer, :class_name => "I18nVariable", :as => :language_value, :autosave => true, :dependent => :destroy
|
||||
has_many :site_metas, :autosave => true, :dependent => :destroy
|
||||
|
||||
before_save :set_key
|
||||
|
||||
def generate_keys
|
||||
private_key = OpenSSL::PKey::RSA.generate(2048)
|
||||
self.public_key = private_key.public_key.to_s
|
||||
@@ -30,5 +37,35 @@ class Site
|
||||
res = res.split('rails_3_1').pop.gsub('(', '').gsub(')','').strip rescue nil
|
||||
res.eql?('local out of date') ? false : true
|
||||
end
|
||||
|
||||
def title
|
||||
@title ||= I18nVariable.first(:conditions => {:key => 'title', :language_value_id => self.id, :language_value_type => self.class}) rescue nil
|
||||
end
|
||||
|
||||
def footer
|
||||
@footer ||= I18nVariable.first(:conditions => {:key => 'footer', :language_value_id => self.id, :language_value_type => self.class}) rescue nil
|
||||
end
|
||||
|
||||
METAS.each do |meta|
|
||||
define_method meta do
|
||||
fetch_meta = self.site_metas.where(key: meta).limit(1)
|
||||
fetch_meta.blank? ? nil : fetch_meta[0].i18n_variable
|
||||
end
|
||||
define_method "#{meta}=" do |values|
|
||||
if a = self.send(meta)
|
||||
a.update_attributes(values)
|
||||
else
|
||||
a = self.site_metas.build(key: meta)
|
||||
a.build_i18n_variable(values)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def set_key
|
||||
title.key = 'title' if title && (title.key.blank? rescue true)
|
||||
footer.key = 'footer' if footer && (footer.key.blank? rescue true)
|
||||
end
|
||||
|
||||
end
|
||||
@@ -15,7 +15,7 @@
|
||||
<div class="adbanner-list">
|
||||
<div class="adbanner-action">
|
||||
<%= link_to t("admin.ad.new_image"),new_admin_ad_banner_ad_image_path(ad_banner_tab) ,:class => "btn btn-primary"%>
|
||||
<%= link_to t("modal.preview"), admin_realtime_preview_ad_banner_path(ad_banner_tab.title) , :class=>'preview_trigger btn btn-success'%>
|
||||
<%= link_to t("modal.preview"), admin_realtime_preview_ad_banner_path(ad_banner_tab.id) , :class=>'preview_trigger btn btn-success'%>
|
||||
</div>
|
||||
<ul class="clear">
|
||||
<%= render :partial => "ad_image_update", :collection => ad_banner_tab.ad_images,:as => :ad_image,:locals=>{:ad_banner => ad_banner_tab} %>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<% content_for :page_specific_css do -%>
|
||||
<%#= stylesheet_link_tag "admin/ad_banner_preview" %>
|
||||
<% end -%>
|
||||
<% content_for :page_specific_css do -%>
|
||||
<% content_for :page_specific_javascript do -%>
|
||||
<%= javascript_include_tag "/static/jquery.cycle.all.latest.js" %>
|
||||
<%= javascript_include_tag "inc/modal-preview" %>
|
||||
<% end -%>
|
||||
|
||||
@@ -130,14 +130,14 @@
|
||||
<div id="post-body">
|
||||
<div id="post-body-content" class="clear">
|
||||
<ul class="nav nav-tabs">
|
||||
<% site_valid_locales_default_head.each do |locale|%>
|
||||
<%= content_tag :li,link_to(I18nVariable.from_locale(locale),"##{locale}",:data=>{:toggle => "tab"}),:class=> (active_when_default_locale_eq locale) %>
|
||||
<% @site_valid_locales.each do |locale|%>
|
||||
<%= content_tag :li,link_to(I18nVariable.from_locale(locale),"##{locale}",:data=>{:toggle => "tab"}),:class=> (active_when_current_locale_eq locale) %>
|
||||
<% end %>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<%= select_tag 'ad_banner[id]',options_from_collection_for_select(AdBanner.all, "id", "title",params[:ad_banner_id]) , :class=>"input-medium", %>
|
||||
<% site_valid_locales_default_head.each do |locale|%>
|
||||
<%= content_tag :div,:class => "tab-pane #{active_when_default_locale_eq locale}",:id=>"#{locale}" do%>
|
||||
<% @site_valid_locales.each do |locale|%>
|
||||
<%= content_tag :div,:class => "tab-pane #{active_when_current_locale_eq locale}",:id=>"#{locale}" do%>
|
||||
<div class="title">
|
||||
<%= f.fields_for :title,@ad_image.title do |f| %>
|
||||
<%= f.text_field locale,:class=>"ad_image-title post-title",:placeholder => "輸入標題"%>
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
<tr class="with_action">
|
||||
<td><%= check_box_tag 'to_delete[]', design.id, false, :class => "checkbox_in_list" %></td>
|
||||
<td>
|
||||
<%= design.title %>
|
||||
<div class="quick-edit">
|
||||
<ul class="nav nav-pills hide">
|
||||
<li><%= link_to t(:edit), edit_admin_design_path(design), :class => 'edit' %></li>
|
||||
<li class="dropdown"><%= link_to t(:delete), admin_design_path(design), :confirm => t('sure?'), :method => :delete, :class => 'delete' %></li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
<td><%= design.author %></td>
|
||||
<td><%= design.intro %></td>
|
||||
</tr>
|
||||
@@ -0,0 +1,12 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="span1 strong"></th>
|
||||
<th class="span7"></th>
|
||||
<th class="span2"></th>
|
||||
<th class="span2"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tbody id="tbody_designs" class="sort-holder">
|
||||
<%= render :partial => 'design', :collection => @designs %>
|
||||
</tbody>
|
||||
@@ -0,0 +1,11 @@
|
||||
<div id='filter' class="subnav">
|
||||
<div class="filters">
|
||||
<div id="sort_headers" class="table-label">
|
||||
<%= render 'sort_headers' %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% content_for :page_specific_javascript do %>
|
||||
<%= javascript_include_tag "sort_header" %>
|
||||
<% end %>
|
||||
@@ -0,0 +1,3 @@
|
||||
<%= render_sort_bar(true, ['title', 'title','span7', 'admin.title'],
|
||||
['author', 'author', 'span2', 'admin.author'],
|
||||
['intro', 'intro', 'span2', 'admin.intro']).html_safe %>
|
||||
@@ -1,52 +1,10 @@
|
||||
<%= flash_messages %>
|
||||
<div id="filter" class="subnav">
|
||||
<div class="filters">
|
||||
<div id="sort_headers" class="table-label">
|
||||
<table class="table main-list">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="span1 strong">
|
||||
<input type="checkbox">
|
||||
<a href class="list-remove"><i class="icon-trash"></i></a>
|
||||
</th>
|
||||
<th class="span7"><%= t('admin.title') %></th>
|
||||
<th class="span2"><%= t('admin.author') %></th>
|
||||
<th class="span2"><%= t('admin.intro') %></th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<%= form_for :news_bulletins, :url => delete_admin_designs_path(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options]), :html => {:id => 'delete_all'}, :remote => true do %>
|
||||
<%= render 'filter' %>
|
||||
<table class="table main-list">
|
||||
<%= render 'designs' %>
|
||||
</table>
|
||||
<% end %>
|
||||
|
||||
<table class="table main-list">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="span1 strong"></th>
|
||||
<th class="span7"></th>
|
||||
<th class="span2"></th>
|
||||
<th class="span2"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @designs.each do |design| %>
|
||||
<tr class="with_action">
|
||||
<td><input type="checkbox"></td>
|
||||
<td>
|
||||
<%= design.title %>
|
||||
<div class="quick-edit">
|
||||
<ul class="nav nav-pills hide">
|
||||
<li><%= link_to t(:edit), edit_admin_design_path(design), :class => 'edit' %></li>
|
||||
<li class="dropdown"><%= link_to t(:delete), admin_design_path(design), :confirm => t('sure?'), :method => :delete, :class => 'delete' %></li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
<td><%= design.author %></td>
|
||||
<td><%= design.intro %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="form-actions form-fixed pagination-right">
|
||||
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('admin.add'), new_admin_design_path, :class => 'btn btn-primary' %>
|
||||
</div>
|
||||
@@ -0,0 +1,3 @@
|
||||
$("#delete_all").attr("action", "<%= delete_admin_designs_path(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options]) %>");
|
||||
$("#sort_headers").html("<%= j render 'sort_headers' %>");
|
||||
$("#tbody_designs").html("<%= j render :partial => 'design', :collection => @designs %>");
|
||||
@@ -17,17 +17,17 @@
|
||||
</dd>
|
||||
</dl>
|
||||
<dl id="sub_manager">
|
||||
<dt><%= t("admin.user_role.auth.sub_manager") %></ht>
|
||||
<% @module_app.sub_managers.each do |manager| %>
|
||||
<dd><%= manager.user.name %> <%= get_auth_by(manager) %><%= link_to '[X]',remove_sub_manager_admin_module_app_path(@module_app,manager),:method => :delete if if_permit_to_delete(:sub_manager) && manager.user != current_user %> </dd>
|
||||
<% end %>
|
||||
<dt><%#= t("admin.user_role.auth.sub_manager") %></ht>
|
||||
<%# @module_app.sub_managers.each do |manager| %>
|
||||
<dd><%#= manager.user.name %> <%#= get_auth_by(manager) %><%#= link_to '[X]',remove_sub_manager_admin_module_app_path(@module_app,manager),:method => :delete if if_permit_to_delete(:sub_manager) && manager.user != current_user %> </dd>
|
||||
<%# end %>
|
||||
<dd>
|
||||
<%= form_tag(assign_sub_manager_admin_module_app_path) do %>
|
||||
<%= collection_select(:sub_manager,:id, User.all, :id, :name, :prompt => true,:disabled => !if_permit_to_assign(:sub_manager))%>
|
||||
<%= submit_tag t("admin.user_role.auth.add_sub_manager") %>
|
||||
<% end %>
|
||||
<%#= form_tag(assign_sub_manager_admin_module_app_path) do %>
|
||||
<%#= collection_select(:sub_manager,:id, User.all, :id, :name, :prompt => true,:disabled => !if_permit_to_assign(:sub_manager))%>
|
||||
<%#= submit_tag t("admin.user_role.auth.add_sub_manager") %>
|
||||
<%# end %>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<%= render :partial => "admin/components/user_role_management", :locals => { :object => @module_app ,:auth=> @module_app.app_auth ,:submit_url=> admin_module_app_app_auths_path(@module_app),:ploy_route_ary=>['remove',:admin,@module_app,@module_app.app_auth] } %>
|
||||
<%#= render :partial => "admin/components/user_role_management", :locals => { :object => @module_app ,:auth=> @module_app.app_auth ,:submit_url=> admin_module_app_app_auths_path(@module_app),:ploy_route_ary=>['remove',:admin,@module_app,@module_app.app_auth] } %>
|
||||
|
||||
@@ -30,7 +30,23 @@
|
||||
<span id="app_page_category"><%= select('page','category', @categories.collect{|category| [category.i18n_variable[I18n.locale], category.id]}, :selected => @item[:category], :include_blank => true ) rescue ''%> </span>
|
||||
</p>
|
||||
<p>
|
||||
<%= f.label :is_published, "#{t('admin.is_published')} ?" %>
|
||||
<%= f.radio_button :is_published, true %>Yes <%= f.radio_button :is_published, false %> No
|
||||
<%= f.label :is_published, "#{t('admin.is_published')} ?" %>
|
||||
<%= f.radio_button :is_published, true %>Yes <%= f.radio_button :is_published, false %> No
|
||||
</p>
|
||||
<p>
|
||||
<%= f.label :menu_enabled_for, "#{t('admin.menu_enabled_for')}:" %>
|
||||
<% @site_valid_locales.each do |valid_locale| %>
|
||||
<%= check_box_tag 'page[menu_enabled_for][]', valid_locale, (@item.menu_enabled_for.nil? ? true : @item.menu_enabled_for.include?(valid_locale)) %>
|
||||
<%= I18nVariable.from_locale(valid_locale) %>
|
||||
<% end %>
|
||||
<%= hidden_field_tag 'page[menu_enabled_for][]', '' %>
|
||||
</p>
|
||||
<p>
|
||||
<%= f.label :enabled_for, "#{t('admin.enabled_for')}:" %>
|
||||
<% @site_valid_locales.each do |valid_locale| %>
|
||||
<%= check_box_tag 'page[enabled_for][]', valid_locale, (@item.enabled_for.nil? ? true : @item.enabled_for.include?(valid_locale)) %>
|
||||
<%= I18nVariable.from_locale(valid_locale) %>
|
||||
<% end %>
|
||||
<%= hidden_field_tag 'page[enabled_for][]', '' %>
|
||||
</p>
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
language.html.erb
|
||||
@@ -0,0 +1 @@
|
||||
mail_setting.html.erb
|
||||
@@ -0,0 +1,68 @@
|
||||
<div id="poststuff">
|
||||
<%= form_for @site, :url => admin_site_path(@site), :html => {:class => "clear"} do |f| %>
|
||||
<div id="post-body">
|
||||
<div id="post-body-content" class="clear">
|
||||
<ul class="nav nav-tabs">
|
||||
<% @site_valid_locales.each do |locale|%>
|
||||
<%#= raise @site_valid_locales.inspect %>
|
||||
<%= content_tag :li, link_to(I18nVariable.from_locale(locale), ".#{locale}", :data => {:toggle => "tab"}), :class => (active_when_current_locale_eq locale) %>
|
||||
<% end %>
|
||||
</ul>
|
||||
<div class="tab-content form-horizontal">
|
||||
<div class="control-group">
|
||||
<label class="control-label"><%= t 'admin.site_title' %></label>
|
||||
<div class="controls">
|
||||
<%= f.check_box :title_always_on %> <%= t 'admin.always_display_title' %>
|
||||
</div>
|
||||
</div>
|
||||
<% @site_valid_locales.each do |locale|%>
|
||||
<%= content_tag :div, :class => "tab-pane fade #{active_when_current_locale_eq locale} #{locale}" do %>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<%= f.fields_for :title, @site.title do |f| %>
|
||||
<%= f.text_field locale, :class => "input-xxlarge" %>
|
||||
<% end %>
|
||||
<p class="help-block">In addition to freeform text, any HTML5 text-based input appears like so.</p>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% @site_valid_locales.each do |locale|%>
|
||||
<%= content_tag :div, :class => "tab-pane fade #{active_when_current_locale_eq locale} #{locale}" do %>
|
||||
<div class="control-group">
|
||||
<label class="control-label"><%= t 'admin.keywords' %></label>
|
||||
<div class="controls">
|
||||
<%= f.fields_for :keywords, @site.keywords do |f| %>
|
||||
<%= f.text_area locale, :class => "input-xxlarge textarea-height-s" %>
|
||||
<% end %>
|
||||
<p class="help-block">In addition to freeform text, any HTML5 text-based input appears like so.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label"><%= t 'admin.site_description' %></label>
|
||||
<div class="controls">
|
||||
<%= f.fields_for :description, @site.description do |f| %>
|
||||
<%= f.text_area locale, :class => "input-xxlarge textarea-height-s" %>
|
||||
<% end %>
|
||||
<p class="help-block">In addition to freeform text, any HTML5 text-based input appears like so.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label"><%= t 'admin.site_footer' %></label>
|
||||
<div class="controls">
|
||||
<%= f.fields_for :footer, @site.footer do |f| %>
|
||||
<%= f.text_area locale, :class => "tinymce_textarea input-xxlarge" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<%= f.submit t("submit"), :class => "btn btn-primary" %>
|
||||
<%= f.submit t("cancel"), :class => "btn ", :type => 'reset' %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
@@ -0,0 +1 @@
|
||||
system_info.html.erb
|
||||
@@ -0,0 +1 @@
|
||||
ui_theme.html.erb
|
||||
@@ -10,23 +10,23 @@
|
||||
</fieldset>
|
||||
<% end %>
|
||||
|
||||
<% if @user_info_model_i18n_variables.size > 0 %>
|
||||
<% if @info_i18n_variables.size > 0 %>
|
||||
<fieldset>
|
||||
<legend>
|
||||
<%= t('admin.user_info') %>
|
||||
<%#= render :partial => 'action_bar' %>
|
||||
</legend>
|
||||
<div><%= render :partial => 'edit_user_attribute_model', :collection => @user_info_model_i18n_variables %></div>
|
||||
<div><%= render :partial => 'edit_user_attribute_model', :collection => @info_i18n_variables %></div>
|
||||
</fieldset>
|
||||
<% end %>
|
||||
|
||||
<% if @user_role_model_i18n_variables.size > 0 %>
|
||||
<% if @role_i18n_variables.size > 0 %>
|
||||
<fieldset>
|
||||
<legend>
|
||||
<%= t('admin.user_role') %>
|
||||
<%#= render :partial => 'action_bar' %>
|
||||
</legend>
|
||||
<div><%= render :partial => 'edit_user_attribute_model', :collection => @user_role_model_i18n_variables %></div>
|
||||
<div><%= render :partial => 'edit_user_attribute_model', :collection => @role_i18n_variables %></div>
|
||||
</fieldset>
|
||||
<% end %>
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
</fieldset>
|
||||
<% end %>
|
||||
|
||||
<% if @user_info_model_i18n_variables.size > 0 %>
|
||||
<% if @info_i18n_variables.size > 0 %>
|
||||
<fieldset>
|
||||
<legend>
|
||||
<%= t('admin.user_info') %>
|
||||
@@ -56,7 +56,7 @@
|
||||
</fieldset>
|
||||
<% end %>
|
||||
|
||||
<% if @user_role_model_i18n_variables.size > 0 %>
|
||||
<% if @role_i18n_variables.size > 0 %>
|
||||
<fieldset>
|
||||
<legend>
|
||||
<%= t('admin.user_role') %>
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li class="search clear">
|
||||
<li class="search clear" title="<%= t :search_nccu %>">
|
||||
<a class="orbit-bar-search" href="#">search</a>
|
||||
<form class="navbar-search" action="">
|
||||
<input class="search-query span3" type="text" placeholder="<%= t(:search_nccu) %>">
|
||||
|
||||
@@ -1,16 +1,19 @@
|
||||
<%#= content_tag :li, :class => active_for_controllers('purchases') do -%>
|
||||
<%#= link_to content_tag(:i, nil, :class => 'icons-purchase') + t('admin.purchase'), admin_purchases_path %>
|
||||
<%# end -%>
|
||||
<% content_for :page_specific_javascript do %>
|
||||
<%= javascript_include_tag "/static/kernel.js" %>
|
||||
<% end %>
|
||||
|
||||
<%= content_tag :li, :class => active_for_controllers('bulletins', '/panel/announcement/back_end/tags', 'bulletin_categorys','module_apps', 'approvals') do -%>
|
||||
<%= content_tag :li, :class => active_for_controllers('bulletins', '/panel/announcement/back_end/tags', 'bulletin_categorys', 'approvals') || active_sys_call_for_app('module_apps','edit','Announcement') do -%>
|
||||
<%= link_to content_tag(:i, nil, :class => 'icons-announcement') + t('admin.announcement'), panel_announcement_back_end_bulletins_path %>
|
||||
<%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('bulletins', '/panel/announcement/back_end/tags', 'bulletin_categorys', 'approvals')) do -%>
|
||||
<%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('bulletins', '/panel/announcement/back_end/tags', 'bulletin_categorys', 'approvals')) do -%>
|
||||
<%= content_tag :li, link_to(t('announcement.all_articles'), panel_announcement_back_end_bulletins_path), :class => active_for_action('bulletins', 'index') %>
|
||||
<%= content_tag :li, link_to(t('announcement.add_new'), new_panel_announcement_back_end_bulletin_path), :class => active_for_action('bulletins', 'new') %>
|
||||
<%= content_tag :li, link_to(t('announcement.categories'), panel_announcement_back_end_bulletin_categorys_path), :class => active_for_action('bulletin_categorys', 'index') %>
|
||||
<%= content_tag :li, link_to(t('announcement.tags'), panel_announcement_back_end_tags_path), :class => active_for_action('/panel/announcement/back_end/tags', 'index') %>
|
||||
<%= content_tag :li, link_to(t('announcement.bulletin.approval_setting'), panel_announcement_back_end_approval_setting_path), :class => active_for_action('approvals', 'setting') if (is_manager? rescue nil) %>
|
||||
<%= content_tag :li, link_to(t('admin.module.authorization'),edit_admin_module_app_path(ModuleApp.first(conditions: {title: "Announcement"}))), :class => active_for_action('module_apps', 'edit') if (is_admin? rescue nil) %>
|
||||
<%= content_tag :li, link_to(t('admin.module.authorization'),edit_admin_module_app_path(ModuleApp.first(conditions: {title: "Announcement"}))), :class => active_sys_call_for_app('module_apps','edit','Announcement') if (is_admin? rescue nil) %>
|
||||
|
||||
<% end -%>
|
||||
|
||||
@@ -18,12 +21,13 @@
|
||||
|
||||
<%= content_tag :li, :class => active_for_controllers('news_bulletins', '/panel/news/back_end/tags', 'news_bulletin_categorys', 'news_approvals') do -%>
|
||||
<%= link_to content_tag(:i, nil, :class => 'icons-announcement') + t('admin.news'), panel_news_back_end_news_bulletins_path %>
|
||||
<%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('news_bulletins', '/panel/news/back_end/tags', 'news_bulletin_categorys', 'news_approvals')) do -%>
|
||||
<%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('news_bulletins', '/panel/news/back_end/tags', 'news_bulletin_categorys', 'news_approvals')) do -%>
|
||||
<%= content_tag :li, link_to(t('announcement.all_articles'), panel_news_back_end_news_bulletins_path), :class => active_for_action('news_bulletins', 'index') %>
|
||||
<%= content_tag :li, link_to(t('announcement.add_new'), new_panel_news_back_end_news_bulletin_path), :class => active_for_action('news_bulletins', 'new') %>
|
||||
<%= content_tag :li, link_to(t('announcement.categories'), panel_news_back_end_news_bulletin_categorys_path), :class => active_for_action('news_bulletin_categorys', 'index') %>
|
||||
<%= content_tag :li, link_to(t('announcement.tags'), panel_news_back_end_tags_path), :class => active_for_action('/panel/news/back_end/tags', 'index') %>
|
||||
<%= content_tag :li, link_to(t('announcement.news_bulletin.approval_setting'), panel_news_back_end_news_approval_setting_path), :class => active_for_action('news_approvals', 'setting') if (is_manager? rescue nil) %>
|
||||
<%= content_tag :li, link_to(t('admin.module.authorization'),edit_admin_module_app_path(ModuleApp.first(conditions: {key: "news"}))), :class => active_sys_call_for_app('module_apps','edit','news') if (is_admin? rescue nil) %>
|
||||
<% end -%>
|
||||
|
||||
<% end -%>
|
||||
@@ -43,18 +47,20 @@
|
||||
<%= link_to content_tag(:i, nil, :class => 'icons-window-block') + t('admin.design'), admin_designs_path %>
|
||||
<% end -%>
|
||||
|
||||
<%= content_tag :li, :class => active_for_controllers('ad_banners', 'ad_images') do -%>
|
||||
<%= content_tag :li, :class => active_for_controllers('ad_banners', 'ad_images') || active_sys_call_for_app('module_apps','edit','ad_banners') do -%>
|
||||
<%= link_to content_tag(:i, nil, :class => 'icons-link') + t('admin.ad_banner'), admin_ad_banners_path %>
|
||||
<%#= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('ad_banners', 'ad_images')) do -%>
|
||||
|
||||
<%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('ad_banners', 'ad_images') ) do -%>
|
||||
<%#= 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') %>
|
||||
<%# end %>
|
||||
<%= content_tag :li, link_to(t('admin.module.authorization'),edit_admin_module_app_path(ModuleApp.first(conditions: {title: "ad_banners"}))), :class => active_sys_call_for_app('module_apps','edit','ad_banners') if (is_admin? rescue nil) %>
|
||||
<% end -%>
|
||||
<% end %>
|
||||
|
||||
<%= content_tag :li, :class => active_for_controllers('web_links', '/panel/web_resource/back_end/tags', 'web_link_categorys') do -%>
|
||||
<%= link_to content_tag(:i, nil, :class => 'icons-link') + t('admin.link'), panel_web_resource_back_end_web_links_path %>
|
||||
<%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('web_links', '/panel/web_resource/back_end/tags', 'web_link_categorys')) do -%>
|
||||
<%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('web_links', '/panel/web_resource/back_end/tags', 'web_link_categorys')) do -%>
|
||||
<%= content_tag :li, link_to(t('admin.all_articles'), panel_web_resource_back_end_web_links_path), :class => active_for_action('web_links', 'index') %>
|
||||
<%= content_tag :li, link_to(t('announcement.add_new'), new_panel_web_resource_back_end_web_link_path), :class => active_for_action('web_links', 'new') %>
|
||||
<%= content_tag :li, link_to(t('announcement.categories'), panel_web_resource_back_end_web_link_categorys_path), :class => active_for_action('web_link_categorys', 'index') %>
|
||||
@@ -62,6 +68,13 @@
|
||||
<% end -%>
|
||||
<% end -%>
|
||||
|
||||
<%= content_tag :li, :class => active_for_controllers(nil) do -%>
|
||||
<%= link_to content_tag(:i, nil, :class => 'icons-cog') + t('admin.site_settings'), nil %>
|
||||
<%= content_tag :li, :class => active_for_controllers('sites') do -%>
|
||||
<%= link_to content_tag(:i, nil, :class => 'icons-cog') + t('admin.site_settings'), admin_site_site_info_path(@site) %>
|
||||
<%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('sites')) do -%>
|
||||
<%= content_tag :li, link_to(t('admin.site_info'), admin_site_site_info_path(@site)), :class => active_for_action('sites', 'site_info') %>
|
||||
<%= content_tag :li, link_to(t('admin.system_info'), admin_site_system_info_path(@site)), :class => active_for_action('sites', 'system_info') %>
|
||||
<%= content_tag :li, link_to(t('admin.language'), admin_site_language_path(@site)), :class => active_for_action('sites', 'language') %>
|
||||
<%= content_tag :li, link_to(t('admin.mail_setting'), admin_site_mail_setting_path(@site)), :class => active_for_action('sites', 'mail_setting') %>
|
||||
<%= content_tag :li, link_to(t('admin.ui_theme'), admin_site_ui_theme_path(@site)), :class => active_for_action('sites', 'ui_theme') %>
|
||||
<% end -%>
|
||||
<% end -%>
|
||||
@@ -14,7 +14,7 @@
|
||||
</head>
|
||||
<body>
|
||||
<%= render 'layouts/orbit_bar' %>
|
||||
<nav id="main-sidebar" class="my_scroll">
|
||||
<div id="main-sidebar" class="my_scroll">
|
||||
<div class="scrollbar">
|
||||
<div class="track">
|
||||
<div class="thumb">
|
||||
@@ -29,7 +29,7 @@
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
<div id="main-wrap">
|
||||
<%= yield %>
|
||||
</div>
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
<meta charset="utf-8">
|
||||
<%= page_title(@item).html_safe %>
|
||||
<%= page_metas(@item).html_safe %>
|
||||
<%= @metas %>
|
||||
<!--[if lt IE 9]>
|
||||
<%= javascript_include_tag "html5" %>
|
||||
<![endif]-->
|
||||
|
||||
Reference in new issue
Block a user