constructor-cms 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.idea/.name +1 -0
- data/.idea/constructor.iml +62 -0
- data/.idea/encodings.xml +5 -0
- data/.idea/misc.xml +5 -0
- data/.idea/modules.xml +9 -0
- data/.idea/scopes/scope_settings.xml +5 -0
- data/.idea/vcs.xml +7 -0
- data/.idea/workspace.xml +873 -0
- data/.rspec +2 -0
- data/cap/app/assets/images/constructor_cap/cross.png +0 -0
- data/cap/app/assets/images/constructor_cap/page_white_edit.png +0 -0
- data/cap/app/controllers/constructor_cap/emails_controller.rb +71 -0
- data/cap/app/models/constructor_cap/email.rb +15 -0
- data/cap/app/views/constructor_cap/emails/_form.haml +17 -0
- data/cap/app/views/constructor_cap/emails/edit.haml +5 -0
- data/cap/app/views/constructor_cap/emails/index.haml +27 -0
- data/cap/app/views/constructor_cap/emails/new.haml +5 -0
- data/cap/app/views/constructor_cap/emails/show.haml +54 -0
- data/cap/config/initializers/admin_menu.rb +4 -0
- data/cap/config/locales/ru.yml +23 -0
- data/cap/config/routes.rb +9 -0
- data/cap/constructor-cap.gemspec +19 -0
- data/cap/db/migrate/20110510182404_create_emails.rb +12 -0
- data/cap/lib/constructor-cap.rb +2 -0
- data/cap/lib/constructor_cap/engine.rb +6 -0
- data/config/routes.rb +4 -0
- data/constructor-cms.gemspec +21 -0
- data/core/app/assets/images/constructor_core/glyphicons-halflings-white.png +0 -0
- data/core/app/assets/images/constructor_core/glyphicons-halflings.png +0 -0
- data/core/app/assets/images/constructor_core/minus.gif +0 -0
- data/core/app/assets/images/constructor_core/plus.gif +0 -0
- data/core/app/assets/images/constructor_core/rss.png +0 -0
- data/core/app/assets/images/constructor_core/treeview-black-line.gif +0 -0
- data/core/app/assets/images/constructor_core/treeview-black.gif +0 -0
- data/core/app/assets/images/constructor_core/treeview-default-line.gif +0 -0
- data/core/app/assets/images/constructor_core/treeview-default.gif +0 -0
- data/core/app/assets/images/constructor_core/treeview-famfamfam-line.gif +0 -0
- data/core/app/assets/images/constructor_core/treeview-famfamfam.gif +0 -0
- data/core/app/assets/images/constructor_core/treeview-gray-line.gif +0 -0
- data/core/app/assets/images/constructor_core/treeview-gray.gif +0 -0
- data/core/app/assets/images/constructor_core/treeview-red-line.gif +0 -0
- data/core/app/assets/images/constructor_core/treeview-red.gif +0 -0
- data/core/app/assets/images/constructor_core/twitter.png +0 -0
- data/core/app/assets/images/constructor_core/widgets.png +0 -0
- data/core/app/assets/javascripts/constructor_core/application.js.coffee +57 -0
- data/core/app/assets/javascripts/constructor_core/bootstrap.js +2276 -0
- data/core/app/assets/javascripts/constructor_core/jquery.cookie.js +92 -0
- data/core/app/assets/javascripts/constructor_core/jquery.treeview.js +256 -0
- data/core/app/assets/javascripts/constructor_core/jquery_bundle.js.coffee +4 -0
- data/core/app/assets/javascripts/constructor_core/urlify.js +82 -0
- data/core/app/assets/stylesheets/constructor_core/application.css.scss +57 -0
- data/core/app/assets/stylesheets/constructor_core/bootstrap-responsive.css +1109 -0
- data/core/app/assets/stylesheets/constructor_core/bootstrap.css +6158 -0
- data/core/app/assets/stylesheets/constructor_core/jquery.treeview.css +73 -0
- data/core/app/controllers/constructor_core/admin_controller.rb +6 -0
- data/core/app/controllers/constructor_core/sessions_controller.rb +15 -0
- data/core/app/helpers/constructor_core/devise_helper.rb +24 -0
- data/core/app/models/constructor_core/user.rb +10 -0
- data/core/app/views/constructor_core/devise/confirmations/new.html.haml +10 -0
- data/core/app/views/constructor_core/devise/mailer/confirmation_instructions.html.haml +5 -0
- data/core/app/views/constructor_core/devise/mailer/reset_password_instructions.html.haml +7 -0
- data/core/app/views/constructor_core/devise/mailer/unlock_instructions.html.haml +5 -0
- data/core/app/views/constructor_core/devise/passwords/edit.html.haml +21 -0
- data/core/app/views/constructor_core/devise/passwords/new.html.haml +13 -0
- data/core/app/views/constructor_core/devise/registrations/edit.html.haml +28 -0
- data/core/app/views/constructor_core/devise/registrations/new.html.haml +20 -0
- data/core/app/views/constructor_core/devise/shared/_links.html.haml +19 -0
- data/core/app/views/constructor_core/devise/unlocks/new.html.haml +9 -0
- data/core/app/views/constructor_core/sessions/new.html.haml +24 -0
- data/core/app/views/layouts/constructor_core/application_admin.haml +65 -0
- data/core/config/environments/production.rb +3 -0
- data/core/config/initializers/devise.rb +223 -0
- data/core/config/locales/devise.en.yml +56 -0
- data/core/config/locales/devise.ru.yml +52 -0
- data/core/config/locales/ru.yml +12 -0
- data/core/config/routes.rb +9 -0
- data/core/constructor-core.gemspec +16 -0
- data/core/db/migrate/1_devise_users.rb +56 -0
- data/core/db/migrate/2_add_default_user.rb +9 -0
- data/core/lib/constructor-core.rb +23 -0
- data/core/lib/constructor_core/engine.rb +6 -0
- data/core/spec/factories.rb +2 -0
- data/core/spec/lib/nav/group_spec.rb +61 -0
- data/core/spec/lib/nav/item_spec.rb +151 -0
- data/core/spec/lib/nav_lib_spec.rb +60 -0
- data/core/spec/spec_helper.rb +34 -0
- data/core/vendor/assets/javascripts/.gitkeep +0 -0
- data/core/vendor/assets/javascripts/ckeditor/ckeditor.js +913 -0
- data/core/vendor/assets/javascripts/ckeditor/config.js +38 -0
- data/core/vendor/assets/javascripts/ckeditor/lang/en.js +5 -0
- data/core/vendor/assets/javascripts/ckeditor/lang/ru.js +5 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js +10 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/_translationstatus.txt +25 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ar.js +9 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/bg.js +9 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ca.js +9 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/cs.js +10 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/cy.js +9 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/da.js +9 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/de.js +10 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/el.js +10 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/en.js +9 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/eo.js +10 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/es.js +10 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/et.js +9 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/fa.js +9 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/fi.js +10 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/fr.js +10 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/gu.js +9 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/he.js +9 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/hi.js +9 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/hr.js +9 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/hu.js +9 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/it.js +10 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ja.js +9 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/km.js +9 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ku.js +10 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/lt.js +9 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/lv.js +10 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/mk.js +9 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/mn.js +9 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/nb.js +9 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/nl.js +10 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/no.js +9 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/pl.js +10 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/pt-br.js +9 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/pt.js +9 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ro.js +9 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ru.js +9 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/sk.js +10 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/sl.js +9 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/sv.js +10 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/th.js +9 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/tr.js +10 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ug.js +9 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/uk.js +9 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/vi.js +9 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/zh-cn.js +7 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/about/dialogs/about.js +6 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/about/dialogs/logo_ckeditor.png +0 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/clipboard/dialogs/paste.js +11 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/colordialog/dialogs/colordialog.js +13 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/dialog/dialogDefinition.js +4 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/div/dialogs/div.js +9 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/fakeobjects/images/spacer.gif +0 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/find/dialogs/find.js +24 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/icons.png +0 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/iframe/dialogs/iframe.js +10 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/iframe/images/placeholder.png +0 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/image/dialogs/image.js +43 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/image/images/noimage.png +0 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/link/dialogs/anchor.js +8 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/link/dialogs/link.js +36 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/link/images/anchor.png +0 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/liststyle/dialogs/liststyle.js +10 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/magicline/images/icon.png +0 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/pastefromword/filter/default.js +31 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/preview/preview.html +10 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/scayt/LICENSE.md +28 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/scayt/README.md +25 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/scayt/dialogs/options.js +20 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/scayt/dialogs/toolbar.css +71 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_address.png +0 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_blockquote.png +0 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_div.png +0 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h1.png +0 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h2.png +0 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h3.png +0 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h4.png +0 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h5.png +0 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h6.png +0 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_p.png +0 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_pre.png +0 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/_translationstatus.txt +20 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/ca.js +13 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/cs.js +13 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/cy.js +14 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/de.js +13 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/el.js +13 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/en.js +13 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/eo.js +12 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/et.js +13 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/fa.js +12 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/fi.js +13 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/fr.js +11 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/he.js +13 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/hr.js +13 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/it.js +14 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/ku.js +13 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/lv.js +13 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/nb.js +11 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/nl.js +13 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/no.js +11 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/pl.js +12 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/pt-br.js +11 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/sk.js +13 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/sv.js +11 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/th.js +13 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/tr.js +12 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/ug.js +13 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/zh-cn.js +9 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/specialchar.js +14 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/table/dialogs/table.js +21 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/tabletools/dialogs/tableCell.js +16 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/templates/dialogs/templates.css +84 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/templates/dialogs/templates.js +10 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/templates/templates/default.js +6 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/templates/templates/images/template1.gif +0 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/templates/templates/images/template2.gif +0 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/templates/templates/images/template3.gif +0 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/wsc/LICENSE.md +28 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/wsc/README.md +25 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/ciframe.html +49 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/tmpFrameset.html +52 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.css +82 -0
- data/core/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.js +11 -0
- data/core/vendor/assets/javascripts/ckeditor/styles.js +111 -0
- data/core/vendor/assets/stylesheets/.gitkeep +0 -0
- data/core/vendor/assets/stylesheets/ckeditor/contents.css +103 -0
- data/core/vendor/assets/stylesheets/ckeditor/skins/moono/dialog.css +5 -0
- data/core/vendor/assets/stylesheets/ckeditor/skins/moono/dialog_ie.css +5 -0
- data/core/vendor/assets/stylesheets/ckeditor/skins/moono/dialog_ie7.css +5 -0
- data/core/vendor/assets/stylesheets/ckeditor/skins/moono/dialog_ie8.css +5 -0
- data/core/vendor/assets/stylesheets/ckeditor/skins/moono/dialog_opera.css +5 -0
- data/core/vendor/assets/stylesheets/ckeditor/skins/moono/editor.css +5 -0
- data/core/vendor/assets/stylesheets/ckeditor/skins/moono/editor_gecko.css +5 -0
- data/core/vendor/assets/stylesheets/ckeditor/skins/moono/editor_ie.css +5 -0
- data/core/vendor/assets/stylesheets/ckeditor/skins/moono/editor_ie7.css +5 -0
- data/core/vendor/assets/stylesheets/ckeditor/skins/moono/editor_ie8.css +5 -0
- data/core/vendor/assets/stylesheets/ckeditor/skins/moono/icons.png +0 -0
- data/core/vendor/assets/stylesheets/ckeditor/skins/moono/images/arrow.png +0 -0
- data/core/vendor/assets/stylesheets/ckeditor/skins/moono/images/close.png +0 -0
- data/core/vendor/assets/stylesheets/ckeditor/skins/moono/images/mini.png +0 -0
- data/core/vendor/assets/stylesheets/ckeditor/skins/moono/readme.md +51 -0
- data/lib/constructor/engine.rb +6 -0
- data/lib/constructor-cms.rb +3 -0
- data/pages/app/assets/images/constructor_pages/arrow_down.png +0 -0
- data/pages/app/assets/images/constructor_pages/arrow_up.png +0 -0
- data/pages/app/assets/images/constructor_pages/information.png +0 -0
- data/pages/app/assets/images/constructor_pages/page_white_edit.png +0 -0
- data/pages/app/assets/images/constructor_pages/photos.png +0 -0
- data/pages/app/controllers/constructor_pages/fields_controller.rb +60 -0
- data/pages/app/controllers/constructor_pages/pages_controller.rb +207 -0
- data/pages/app/controllers/constructor_pages/templates_controller.rb +71 -0
- data/pages/app/helpers/constructor_pages/fields_helper.rb +18 -0
- data/pages/app/helpers/constructor_pages/pages_helper.rb +15 -0
- data/pages/app/helpers/constructor_pages/templates_helper.rb +11 -0
- data/pages/app/models/constructor_pages/field.rb +60 -0
- data/pages/app/models/constructor_pages/page.rb +117 -0
- data/pages/app/models/constructor_pages/template.rb +30 -0
- data/pages/app/models/constructor_pages/types/boolean_type.rb +12 -0
- data/pages/app/models/constructor_pages/types/date_type.rb +16 -0
- data/pages/app/models/constructor_pages/types/float_type.rb +12 -0
- data/pages/app/models/constructor_pages/types/html_type.rb +12 -0
- data/pages/app/models/constructor_pages/types/image_type.rb +18 -0
- data/pages/app/models/constructor_pages/types/integer_type.rb +12 -0
- data/pages/app/models/constructor_pages/types/string_type.rb +12 -0
- data/pages/app/models/constructor_pages/types/text_type.rb +12 -0
- data/pages/app/views/constructor_pages/fields/_form.haml +28 -0
- data/pages/app/views/constructor_pages/fields/edit.haml +6 -0
- data/pages/app/views/constructor_pages/fields/new.haml +6 -0
- data/pages/app/views/constructor_pages/fields/types/_boolean.haml +1 -0
- data/pages/app/views/constructor_pages/fields/types/_date.haml +1 -0
- data/pages/app/views/constructor_pages/fields/types/_float.haml +1 -0
- data/pages/app/views/constructor_pages/fields/types/_html.haml +1 -0
- data/pages/app/views/constructor_pages/fields/types/_image.haml +4 -0
- data/pages/app/views/constructor_pages/fields/types/_integer.haml +1 -0
- data/pages/app/views/constructor_pages/fields/types/_string.haml +1 -0
- data/pages/app/views/constructor_pages/fields/types/_text.haml +1 -0
- data/pages/app/views/constructor_pages/pages/_breadcrumbs.haml +7 -0
- data/pages/app/views/constructor_pages/pages/_form.haml +98 -0
- data/pages/app/views/constructor_pages/pages/_menu.haml +8 -0
- data/pages/app/views/constructor_pages/pages/_submenu.haml +6 -0
- data/pages/app/views/constructor_pages/pages/edit.haml +6 -0
- data/pages/app/views/constructor_pages/pages/error_404.haml +23 -0
- data/pages/app/views/constructor_pages/pages/index.haml +50 -0
- data/pages/app/views/constructor_pages/pages/new.haml +6 -0
- data/pages/app/views/constructor_pages/pages/show.haml +5 -0
- data/pages/app/views/constructor_pages/pages/sitemap.haml +12 -0
- data/pages/app/views/constructor_pages/templates/_form.haml +48 -0
- data/pages/app/views/constructor_pages/templates/edit.haml +6 -0
- data/pages/app/views/constructor_pages/templates/index.haml +38 -0
- data/pages/app/views/constructor_pages/templates/new.haml +6 -0
- data/pages/config/initializers/dragonfly.rb +9 -0
- data/pages/config/locales/ru.yml +39 -0
- data/pages/config/routes.rb +34 -0
- data/pages/constructor-pages.gemspec +21 -0
- data/pages/db/migrate/10_create_html_types.rb +15 -0
- data/pages/db/migrate/11_create_image_types.rb +16 -0
- data/pages/db/migrate/12_add_default_template.rb +13 -0
- data/pages/db/migrate/1_create_pages.rb +27 -0
- data/pages/db/migrate/2_create_templates.rb +18 -0
- data/pages/db/migrate/3_create_fields.rb +17 -0
- data/pages/db/migrate/4_create_string_types.rb +15 -0
- data/pages/db/migrate/5_create_float_types.rb +15 -0
- data/pages/db/migrate/6_create_boolean_types.rb +15 -0
- data/pages/db/migrate/7_create_integer_types.rb +15 -0
- data/pages/db/migrate/8_create_text_types.rb +15 -0
- data/pages/db/migrate/9_create_date_types.rb +15 -0
- data/pages/lib/constructor-pages.rb +7 -0
- data/pages/lib/constructor_pages/engine.rb +6 -0
- data/pages/public/hello.txt +1 -0
- data/pages/spec/factories.rb +7 -0
- data/pages/spec/models/page_model_spec.rb +113 -0
- metadata +396 -0
@@ -0,0 +1,18 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
module ConstructorPages
|
4
|
+
module FieldsHelper
|
5
|
+
def types_value
|
6
|
+
[
|
7
|
+
["Строка", "string"],
|
8
|
+
["Целое число", "integer"],
|
9
|
+
["Дробное число", "float"],
|
10
|
+
["Булево", "boolean"],
|
11
|
+
["Дата", "date"],
|
12
|
+
["Текст", "text"],
|
13
|
+
["HTML", "html"],
|
14
|
+
["Изображение", "image"]
|
15
|
+
]
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module ConstructorPages
|
2
|
+
module PagesHelper
|
3
|
+
def for_select(roots)
|
4
|
+
result = []
|
5
|
+
roots.each do |r|
|
6
|
+
r.self_and_descendants.each {|i| result.push(["#{'--'*i.level} #{i.name}", i.id, {'data-full_url' => i.full_url}])}
|
7
|
+
end
|
8
|
+
result
|
9
|
+
end
|
10
|
+
|
11
|
+
def templates
|
12
|
+
Template.all.map{|t| ["#{'--'*t.level} #{t.name}", t.id]}
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
module ConstructorPages
|
4
|
+
class Field < ActiveRecord::Base
|
5
|
+
attr_accessible :name, :code_name, :type_value, :template_id
|
6
|
+
validates_presence_of :name
|
7
|
+
|
8
|
+
validate :method_uniqueness
|
9
|
+
|
10
|
+
validates_uniqueness_of :code_name, :scope => :template_id
|
11
|
+
|
12
|
+
after_create :create_page_field
|
13
|
+
after_destroy :destroy_page_field
|
14
|
+
|
15
|
+
belongs_to :template
|
16
|
+
|
17
|
+
has_one :string_type, :class_name => "Types::StringType"
|
18
|
+
has_one :integer_type, :class_name => "Types::IntegerType"
|
19
|
+
has_one :float_type, :class_name => "Types::FloatType"
|
20
|
+
has_one :boolean_type, :class_name => "Types::BooleanType"
|
21
|
+
has_one :text_type, :class_name => "Types::TextType"
|
22
|
+
has_one :date_type, :class_name => "Types::DateType"
|
23
|
+
has_one :html_type, :class_name => "Types::HtmlType"
|
24
|
+
has_one :image_type, :class_name => "Types::ImageType"
|
25
|
+
|
26
|
+
acts_as_list :scope => :template_id
|
27
|
+
default_scope :order => :position
|
28
|
+
|
29
|
+
private
|
30
|
+
|
31
|
+
def method_uniqueness
|
32
|
+
if Page.first.respond_to?(code_name.pluralize) \
|
33
|
+
or Page.first.respond_to?(code_name.singularize) \
|
34
|
+
or template.self_and_ancestors.map{|t| t.code_name}.include?(code_name.pluralize) \
|
35
|
+
or template.self_and_ancestors.map{|t| t.code_name}.include?(code_name.singularize) \
|
36
|
+
or template.descendants.map{|t| t.code_name}.include?(code_name.pluralize) \
|
37
|
+
or template.descendants.map{|t| t.code_name}.include?(code_name.singularize)
|
38
|
+
errors.add(:base, "Такой метод уже используется")
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def create_page_field
|
43
|
+
self.template.pages.each do |page|
|
44
|
+
"constructor_pages/types/#{type_value}_type".classify.constantize.create(
|
45
|
+
:page_id => page.id,
|
46
|
+
:field_id => id
|
47
|
+
)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
def destroy_page_field
|
52
|
+
self.template.pages.each do |page|
|
53
|
+
"constructor_pages/types/#{type_value}_type".classify.constantize.destroy_all(
|
54
|
+
:page_id => page.id,
|
55
|
+
:field_id => id
|
56
|
+
)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,117 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
module ConstructorPages
|
4
|
+
class Page < ActiveRecord::Base
|
5
|
+
attr_accessible :name, :title, :keywords, :description,
|
6
|
+
:url, :full_url, :active, :auto_url,
|
7
|
+
:parent_id, :link, :in_menu, :in_map,
|
8
|
+
:in_nav, :template_id
|
9
|
+
|
10
|
+
has_many :string_types,:dependent => :destroy, :class_name => "Types::StringType"
|
11
|
+
has_many :float_types, :dependent => :destroy, :class_name => "Types::FloatType"
|
12
|
+
has_many :boolean_types, :dependent => :destroy, :class_name => "Types::BooleanType"
|
13
|
+
has_many :integer_types, :dependent => :destroy, :class_name => "Types::IntegerType"
|
14
|
+
has_many :text_types, :dependent => :destroy, :class_name => "Types::TextType"
|
15
|
+
has_many :date_types, :dependent => :destroy, :class_name => "Types::DateType"
|
16
|
+
has_many :html_types, :dependent => :destroy, :class_name => "Types::HtmlType"
|
17
|
+
has_many :image_types, :dependent => :destroy, :class_name => "Types::ImageType"
|
18
|
+
|
19
|
+
belongs_to :template
|
20
|
+
|
21
|
+
default_scope order(:lft)
|
22
|
+
|
23
|
+
before_save :url_prepare, :content_filter
|
24
|
+
after_update :full_url_descendants_change
|
25
|
+
|
26
|
+
before_update :full_url_change
|
27
|
+
before_create :full_url_create
|
28
|
+
|
29
|
+
after_create :create_fields
|
30
|
+
|
31
|
+
acts_as_nested_set
|
32
|
+
|
33
|
+
def self.children_of(page)
|
34
|
+
Page.where(:parent_id => page)
|
35
|
+
end
|
36
|
+
|
37
|
+
def field(code_name, meth = "value")
|
38
|
+
field = ConstructorPages::Field.where(:code_name => code_name, :template_id => self.template_id).first
|
39
|
+
|
40
|
+
if field
|
41
|
+
f = "constructor_pages/types/#{field.type_value}_type".classify.constantize.where(:field_id => field.id, :page_id => self.id).first
|
42
|
+
f.send(meth) if f
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
def method_missing(name, *args, &block)
|
47
|
+
name = name.to_s
|
48
|
+
|
49
|
+
if field(name).nil?
|
50
|
+
_template = Template.find_by_code_name(name.singularize)
|
51
|
+
template_id = _template.id if _template
|
52
|
+
|
53
|
+
if template_id
|
54
|
+
result = []
|
55
|
+
result = descendants.where(:template_id => template_id) if name == name.pluralize
|
56
|
+
result = ancestors.where(:template_id => template_id).first if result.empty?
|
57
|
+
result || []
|
58
|
+
end
|
59
|
+
else
|
60
|
+
field(name)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
def as_json(options = {})
|
65
|
+
options = {
|
66
|
+
:name => self.name,
|
67
|
+
:title => self.title
|
68
|
+
}.merge options
|
69
|
+
|
70
|
+
self.template.fields.each do |field|
|
71
|
+
unless self.send(field.code_name)
|
72
|
+
options = {field.code_name => self.send(field.code_name)}.merge options
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
options
|
77
|
+
end
|
78
|
+
|
79
|
+
private
|
80
|
+
|
81
|
+
def full_url_change
|
82
|
+
if parent_id
|
83
|
+
self.full_url = '/' + Page.find(parent_id).self_and_ancestors.map {|c| c.url}.append(self.url).join('/')
|
84
|
+
else
|
85
|
+
self.full_url = '/' + self.url
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
def full_url_create
|
90
|
+
if self.parent.nil?
|
91
|
+
self.full_url = '/' + self.url
|
92
|
+
else
|
93
|
+
self.full_url = self.parent.full_url + '/' + self.url
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
def full_url_descendants_change
|
98
|
+
self.descendants.each { |c| c.save }
|
99
|
+
end
|
100
|
+
|
101
|
+
def url_prepare
|
102
|
+
if self.auto_url or self.url.empty?
|
103
|
+
self.url = self.name.parameterize
|
104
|
+
else
|
105
|
+
self.url = self.url.parameterize
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
def create_fields
|
110
|
+
template.fields.each do |field|
|
111
|
+
"constructor_pages/types/#{field.type_value}_type".classify.constantize.create(
|
112
|
+
:page_id => id,
|
113
|
+
:field_id => field.id)
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
117
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
module ConstructorPages
|
4
|
+
class Template < ActiveRecord::Base
|
5
|
+
attr_accessible :name, :code_name, :child_id, :parent_id
|
6
|
+
validates_presence_of :name
|
7
|
+
validates_uniqueness_of :code_name
|
8
|
+
|
9
|
+
validate :method_uniqueness
|
10
|
+
|
11
|
+
default_scope order(:lft)
|
12
|
+
|
13
|
+
has_many :pages
|
14
|
+
has_many :fields
|
15
|
+
|
16
|
+
acts_as_nested_set
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def method_uniqueness
|
21
|
+
if Page.first.respond_to?(code_name.pluralize) \
|
22
|
+
or Page.first.respond_to?(code_name.singularize) \
|
23
|
+
or root.self_and_descendants.map{|t| t.code_name}.include?(code_name.pluralize) \
|
24
|
+
or root.self_and_descendants.map{|t| t.code_name}.include?(code_name.singularize) \
|
25
|
+
|
26
|
+
errors.add(:base, "Такой метод уже используется")
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
module ConstructorPages
|
4
|
+
module Types
|
5
|
+
class DateType < ActiveRecord::Base
|
6
|
+
attr_accessible :value, :field_id, :page_id
|
7
|
+
|
8
|
+
belongs_to :field
|
9
|
+
belongs_to :page
|
10
|
+
|
11
|
+
def russian
|
12
|
+
Russian::strftime(self.value, "%d %B %Y").gsub(/0(\d\D)/, '\1')
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
module ConstructorPages
|
4
|
+
module Types
|
5
|
+
class ImageType < ActiveRecord::Base
|
6
|
+
attr_accessible :value, :field_id, :page_id
|
7
|
+
|
8
|
+
belongs_to :field
|
9
|
+
belongs_to :page
|
10
|
+
|
11
|
+
image_accessor :value
|
12
|
+
|
13
|
+
validates :value, :presence => true
|
14
|
+
validates_size_of :value, :maximum => 5.megabytes, :message => :incorrect_size
|
15
|
+
validates_property :mime_type, :of => :value, :in => %w(image/jpeg image/png image/gif), :message => :incorrect_format
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
= form_for @field do |f|
|
2
|
+
- if @field.errors.any?
|
3
|
+
.alert.alert-error.fade.in.span12
|
4
|
+
= link_to "×", "#", :class => "close", 'data-dismiss' => 'alert'
|
5
|
+
- @field.errors.full_messages.each do |m|
|
6
|
+
= m
|
7
|
+
|
8
|
+
.form-horizontal
|
9
|
+
.control-group
|
10
|
+
= f.label :name, :class => 'control-label'
|
11
|
+
.controls= f.text_field :name, :class => "span4"
|
12
|
+
|
13
|
+
.control-group
|
14
|
+
= f.label :code_name, :class => 'control-label'
|
15
|
+
.controls= f.text_field :code_name, :class => "span4"
|
16
|
+
= f.hidden_field :template_id, :value => @field.template.id, :class => "span4"
|
17
|
+
|
18
|
+
.control-group
|
19
|
+
= f.label :type_value, :class => 'control-label'
|
20
|
+
.controls
|
21
|
+
= f.select :type_value, options_for_select(types_value, :selected => @field.type_value), :class => "span4"
|
22
|
+
|
23
|
+
.row-fluid
|
24
|
+
.span12
|
25
|
+
.form-actions
|
26
|
+
.btn-group
|
27
|
+
= f.submit :class => "btn btn-primary"
|
28
|
+
= link_to "Отмена", template_url(@field.template), :class => "btn"
|
@@ -0,0 +1 @@
|
|
1
|
+
= check_box_tag "fields[#{field.type_value}][#{field.id}]", nil, page.boolean_types.where(:field_id => field.id).first.value
|
@@ -0,0 +1 @@
|
|
1
|
+
= date_select "fields[#{field.type_value}][#{field.id}]", "date", :default => page.date_types.where(:field_id => field.id).first.value
|
@@ -0,0 +1 @@
|
|
1
|
+
= text_field_tag "fields[#{field.type_value}][#{field.id}]", page.float_types.where(:field_id => field.id).first.value, :class => "span2"
|
@@ -0,0 +1 @@
|
|
1
|
+
= text_area_tag "fields[#{field.type_value}][#{field.id}]", page.html_types.where(:field_id => field.id).first.value, :rows => 10, :class => "span9 ckeditor"
|
@@ -0,0 +1 @@
|
|
1
|
+
= text_field_tag "fields[#{field.type_value}][#{field.id}]", page.integer_types.where(:field_id => field.id).first.value, :class => "span2"
|
@@ -0,0 +1 @@
|
|
1
|
+
= text_field_tag "fields[#{field.type_value}][#{field.id}]", page.string_types.where(:field_id => field.id).first.value, :class => "span6"
|
@@ -0,0 +1 @@
|
|
1
|
+
= text_area_tag "fields[#{field.type_value}][#{field.id}]", page.text_types.where(:field_id => field.id).first.value, :rows => 10, :class => "span6"
|
@@ -0,0 +1,98 @@
|
|
1
|
+
= form_for @page, :html => {:multipart => @multipart} do |f|
|
2
|
+
- if @page.errors.any?
|
3
|
+
.alert.alert-error.fade.in.span12
|
4
|
+
= link_to "×", "#", :class => "close", 'data-dismiss' => 'alert'
|
5
|
+
- @page.errors.full_messages.each do |m|
|
6
|
+
= m
|
7
|
+
|
8
|
+
.form-horizontal
|
9
|
+
.control-group
|
10
|
+
= f.label :active, :class => 'control-label'
|
11
|
+
.controls= f.check_box :active, :class => "span6"
|
12
|
+
|
13
|
+
.control-group
|
14
|
+
= f.label :name, :class => 'control-label'
|
15
|
+
.controls= f.text_field :name, :class => "span4"
|
16
|
+
|
17
|
+
.control-group.auto_url
|
18
|
+
= f.label :auto_url, :class => 'control-label'
|
19
|
+
.controls
|
20
|
+
= f.check_box :auto_url, :class => "span9"
|
21
|
+
|
22
|
+
.control-group.url
|
23
|
+
= f.label :url, :class => 'control-label'
|
24
|
+
.controls
|
25
|
+
.full_url
|
26
|
+
%span.path>= @page.parent.full_url unless @page.parent.nil?
|
27
|
+
\/
|
28
|
+
%span.address>= @page.url
|
29
|
+
= f.text_field :url, :class => "span3"
|
30
|
+
%i.address_icon.icon-pencil
|
31
|
+
|
32
|
+
- unless @page.new_record?
|
33
|
+
- @page.template.fields.each do |field|
|
34
|
+
.control-group
|
35
|
+
= label_tag "", field.name, :class => 'control-label'
|
36
|
+
.controls
|
37
|
+
= render :partial => "constructor_pages/fields/types/#{field.type_value}", :locals => {:field => field, :page => @page}
|
38
|
+
|
39
|
+
.accordion
|
40
|
+
.accordion-group
|
41
|
+
.accordion-heading.text-center
|
42
|
+
= link_to 'Настройки', '#collapse', :class => 'accordion-toggle', 'data-toggle' => 'collapse'
|
43
|
+
.accordion-body.in.collapse#collapse
|
44
|
+
.accordion-inner
|
45
|
+
.control-group
|
46
|
+
= f.label :parent, :class => 'control-label'
|
47
|
+
.controls
|
48
|
+
= f.select :parent_id, options_for_select(for_select(@roots), :selected => @page.parent_id, :disabled => @page.self_and_descendants.map{|p| p.id}), :include_blank => 'Нет'
|
49
|
+
|
50
|
+
.control-group
|
51
|
+
= f.label :template, :class => 'control-label'
|
52
|
+
.controls
|
53
|
+
= f.select :template_id, options_for_select(templates, :selected => @template)
|
54
|
+
.control-group
|
55
|
+
= f.label :link, :class => 'control-label'
|
56
|
+
.controls
|
57
|
+
= f.text_field :link, :class => "span9"
|
58
|
+
.control-group
|
59
|
+
%label.control-label Отображать в
|
60
|
+
.controls
|
61
|
+
%label.checkbox.inline.span2{:for => 'in_menu'}
|
62
|
+
= f.check_box :in_menu
|
63
|
+
Меню
|
64
|
+
|
65
|
+
%label.checkbox.inline.span2{:for => 'in_map'}
|
66
|
+
= f.check_box :in_map
|
67
|
+
Карта сайта
|
68
|
+
|
69
|
+
%label.checkbox.inline.span2{:for => 'in_nav'}
|
70
|
+
= f.check_box :in_nav
|
71
|
+
Хлебные крошки
|
72
|
+
|
73
|
+
.accordion
|
74
|
+
.accordion-group
|
75
|
+
.accordion-heading.text-center
|
76
|
+
= link_to 'Поисковая оптимизация', '#collapse-three', :class => 'accordion-toggle', 'data-toggle' => 'collapse'
|
77
|
+
.accordion-body.in.collapse#collapse-three
|
78
|
+
.accordion-inner
|
79
|
+
.control-group
|
80
|
+
= f.label :title, :class => 'control-label'
|
81
|
+
.controls
|
82
|
+
= f.text_field :title, :class => "span9"
|
83
|
+
.control-group
|
84
|
+
= f.label :keywords, :class => 'control-label'
|
85
|
+
.controls
|
86
|
+
= f.text_field :keywords, :class => "span9"
|
87
|
+
.control-group
|
88
|
+
= f.label :description, :class => 'control-label'
|
89
|
+
.controls
|
90
|
+
= f.text_area :description, :class => "span9", :rows => 8
|
91
|
+
|
92
|
+
.row-fluid
|
93
|
+
.span12
|
94
|
+
.form-actions
|
95
|
+
.btn-group
|
96
|
+
= f.submit :class => "btn btn-primary"
|
97
|
+
= link_to "Отмена", pages_url, :class => "btn"
|
98
|
+
= link_to "Удалить страницу", @page, :confirm => 'Вы уверены?', :method => :delete, :class => "btn btn-danger pull-right" unless @page.new_record?
|
@@ -0,0 +1,23 @@
|
|
1
|
+
!!!
|
2
|
+
%html{'class' => 'no-js', 'lang' => 'en'}
|
3
|
+
%head
|
4
|
+
%meta{'charset' => 'utf-8'}/
|
5
|
+
%meta{'http-equiv' => 'X-UA-Compatible', 'content' => 'IE=edge,chrome=1'}/
|
6
|
+
%title Страница не найдена
|
7
|
+
|
8
|
+
= stylesheet_link_tag 'styles'
|
9
|
+
= csrf_meta_tag
|
10
|
+
= favicon_link_tag
|
11
|
+
|
12
|
+
%body
|
13
|
+
.b-error-404
|
14
|
+
%h1.b-error-404__h1 Ошибка 404
|
15
|
+
%p.b-error-404__text
|
16
|
+
Не правильно набран адрес,
|
17
|
+
%br/
|
18
|
+
или такой страницы на сайте больше не существует.
|
19
|
+
%p
|
20
|
+
= link_to "Главная страница сайта", '/', :class => "b-error-404__link-home"
|
21
|
+
//%br/
|
22
|
+
//= link_to "Карта сайта", "/sitemap"
|
23
|
+
|
@@ -0,0 +1,50 @@
|
|
1
|
+
- content_for :page_title do
|
2
|
+
Структура
|
3
|
+
|
4
|
+
- content_for :actions do
|
5
|
+
.span4.clearfix.text-right
|
6
|
+
= link_to "<i class='icon-plus icon-white'></i>".html_safe, pages.new_page_path, :class => "btn btn-success"
|
7
|
+
|
8
|
+
%section.span8
|
9
|
+
%ul#tree.treeview-gray
|
10
|
+
- @roots.each do |root|
|
11
|
+
- level = root.level
|
12
|
+
- last_page = nil
|
13
|
+
|
14
|
+
- root.self_and_descendants.each do |page|
|
15
|
+
- if page.level > level
|
16
|
+
<ul>
|
17
|
+
- elsif page.level < level
|
18
|
+
</li>
|
19
|
+
= raw "</ul></li>" * (level-page.level)
|
20
|
+
- elsif !page.root?
|
21
|
+
</li>
|
22
|
+
|
23
|
+
<li>
|
24
|
+
- if page.active == true
|
25
|
+
= link_to page.name, page.full_url, :class => "btn"
|
26
|
+
- else
|
27
|
+
%button.btn.disabled= page.name
|
28
|
+
|
29
|
+
.btn-group
|
30
|
+
- if not page.right_sibling.nil? and page.move_possible?(page.right_sibling)
|
31
|
+
= link_to "<i class='icon-arrow-down'></i>".html_safe, page_move_down_path(page), :method => :post, :class => "btn btn-mini"
|
32
|
+
- if not page.left_sibling.nil? and page.move_possible?(page.left_sibling)
|
33
|
+
= link_to "<i class='icon-arrow-up'></i>".html_safe, page_move_up_path(page), :method => :post, :class => "btn btn-mini"
|
34
|
+
|
35
|
+
= link_to "<i class='icon-pencil icon-white'></i>".html_safe, edit_page_path(page), :class => "btn btn-primary btn-mini"
|
36
|
+
|
37
|
+
- unless page.template.nil?
|
38
|
+
- if page.template.child_id.nil?
|
39
|
+
- if !page.template.leaf?
|
40
|
+
= link_to "<i class='icon-plus icon-white'></i> #{page.template.descendants.first.name}".html_safe, new_child_page_path(page), :class => "btn btn-success btn-mini"
|
41
|
+
- else
|
42
|
+
= link_to "<i class='icon-plus icon-white'></i> #{ConstructorPages::Template.find(page.template.child_id).name}".html_safe, new_child_page_path(page), :class => "btn btn-success btn-mini"
|
43
|
+
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
- level = page.level
|
48
|
+
- last_page = page
|
49
|
+
</li>
|
50
|
+
= raw "</ul></li>" * last_page.level
|