Merge branch 'dashboard' of https://github.com/Rulingcom/orbit into dashboard

Conflicts:
	vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletins_controller.rb
	vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form.html.erb
	vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/_form.html.erb
This commit is contained in:
unknown committed 2012-04-05 15:16:33 +08:00
commit 9382ef6ae8
164 files changed
+1088 -2321

No files matched your search

+4 -4
View File
@@ -45,10 +45,10 @@
opacity: 1;
filter: alpha(opacity=100);
cursor: pointer;
}
.select-role {
display:none;
overflow:hidden;
}
.select-role {
display:none;
padding: 10px 0 0;
}
.file-upload {
position:relative;
+2 -1
View File
@@ -1250,7 +1250,8 @@
var that = this
, complete = function () {
if (startEvent == 'show') that.reset()
that.$element.trigger(completeEvent)
that.$element.trigger(completeEvent)
mainTablePosition();
}
this.$element
@@ -9,6 +9,12 @@ $('.bulletin_files_block a.delete').live('click', function(){
$('.action a.remove_existing_record').live('click', function(){
$(this).next('.should_destroy').attr('value', 1);
//$("#bulletin_" + $(this).prev().attr('value')).hide();
$("tr#bulletin_" + $(this).prev().attr('value')).hide();
});
$('.quick_edit_cancel').live('click', function(){
tr = $(this).attr('rel');
$('#' + tr).hide();
$("tr#bulletin_file_" + $(this).prev().attr('value')).hide();
$("tr#bulletin_link_" + $(this).prev().attr('value')).hide();
});
+3
View File
@@ -0,0 +1,3 @@
/*! HTML5 Shiv pre3.5 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
Uncompressed source: https://github.com/aFarkas/html5shiv */
(function(a,b){function h(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function i(){var a=l.elements;return typeof a=="string"?a.split(" "):a}function j(a){var b={},c=a.createElement,f=a.createDocumentFragment,g=f();a.createElement=function(a){l.shivMethods||c(a);var f;return b[a]?f=b[a].cloneNode():e.test(a)?f=(b[a]=c(a)).cloneNode():f=c(a),f.canHaveChildren&&!d.test(a)?g.appendChild(f):f},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+i().join().replace(/\w+/g,function(a){return b[a]=c(a),g.createElement(a),'c("'+a+'")'})+");return n}")(l,g)}function k(a){var b;return a.documentShived?a:(l.shivCSS&&!f&&(b=!!h(a,"article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio{display:none}canvas,video{display:inline-block;*display:inline;*zoom:1}[hidden]{display:none}audio[controls]{display:inline-block;*display:inline;*zoom:1}mark{background:#FF0;color:#000}")),g||(b=!j(a)),b&&(a.documentShived=b),a)}function p(a){var b,c=a.getElementsByTagName("*"),d=c.length,e=RegExp("^(?:"+i().join("|")+")$","i"),f=[];while(d--)b=c[d],e.test(b.nodeName)&&f.push(b.applyElement(q(b)));return f}function q(a){var b,c=a.attributes,d=c.length,e=a.ownerDocument.createElement(n+":"+a.nodeName);while(d--)b=c[d],b.specified&&e.setAttribute(b.nodeName,b.nodeValue);return e.style.cssText=a.style.cssText,e}function r(a){var b,c=a.split("{"),d=c.length,e=RegExp("(^|[\\s,>+~])("+i().join("|")+")(?=[[\\s,>+~#.:]|$)","gi"),f="$1"+n+"\\:$2";while(d--)b=c[d]=c[d].split("}"),b[b.length-1]=b[b.length-1].replace(e,f),c[d]=b.join("}");return c.join("{")}function s(a){var b=a.length;while(b--)a[b].removeNode()}function t(a){var b,c,d=a.namespaces,e=a.parentWindow;return!o||a.printShived?a:(typeof d[n]=="undefined"&&d.add(n),e.attachEvent("onbeforeprint",function(){var d,e,f,g=a.styleSheets,i=[],j=g.length,k=Array(j);while(j--)k[j]=g[j];while(f=k.pop())if(!f.disabled&&m.test(f.media)){for(d=f.imports,j=0,e=d.length;j<e;j++)k.push(d[j]);try{i.push(f.cssText)}catch(l){}}i=r(i.reverse().join("")),c=p(a),b=h(a,i)}),e.attachEvent("onafterprint",function(){s(c),b.removeNode(!0)}),a.printShived=!0,a)}var c=a.html5||{},d=/^<|^(?:button|form|map|select|textarea|object|iframe)$/i,e=/^<|^(?:a|b|button|code|div|fieldset|form|h1|h2|h3|h4|h5|h6|i|iframe|img|input|label|li|link|ol|option|p|param|q|script|select|span|strong|style|table|tbody|td|textarea|tfoot|th|thead|tr|ul)$/i,f,g;(function(){var c=b.createElement("a");c.innerHTML="<xyz></xyz>",f="hidden"in c,f&&typeof injectElementWithStyles=="function"&&injectElementWithStyles("#modernizr{}",function(b){b.hidden=!0,f=(a.getComputedStyle?getComputedStyle(b,null):b.currentStyle).display=="none"}),g=c.childNodes.length==1||function(){try{b.createElement("a")}catch(a){return!0}var c=b.createDocumentFragment();return typeof c.cloneNode=="undefined"||typeof c.createDocumentFragment=="undefined"||typeof c.createElement=="undefined"}()})();var l={elements:c.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:c.shivCSS!==!1,shivMethods:c.shivMethods!==!1,type:"default",shivDocument:k};a.html5=l,k(b);var m=/^$|\b(?:all|print)\b/,n="html5shiv",o=!g&&function(){var c=b.documentElement;return typeof b.namespaces!="undefined"&&typeof b.parentWindow!="undefined"&&typeof c.applyElement!="undefined"&&typeof c.removeNode!="undefined"&&typeof a.attachEvent!="undefined"}();l.type+=" print",l.shivPrint=t,t(b)})(this,document)
+2 -1
View File
@@ -10,4 +10,5 @@
//= require jquery.isotope.min
//= require jquery.tinyscrollbar.min
//= require orbit-1.0
//= require tinymce-jquery
//= require tinymce-jquery
//= require tinymce_orbit
+23 -6
View File
@@ -39,16 +39,29 @@ $(document).ready(function(){
break;
}
});
$(document).on('click', '.toggle-tr-edit', function() {
$(this).parents('tr').next('.qe-block').removeClass('hide');
$(this).parents('tr').next('.qe-block').find('.qe-edit-div').addClass('hide');
$(this).parents('tr').next('.qe-block').find('#qe-' + $(this).attr('rel')).toggleClass('hide');
});
$(document).on('click', '.sort-header > .sort', function() {
$.getScript($(this).attr('rel'));
});
var $role = $('.select-role');
var method =$('.privacy:eq(1)').attr('checked');
if(method == 'checked'){
$role.slideDown(0);
}
$('.privacy').each(function($i) {
$(this).click(function() {
switch ($i) {
case 0:
$role.slideUp(300);
break;
case 1:
$role.slideDown(300);
break;
}
});
});
/*tinyscrollbar&windows-Size*/
resize();
@@ -86,6 +99,10 @@ function mainTablePosition() {
var $height = $('#main-wrap > .subnav').height()
var $table = $('#main-wrap > .table')
//alert ($table.height())
$height = $height-17;
if($height<0){
$height = 0;
}
$table.stop().animate({marginTop:$height},500)
//$table.css({marginTop : $height})
}
+26
View File
@@ -0,0 +1,26 @@
$(function() {
$('.tinymce_textarea').tinymce({
theme: 'advanced',
plugins : "autolink,lists,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
// Theme options
theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : false,
// Skin options
skin : "o2k7",
skin_variant : "silver",
// Drop lists for link/image/media/template dialogs
template_external_list_url : "js/template_list.js",
external_link_list_url : "js/link_list.js",
external_image_list_url : "js/image_list.js",
media_external_list_url : "js/media_list.js"
});
});
+1 -1
View File
@@ -98,7 +98,7 @@ h1, h2, h3, h4, h5, h6 {
border-radius: 0 0 4px 4px;
}
table .span1-2 {
width: 94px;
min-width: 85px;
float: none;
margin-left: 0;
}
+23 -8
View File
@@ -9,9 +9,9 @@
.main-list {
margin-bottom: 0;
}
.main-list thead th {
background-color: rgba(0,0,0,0.05);
border-right: 1px solid #ddd;
.main-wrap>.main-list thead th {
background-color: transparent;
border-right: medium none;
}
.main-list thead th:last-child {
border-right: none;
@@ -29,19 +29,22 @@
}
.main-list tbody .quick-edit {
position:relative;
height:40px;
height:20px;
}
.main-list tbody .quick-edit .nav {
/*left: -55px;*/
position: absolute;
/*top: -3px;*/
width: 350px;
left: -8px;
}
.main-list td {
/*height:80px;*/
background-color: #FFFFFF;
border-bottom: 1px solid #DDDDDD;
border-top: medium none;
}
.main-list .nav {
margin-top: 15px;
margin-top: 0;
margin-bottom: 3px;
}
.main-list tr.with_action:hover .hide {
@@ -53,7 +56,7 @@
}
.main-list .label-td {
background-color: rgba(255, 255, 255, 1);
height: 60px;
height: 40px;
overflow: hidden;
position: absolute;
width: 100%;
@@ -74,6 +77,15 @@
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
z-index: 5;
}
.table-label {
background-color: #F2F2F2;
position: relative;
}
.table-label .main-list thead th {
background-color: #F2F2F2;
border-right: 1px solid #DDDDDD;
border-top: 1px solid #DDDDDD !important;
}
.route-group .route {
padding: 0;
@@ -108,7 +120,10 @@ legend {
-webkit-border-radius: 0;
border-radius: 0;
border-left: none;
border-right: none;
border-right: none;
position: fixed;
top: 30px;
z-index: 50;
}
.subnav .nav > li:first-child > a, .subnav .nav > li:first-child > a:hover {
-moz-border-radius: 0;
-1
View File
@@ -2,7 +2,6 @@ html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockq
-webkit-text-size-adjust:none;
}
html, body{
background: url(<%= asset_path 'background.jpg' %>) repeat left top;
height: 100%;
}
/*自定*/
-2
View File
@@ -350,8 +350,6 @@
border-top: none;
}
#post-body .editor {
background-color: #333333;
height: 20px;
margin: 8px 0;
width: 100%;
}
+2 -2
View File
@@ -58,8 +58,8 @@
cursor: pointer;
}
.select-role {
display:none;
overflow:hidden;
display:none;
padding: 10px 0;
}
.file-upload {
position:relative;
@@ -1,8 +1,7 @@
class Admin::ObjectAuthsController < ApplicationController
include OrbitCoreLib::PermissionUnility
layout "admin"
before_filter :authenticate_user!
before_filter :check_if_user_can_do_object_auth
before_filter :force_order
# before_filter :is_admin? ,:only => :index
@@ -84,6 +83,12 @@ class Admin::ObjectAuthsController < ApplicationController
end
private
def force_order
authenticate_user!
check_if_user_can_do_object_auth
end
def check_if_user_can_do_object_auth
unless check_permission(:manager)
render :nothing => true, :status => 403
+1 -1
View File
@@ -47,7 +47,7 @@ class ApplicationController < ActionController::Base
# Render the page
def render_page(id = nil)
if @item
render :text => parse_page(@item, id)
render :text => process_page(@item, id), :layout => 'page_layout'
else
render :text => '404 Not Found'
end
+8 -3
View File
@@ -1,12 +1,12 @@
class OrbitBackendController< ApplicationController
before_filter :authenticate_user!
before_filter :force_order,:except => [:public]
before_filter :setup_vars
# before_filter {|c| c.front_end_available(@app_title)}
before_filter :check_user_can_use,:except => [:public]
# before_filter :check_user_can_use
include OrbitCoreLib::PermissionUnility
include AdminHelper
layout 'admin'
layout 'new_admin'
def setup_vars
@app_title = request.fullpath.split('/')[2]
@@ -15,6 +15,11 @@ class OrbitBackendController< ApplicationController
private
def force_order
authenticate_user!
check_user_can_use
end
def check_user_can_use
unless check_permission
redirect_to polymorphic_path(['panel',@app_title,'back_end','public'])
+2
View File
@@ -1,5 +1,7 @@
class PagesController < ApplicationController
include ApplicationHelper
before_filter :get_item, :only => [:index_from_link, :show_from_link]
def index
+47
View File
@@ -107,4 +107,51 @@ module ApplicationHelper
end
end
def process_page(page, id)
parse_page_noko(page, id)
end
def page_metas(page)
metas = ''
@site.page_metas.each do |meta|
name, content = meta.get_name_content
metas << "<meta name=#{name} content=#{content} />\n"
end rescue nil
return metas
end
def page_title(page)
"<title>#{page.title ? page.title[I18n.locale] : page.i18n_variable[I18n.locale]}</title>\n"
end
def page_stylesheets(page)
stylesheets = ''
stylesheets << "<link href='/assets/bootstrap.css.erb' rel='stylesheet' type='text/css' />\n"
stylesheets << "<link href='/assets/bootstrap-orbit.css' rel='stylesheet' type='text/css' />\n"
stylesheets << "<link href='/assets/style.css.erb' rel='stylesheet' type='text/css' />\n"
stylesheets << "<link href='#{page.design.reset_css.file.url}' rel='stylesheet' type='text/css' />\n" if page.design.reset_css
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
stylesheets
end
def page_javascripts(page)
javascripts = ''
javascripts << "<script type='text/javascript' src='/static/jquery.js'></script>\n"
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"
javascripts << "<script type='text/javascript' src='/assets/bootstrap.js'></script>\n"
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-1.0.js'></script>\n"
javascripts << "<script type='text/javascript' src='/assets/orbit_bar.js'></script>\n"
javascripts << "<script type='text/javascript' src='/assets/event.js'></script>\n"
page.design.javascripts.each do |js|
# javascripts << "<script type='text/javascript' src='#{js.file.url}'></script>"
end
javascripts
end
end
+6 -2
View File
@@ -2,6 +2,8 @@ class Layout < DesignFile
include ParserLayout
attr_reader :content
field :body
embeds_one :menu
embedded_in :design
@@ -17,8 +19,10 @@ class Layout < DesignFile
Layout.count > 0
end
def parse_layout
parse_layout_contents(self)
def parse_layout
html = Nokogiri::HTML(self.file.read)
self.body = html.at_css("body").inner_html
parse_body(self)
end
end
+15
View File
@@ -0,0 +1,15 @@
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
+11
View File
@@ -0,0 +1,11 @@
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
end
+5
View File
@@ -0,0 +1,5 @@
class PageMeta < Meta
belongs_to :page
end
+5
View File
@@ -0,0 +1,5 @@
class SiteMeta < Meta
belongs_to :site
end
+1 -1
View File
@@ -1,6 +1,6 @@
class ObjectAuth < PrototypeAuth
include OrbitCoreLib::ObjectTokenUnility
validates_uniqueness_of :obj_authable_type,:scope => :title #{ |c| }
validates_uniqueness_of :title ,:scope => [:obj_authable_type,:obj_authable_id] #{ |c| }
belongs_to :obj_authable, polymorphic: true
# > - Something.find_with_auth(query)
# > - or Something.find(query).auth
+13 -1
View File
@@ -6,17 +6,23 @@ class Page < Item
belongs_to :design
belongs_to :module_app
has_one :title, :class_name => "I18nVariable", :as => :language_value, :autosave => true, :dependent => :destroy
has_many :page_parts, :autosave => true, :dependent => :destroy
has_many :page_contexts, :autosave => true, :dependent => :destroy
has_many :page_metas, :autosave => true, :dependent => :destroy
accepts_nested_attributes_for :page_parts, :allow_destroy => true
before_save :create_parts
before_save :create_parts, :set_key
# embeds_many :custom_images, :class_name => 'Image', as: :design_image
def is_home?
self.parent ? false : true
end
def title
@title ||= I18nVariable.first(:conditions => {:key => 'title', :language_value_id => self.id, :language_value_type => self.class}) rescue nil
end
protected
@@ -27,4 +33,10 @@ class Page < Item
end
end
def set_key
if title.new_record?
title.key = 'title'
end
end
end
+2
View File
@@ -12,6 +12,8 @@ class Site
field :school
field :department
has_many :site_metas, :autosave => true, :dependent => :destroy
def generate_keys
private_key = OpenSSL::PKey::RSA.generate(2048)
+5 -1
View File
@@ -1,3 +1,7 @@
<%= flash_messages %>
<%= parse_page_edit(@item).html_safe %>
<%= page_stylesheets(@item).html_safe %>
<%= page_javascripts(@item).html_safe %>
<%= parse_page_edit_noko(@item).html_safe %>
+1 -1
View File
@@ -28,7 +28,7 @@
<% if user_signed_in? %>
<li class="dropdown active">
<a class="orbit-bar-account" href="#" data-toggle="dropdown">
<img class="member-img" src="/assets/menber-pic.png" />
<img class="member-img" src="/assets/person.png" />
<%#= image_tag current_user.avatar.thumb.url, :class => 'member-img' %>
<span class="member-name"><%= current_user.name %></span>
</a>
+2 -1
View File
@@ -9,8 +9,9 @@
<%= content_tag :li, link_to(t('admin.add_new'), new_panel_announcement_back_end_bulletin_path), :class => active_for_action('bulletins', 'new') %>
<%= content_tag :li, link_to(t('admin.categories'), panel_announcement_back_end_bulletin_categorys_path), :class => active_for_action('bulletin_categorys', 'index') %>
<%= content_tag :li, link_to(t('admin.tags'), panel_announcement_back_end_tags_path), :class => active_for_action('tags', 'index') %>
<%= content_tag :li, link_to(t('announcement.bulletin.fact_check_setting'), panel_announcement_back_end_fact_checks_setting_path), :class => active_for_action('tags', 'index') %>
<%= content_tag :li, link_to(t('announcement.bulletin.fact_check_setting'), panel_announcement_back_end_fact_checks_setting_path), :class => active_for_action('tags', 'index') if is_manager? %>
<% end -%>
<% end -%>
<%= content_tag :li, :class => active_for_controllers('users') do -%>
+1 -1
View File
@@ -5,7 +5,7 @@
<title><%= @title || APP_CONFIG['orbit'] %></title>
<link rel="shortcut icon" href="/favicon.ico">
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<%= javascript_include_tag "html5" %>
<![endif]-->
<%= stylesheet_link_tag "admin" %>
<%= javascript_include_tag "admin" %>
+1 -1
View File
@@ -4,7 +4,7 @@
<meta charset="utf-8">
<title><%= @title || APP_CONFIG['orbit'] %></title>
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<%= javascript_include_tag "html5" %>
<![endif]-->
<%= stylesheet_link_tag "devise" %>
<%= javascript_include_tag "devise" %>
+1 -1
View File
@@ -2,7 +2,7 @@
<html>
<head>
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<%= javascript_include_tag "html5" %>
<![endif]-->
<%#= stylesheet_link_tag "module_widget" %>
<%= javascript_include_tag "module_widget" %>
+1 -1
View File
@@ -4,7 +4,7 @@
<meta charset="utf-8">
<title><%= @title || APP_CONFIG['orbit'] %></title>
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<%= javascript_include_tag "html5" %>
<![endif]-->
<%= stylesheet_link_tag "new_admin" %>
<%= javascript_include_tag "new_admin" %>
+17
View File
@@ -0,0 +1,17 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<%= page_title(@item).html_safe %>
<%= page_metas(@item).html_safe %>
<%= @metas %>
<!--[if lt IE 9]>
<%= javascript_include_tag "html5" %>
<![endif]-->
<%= page_stylesheets(@item).html_safe %>
<%= page_javascripts(@item).html_safe %>
</head>
<body>
<%= yield %>
</body>
</html>
+1 -1
View File
@@ -5,7 +5,7 @@
<title><%= @title || APP_CONFIG['orbit'] %></title>
<link rel="shortcut icon" href="/favicon.ico">
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<%= javascript_include_tag "html5" %>
<![endif]-->
<%= stylesheet_link_tag "site_editor" %>
<%= javascript_include_tag "site_editor" %>