mcms_pages 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/MIT-LICENSE +20 -0
- data/README.rdoc +3 -0
- data/Rakefile +40 -0
- data/app/assets/images/layouts/one-column.png +0 -0
- data/app/assets/images/layouts/three-column.png +0 -0
- data/app/assets/images/layouts/two-column-with-left.png +0 -0
- data/app/assets/images/layouts/two-column-with-right.png +0 -0
- data/app/assets/images/mcms_pages/9.jpg +0 -0
- data/app/assets/images/mcms_pages/background.jpg +0 -0
- data/app/assets/images/mcms_pages/bamboo_love.jpg +0 -0
- data/app/assets/images/mcms_pages/branch-end.gif +0 -0
- data/app/assets/images/mcms_pages/branch-start.gif +0 -0
- data/app/assets/images/mcms_pages/branch.gif +0 -0
- data/app/assets/images/mcms_pages/content_bottom.jpg +0 -0
- data/app/assets/images/mcms_pages/icons/accept.png +0 -0
- data/app/assets/images/mcms_pages/icons/add.png +0 -0
- data/app/assets/images/mcms_pages/icons/ajax-loader.gif +0 -0
- data/app/assets/images/mcms_pages/icons/application_edit.png +0 -0
- data/app/assets/images/mcms_pages/icons/application_go.png +0 -0
- data/app/assets/images/mcms_pages/icons/arrow_left.png +0 -0
- data/app/assets/images/mcms_pages/icons/arrow_switch.png +0 -0
- data/app/assets/images/mcms_pages/icons/arrow_up.png +0 -0
- data/app/assets/images/mcms_pages/icons/bin.png +0 -0
- data/app/assets/images/mcms_pages/icons/bin_closed.png +0 -0
- data/app/assets/images/mcms_pages/icons/cancel.png +0 -0
- data/app/assets/images/mcms_pages/icons/cog_add.png +0 -0
- data/app/assets/images/mcms_pages/icons/cog_edit.png +0 -0
- data/app/assets/images/mcms_pages/icons/cross.png +0 -0
- data/app/assets/images/mcms_pages/icons/delete.png +0 -0
- data/app/assets/images/mcms_pages/icons/doc.png +0 -0
- data/app/assets/images/mcms_pages/icons/down.gif +0 -0
- data/app/assets/images/mcms_pages/icons/edit.png +0 -0
- data/app/assets/images/mcms_pages/icons/email.png +0 -0
- data/app/assets/images/mcms_pages/icons/email_edit.png +0 -0
- data/app/assets/images/mcms_pages/icons/email_go.png +0 -0
- data/app/assets/images/mcms_pages/icons/email_open.png +0 -0
- data/app/assets/images/mcms_pages/icons/eye.png +0 -0
- data/app/assets/images/mcms_pages/icons/folder.png +0 -0
- data/app/assets/images/mcms_pages/icons/folder_open.png +0 -0
- data/app/assets/images/mcms_pages/icons/folder_page_white.png +0 -0
- data/app/assets/images/mcms_pages/icons/image_add.png +0 -0
- data/app/assets/images/mcms_pages/icons/image_edit.png +0 -0
- data/app/assets/images/mcms_pages/icons/img.png +0 -0
- data/app/assets/images/mcms_pages/icons/information.png +0 -0
- data/app/assets/images/mcms_pages/icons/layout_add.png +0 -0
- data/app/assets/images/mcms_pages/icons/layout_edit.png +0 -0
- data/app/assets/images/mcms_pages/icons/music.png +0 -0
- data/app/assets/images/mcms_pages/icons/page.png +0 -0
- data/app/assets/images/mcms_pages/icons/page_add.png +0 -0
- data/app/assets/images/mcms_pages/icons/page_edit.png +0 -0
- data/app/assets/images/mcms_pages/icons/page_white_edit.png +0 -0
- data/app/assets/images/mcms_pages/icons/page_white_gear.png +0 -0
- data/app/assets/images/mcms_pages/icons/page_white_put.png +0 -0
- data/app/assets/images/mcms_pages/icons/pdf.png +0 -0
- data/app/assets/images/mcms_pages/icons/ppt.png +0 -0
- data/app/assets/images/mcms_pages/icons/star.png +0 -0
- data/app/assets/images/mcms_pages/icons/tick.png +0 -0
- data/app/assets/images/mcms_pages/icons/up.gif +0 -0
- data/app/assets/images/mcms_pages/icons/user_add.png +0 -0
- data/app/assets/images/mcms_pages/icons/user_comment.png +0 -0
- data/app/assets/images/mcms_pages/icons/user_edit.png +0 -0
- data/app/assets/images/mcms_pages/icons/xls.png +0 -0
- data/app/assets/images/mcms_pages/icons/zip.png +0 -0
- data/app/assets/images/mcms_pages/icons/zoom.png +0 -0
- data/app/assets/images/mcms_pages/tab_off.jpg +0 -0
- data/app/assets/images/mcms_pages/tab_on.jpg +0 -0
- data/app/assets/javascripts/menuPage.js +45 -0
- data/app/assets/javascripts/pageFormAdmin.js +192 -0
- data/app/assets/stylesheets/mcms_pages/layout.css.scss +16 -0
- data/app/assets/stylesheets/mcms_pages/page_styles.css +95 -0
- data/app/assets/stylesheets/mcms_pages/pages.css.scss +172 -0
- data/app/controllers/admin/layouts_controller.rb +51 -0
- data/app/controllers/admin/pages_controller.rb +303 -0
- data/app/controllers/admin_controller.rb +22 -0
- data/app/controllers/application_controller.rb +20 -0
- data/app/controllers/pages_controller.rb +151 -0
- data/app/helpers/pages_helper.rb +118 -0
- data/app/models/ckeditor/asset.rb +8 -0
- data/app/models/ckeditor/attachment_file.rb +13 -0
- data/app/models/ckeditor/picture.rb +14 -0
- data/app/models/layout.rb +64 -0
- data/app/models/page.rb +152 -0
- data/app/models/page_part.rb +99 -0
- data/app/models/page_parts_page.rb +52 -0
- data/app/views/mcms_pages/admin/layouts/index.html.erb +54 -0
- data/app/views/mcms_pages/admin/pages/_action.html.erb +19 -0
- data/app/views/mcms_pages/admin/pages/_error_messages.html.erb +42 -0
- data/app/views/mcms_pages/admin/pages/_form.html.erb +90 -0
- data/app/views/mcms_pages/admin/pages/_form.js.erb +55 -0
- data/app/views/mcms_pages/admin/pages/_page.html.erb +63 -0
- data/app/views/mcms_pages/admin/pages/_page_part_edit_form.html.erb +140 -0
- data/app/views/mcms_pages/admin/pages/_page_part_form.html.erb +133 -0
- data/app/views/mcms_pages/admin/pages/_page_part_form_field.html.erb +21 -0
- data/app/views/mcms_pages/admin/pages/_page_part_page_form_field.html.erb +39 -0
- data/app/views/mcms_pages/admin/pages/add_page_part.js.erb +25 -0
- data/app/views/mcms_pages/admin/pages/edit.html.erb +15 -0
- data/app/views/mcms_pages/admin/pages/find_child.html.erb +15 -0
- data/app/views/mcms_pages/admin/pages/index.html.erb +26 -0
- data/app/views/mcms_pages/admin/pages/new.html.erb +15 -0
- data/app/views/mcms_pages/layouts/_footer.html.erb +16 -0
- data/app/views/mcms_pages/layouts/_header.html.erb +16 -0
- data/app/views/mcms_pages/layouts/_javascript.html.erb +22 -0
- data/app/views/mcms_pages/layouts/_stylesheets.html.erb +23 -0
- data/app/views/mcms_pages/layouts/mcms_layout.html.erb +39 -0
- data/app/views/mcms_pages/pages/_left_side_body.html.erb +16 -0
- data/app/views/mcms_pages/pages/_main_body.html.erb +16 -0
- data/app/views/mcms_pages/pages/_menu.html.erb +18 -0
- data/app/views/mcms_pages/pages/_menubar.html.erb +24 -0
- data/app/views/mcms_pages/pages/_one_column_layout.html.erb +14 -0
- data/app/views/mcms_pages/pages/_right_side_body.html.erb +16 -0
- data/app/views/mcms_pages/pages/_three_column_layout.html.erb +20 -0
- data/app/views/mcms_pages/pages/_two_column_layout.html.erb +27 -0
- data/app/views/mcms_pages/pages/home.html.erb +26 -0
- data/app/views/mcms_pages/pages/show.html.erb +34 -0
- data/config/routes.rb +57 -0
- data/db/migrate/20120605100629_create_pages.rb +17 -0
- data/db/migrate/20120605100650_create_page_parts.rb +10 -0
- data/db/migrate/20120606150655_create_mcms_assets.rb +26 -0
- data/db/migrate/20120606150656_add_title_position_to_page_parts.rb +5 -0
- data/db/migrate/20120609055514_add_parent_id_to_pages.rb +5 -0
- data/db/migrate/20120612054659_add_lft_rgt_to_mcms_pages.rb +6 -0
- data/db/migrate/20120614125619_create_layouts.rb +16 -0
- data/db/migrate/20120614131633_add_layout_id_to_mcms_pages.rb +5 -0
- data/db/migrate/20120614134343_add_foreign_key_to_page.rb +6 -0
- data/db/migrate/20120618060815_drop_column_permalink_from_mcms_pages.rb +10 -0
- data/db/migrate/20120618102226_add_slug_to_mcms_pages.rb +6 -0
- data/db/migrate/20120625063039_create_page_associations.rb +14 -0
- data/db/migrate/20120625112225_add_header_footer_to_mcms_layouts.rb +6 -0
- data/db/seeds.rb +175 -0
- data/lib/generators/mcms_pages/USAGE +8 -0
- data/lib/generators/mcms_pages/assets_generator.rb +79 -0
- data/lib/generators/mcms_pages/mcms_pages_generator.rb +101 -0
- data/lib/generators/mcms_pages/templates/asset_manager.rb +160 -0
- data/lib/generators/mcms_pages/templates/ckeditor.rb +18 -0
- data/lib/generators/mcms_pages/views_generator.rb +79 -0
- data/lib/mcms_pages/engine.rb +13 -0
- data/lib/mcms_pages/version.rb +3 -0
- data/lib/mcms_pages.rb +7 -0
- data/lib/tasks/mcms_pages_tasks.rake +4 -0
- data/test/dummy/README.rdoc +261 -0
- data/test/dummy/Rakefile +7 -0
- data/test/dummy/app/assets/javascripts/application.js +15 -0
- data/test/dummy/app/assets/stylesheets/application.css +13 -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/application.rb +59 -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 +37 -0
- data/test/dummy/config/environments/production.rb +67 -0
- data/test/dummy/config/environments/test.rb +37 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/inflections.rb +15 -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/config.ru +4 -0
- data/test/dummy/log/development.log +0 -0
- data/test/dummy/public/404.html +26 -0
- data/test/dummy/public/422.html +26 -0
- data/test/dummy/public/500.html +25 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/script/rails +6 -0
- data/test/integration/navigation_test.rb +10 -0
- data/test/mcms_pages_test.rb +7 -0
- data/test/test_helper.rb +15 -0
- metadata +360 -0
data/MIT-LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Copyright 2012 YOURNAME
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
4
|
+
a copy of this software and associated documentation files (the
|
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
9
|
+
the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be
|
|
12
|
+
included in all copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
data/Rakefile
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
#!/usr/bin/env rake
|
|
2
|
+
begin
|
|
3
|
+
require 'bundler/setup'
|
|
4
|
+
rescue LoadError
|
|
5
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
|
6
|
+
end
|
|
7
|
+
begin
|
|
8
|
+
require 'rdoc/task'
|
|
9
|
+
rescue LoadError
|
|
10
|
+
require 'rdoc/rdoc'
|
|
11
|
+
require 'rake/rdoctask'
|
|
12
|
+
RDoc::Task = Rake::RDocTask
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
|
16
|
+
rdoc.rdoc_dir = 'rdoc'
|
|
17
|
+
rdoc.title = 'McmsPages'
|
|
18
|
+
rdoc.options << '--line-numbers'
|
|
19
|
+
rdoc.rdoc_files.include('README.rdoc')
|
|
20
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
|
|
24
|
+
load 'rails/tasks/engine.rake'
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
Bundler::GemHelper.install_tasks
|
|
29
|
+
|
|
30
|
+
require 'rake/testtask'
|
|
31
|
+
|
|
32
|
+
Rake::TestTask.new(:test) do |t|
|
|
33
|
+
t.libs << 'lib'
|
|
34
|
+
t.libs << 'test'
|
|
35
|
+
t.pattern = 'test/**/*_test.rb'
|
|
36
|
+
t.verbose = false
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
task :default => :test
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @File Name : pageFormAdmin.js
|
|
3
|
+
* @Company Name : Mindfire Solutions Private Limited
|
|
4
|
+
* @Creator Name : Vikram Kumar Mishra
|
|
5
|
+
* @Date Created : 2012-07-05
|
|
6
|
+
* @Date Modified :
|
|
7
|
+
* @Last Modification Details :
|
|
8
|
+
* @Purpose : To handle menu related stuff
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
$(document).ready(function(){
|
|
12
|
+
|
|
13
|
+
// assigning DOM element li in a variable
|
|
14
|
+
var menuLi = $('.pages-menu-li');
|
|
15
|
+
|
|
16
|
+
/*
|
|
17
|
+
* @params : None
|
|
18
|
+
* @return : None
|
|
19
|
+
* @purpose : initializing the functions call to bind events with DOM element
|
|
20
|
+
*/
|
|
21
|
+
var initialize = function(){
|
|
22
|
+
|
|
23
|
+
//function call to add tab
|
|
24
|
+
menuLi.hover(showInnerItem);
|
|
25
|
+
|
|
26
|
+
} // end initialize function
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
/*
|
|
30
|
+
* @params : None
|
|
31
|
+
* @return : None
|
|
32
|
+
* @purpose : To show nested menu items
|
|
33
|
+
*/
|
|
34
|
+
var showInnerItem = function(){
|
|
35
|
+
|
|
36
|
+
var childUl = $(this).find('ul')
|
|
37
|
+
|
|
38
|
+
childUl.css('display: block');
|
|
39
|
+
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
//function call to initialize all the methods required when document is ready
|
|
43
|
+
initialize();
|
|
44
|
+
|
|
45
|
+
}); //end ready function
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @File Name : pageFormAdmin.js
|
|
3
|
+
* @Company Name : Mindfire Solutions Private Limited
|
|
4
|
+
* @Creator Name : Vikram Kumar Mishra
|
|
5
|
+
* @Date Created : 2012-06-08
|
|
6
|
+
* @Date Modified : 2012-06-14
|
|
7
|
+
* @Last Modification Details : '' removed from css selectors
|
|
8
|
+
* @Purpose : To handle client side work for page form used by admin
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
//bind the events to elts of the document when it is ready
|
|
12
|
+
$(document).ready(function(){
|
|
13
|
+
|
|
14
|
+
//assigning DOM element in a variable
|
|
15
|
+
var treeElement = $('.pages-tree .page-toggle');
|
|
16
|
+
|
|
17
|
+
/*
|
|
18
|
+
* @params : None
|
|
19
|
+
* @return : None
|
|
20
|
+
* @purpose : initializing the functions call to bind events with DOM element
|
|
21
|
+
*/
|
|
22
|
+
var initialize = function(){
|
|
23
|
+
|
|
24
|
+
//function call to add tab
|
|
25
|
+
showCurrentTab();
|
|
26
|
+
|
|
27
|
+
//function call to toggle tree element on click event
|
|
28
|
+
treeElement.live('click', toggleTree);
|
|
29
|
+
|
|
30
|
+
//function call to find first and last li of tree
|
|
31
|
+
findFirstLastLi();
|
|
32
|
+
|
|
33
|
+
} // end initialize function
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
/*
|
|
37
|
+
* @params : None
|
|
38
|
+
* @return : None
|
|
39
|
+
* @purpose : adding tab functionality like jquery tabs
|
|
40
|
+
*/
|
|
41
|
+
var showCurrentTab = function(){
|
|
42
|
+
|
|
43
|
+
//hiding all divs and then showing first div of tab content div
|
|
44
|
+
$('.page-tabs div').hide();
|
|
45
|
+
$('.page-tabs #page-part-form').show();
|
|
46
|
+
$('.page-tabs #page-part-form #page-part-fields-0').show();
|
|
47
|
+
$('.page-tabs #page-part-form #page-part-fields-0 div').show();
|
|
48
|
+
$('.page-tabs ul li:first a').addClass('active');
|
|
49
|
+
|
|
50
|
+
//assigning the DOM element in a variable
|
|
51
|
+
var tabElt = $('.page-tabs ul li a');
|
|
52
|
+
|
|
53
|
+
//function call to show/hide tab content for click event
|
|
54
|
+
tabElt.click(toggleTab);
|
|
55
|
+
|
|
56
|
+
} // end addTab function
|
|
57
|
+
|
|
58
|
+
/*
|
|
59
|
+
* @params : None
|
|
60
|
+
* @return : None
|
|
61
|
+
* @purpose : function to show the tab content corresponding to the clicked link and hide others
|
|
62
|
+
*/
|
|
63
|
+
var toggleTab = function(){
|
|
64
|
+
|
|
65
|
+
//making all links inactive by removng the class attribute "active"
|
|
66
|
+
$('.page-tabs ul li a').removeClass('active');
|
|
67
|
+
|
|
68
|
+
//activating the currently clicked link
|
|
69
|
+
$(this).addClass('active');
|
|
70
|
+
|
|
71
|
+
//finding the href of current link to identify the target div
|
|
72
|
+
//because ID of target div is the href for the link
|
|
73
|
+
var currentTabDiv = $(this).attr('href');
|
|
74
|
+
|
|
75
|
+
//hide all child divs
|
|
76
|
+
$('.page-tabs div').hide();
|
|
77
|
+
|
|
78
|
+
//showing the specific div to display the target tab element
|
|
79
|
+
$(currentTabDiv).parent().show();
|
|
80
|
+
$(currentTabDiv).show();
|
|
81
|
+
$(currentTabDiv+' div').show();
|
|
82
|
+
|
|
83
|
+
} // end toggleTab function
|
|
84
|
+
|
|
85
|
+
/*
|
|
86
|
+
* @params : Object
|
|
87
|
+
* @return : None
|
|
88
|
+
* @purpose : function to show and hide pages tree
|
|
89
|
+
*/
|
|
90
|
+
var toggleTree = function(e){
|
|
91
|
+
|
|
92
|
+
//If this method is called,
|
|
93
|
+
//the default action of the event will not be triggered.
|
|
94
|
+
e.preventDefault();
|
|
95
|
+
|
|
96
|
+
//assigning the first li DOM element in a variable
|
|
97
|
+
var liElt = $(this).parents('li:first');
|
|
98
|
+
|
|
99
|
+
//assigning the DOM element with classes page-icon, page-toggle in a variable
|
|
100
|
+
var iconElt = liElt.find('.page-icon.page-toggle');
|
|
101
|
+
|
|
102
|
+
//assigning the DOM element with classes page-nested in a variable
|
|
103
|
+
var nestedElt = liElt.find('.page-nested');
|
|
104
|
+
|
|
105
|
+
// if node with child is expanded, i.e. node with child is having
|
|
106
|
+
// the class 'page-expanded'
|
|
107
|
+
if (iconElt.hasClass('page-expanded')) {
|
|
108
|
+
|
|
109
|
+
//remove the class page-expanded
|
|
110
|
+
iconElt.removeClass('page-expanded');
|
|
111
|
+
|
|
112
|
+
//and slide up the child nodes, i.e. hide child nodes
|
|
113
|
+
nestedElt.slideUp();
|
|
114
|
+
|
|
115
|
+
} // end if block
|
|
116
|
+
|
|
117
|
+
// if node with child is not expanded, i.e. node with child is not having
|
|
118
|
+
// the class 'page-expanded'
|
|
119
|
+
else {
|
|
120
|
+
|
|
121
|
+
//asign the data-ajax-content url to a variable to retrieve the data
|
|
122
|
+
var contentUrl = nestedElt.attr('data-ajax-content');
|
|
123
|
+
|
|
124
|
+
//add the class page-loading to show the loading image
|
|
125
|
+
liElt.addClass('page-loading');
|
|
126
|
+
|
|
127
|
+
//retrieve child pages through ajax call from content url
|
|
128
|
+
nestedElt.load(contentUrl, function() {
|
|
129
|
+
|
|
130
|
+
//find last li of child element and add the class page-branch-end
|
|
131
|
+
//nestedElt.find('li:last').addClass('pages-tree-end');
|
|
132
|
+
$('#pages-records.pages-tree #page-sortable-list li:last-child').addClass('pages-tree-end');
|
|
133
|
+
|
|
134
|
+
nestedElt.find('li:last').addClass('pages-tree-end');
|
|
135
|
+
|
|
136
|
+
//check of ul have more than one li as siblings
|
|
137
|
+
if(nestedElt.find('li:first').next().prop('tagName') != 'LI')
|
|
138
|
+
{
|
|
139
|
+
//if not then add class pages-tree-end to first li element of nested element of tree
|
|
140
|
+
nestedElt.find('li:first').addClass('pages-tree-end');
|
|
141
|
+
|
|
142
|
+
} // end if
|
|
143
|
+
|
|
144
|
+
//add class page-expanded to span with class page-icon and page-toggle
|
|
145
|
+
iconElt.addClass('page-expanded');
|
|
146
|
+
|
|
147
|
+
//show the child elements by sliding down
|
|
148
|
+
nestedElt.slideDown();
|
|
149
|
+
|
|
150
|
+
//remove the loading class as the content is loaded
|
|
151
|
+
liElt.removeClass('page-loading');
|
|
152
|
+
|
|
153
|
+
}); // end load method
|
|
154
|
+
|
|
155
|
+
} //end else block
|
|
156
|
+
|
|
157
|
+
} // end toggleTree function
|
|
158
|
+
|
|
159
|
+
/*
|
|
160
|
+
* @params : None
|
|
161
|
+
* @return : None
|
|
162
|
+
* @purpose : function to find first and last li element and add class pages-tree-start to it
|
|
163
|
+
*/
|
|
164
|
+
var findFirstLastLi = function(){
|
|
165
|
+
|
|
166
|
+
//adding class pages-tree-start to first li element of tree
|
|
167
|
+
$('#pages-records.pages-tree #page-sortable-list').find('li:first').addClass('pages-tree-start');
|
|
168
|
+
|
|
169
|
+
//adding class pages-tree-end to last li element of tree
|
|
170
|
+
$('#pages-records.pages-tree #page-sortable-list li:last-child').addClass('pages-tree-end');
|
|
171
|
+
|
|
172
|
+
//assigning the DOM element with classes page-nested in a variable
|
|
173
|
+
var nestedElt = $('#pages-records.pages-tree #page-sortable-list li .page-nested');
|
|
174
|
+
|
|
175
|
+
//check of ul have more than one li as siblings
|
|
176
|
+
if(nestedElt.find('li').next().prop('tagName') != 'LI')
|
|
177
|
+
{
|
|
178
|
+
|
|
179
|
+
//if not then add class pages-tree-end to first li element of nested element of tree
|
|
180
|
+
nestedElt.find('li:first').addClass('pages-tree-end');
|
|
181
|
+
|
|
182
|
+
} // end if
|
|
183
|
+
|
|
184
|
+
//adding class pages-tree-end to last li element of nested element of tree
|
|
185
|
+
$('.page-nested').find('li:last').addClass('pages-tree-end');
|
|
186
|
+
|
|
187
|
+
} // end findFirstLi function
|
|
188
|
+
|
|
189
|
+
//function call to initialize all the methods required when document is ready
|
|
190
|
+
initialize();
|
|
191
|
+
|
|
192
|
+
}); //end ready function
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Place all the styles related to the layout controller here.
|
|
2
|
+
// They will automatically be included in application.css.
|
|
3
|
+
// You can use Sass (SCSS) here: http://sass-lang.com/
|
|
4
|
+
|
|
5
|
+
.layout-images{
|
|
6
|
+
|
|
7
|
+
float:left;
|
|
8
|
+
padding: 0px;
|
|
9
|
+
margin-left: 20px;
|
|
10
|
+
margin-bottom: 20px;
|
|
11
|
+
position: relative;
|
|
12
|
+
width: 48%;
|
|
13
|
+
height: 48%;
|
|
14
|
+
text-align: center;
|
|
15
|
+
|
|
16
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/*
|
|
2
|
+
|
|
3
|
+
* @File Name : page_style.scss
|
|
4
|
+
* @Company Name : Mindfire Solutions Private Limited
|
|
5
|
+
* @Creator Name : Vikram Kumar Mishra
|
|
6
|
+
* @Date Created : 2012-06-15
|
|
7
|
+
* @Date Modified :
|
|
8
|
+
* @Last Modification Details :
|
|
9
|
+
* @Purpose : Place all the styles related to the pages for user.
|
|
10
|
+
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
li{
|
|
14
|
+
list-style-type: none;
|
|
15
|
+
display: inline;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.even
|
|
19
|
+
{
|
|
20
|
+
background-color: aquamarine;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.pages-clearfix:after {
|
|
24
|
+
clear: both;
|
|
25
|
+
content: ".";
|
|
26
|
+
display: block;
|
|
27
|
+
height: 0;
|
|
28
|
+
visibility: hidden;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.pages-clearfix {
|
|
32
|
+
display: block;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
#application-actions{
|
|
36
|
+
float: right;
|
|
37
|
+
padding-left: 15px;
|
|
38
|
+
padding-top: 0;
|
|
39
|
+
width: 30.7%;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
#page-header{
|
|
43
|
+
|
|
44
|
+
width: 100%;
|
|
45
|
+
text-align: center;
|
|
46
|
+
background-color: yellow;
|
|
47
|
+
padding-top: 10px;
|
|
48
|
+
padding-bottom: 10px;
|
|
49
|
+
margin-bottom: 10px;
|
|
50
|
+
float:left;
|
|
51
|
+
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
#page-footer{
|
|
55
|
+
|
|
56
|
+
width: 100%;
|
|
57
|
+
text-align: center;
|
|
58
|
+
background-color: yellow;
|
|
59
|
+
padding-top: 10px;
|
|
60
|
+
padding-bottom: 10px;
|
|
61
|
+
position: relative;
|
|
62
|
+
margin-top: 10px;
|
|
63
|
+
float:left;
|
|
64
|
+
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
#page-left-body{
|
|
68
|
+
|
|
69
|
+
width: 20%;
|
|
70
|
+
text-align: center;
|
|
71
|
+
background-color: blue;
|
|
72
|
+
min-height:200px;
|
|
73
|
+
border: 1px solid red;
|
|
74
|
+
float:left;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
#page-main-body{
|
|
78
|
+
|
|
79
|
+
min-height:100px;
|
|
80
|
+
text-align: center;
|
|
81
|
+
margin-left: 10px;
|
|
82
|
+
margin-right: 10px;
|
|
83
|
+
background-color: white;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
#page-right-body{
|
|
87
|
+
|
|
88
|
+
width: 20%;
|
|
89
|
+
text-align: center;
|
|
90
|
+
background-color: blue;
|
|
91
|
+
min-height:200px;
|
|
92
|
+
border: 1px solid red;
|
|
93
|
+
float:right;
|
|
94
|
+
}
|
|
95
|
+
|