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

Conflicts:
	config/locales/zh_tw.yml
This commit is contained in:
Matthew K. Fu JuYuan committed 2012-05-14 12:36:09 +08:00
commit 2cd67356a5
80 files changed
+1216 -511

No files matched your search

@@ -15,6 +15,12 @@ class Admin::ItemsController < ApplicationController
@item = get_homepage
end
end
def update_position
item = Item.find(params[:id])
item.shift_to(params[:parent_id], params[:position])
render :nothing => true
end
protected
@@ -11,7 +11,17 @@ class Admin::ModuleAppsController < ApplicationController
def reload_frontend_pages
@module_app = ModuleApp.find(params[:id])
@categories = @module_app.key.eql?('announcement') ? BulletinCategory.all : nil
case @module_app.key
when 'announcement'
@categories = BulletinCategory.all
@tags = AnnouncementTag.all
when 'news'
@categories = NewsBulletinCategory.all
@tags = NewsTag.all
when 'web_resource'
@categories = WebLinkCategory.all
@tags = WebResourceTag.all
end
respond_to do |format|
format.js {}
end
@@ -22,17 +22,20 @@ class Admin::PagePartsController < ApplicationController
def edit
@part = PagePart.find(params[:id])
@module_apps = ModuleApp.all(:conditions => {:enable_frontend => true})
@module_apps = ModuleApp.excludes(widgets: nil).where(enable_frontend: true).order_by(:title, :asc)
@module_app = @part.module_app ? @part.module_app : @module_apps[0]
@r_tag = @part.public_r_tag.blank? ? LIST[:public_r_tags][0] : @part.public_r_tag
@tag_objects = @r_tag.classify.constantize.all rescue nil
case @module_app.key
when 'announcement'
@categories = BulletinCategory.all
@tags = AnnouncementTag.all
when 'news'
@categories = NewsBulletinCategory.all
@tags = NewsTag.all
when 'web_resource'
@categories = WebLinkCategory.all
@tags = WebResourceTag.all
end
end
@@ -69,10 +72,13 @@ class Admin::PagePartsController < ApplicationController
case @module_app.key
when 'announcement'
@categories = BulletinCategory.all
@tags = AnnouncementTag.all
when 'news'
@categories = NewsBulletinCategory.all
@tags = NewsTag.all
when 'web_resource'
@categories = WebLinkCategory.all
@tags = WebResourceTag.all
end
respond_to do |format|
format.js {}
+5 -2
View File
@@ -20,14 +20,14 @@ class Admin::PagesController < ApplicationController
def new
@item = Page.new
@item.parent = Item.find(params[:parent_id]) rescue nil
@apps = ModuleApp.all
@apps = ModuleApp.excludes(app_pages: nil).entries
@designs = Design.all.entries
@design = Design.first
end
def edit
@item = Page.find(params[:id])
@apps = ModuleApp.all
@apps = ModuleApp.excludes(app_pages: nil).entries
@designs = Design.all.entries
@design = @item.design ? @item.design : @designs.first
@app_frontend_urls = @item.module_app.app_pages if @item.module_app
@@ -35,10 +35,13 @@ class Admin::PagesController < ApplicationController
case @item.module_app.key
when 'announcement'
@categories = BulletinCategory.all
@tags = AnnouncementTag.all
when 'news'
@categories = NewsBulletinCategory.all
@tags = NewsTag.all
when 'web_resource'
@categories = WebLinkCategory.all
@tags = WebResourceTag.all
end
else
@categories = nil
+2 -2
View File
@@ -99,9 +99,9 @@ class ApplicationController < ActionController::Base
end
# Render the page
def render_page(param={})
def render_page
if @item
render :text => process_page(@item, param[:id], param), :layout => 'page_layout'
render :text => parse_page_noko(@item), :layout => 'page_layout'
else
render :text => '404 Not Found'
end
+1 -1
View File
@@ -24,7 +24,7 @@ class OrbitBackendController< ApplicationController
def check_user_can_use
unless check_permission
#redirect_to polymorphic_path(['panel',@app_title,'back_end','public'])
render :text => '403 Forbidden'
redirect_to root_url
end
end
@@ -1,7 +1,7 @@
class OrbitFrontendComponentController< ApplicationController
before_filter :setup_vars
before_filter {|c| c.front_end_available(@app_title)}
layout :false
layout "module_widget"
def setup_vars
@app_title = request.fullpath.split('/')[2]
+12 -10
View File
@@ -15,11 +15,11 @@ class PagesController < ApplicationController
def show
#begin
@item = Item.first(:conditions => {:full_name => params[:page_name]})
@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(params)
render_page
when 'Link'
redirect_to "http://#{@item[:url]}"
end
@@ -32,17 +32,19 @@ class PagesController < ApplicationController
end
def index_from_link
if params[:page]
redirect_to "/#{@item.full_name}?page=#{params[:page]}&category_id=#{params[:category_id]}&tag_id=#{params[:tag_id]}"
else
redirect_to "/#{@item.full_name}?category_id=#{params[:category_id]}&tag_id=#{params[:tag_id]}"
end
url = "/#{@item.path}"
options = ''
options << "?page_main=#{params[:page_main]}" unless params[:page_main].blank?
options << "#{options.blank? ? '?' : '&'}category_id=#{params[:category_id]}" unless params[:category_id].blank?
options << "#{options.blank? ? '?' : '&'}tag_id=#{params[:tag_id]}" unless params[:tag_id].blank?
redirect_to url + options
end
def show_from_link
# debugger
# a=1
redirect_to "/#{@item.full_name}?id=#{params[:id]}&preview=#{params[:preview]}"
url = "/#{@item.path}?id=#{params[:id]}"
options = ''
options << "&preview=#{params[:preview]}" unless params[:preview].blank?
redirect_to url + options
end
def load_orbit_bar