forgeos_cms 1.9.4 → 1.9.5.rc1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +2 -0
- data/MIT-LICENSE +20 -0
- data/README.textile +3 -1
- data/app/assets/javascripts/forgeos/admin/functions.js +2 -0
- data/app/assets/javascripts/forgeos/admin/functions/forgeos_cms/all.js +1 -0
- data/app/assets/javascripts/forgeos/admin/functions/forgeos_cms/carousels.js +4 -4
- data/app/assets/javascripts/forgeos/admin/inits.js +2 -0
- data/app/assets/javascripts/forgeos/admin/inits/forgeos_cms/all.js +1 -0
- data/app/assets/javascripts/forgeos/admin/inits/forgeos_cms/carousels.js +5 -1
- data/app/assets/stylesheets/forgeos/admin/forgeos_cms/_blocks.css.sass +12 -10
- data/app/assets/stylesheets/forgeos/jstree/themes/association_page/style.css.sass +4 -4
- data/app/assets/stylesheets/forgeos/jstree/themes/block_category/style.css.sass +4 -4
- data/app/assets/stylesheets/forgeos/jstree/themes/menu-tree/style.css.sass +10 -7
- data/app/assets/stylesheets/forgeos/jstree/themes/page_category/style.css.sass +4 -4
- data/app/controllers/admin/actualities_controller.rb +15 -5
- data/app/controllers/admin/import_controller.rb +2 -2
- data/app/controllers/admin/menus_controller.rb +13 -2
- data/app/controllers/admin/newsletters_controller.rb +8 -5
- data/app/controllers/admin/pages_controller.rb +6 -2
- data/app/controllers/admin/static_content_blocks_controller.rb +6 -2
- data/app/controllers/admin/widgets_controller.rb +7 -4
- data/app/helpers/admin/base_helper.rb +5 -5
- data/app/models/block.rb +1 -1
- data/app/models/page_sweeper.rb +1 -1
- data/app/views/admin/actualities/_form.html.haml +2 -2
- data/app/views/admin/actualities/activate.js.erb +1 -0
- data/app/views/admin/actualities/destroy.js.erb +1 -0
- data/app/views/admin/actualities/index.json.erb +3 -6
- data/app/views/admin/carousels/_form.html.haml +2 -2
- data/app/views/admin/categories/_block.html.haml +1 -0
- data/app/views/admin/menus/_form.html.haml +1 -1
- data/app/views/admin/menus/_form_menu_links.html.haml +2 -0
- data/app/views/admin/menus/activate.js.erb +1 -0
- data/app/views/admin/menus/destroy.js.erb +1 -0
- data/app/views/admin/menus/index.json.erb +4 -6
- data/app/views/admin/newsletters/_form.html.haml +1 -1
- data/app/views/admin/newsletters/destroy.js.erb +1 -0
- data/app/views/admin/newsletters/index.json.erb +1 -3
- data/app/views/admin/pages/_form.html.haml +1 -1
- data/app/views/admin/pages/_page_url.html.haml +1 -0
- data/app/views/admin/pages/_seo.html.haml +1 -2
- data/app/views/admin/pages/destroy.js.erb +1 -0
- data/app/views/admin/pages/index.json.erb +3 -5
- data/app/views/admin/static_content_blocks/_form.html.haml +1 -1
- data/app/views/admin/static_content_blocks/destroy.js.erb +1 -0
- data/app/views/admin/static_content_blocks/index.json.erb +3 -6
- data/app/views/admin/widget_actualities/_form.html.haml +1 -1
- data/app/views/admin/widget_faqs/_form.html.haml +1 -1
- data/app/views/admin/widgets/destroy.js.erb +1 -0
- data/app/views/admin/widgets/index.json.erb +2 -4
- data/config/forgeos_admin_menu.yml +13 -0
- data/config/locales/activerecord/en.yml +0 -1
- data/config/locales/activerecord/fr.yml +0 -1
- data/config/locales/admin/page/fr.yml +5 -5
- data/config/routes.rb +5 -2
- data/lib/forgeos/cms.rb +0 -1
- data/lib/forgeos/cms/engine.rb +4 -1
- data/lib/forgeos/cms/version.rb +5 -0
- data/lib/forgeos_cms.rb +0 -2
- data/test/dummy/Rakefile +7 -0
- data/test/dummy/app/assets/javascripts/application.js +9 -0
- data/test/dummy/app/assets/stylesheets/application.css +7 -0
- data/test/dummy/app/controllers/application_controller.rb +3 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/config/application.rb +42 -0
- data/test/dummy/config/boot.rb +10 -0
- data/test/dummy/config/database.yml +25 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +27 -0
- data/test/dummy/config/environments/production.rb +51 -0
- data/test/dummy/config/environments/test.rb +39 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/inflections.rb +10 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/secret_token.rb +7 -0
- data/test/dummy/config/initializers/session_store.rb +8 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +5 -0
- data/test/dummy/config/routes.rb +58 -0
- data/test/dummy/public/404.html +26 -0
- data/test/dummy/public/422.html +26 -0
- data/test/dummy/public/500.html +26 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/script/rails +6 -0
- data/test/forgeos_cms_test.rb +7 -0
- data/test/test_helper.rb +10 -0
- metadata +337 -307
- data/app/controllers/actualities_controller.rb +0 -11
- data/app/controllers/admin/base_controller.rb +0 -11
- data/app/controllers/forgeos/application_controller.rb +0 -38
- data/app/controllers/newsletters_controller.rb +0 -11
- data/app/controllers/pages_controller.rb +0 -24
- data/app/controllers/search_controller.rb +0 -7
- data/app/helpers/application_helper.rb +0 -43
- data/app/helpers/menu_helper.rb +0 -46
- data/app/helpers/routes_helper.rb +0 -19
- data/app/views/actualities/rss.rxml +0 -20
- data/app/views/admin/carousels/_attachments_popups.html.haml +0 -43
- data/app/views/pages/_linked_pages.html.haml +0 -4
- data/app/views/pages/_page.html.haml +0 -15
- data/app/views/pages/show.html.haml +0 -9
- data/app/views/search/index.html.haml +0 -8
- data/lib/forgeos/admin_menu.rb +0 -14
@@ -1,11 +0,0 @@
|
|
1
|
-
class ActualitiesController < Forgeos::ApplicationController
|
2
|
-
|
3
|
-
def rss
|
4
|
-
@actualities = Actuality.find_all_by_active(true, :limit => 20, :order => 'created_at DESC')
|
5
|
-
@feed_title = 'Feed title'
|
6
|
-
@feed_description = 'Feed description'
|
7
|
-
@locale = 'fr-fr'
|
8
|
-
response.headers['Content-Type'] = 'application/rss+xml'
|
9
|
-
end
|
10
|
-
|
11
|
-
end
|
@@ -1,11 +0,0 @@
|
|
1
|
-
load File.join(Gem.loaded_specs['forgeos_core'].full_gem_path, 'app', 'controllers', 'admin', 'base_controller.rb')
|
2
|
-
Admin::BaseController.class_eval do
|
3
|
-
before_filter :forgeos_cms_javascripts_files
|
4
|
-
|
5
|
-
private
|
6
|
-
|
7
|
-
def forgeos_cms_javascripts_files
|
8
|
-
@forgeos_js_functions_files += forgeos_javascripts_files('forgeos_cms', 'forgeos/admin/functions')
|
9
|
-
@forgeos_js_inits_files += forgeos_javascripts_files('forgeos_cms', 'forgeos/admin/inits')
|
10
|
-
end
|
11
|
-
end
|
@@ -1,38 +0,0 @@
|
|
1
|
-
load File.join(Gem.loaded_specs['forgeos_core'].full_gem_path, 'app', 'controllers', 'forgeos', 'application_controller.rb')
|
2
|
-
|
3
|
-
Forgeos::ApplicationController.class_eval do
|
4
|
-
include RoutesHelper
|
5
|
-
|
6
|
-
private
|
7
|
-
|
8
|
-
def page_not_found
|
9
|
-
if @page = Page.find_by_single_key(404)
|
10
|
-
return render(@page, :layout => true, :status => 404)
|
11
|
-
else
|
12
|
-
return render(:text => (I18n.t('page_not_found') || 'page not found'), :layout => false, :status => 404)
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
def render_optional_error_file(status_code)
|
17
|
-
status = interpret_status(status_code)
|
18
|
-
locale_path = "#{Rails.public_path}/#{status[0,3]}.#{I18n.locale}.html" if I18n.locale
|
19
|
-
cached_path = "#{Rails.configuration.action_controller.page_cache_directory}/#{status[0,3]}.html" if Rails.configuration.action_controller.page_cache_directory
|
20
|
-
path = "#{Rails.public_path}/#{status[0,3]}.html"
|
21
|
-
|
22
|
-
if locale_path && File.exist?(locale_path)
|
23
|
-
render :file => locale_path, :status => status, :content_type => Mime::HTML
|
24
|
-
elsif cached_path && File.exist?(cached_path)
|
25
|
-
render :file => cached_path, :status => status, :content_type => Mime::HTML
|
26
|
-
elsif File.exist?(path)
|
27
|
-
render :file => path, :status => status, :content_type => Mime::HTML
|
28
|
-
else
|
29
|
-
head status
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
# Rails Bug fix on Nested inheritance models : Load nested models to use it parent class
|
35
|
-
Carousel
|
36
|
-
WidgetActuality
|
37
|
-
WidgetFaq
|
38
|
-
LinkPage
|
@@ -1,11 +0,0 @@
|
|
1
|
-
class NewslettersController < Forgeos::ApplicationController
|
2
|
-
skip_before_filter :verify_authenticity_token, :only => [:create]
|
3
|
-
def create
|
4
|
-
if Newsletter.find_or_create_by_email(params[:newsletter])
|
5
|
-
flash[:notice] = t('newsletter.subscribe.success')
|
6
|
-
else
|
7
|
-
flash[:error] = t('newsletter.subscribe.failed')
|
8
|
-
end
|
9
|
-
redirect_to :back
|
10
|
-
end
|
11
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
class PagesController < Forgeos::ApplicationController
|
2
|
-
before_filter :get_page, :only => [ :show ]
|
3
|
-
caches_page :show, :if => :get_page
|
4
|
-
|
5
|
-
def index
|
6
|
-
if @page = Page.find_by_single_key('home')
|
7
|
-
redirect_to(@page)
|
8
|
-
else
|
9
|
-
page_not_found
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
def show
|
14
|
-
return page_not_found unless @page
|
15
|
-
end
|
16
|
-
|
17
|
-
private
|
18
|
-
|
19
|
-
def get_page
|
20
|
-
url = params[:url].last.gsub(/\.\w+$/,'')
|
21
|
-
@format = params[:url].last.split('.').last || request.format
|
22
|
-
@page = Page.find_by_url(url, :conditions => { :active => true })
|
23
|
-
end
|
24
|
-
end
|
@@ -1,43 +0,0 @@
|
|
1
|
-
# Methods added to this helper will be available to all templates in the application.
|
2
|
-
module ApplicationHelper
|
3
|
-
include MenuHelper
|
4
|
-
def meta_info(page, meta)
|
5
|
-
if page && page.meta_info
|
6
|
-
case meta
|
7
|
-
when :title
|
8
|
-
return page.meta_info.title
|
9
|
-
when :keywords
|
10
|
-
return page.meta_info.keywords
|
11
|
-
when :description
|
12
|
-
return page.meta_info.description
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
def page_by_key(single_key)
|
18
|
-
page = Page.find_by_single_key(single_key)
|
19
|
-
return page ? page : @page
|
20
|
-
end
|
21
|
-
|
22
|
-
def block_content_by_key(single_key)
|
23
|
-
block = Block.find_by_single_key(single_key)
|
24
|
-
block.content if block
|
25
|
-
end
|
26
|
-
|
27
|
-
def page_category_path(object)
|
28
|
-
super(:id => nil, :category_name => object.name)
|
29
|
-
end
|
30
|
-
|
31
|
-
def render_block(id)
|
32
|
-
block = case id
|
33
|
-
when Integer
|
34
|
-
Block.find_by_id(id)
|
35
|
-
when Block
|
36
|
-
id
|
37
|
-
when String, Symbol
|
38
|
-
Block.find_by_single_key(id)
|
39
|
-
end
|
40
|
-
|
41
|
-
block ? block.content : nil
|
42
|
-
end
|
43
|
-
end
|
data/app/helpers/menu_helper.rb
DELETED
@@ -1,46 +0,0 @@
|
|
1
|
-
module MenuHelper
|
2
|
-
def display_menu_front(menu, options = {}, &block)
|
3
|
-
if !menu.nil? and menu.active?
|
4
|
-
lis = get_menu_li(menu.menu_links, options, &block)
|
5
|
-
content_tag :ul, lis.join , :class => options[:ul_class]
|
6
|
-
end
|
7
|
-
end
|
8
|
-
alias_method :display_menu, :display_menu_front
|
9
|
-
|
10
|
-
private
|
11
|
-
def get_li_class(menu_link, options)
|
12
|
-
if options[:li_current_class] &&
|
13
|
-
# request uri equals menu_link url or one of its children url
|
14
|
-
(menu_link.url_match?(request.request_uri) ||
|
15
|
-
# request page equals page link target or one of its children page link targe
|
16
|
-
(options[:page] && menu_link.is_a?(PageLink) && menu_link.url_match?(options[:page])))
|
17
|
-
options[:li_current_class]
|
18
|
-
else
|
19
|
-
options[:li_class]
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
def get_menu_li(menu_links, options, &block)
|
24
|
-
lis = []
|
25
|
-
links = menu_links.find_all_by_active(true)
|
26
|
-
links.each_with_index do |menu_link,index|
|
27
|
-
if menu_link.active?
|
28
|
-
li_class = get_li_class(menu_link, options)
|
29
|
-
li_class = li_class ? [li_class] : []
|
30
|
-
li_class << 'first' if index == 0
|
31
|
-
li_class << 'last' if index == links.size - 1
|
32
|
-
li_link = if block_given?
|
33
|
-
capture(menu_link,&block)
|
34
|
-
else
|
35
|
-
link_to(menu_link.title,menu_link.url, :popup => menu_link.popup)
|
36
|
-
end
|
37
|
-
children = menu_link.children
|
38
|
-
unless children.empty?
|
39
|
-
li_link += content_tag :ul, get_menu_li(children, options, &block).join , :class => options[:ul_class]
|
40
|
-
end
|
41
|
-
lis << content_tag(:li, li_link, :class => (li_class.empty? ? nil : li_class.join(' ')) )
|
42
|
-
end
|
43
|
-
end
|
44
|
-
return lis
|
45
|
-
end
|
46
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
module RoutesHelper
|
2
|
-
def page_path(*args)
|
3
|
-
super(extract_page_options(args))
|
4
|
-
end
|
5
|
-
|
6
|
-
def page_url(*args)
|
7
|
-
super(extract_page_options(args))
|
8
|
-
end
|
9
|
-
|
10
|
-
def extract_page_options(args)
|
11
|
-
options = args.dup.extract_options!
|
12
|
-
object = args.first
|
13
|
-
if object.kind_of?(Page)
|
14
|
-
return options.merge(:url => object.url)
|
15
|
-
else
|
16
|
-
return args
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
xml.instruct! :xml, :version=>"1.0"
|
2
|
-
|
3
|
-
xml.rss(:version=>"2.0", "xmlns:atom" => "http://www.w3.org/2005/Atom") do
|
4
|
-
xml.channel do
|
5
|
-
xml.title @feed_title
|
6
|
-
xml.link actualities_url
|
7
|
-
xml.description @feed_description
|
8
|
-
xml.language @locale
|
9
|
-
@actualities.each do |a|
|
10
|
-
xml.item do
|
11
|
-
xml.title a.title
|
12
|
-
xml.description a.content
|
13
|
-
xml.author "#{a.admin.email} (#{a.admin.fullname})"
|
14
|
-
xml.pubDate a.created_at.strftime("%a, %d %b %Y %H:%M:%S %z")
|
15
|
-
xml.link actualities_url(a)
|
16
|
-
xml.guid actualities_url(a)
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
@@ -1,43 +0,0 @@
|
|
1
|
-
#imageUploadDialog.upload-lightbox-container.white
|
2
|
-
#imageUpload
|
3
|
-
= form.file_field :uploaded_data
|
4
|
-
= hidden_field_tag :target, params[:target]
|
5
|
-
= hidden_field_tag :target_id, params[:target_id]
|
6
|
-
= form.submit I18n.t('save').capitalize
|
7
|
-
%span= I18n.t('or')
|
8
|
-
= link_to_function I18n.t('media.add_form_library'), "$('#imageSelectDialog').dialog('open');"
|
9
|
-
|
10
|
-
#imageSelectDialog.media-hoverlay
|
11
|
-
.media-hoverlay-header
|
12
|
-
= link_to_function content_tag(:span, I18n.t('media.picture.upload.action').capitalize, :class=>'big-icons add-picture'), "$(\'#imageUploadDialog\').dialog(\'open\'); $(\'#imageSelectDialog\').dialog(\'close\')", :class=>'backgrounds button'
|
13
|
-
.display-mode
|
14
|
-
.heading-separator
|
15
|
-
.display-thumbnails
|
16
|
-
.display-list.off
|
17
|
-
#search.right.image
|
18
|
-
%a.small-icons.left.search-link{ :href => "#" }
|
19
|
-
%span.small-icons.search-span
|
20
|
-
Search
|
21
|
-
.backgrounds.search-form-image
|
22
|
-
.backgrounds.search-form-thumbnails
|
23
|
-
.media-hoverlay-sidebar.grid_3.omega.alpha
|
24
|
-
.sidebar-content
|
25
|
-
%h2{ :class => 'small-icons picture'}
|
26
|
-
= link_to_function I18n.t('media.picture.all').capitalize, "select_all_elements_without_category('picture-attachment-tree')"
|
27
|
-
#picture-attachment-tree
|
28
|
-
.media-hoverlay-content.thumbnails
|
29
|
-
.table#thumbnail-table.datatable.media.selectable_rows
|
30
|
-
.media-hoverlay-content.table.hidden
|
31
|
-
%table#image-table.datatable.media.selectable_rows
|
32
|
-
%tr
|
33
|
-
%td
|
34
|
-
|
35
|
-
= dataSlides_tag :id => 'thumbnail-table', :url => forgeos_core.admin_attachments_path(:format => :json, :skin => 'thumbnail', :file_type => 'picture', :mode => 'selection'), :columns => [ '{ "bSortable": true, "bSearchable": true, "sType": "string", "bUseRendered": true, "fnRender": null, "iDataSort": 0, "nTf": null, "nTh": function(){$(".thead").find(".th");}, "sWidth": "0px"}','{"bVisible": false}', '{ "bVisible": false }', '{ "bVisible": false}' ], :autostart => false
|
36
|
-
|
37
|
-
= dataTables_tag :id => 'image-table', :url => forgeos_core.admin_attachments_path(:format => :json, :file_type => 'picture', :mode => 'selection'), :columns => ["{'sClass':'th-checkbox-container', 'bSortable': false }","{ 'sTitle': '#{I18n.t('media.filename')}'}","{ 'sTitle': '#{I18n.t('media.content_type')}'}","{ 'sTitle': '#{I18n.t('media.updated_at')}'}","{ 'sTitle': '#{I18n.t('media.size')}'}", '{"bVisible": false}', '{ "bVisible": false }','{ "bVisible": false}','{ "bVisible": false}','{ "bVisible": false}'], :autostart => false
|
38
|
-
|
39
|
-
|
40
|
-
:javascript
|
41
|
-
function initImageUpload(link) {
|
42
|
-
forgeosInitUpload('#image', 'add_picture_to_carousel_item');
|
43
|
-
}
|
@@ -1,15 +0,0 @@
|
|
1
|
-
- object.blocks.each do |block|
|
2
|
-
- case block
|
3
|
-
- when Carousel
|
4
|
-
.carousel-list
|
5
|
-
%ul{ :id => "carousel_#{block.id}" }
|
6
|
-
- block.items.each do |item|
|
7
|
-
%li
|
8
|
-
= link_to image_tag(item.picture.public_filename(:normal), :alt => item.picture.name ), item.url
|
9
|
-
%span= item.title
|
10
|
-
- else
|
11
|
-
%div{ :id => "block_#{block.id}" }= block.content
|
12
|
-
%div{ :id => "page_#{object.id}" }= object.content
|
13
|
-
|
14
|
-
= render :partial => 'pages/linked_pages', :locals => { :linked_pages => object.linked_pages }
|
15
|
-
= statistics_collector_tag(object)
|
@@ -1,9 +0,0 @@
|
|
1
|
-
- if @page
|
2
|
-
= render @page
|
3
|
-
- if @page.meta_info
|
4
|
-
- content_for :title, @page.meta_info.title
|
5
|
-
- content_for :meta_description, @page.meta_info.description
|
6
|
-
- content_for :meta_keywords, @page.meta_info.keywords
|
7
|
-
|
8
|
-
- else
|
9
|
-
= I18n.t('page_not_found').capitalize
|
data/lib/forgeos/admin_menu.rb
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
# Set administration's menu
|
2
|
-
Forgeos::AdminMenu << {
|
3
|
-
:title => 'back_office.menu.pages',
|
4
|
-
:url => [
|
5
|
-
'/admin/pages',
|
6
|
-
'/admin/static_content_blocks',
|
7
|
-
'/admin/widgets',
|
8
|
-
'/admin/carousels',
|
9
|
-
'/admin/widget_actualities',
|
10
|
-
'/admin/menus'
|
11
|
-
],
|
12
|
-
:i18n => true,
|
13
|
-
:html => { :class => 'left last'}
|
14
|
-
}
|