minimalist_cms 0.0.2 → 0.0.4

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.
@@ -0,0 +1,18 @@
1
+ module MinimalistCms
2
+ class PagesController < ApplicationController
3
+ def show
4
+ @page = if params[:id].present?
5
+ Page.find_by_slug(params[:id])
6
+ else
7
+ Page.find_by_home(true)
8
+ end
9
+ raise ActionController::RoutingError.new('Page Not Found') if @page.nil?
10
+ end
11
+
12
+ def update
13
+ @page = Page.find(params[:id])
14
+ @page.update_attribute(:body, params[:body])
15
+ render json: @page
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,5 @@
1
+ module MinimalistCms
2
+ class Page < ActiveRecord::Base
3
+ acts_as_page
4
+ end
5
+ end
@@ -0,0 +1 @@
1
+ <%= editable(@page) { @page.body } %>
@@ -1,6 +1,8 @@
1
- Rails.application.routes.draw do
2
- root to: "pages#show"
3
- get ':id', to: "pages#show"
4
- resources :pages
5
- resources :page_parts
1
+ MinimalistCms::Engine.routes.draw do
2
+ scope module: :minimalist_cms do
3
+ root to: "pages#show"
4
+ get ':id', to: "pages#show"
5
+ resources :pages
6
+ resources :page_parts
7
+ end
6
8
  end
@@ -6,12 +6,12 @@ class CreatePages < ActiveRecord::Migration
6
6
  t.boolean :home
7
7
  t.boolean :draft, default: true
8
8
  end
9
- Page.create_translation_table! title: :string, slug: :string,
9
+ MinimalistCms::Page.create_translation_table! title: :string, slug: :string,
10
10
  meta_keywords: :string, meta_description: :text
11
11
  end
12
12
 
13
13
  def down
14
14
  drop_table :pages
15
- Page.drop_translation_table!
15
+ MinimalistCms::Page.drop_translation_table!
16
16
  end
17
17
  end
@@ -1,10 +1,11 @@
1
1
  class CreatePageParts < ActiveRecord::Migration
2
2
  def up
3
3
  create_table :page_parts do |t|
4
+ t.string :title
4
5
  t.timestamps
5
6
  t.references :page
6
7
  end
7
- PagePart.create_translation_table! title: :string, body: :text
8
+ PagePart.create_translation_table! body: :text
8
9
  end
9
10
 
10
11
  def down
@@ -3,5 +3,6 @@ require 'acts_as_page'
3
3
 
4
4
  module MinimalistCms
5
5
  class Engine < ::Rails::Engine
6
+ engine_name 'minimalist'
6
7
  end
7
8
  end
@@ -1,3 +1,3 @@
1
1
  module MinimalistCms
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minimalist_cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-24 00:00:00.000000000 Z
12
+ date: 2013-04-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -146,16 +146,12 @@ executables: []
146
146
  extensions: []
147
147
  extra_rdoc_files: []
148
148
  files:
149
- - app/controllers/pages_controller.rb
150
- - app/controllers/page_parts_controller.rb
151
- - app/views/pages/show.html.erb
152
- - app/views/pages/_form.html.erb
153
- - app/views/pages/edit.js.erb
154
- - app/views/pages/new.js.erb
149
+ - app/controllers/minimalist_cms/pages_controller.rb
150
+ - app/views/minimalist_cms/pages/show.html.erb
155
151
  - app/helpers/page_helper.rb
156
152
  - app/assets/stylesheets/minimalist_cms/minimalist_cms.css
157
153
  - app/assets/javascripts/minimalist_cms/minimalist_cms.coffee
158
- - app/models/page.rb
154
+ - app/models/minimalist_cms/page.rb
159
155
  - config/routes.rb
160
156
  - db/migrate/20121216194550_create_pages.rb
161
157
  - db/migrate/20130324132057_create_page_parts.rb
@@ -191,3 +187,4 @@ signing_key:
191
187
  specification_version: 3
192
188
  summary: This is the simpler cms ever
193
189
  test_files: []
190
+ has_rdoc:
@@ -1,9 +0,0 @@
1
- class PagePartsController < ApplicationController
2
- respond_to :json
3
-
4
- def update
5
- @part = PagePart.find(params[:id])
6
- @part.update_attributes(params[:page_part])
7
- render json: @part
8
- end
9
- end
@@ -1,10 +0,0 @@
1
- class PagesController < ApplicationController
2
- def show
3
- @page = if params[:id].present?
4
- Page.find_by_slug(params[:id])
5
- else
6
- Page.find_by_home(true)
7
- end
8
- raise ActionController::RoutingError.new('Page Not Found') if @page.nil?
9
- end
10
- end
@@ -1,3 +0,0 @@
1
- class Page < ActiveRecord::Base
2
- acts_as_page
3
- end
@@ -1,17 +0,0 @@
1
- <div class="modal hide fade">
2
- <%= simple_form_for @page, remote: true do |f| %>
3
- <div class="modal-header">
4
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
5
- <h3><%= title %></h3>
6
- </div>
7
- <div class="modal-body">
8
- <%= f.input :title %>
9
- <%= f.input :meta_description %>
10
- <%= f.input :meta_keywords %>
11
- </div>
12
- <div class="modal-footer">
13
- <a href="#" class="btn" data-dismiss="modal">Close</a>
14
- <%= f.submit 'Save', class: 'btn btn-primary' %>
15
- </div>
16
- <% end %>
17
- </div>
@@ -1,5 +0,0 @@
1
- if($('#modalContainer').children().length != 0) {
2
- $('#modalContainer').children().first().modal('hide')
3
- }
4
- $('#modalContainer').html("<%= j(render('form', title: 'Modifier la page')) %>")
5
- $('#modalContainer').children().first().modal()
@@ -1,5 +0,0 @@
1
- if($('#modalContainer').children().length != 0) {
2
- $('#modalContainer').children().first().modal('hide')
3
- }
4
- $('#modalContainer').html("<%= j(render('form', title: 'Ajouter une page')) %>")
5
- $('#modalContainer').children().first().modal()
@@ -1,3 +0,0 @@
1
- <div class="editable-long-text" data-object="page_parts" data-id="<%= @page.body.id %>" data-attribute="body">
2
- <%= raw @page.body.body %>
3
- </div>