Merge branch 'design_team' of https://github.com/Rulingcom/orbit into nccu_0509
Conflicts: app/controllers/admin/object_auths_new_interface_controller.rb app/helpers/application_helper.rb app/models/ad_banner.rb
This commit is contained in:
commit
a31a9c4792
169 files changed
+14400
-185
No files matched your search
@@ -0,0 +1,36 @@
|
||||
// JavaScript Document
|
||||
|
||||
// can copy code to any of ur desired javascsript
|
||||
|
||||
//extended jquery to search fast.
|
||||
$.extend($.expr[':'], {
|
||||
'containsi': function (elem, i, match, array) {
|
||||
return (elem.textContent || elem.innerText || '').toLowerCase().indexOf((match[3] || "").toLowerCase()) >= 0;
|
||||
}
|
||||
});
|
||||
var interval,sval;
|
||||
$(document).ready(function(){
|
||||
$("#user_filter").keyup(function(e){
|
||||
if((e.which>96 && e.which<123) || (e.which>64 && e.which<92) || (e.which == 32) || (e.which == 8)){
|
||||
sval = $(this).val();
|
||||
$(".checkbox").popover("hide");
|
||||
$("div.checkblock").hide();
|
||||
clearInterval(interval);
|
||||
interval = setInterval(waitForSearch,1000);
|
||||
}
|
||||
})
|
||||
})
|
||||
var waitForSearch = function(){
|
||||
if(sval){
|
||||
var totalfoundbyname = $("div#users_checkbox_ary label.member-name:containsi("+sval+")").length
|
||||
if(totalfoundbyname!=0){
|
||||
$("div#users_checkbox_ary label.member-name:containsi("+sval+")").parent().parent().show();
|
||||
}else if(totalfoundbyname==0){
|
||||
$("div#users_checkbox_ary div.for_unit:containsi("+sval+")").parent().show();
|
||||
}
|
||||
}else{
|
||||
$(".checkbox").popover('hide');
|
||||
$("div.checkblock").show();
|
||||
}
|
||||
clearInterval(interval);
|
||||
}
|
||||
@@ -15,4 +15,5 @@
|
||||
//= require tinymce_orbit
|
||||
//= require orbit-bar-search
|
||||
//= require side_bar_history
|
||||
//= require rss
|
||||
//= require ajax_form
|
||||
@@ -1,29 +1,90 @@
|
||||
function load_tinymce() {
|
||||
$('.tinymce_textarea').tinymce({
|
||||
|
||||
// General options
|
||||
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",
|
||||
file_browser_callback : 'myFileBrowser',
|
||||
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 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,formatselect,fontselect,fontsizeselect",
|
||||
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,bullist,numlist,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,forecolor,backcolor",
|
||||
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,fullscreen",
|
||||
theme_advanced_toolbar_location : "top",
|
||||
theme_advanced_toolbar_align : "left",
|
||||
theme_advanced_statusbar_location : "bottom",
|
||||
theme_advanced_resizing : true,
|
||||
// Theme options
|
||||
theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,formatselect,fontselect,fontsizeselect",
|
||||
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,bullist,numlist,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,forecolor,backcolor",
|
||||
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,fullscreen",
|
||||
theme_advanced_toolbar_location : "top",
|
||||
theme_advanced_toolbar_align : "left",
|
||||
theme_advanced_statusbar_location : "bottom",
|
||||
theme_advanced_resizing : true,
|
||||
|
||||
// Skin options
|
||||
skin : "o2k7",
|
||||
skin_variant : "silver",
|
||||
// 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"
|
||||
// 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"
|
||||
|
||||
// Style formats
|
||||
style_formats : [
|
||||
{title : 'Bold text', inline : 'b'},
|
||||
{title : 'Red text', inline : 'span', styles : {color : '#ff0000'}},
|
||||
{title : 'Red header', block : 'h1', styles : {color : '#ff0000'}},
|
||||
{title : 'Example 1', inline : 'span', classes : 'example1'},
|
||||
{title : 'Example 2', inline : 'span', classes : 'example2'},
|
||||
{title : 'Table styles'},
|
||||
{title : 'Table row 1', selector : 'tr', classes : 'tablerow1'}
|
||||
],
|
||||
|
||||
// Replace values for the template plugin
|
||||
template_replace_values : {
|
||||
username : "Some User",
|
||||
staffid : "991234"
|
||||
}
|
||||
});
|
||||
function myFileBrowser (field_name, url, type, win) {
|
||||
|
||||
|
||||
var cmsURL = window.location.toString();
|
||||
cmsURL = cmsURL.split("/");
|
||||
// cmsURL = "http://<?php echo $_SITE['domain'].$_SITE['rel_path']; ?>/modules/modules/filemanager/";
|
||||
|
||||
// script URL - use an absolute path!
|
||||
if (cmsURL.indexOf("?") < 0) {
|
||||
//add the type as the only query parameter
|
||||
cmsURL = cmsURL + "?type=" + type;
|
||||
}
|
||||
else {
|
||||
//add the type as an additional query parameter
|
||||
// (PHP session ID is now included if there is one at all)
|
||||
cmsURL = cmsURL + "&type=" + type;
|
||||
}
|
||||
|
||||
tinyMCE.activeEditor.windowManager.open({
|
||||
file : cmsURL,
|
||||
title : 'File Browser',
|
||||
width : 850, // Your dimensions may differ - toy around with them!
|
||||
height : 455,
|
||||
resizable : "no",
|
||||
inline : "no", // This parameter only has an effect if you use the inlinepopups plugin!
|
||||
close_previous : "no"
|
||||
}, {
|
||||
window : win,
|
||||
input : field_name
|
||||
});
|
||||
return false;
|
||||
}
|
||||
function ajaxSave() {
|
||||
var ed = tinyMCE.get('content');
|
||||
// Do you ajax call here, window.setTimeout fakes ajax call
|
||||
ed.setProgressState(1); // Show progress
|
||||
window.setTimeout(function() {
|
||||
ed.setProgressState(0); // Hide progress
|
||||
alert(ed.getContent());
|
||||
}, 3000);
|
||||
}
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
load_tinymce();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,65 @@
|
||||
class Admin::AssetCategoriesController < OrbitBackendController
|
||||
|
||||
def index
|
||||
@asset_categories = AssetCategory.all
|
||||
@asset_category = AssetCategory.new
|
||||
@url = admin_asset_categories_path
|
||||
|
||||
end
|
||||
|
||||
def show
|
||||
@asset_category = AssetCategory.find(params[:id])
|
||||
end
|
||||
|
||||
def new
|
||||
@asset_category = AssetCategory.new
|
||||
end
|
||||
|
||||
def edit
|
||||
@asset_category = AssetCategory.find(params[:id])
|
||||
@i18n_variable = @asset_category.i18n_variable
|
||||
@url = admin_asset_categories_path(@asset_category)
|
||||
end
|
||||
|
||||
def create
|
||||
@asset_category = AssetCategory.new(params[:asset_category])
|
||||
|
||||
respond_to do |format|
|
||||
if @asset_category.save
|
||||
format.html { redirect_to(admin_asset_categories_url, :notice => t('announcement.create_asset_category_success')) }
|
||||
format.js
|
||||
else
|
||||
format.html { render :action => "new" }
|
||||
format.js { render action: "new" }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def update
|
||||
@asset_category = AssetCategory.find(params[:id])
|
||||
|
||||
@url = admin_asset_categories_path(@asset_category)
|
||||
|
||||
respond_to do |format|
|
||||
if @asset_category.update_attributes(params[:asset_category])
|
||||
# format.html { redirect_to(panel_announcement_back_end_asset_category_url(@asset_category), :notice => t('asset_category.update_asset_category_success')) }
|
||||
# format.html { redirect_to(panel_announcement_back_end_asset_categories_url, :notice => t('asset_category.update_asset_category_success')) }
|
||||
# format.xml { head :ok }
|
||||
format.js
|
||||
else
|
||||
format.html { render :action => "edit" }
|
||||
format.js { render :action => "edit" }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def destroy
|
||||
@asset_category = AssetCategory.find(params[:id])
|
||||
@asset_category.destroy
|
||||
|
||||
respond_to do |format|
|
||||
format.html { redirect_to(admin_asset_categories_url) }
|
||||
format.js
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,11 +1,7 @@
|
||||
class Admin::AssetsController < ApplicationController
|
||||
|
||||
layout "admin"
|
||||
before_filter :authenticate_user!
|
||||
before_filter :is_admin?
|
||||
class Admin::AssetsController < OrbitBackendController
|
||||
|
||||
def index
|
||||
@assets = Asset.all.entries
|
||||
@assets = (params[:sort] || @filter) ? get_sorted_and_filtered("asset") : Asset.all.page(params[:page]).per(10)
|
||||
end
|
||||
|
||||
def show
|
||||
@@ -14,6 +10,7 @@ class Admin::AssetsController < ApplicationController
|
||||
|
||||
def new
|
||||
@asset = Asset.new
|
||||
@asset_categories = AssetCategory.all
|
||||
respond_to do |format|
|
||||
format.html {}
|
||||
format.js { render 'js/show_pop_up', :locals => {:partial => 'admin/assets/new'} }
|
||||
@@ -22,6 +19,7 @@ class Admin::AssetsController < ApplicationController
|
||||
|
||||
def edit
|
||||
@asset = Asset.find(params[:id])
|
||||
@asset_categories = AssetCategory.all
|
||||
respond_to do |format|
|
||||
format.html {}
|
||||
format.js { render 'js/show_pop_up', :locals => {:partial => 'admin/assets/edit'} }
|
||||
@@ -33,7 +31,7 @@ class Admin::AssetsController < ApplicationController
|
||||
if @asset.save
|
||||
respond_to do |format|
|
||||
format.html { redirect_to admin_assets_url }
|
||||
format.js { render 'js/remove_pop_up_and_reload_content', :locals => {:function => 'append', :id => 'asset_tbody', :value => @asset, :values => nil, :partial => 'admin/assets/asset', :locals => nil} }
|
||||
format.js { render 'js/remove_pop_up_and_reload_content', :locals => {:function => 'append', :id => 'tbody_assets', :value => @asset, :values => nil, :partial => 'admin/assets/asset', :locals => nil} }
|
||||
end
|
||||
else
|
||||
respond_to do |format|
|
||||
@@ -66,5 +64,12 @@ class Admin::AssetsController < ApplicationController
|
||||
format.js { render 'js/remove_element', :locals => {:id => "asset_#{@asset.id}"} }
|
||||
end
|
||||
end
|
||||
|
||||
def delete
|
||||
if params[:to_delete]
|
||||
asset = Asset.any_in(:_id => params[:to_delete]).delete_all
|
||||
end
|
||||
redirect_to assets_url(:filter => params[:filter], :direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options])
|
||||
end
|
||||
|
||||
end
|
||||
@@ -7,6 +7,7 @@ class Admin::DashboardsController < ApplicationController
|
||||
def index
|
||||
@module_app_contents, @module_app_contents_total = get_module_app_count('bulletin', 'news_bulletin', 'page_context', 'web_link')
|
||||
@recent_updated = get_recently_updated('bulletin', 'news_bulletin', 'page_context', 'web_link')
|
||||
@most_visited = get_most_visited('bulletin', 'news_bulletin', 'page_context')
|
||||
end
|
||||
|
||||
protected
|
||||
@@ -35,5 +36,18 @@ class Admin::DashboardsController < ApplicationController
|
||||
sorted_objects = a.sort {|a,b| b[1]<=>a[1]}
|
||||
sorted_objects[0..9]
|
||||
end
|
||||
|
||||
def get_most_visited(*args)
|
||||
a = {}
|
||||
args.each do |module_app|
|
||||
module_app_class = module_app.classify.constantize
|
||||
objects = module_app_class.order_by(:view_count, :desc).limit(10)
|
||||
objects.each do |object|
|
||||
a.merge!(object => object.view_count) if object.view_count > 0
|
||||
end
|
||||
end
|
||||
sorted_objects = a.sort {|a,b| b[1]<=>a[1]}
|
||||
sorted_objects[0..9]
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,8 +1,6 @@
|
||||
class Admin::ObjectAuthsNewInterfaceController < OrbitBackendController
|
||||
include OrbitCoreLib::PermissionUnility
|
||||
layout "new_admin"
|
||||
before_filter :force_order
|
||||
|
||||
|
||||
|
||||
def setting
|
||||
|
||||
@@ -7,6 +7,7 @@ class PagesController < ApplicationController
|
||||
def index
|
||||
@item = Page.find_by_name('home')
|
||||
if @item
|
||||
impressionist(@item)
|
||||
render_page
|
||||
else
|
||||
render :text => 'You need a home page'
|
||||
@@ -14,18 +15,19 @@ class PagesController < ApplicationController
|
||||
end
|
||||
|
||||
def show
|
||||
#begin
|
||||
@item = Item.first(:conditions => {:path => params[:page_name]})
|
||||
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
|
||||
when 'Link'
|
||||
redirect_to "http://#{@item[:url]}"
|
||||
end
|
||||
else
|
||||
render :file => "#{Rails.root}/public/404.html", :status => :not_found
|
||||
end
|
||||
#begin
|
||||
@item = Item.first(:conditions => {:path => params[:page_name]})
|
||||
if @item && @item.is_published && (@item.enabled_for.nil? ? true : @item.enabled_for.include?(I18n.locale.to_s))
|
||||
impressionist(@item)
|
||||
case @item._type
|
||||
when 'Page'
|
||||
render_page
|
||||
when 'Link'
|
||||
redirect_to @item[:url]
|
||||
end
|
||||
else
|
||||
render :file => "#{Rails.root}/public/404.html", :status => :not_found
|
||||
end
|
||||
#rescue
|
||||
# render :file => "#{Rails.root}/public/404.html", :status => :not_found
|
||||
#end
|
||||
@@ -55,11 +57,7 @@ class PagesController < ApplicationController
|
||||
|
||||
def get_item
|
||||
module_app = ModuleApp.first(:conditions => {:key => params[:app_name]})
|
||||
# if params[:category_id]
|
||||
# @item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action], :category => params[:category_id]})
|
||||
# else
|
||||
@item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action]})
|
||||
# end
|
||||
@item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action]})
|
||||
end
|
||||
|
||||
end
|
||||
@@ -3,26 +3,26 @@ module Admin::DashboardHelper
|
||||
def get_link(title)
|
||||
case title
|
||||
when 'bulletin'
|
||||
panel_announcement_back_end_bulletins_path
|
||||
panel_announcement_front_end_bulletins_path
|
||||
when 'news_bulletin'
|
||||
panel_news_back_end_news_bulletins_path
|
||||
panel_news_front_end_news_bulletins_path
|
||||
when'page_context'
|
||||
panel_page_content_back_end_page_contexts_path
|
||||
panel_page_content_front_end_page_contexts_path
|
||||
when'web_link'
|
||||
panel_web_resource_back_end_web_links_path
|
||||
panel_web_resource_front_end_web_links_path
|
||||
end
|
||||
end
|
||||
|
||||
def get_link_to_object(object)
|
||||
case object._type.underscore
|
||||
when 'bulletin'
|
||||
panel_announcement_back_end_bulletin_path(object)
|
||||
panel_announcement_front_end_bulletin_path(object)
|
||||
when 'news_bulletin'
|
||||
panel_news_back_end_news_bulletin_path(object)
|
||||
panel_news_front_end_news_bulletin_path(object)
|
||||
when'page_context'
|
||||
panel_page_content_back_end_page_context_path(object)
|
||||
panel_page_content_front_end_page_context_path(object)
|
||||
when'web_link'
|
||||
panel_web_resource_back_end_web_link_path(object)
|
||||
panel_web_resource_front_end_web_link_path(object)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -96,7 +96,6 @@ module ApplicationHelper
|
||||
end
|
||||
|
||||
def visible_for_controllers(*controller_names)
|
||||
puts controller_names
|
||||
(controller_names.include?(controller.controller_name) || controller_names.include?(request.fullpath)) ? '' : 'hide'
|
||||
end
|
||||
|
||||
@@ -173,8 +172,33 @@ module ApplicationHelper
|
||||
locale.to_sym == I18n.locale ? 'active in': ''
|
||||
end
|
||||
|
||||
<<<<<<< HEAD
|
||||
def at_least_module_manager
|
||||
is_manager? || is_admin?
|
||||
end
|
||||
=======
|
||||
def dislpay_view_count(object)
|
||||
"#{t(:view_count)}: #{object.view_count}"
|
||||
end
|
||||
|
||||
def display_visitors(options={})
|
||||
Impression.where(options).distinct(:session_hash).count
|
||||
end
|
||||
|
||||
def display_visitors_today
|
||||
display_visitors(created_at: {'$gte' => Date.today.beginning_of_day, '$lte' => Date.today.end_of_day})
|
||||
end
|
||||
|
||||
def display_visitors_this_week
|
||||
display_visitors(created_at: {'$gte' => Date.today.beginning_of_week, '$lte' => Date.today.end_of_week})
|
||||
end
|
||||
|
||||
def display_visitors_this_month
|
||||
display_visitors(created_at: {'$gte' => Date.today.beginning_of_month, '$lte' => Date.today.end_of_month})
|
||||
end
|
||||
|
||||
def display_visitors_this_year
|
||||
display_visitors(created_at: {'$gte' => Date.today.beginning_of_year, '$lte' => Date.today.end_of_year})
|
||||
end
|
||||
|
||||
end
|
||||
@@ -9,5 +9,8 @@ class Asset
|
||||
field :description
|
||||
|
||||
validates_presence_of :filename, :data
|
||||
|
||||
belongs_to :asset_category
|
||||
belongs_to :assetable, polymorphic: true
|
||||
|
||||
end
|
||||
@@ -0,0 +1,16 @@
|
||||
class AssetCategory
|
||||
include Mongoid::Document
|
||||
include Mongoid::Timestamps
|
||||
|
||||
field :key
|
||||
field :display
|
||||
|
||||
has_one :i18n_variable, :as => :language_value, :autosave => true, :dependent => :destroy
|
||||
|
||||
has_many :assets
|
||||
|
||||
def self.from_id(id)
|
||||
AssetCategory.find(id) rescue nil
|
||||
end
|
||||
|
||||
end
|
||||
+11
-1
@@ -2,10 +2,20 @@ class Link < Item
|
||||
|
||||
field :url
|
||||
|
||||
validates_presence_of :url
|
||||
validates :url, :presence => true, :format => /^(http|https):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(([0-9]{1,5})?\/.*)?$/ix
|
||||
|
||||
before_validation :add_http
|
||||
|
||||
def link
|
||||
ApplicationController.helpers.link_to(self.name, self.url)
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def add_http
|
||||
unless self.url[/^http?s:\/\//]
|
||||
self.url = 'http://' + self.url
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,10 +1,14 @@
|
||||
class Page < Item
|
||||
include Impressionist::Impressionable
|
||||
|
||||
is_impressionable :counter_cache => { :column_name => :view_count }
|
||||
|
||||
field :content
|
||||
field :app_frontend_url
|
||||
field :theme_id, :type => BSON::ObjectId, :default => nil
|
||||
field :category
|
||||
field :tag
|
||||
field :view_count, :type => Integer, :default => 0
|
||||
|
||||
belongs_to :design
|
||||
belongs_to :module_app
|
||||
|
||||
@@ -48,8 +48,8 @@ class AssetUploader < CarrierWave::Uploader::Base
|
||||
# end
|
||||
|
||||
# Override the filename of the uploaded files:
|
||||
# def filename
|
||||
# "something.jpg" if original_filename
|
||||
# end
|
||||
def filename
|
||||
model.filename
|
||||
end
|
||||
|
||||
end
|
||||
@@ -0,0 +1,17 @@
|
||||
|
||||
<tr id="<%= dom_id asset_category %>" class="with_action">
|
||||
<td>
|
||||
<%= asset_category.key %>
|
||||
<div class="quick-edit">
|
||||
<ul class="nav nav-pills hide">
|
||||
|
||||
<li><%= link_to t('asset_category.edit'), edit_admin_asset_category_path(asset_category), :remote => true %></li>
|
||||
<li><%= link_to t('asset_category.delete'), admin_asset_category_path(asset_category), :confirm => t('announcement.sure?'), :method => :delete, :remote => true %></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
<% @site_valid_locales.each do |locale| %>
|
||||
<td><%= asset_category.i18n_variable[locale] rescue nil %></td>
|
||||
<% end %>
|
||||
</tr>
|
||||
@@ -0,0 +1,30 @@
|
||||
<% # encoding: utf-8 %>
|
||||
|
||||
<%= form_for(@asset_category, :remote => true, :url => @url) do |f| %>
|
||||
|
||||
<h2><%= (@asset_category.new_record? ? 'Add' : 'Edit') %></h2>
|
||||
|
||||
<div id="widget-title">
|
||||
<%= f.label :key %>
|
||||
<%= f.text_field :key %>
|
||||
</div>
|
||||
|
||||
<div id="widget-title">
|
||||
<%= f.fields_for :i18n_variable, (@asset_category.new_record? ? @asset_category.build_i18n_variable : @asset_category.i18n_variable) do |f| %>
|
||||
<% @site_valid_locales.each do |locale| %>
|
||||
<div class="control-group">
|
||||
<%= label_tag "name-#{locale}", "Name-#{I18nVariable.from_locale(locale)}", :class => 'control-label' %>
|
||||
<div class="controls">
|
||||
<%= f.text_field locale, :class => 'input-xxlarge' %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="form-actions pagination-right">
|
||||
<%= f.submit t('submit'), :class=>'btn btn-primary' %>
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
$('<%= j render :partial => 'asset_category', :collection => [@asset_category] %>').appendTo('#asset_categories').hide().fadeIn();
|
||||
$("#new_asset_category")[0].reset();
|
||||
@@ -0,0 +1 @@
|
||||
$("#<%= dom_id @asset_category %>").remove();
|
||||
@@ -0,0 +1 @@
|
||||
$("#form > form").replaceWith("<%= j render "form" %>");
|
||||
@@ -0,0 +1,41 @@
|
||||
|
||||
<%= 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="span2"><%= t('asset_category.key') %></th>
|
||||
<% @site_valid_locales.each do |locale| %>
|
||||
<th class="span2"><%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %></th>
|
||||
<% end %>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<table id="asset_categories" class="table main-list">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="span2"></th>
|
||||
<% @site_valid_locales.each do |locale| %>
|
||||
<th class="span2"></th>
|
||||
<% end %>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<%= render :partial => 'asset_category', :collection => @asset_categories %>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div id="form"><%= render :partial => "form" %></div>
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
$("#form > form").replaceWith("<%= j render "form" %>");
|
||||
@@ -0,0 +1,4 @@
|
||||
$("#<%= dom_id @asset_category %>").replaceWith("<%= j render :partial => 'asset_category', :collection => [@asset_category] %>");
|
||||
<% @asset_category = AssetCategory.new(:display => 'List') # reset for new form %>
|
||||
$(".edit_asset_category").replaceWith("<%= j render "form" %>")
|
||||
$(".new_asset_category")[0].reset();
|
||||
@@ -1,17 +1,16 @@
|
||||
<tr id="asset_<%= asset.id %>" class="have">
|
||||
<td><%= asset.id %></td>
|
||||
<td><div class="assets_pic"><%= image_tag(asset.data.url) %></div>
|
||||
<%#= link_to asset.filename, asset.data.url, :target => '_blank' %>
|
||||
<tr id="asset_<%= asset.id %>" class="with_action">
|
||||
<td><%= check_box_tag 'to_delete[]', asset.id, false, :class => "checkbox_in_list" %></td>
|
||||
<td>
|
||||
<div class="assets_pic"><%= image_tag(asset.data.url) %></div>
|
||||
<div class="quick-edit">
|
||||
<ul class="nav nav-pills hide">
|
||||
<li><%= link_to t(:edit), edit_admin_asset_path(asset), :remote => true, :class => 'edit' %></li>
|
||||
<li class="dropdown"><%= link_to t(:delete), admin_asset_path(asset), :confirm => t('sure?'), :method => :delete, :class => 'delete' %></li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
<td><%= asset.description %></td>
|
||||
<td><%= asset.data.file.content_type %></td>
|
||||
<td><%= asset.data_identifier %></td>
|
||||
<td><%= number_to_human_size(asset.data.file.file_length) %></td>
|
||||
<td class="action">
|
||||
<%= link_to t(:edit), edit_admin_asset_path(asset), :remote => true, :class => 'edit' %>
|
||||
<%= link_to t(:delete), admin_asset_path(asset), :confirm => t('sure?'), :method => :delete, :remote => true, :class => 'delete' %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="6"></td>
|
||||
</tr>
|
||||
@@ -9,7 +9,7 @@
|
||||
<%= link_back %>
|
||||
<%= f.submit t(:edit) %>
|
||||
<% else %>
|
||||
<a id='ajax_form_submit'><%= t(:edit) %></a>
|
||||
<a id='ajax_form_submit'><%= t(:update) %></a>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
@@ -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 %>
|
||||
@@ -8,6 +8,11 @@
|
||||
<%= f.text_field :description, :class => 'text' %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<%= f.label :category %>
|
||||
<%= f.select :asset_category_id, @asset_categories.collect{|t| [ t.i18n_variable[I18n.locale], t.id ]}, {}, :class => "input-medium" %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<%= f.label :data, t('admin.data'), :class => 'file' %>
|
||||
<%= f.file_field :data %>
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
<%= render_sort_bar(true, ['title', 'title','span1-2', 'admin.title'],
|
||||
['description', 'description', 'span1-2', 'admin.description'],
|
||||
['intro', 'intro', 'span1-2', 'admin.intro'],
|
||||
['intro', 'intro', 'span1-2', 'admin.intro'],
|
||||
['intro', 'intro', 'span1-2', 'admin.file_length']).html_safe %>
|
||||
@@ -1,32 +1,31 @@
|
||||
<% content_for :secondary do %>
|
||||
<div class="assets_setup">
|
||||
<ul class="list">
|
||||
<li><%= link_to t(:new_asset, :scope => :admin), new_admin_asset_path, :remote => true, :class => 'button positive' %></li>
|
||||
<li><%= link_to t('admin.assets.file'), '', :remote => true, :class => 'button positive' %></li>
|
||||
<li><%= link_to t('admin.assets.album'), '', :remote => true, :class => 'button positive'%></li>
|
||||
<li><%= link_to t('admin.assets.video'), '', :remote => true, :class => 'button positive' %></li>
|
||||
<li><%= link_to t('admin.assets.book'), '', :remote => true, :class => 'button positive' %></li>
|
||||
</ul>
|
||||
</div>
|
||||
<% end -%>
|
||||
|
||||
<div class="main2">
|
||||
<h1><%= t('admin.list_assets') %></h1>
|
||||
|
||||
<table>
|
||||
<%= form_for :assets, :url => delete_admin_assets_path(:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil, :sort_options => params[:sort_options]), :html => {:id => 'delete_all'}, :remote => true do %>
|
||||
<%= render 'filter' %>
|
||||
<table id="asset_sort_list" class="table main-list">
|
||||
<thead>
|
||||
<tr>
|
||||
<td><%= t('admin.id') %></th>
|
||||
<td><%= t('admin.file_name') %></th>
|
||||
<td><%= t('admin.description') %></th>
|
||||
<td><%= t('admin.format') %></th>
|
||||
<td><%= t('admin.orig_upload_file') %></th>
|
||||
<td><%= t('admin.file_size') %></th>
|
||||
<td><%= t('admin.action') %></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="span1"></th>
|
||||
<th class="span1-2"></th>
|
||||
<th class="span1-2"></th>
|
||||
<th class="span1-2"></th>
|
||||
<th class="span1-2"></th>
|
||||
<th class="span1-2"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id='asset_tbody'>
|
||||
<tbody id="tbody_assets" class="sort-holder">
|
||||
<%= render :partial => 'asset', :collection => @assets %>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="form-actions form-fixed pagination-right">
|
||||
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('admin.add'), new_admin_asset_path, :remote => true, :class => 'btn btn-primary pull-right' %>
|
||||
<div id="asset_pagination" class="paginationFixed">
|
||||
<%= paginate @assets, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil, :sort_options => params[:sort_options]} %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% content_for :page_specific_javascript do %>
|
||||
<%= javascript_include_tag "/static/jquery.cycle.all.latest.js" %>
|
||||
<%= javascript_include_tag "inc/modal-preview" %>
|
||||
<% end %>
|
||||
|
||||
@@ -380,49 +380,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item element">
|
||||
<h3><i class="icons-"></i><a href=""><%= t(:traffic) %></a></h3>
|
||||
<div class="detail w-a h-a">
|
||||
<p class="totle"><span><%= t(:total_visitors) %></span>438,913</p>
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><%= t(:item) %></th>
|
||||
<th class="span2"><%= t(:data) %></th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
<div class="detal-list my_scroll">
|
||||
<div class="scrollbar">
|
||||
<div class="track">
|
||||
<div class="thumb">
|
||||
<div class="end"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="viewport">
|
||||
<div class="overview">
|
||||
<table class="table table-striped">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Visitors Today</td>
|
||||
<td>2,304</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Visitors This Month</td>
|
||||
<td>783</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Visitor This Tear</td>
|
||||
<td>45</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="item element">
|
||||
<h3><i class="icons-"></i><a href=""><%= t(:site_info) %></a></h3>
|
||||
<div class="detail noStatistics w-b h-a">
|
||||
@@ -481,6 +439,56 @@
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
|
||||
<div class="item element">
|
||||
<h3><i class="icons-"></i><%= t(:traffic) %></h3>
|
||||
<div class="detail w-a h-a">
|
||||
<p class="totle"><span><%= t(:total_visitors) %></span><%= display_visitors %></p>
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><%= t(:item) %></th>
|
||||
<th class="span2"><%= t(:data) %></th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
<div class="detal-list my_scroll">
|
||||
<div class="scrollbar">
|
||||
<div class="track">
|
||||
<div class="thumb">
|
||||
<div class="end"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="viewport">
|
||||
<div class="overview">
|
||||
<table class="table table-striped">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><%= t(:visitors_today) %></td>
|
||||
<td><%= display_visitors_today %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><%= t(:visitors_this_week) %></td>
|
||||
<td><%= display_visitors_this_week %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><%= t(:visitors_this_month) %></td>
|
||||
<td><%= display_visitors_this_month %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><%= t(:visitors_this_year) %></td>
|
||||
<td><%= display_visitors_this_year %></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="item element">
|
||||
<h3><i class="icons-"></i><%= t(:recent_update) %></h3>
|
||||
<div class="detail noStatistics w-b h-a">
|
||||
@@ -517,4 +525,43 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="item element">
|
||||
<h3><i class="icons-"></i><%= t(:most_visited_page) %></h3>
|
||||
<div class="detail noStatistics w-b h-a">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><%= t(:title) %></th>
|
||||
<th class="span2"><%= t(:module) %></th>
|
||||
<th class="span2"><%= t(:hits) %></th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
<div class="detal-list my_scroll">
|
||||
<div class="scrollbar">
|
||||
<div class="track">
|
||||
<div class="thumb">
|
||||
<div class="end"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="viewport">
|
||||
<div class="overview">
|
||||
<table class="table table-striped">
|
||||
<tbody>
|
||||
<% @most_visited.each do |object| %>
|
||||
<tr>
|
||||
<td><%= link_to ((object[0].title[I18n.locale] rescue nil) || (object[0].page.i18n_variable[I18n.locale] rescue nil)), get_link_to_object(object[0]) %></td>
|
||||
<td class="span2"><%= link_to t("dashboard.#{object[0]._type.underscore}"), get_link(object[0]._type.underscore) %></td>
|
||||
<td class="span2"><%= object[1] %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in new issue
Block a user