#[PagesCms](http://www.colinw.info/projects/pagescms) Pages CMS uses nested forms and draggable items to allow the user to build a site within the predefined layout from a designer. It incorporates an image management system as well as a page management system. It's like a wordpress page builder on rails. Check out http://www.colinw.info/projects/pagescms for screenshots, gifs and to see a site built entirely with PagesCMS! ## About #### Advantages - Get hacking right away with out of the box support for bootstrap. - Easily drag page layouts into the position you want them. - Built in blog. - Limited dependencies, doesn't require or come with a User model. - Easily customized. - Lightweight and easy to understand: Built with simple rails techniques everyone can understand. - Now with multi-site support! #### How it Works The page builder is the central feature of PagesCMS. In essence, it allows the user to create divisions on a page, and then add various sorts of content into the div. The content types right now: - Text Box (Markdown or Wysiwyg) - Thumbnail - Image Box - Contact Form - Blog Feed These content types can be interpreted by a designer to create a unique look and feel for every page. In addition, there is a sidebar that is fully customizable. Content editing is done using the great [wysihtml5 editor](https://github.com/Voog/wysihtml) AND Markdown with Redcarpet. Just add either a markdown box or a wysiwyg box. #### GIFs ![Admin Overview](https://colin-w-info-uploads.s3.amazonaws.com/images/1435258229_admin-overview.gif) ![Article Edit](https://colin-w-info-uploads.s3.amazonaws.com/images/1435258248_article-edit.gif) ![Page Sort](https://colin-w-info-uploads.s3.amazonaws.com/images/1435258308_page-sort.gif) ![Page Edit](https://colin-w-info-uploads.s3.amazonaws.com/images/1435262440_page-edit.gif) ## Installation 1. Add: `gem 'pages_cms', '~> 2.3.0'` to your `Gemfile` 2. Run: `$ rails generate pages_cms:install` This has built everything that PagesCMS needs to work, but to get hacking with some default styling and layout included, follow the next steps: The base theme is built on bootstrap: 1. Add: `gem "bootstrap-sass"` to your `Gemfile` 2. Add: `//= require bootstrap` to your `application.js` 3. Run: `$ bundle install` To get hacking the views and stylesheets: `$ rails generate pages_cms:views` ##### Important Note! - Links for blog pages require that the page for the account be called 'Blog' - You need an account with `mount_location = '/'`, and a page in that account called 'Home'. Otherwise, when the app redirects to `'/'`, you will see a redirect loop. You should now be able to go to `/admin/pages` and start building pages! #### The generator has added some methods to your App: | Method | Usage | | ------------------------- | --------------------------------------------------------- | | `logged_in_admin` | Authorizes controllers in the `PagesCms` engine | | `current_user_is_admin?` | Verifies that the current user is an admin in the views | Make sure to fill these methods out to secure your application. #### Notes Let me know if you are having dependency issues, this is one area that is very untested, and we can work to find a solution. The app is only tested with the latest version of rails and notably postgres as well. The blog section uses array tagging so those with sqlite3 will have problems. ## Licence MIT, author makes no liability whatsoever. ## Free Software Used Thank you to: - html5 sortable: http://farhadi.ir/projects/html5sortable/ - select2 Jquery: https://select2.github.io/ - wysihtml5: https://github.com/Voog/wysihtml - bootstrap sass: https://github.com/twbs/bootstrap-sass - cocoon: https://github.com/nathanvda/cocoon ##Contributing More than welcome! This project is currently looking for dedicated core contributors looking to build exciting open source software. Shoot me a message or an email, I'd love to talk to you about the project! 1. Fork 2. Make Topic Branch 3. Submit Pull Request #### Current To Do List - Enable strong params for admin/pages controller (right now if strong params are enabled, saves old elements twice!?!) - Bigger feature list, what block elements do people want? - Testing, increase coverage and test dependency version changes. ##Decorators and Customization The app is being constructed will full customization in mind by using decorators. This part has yet to be fully implemented as of right now however.