Merge branch 'design_team' into ldap for NCCU 0229 demo on Redmine
Conflicts: app/views/devise/passwords/new.html.erb app/views/devise/sessions/new.html.erb
This commit is contained in:
commit
9a40ecd1d9
186 files changed
+7748
-4699
No files matched your search
@@ -15,21 +15,6 @@ class Admin::ItemsController < ApplicationController
|
||||
@item = get_homepage
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
#TODO
|
||||
# Allow to move items down and up different parents
|
||||
# def up
|
||||
# @item = Item.find(params[:id])
|
||||
# @item.move_higher
|
||||
# redirect_to admin_items_url( :parent_name => @item.parent_name )
|
||||
# end
|
||||
#
|
||||
# def down
|
||||
# @item = Item.find(params[:id])
|
||||
# @item.move_lower
|
||||
# redirect_to admin_items_url( :parent_name => @item.parent_name )
|
||||
# end
|
||||
|
||||
protected
|
||||
|
||||
|
||||
@@ -12,13 +12,11 @@ class Admin::LinksController < ApplicationController
|
||||
|
||||
def new
|
||||
@item = Link.new
|
||||
@item.is_published = true
|
||||
@item.parent_id = Page.find(params[:parent_id]).id rescue nil
|
||||
@item.parent = Page.find(params[:parent_id]) rescue nil
|
||||
end
|
||||
|
||||
def edit
|
||||
@item = Link.find(params[:id])
|
||||
@i18n_variable = @item.i18n_variable
|
||||
end
|
||||
|
||||
def create
|
||||
@@ -34,7 +32,6 @@ class Admin::LinksController < ApplicationController
|
||||
end
|
||||
else
|
||||
flash.now[:error] = t('admin.create_error_link')
|
||||
@i18n_variable = @item.i18n_variable
|
||||
render :action => "new"
|
||||
end
|
||||
end
|
||||
@@ -52,7 +49,6 @@ class Admin::LinksController < ApplicationController
|
||||
end
|
||||
else
|
||||
flash.now[:error] = t('admin.update_error_link')
|
||||
@i18n_variable = @item.i18n_variable
|
||||
render :action => "edit"
|
||||
end
|
||||
end
|
||||
@@ -60,7 +56,6 @@ class Admin::LinksController < ApplicationController
|
||||
def destroy
|
||||
@item = Link.find(params[:id])
|
||||
@item.destroy
|
||||
@item.destroy_i18n_variable
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
redirect_to admin_items_url
|
||||
|
||||
@@ -11,6 +11,7 @@ class Admin::ModuleAppsController < ApplicationController
|
||||
|
||||
def reload_frontend_pages
|
||||
@module_app = ModuleApp.find(params[:id])
|
||||
@categories = @module_app.key.eql?('announcement') ? BulletinCategory.all : nil
|
||||
respond_to do |format|
|
||||
format.js {}
|
||||
end
|
||||
|
||||
@@ -26,6 +26,12 @@ class Admin::PagePartsController < ApplicationController
|
||||
@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
|
||||
case @module_app.key
|
||||
when 'bulletin'
|
||||
@categories = BulletinCategory.all
|
||||
when 'web_resource'
|
||||
@categories = WebLinkCategory.all
|
||||
end
|
||||
end
|
||||
|
||||
def create
|
||||
@@ -58,6 +64,12 @@ class Admin::PagePartsController < ApplicationController
|
||||
|
||||
def reload_widgets
|
||||
@module_app = ModuleApp.find(params[:id])
|
||||
case @module_app.key
|
||||
when 'announcement'
|
||||
@categories = BulletinCategory.all
|
||||
when 'web_resource'
|
||||
@categories = WebLinkCategory.all
|
||||
end
|
||||
respond_to do |format|
|
||||
format.js {}
|
||||
end
|
||||
|
||||
@@ -19,24 +19,28 @@ class Admin::PagesController < ApplicationController
|
||||
|
||||
def new
|
||||
@item = Page.new
|
||||
@item.parent = Item.find(params[:parent_id]) rescue nil
|
||||
@apps = ModuleApp.all
|
||||
@item.is_published = true
|
||||
@item.parent_id = @parent_item.id rescue nil
|
||||
@designs = Design.all.entries
|
||||
@default_design = Design.first
|
||||
@design = Design.first
|
||||
end
|
||||
|
||||
def edit
|
||||
@item = Page.find(params[:id])
|
||||
@apps = ModuleApp.all
|
||||
@i18n_variable = @item.i18n_variable
|
||||
@designs = Design.all.entries
|
||||
@design = @item.design
|
||||
@design = @item.design ? @item.design : @designs.first
|
||||
@app_frontend_urls = @item.module_app.app_pages if @item.module_app
|
||||
@categories = BulletinCategory.all if @item.module_app && @item.module_app.key.eql?('announcement')
|
||||
end
|
||||
|
||||
def create
|
||||
@item = Page.new(params[:page])
|
||||
|
||||
if @item.module_app.key == 'page_content'
|
||||
@item.page_contexts.build(:create_user_id => current_user.id, :update_user_id => current_user.id )
|
||||
end
|
||||
|
||||
if @item.save
|
||||
flash.now[:notice] = t('admin.create_success_page')
|
||||
respond_to do |format|
|
||||
@@ -47,13 +51,20 @@ class Admin::PagesController < ApplicationController
|
||||
end
|
||||
else
|
||||
flash.now[:error] = t('admin.create_error_page')
|
||||
@i18n_variable = @item.i18n_variable
|
||||
@apps = ModuleApp.all
|
||||
@designs = Design.all.entries
|
||||
@design = Design.first
|
||||
render :action => "new"
|
||||
end
|
||||
end
|
||||
|
||||
def update
|
||||
@item = Page.find(params[:id])
|
||||
|
||||
if @item.module_app && @item.module_app.key == 'page_content' && @item.page_contexts.blank?
|
||||
@item.page_contexts.build(:create_user_id => current_user.id, :update_user_id => current_user.id )
|
||||
end
|
||||
|
||||
if @item.update_attributes(params[:page])
|
||||
flash[:notice] = t('admin.update_success_page')
|
||||
respond_to do |format|
|
||||
@@ -70,8 +81,6 @@ class Admin::PagesController < ApplicationController
|
||||
def destroy
|
||||
@item = Page.find(params[:id])
|
||||
@item.destroy
|
||||
@item.destroy_page_parts
|
||||
@item.destroy_i18n_variable
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
redirect_to admin_items_url( :parent_id => @item.parent_id )
|
||||
|
||||
@@ -3,6 +3,8 @@ class ApplicationController < ActionController::Base
|
||||
|
||||
include ParserFrontEnd, ParserBackEnd
|
||||
|
||||
layout :layout_by_resource
|
||||
|
||||
helper :all
|
||||
before_filter :set_locale, :set_site
|
||||
|
||||
@@ -104,6 +106,12 @@ class ApplicationController < ActionController::Base
|
||||
Item.first(:conditions => {:parent_id => nil})
|
||||
end
|
||||
|
||||
|
||||
def layout_by_resource
|
||||
if devise_controller?
|
||||
"devise"
|
||||
else
|
||||
"application"
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,7 +1,7 @@
|
||||
class ObitFrontendComponentController< ApplicationController
|
||||
before_filter :setup_vars
|
||||
before_filter {|c| c.front_end_available(@app_title)}
|
||||
layout 'production'
|
||||
layout 'module_widget'
|
||||
|
||||
def setup_vars
|
||||
@app_title = request.fullpath.split('/')[2]
|
||||
|
||||
@@ -13,13 +13,16 @@ class PagesController < ApplicationController
|
||||
|
||||
def show
|
||||
#begin
|
||||
item = Item.first(:conditions => {:full_name => params[:page_name]})
|
||||
case item._type
|
||||
when 'Page'
|
||||
@item = item
|
||||
render_page(params[:id])
|
||||
when 'Link'
|
||||
redirect_to "http://#{item[:url]}"
|
||||
@item = Item.first(:conditions => {:full_name => params[:page_name]})
|
||||
if @item && @item.is_published
|
||||
case @item._type
|
||||
when 'Page'
|
||||
render_page(params[:id])
|
||||
when 'Link'
|
||||
redirect_to "http://#{@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
|
||||
@@ -35,14 +38,18 @@ class PagesController < ApplicationController
|
||||
end
|
||||
|
||||
def load_orbit_bar
|
||||
render :partial => 'layouts/orbit_bar'
|
||||
render :partial => 'layouts/orbit_bar', :locals => {:referer => request.referer}
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def get_item
|
||||
module_app = ModuleApp.first(:conditions => {:key => params[:app_name]})
|
||||
@item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action]})
|
||||
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
|
||||
end
|
||||
|
||||
end
|
||||
Reference in new issue
Block a user