fullstack-cms 0.1.4 → 0.1.5

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/TODO.md ADDED
@@ -0,0 +1,25 @@
1
+ # Fullstack CMS roadmap
2
+
3
+ ## Page parts with schema
4
+
5
+ usage:
6
+ <%= part "marketing-1", :schema => "text-with-title" %>
7
+ <%= part "marketing-2", :schema => "text-with-title" %>
8
+ <%= part "announcement", :schema => "announcement" %>
9
+
10
+ class AnnouncementPagePart < PagePart
11
+ field :claim, :string
12
+ field :link, :link
13
+ end
14
+
15
+ class TextPagePart < PagePart
16
+ field :text, :text, :markup => true
17
+ end
18
+
19
+ class TextWithTitlePagePart < PagePart
20
+ field :title, :string
21
+ field :text, :text, :markup => true
22
+ end
23
+
24
+ # Update e Creatore di ogni cosa
25
+
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.4
1
+ 0.1.5
@@ -3,6 +3,7 @@ class Admin::PagesController < Admin::BaseController
3
3
 
4
4
  def index
5
5
  @pages = Page.all
6
+ @skip_filter = true
6
7
  end
7
8
 
8
9
  def edit
@@ -1,7 +1,6 @@
1
1
  class PagePart < ActiveRecord::Base
2
+ inheritable
2
3
  field :name
3
- field :content, :text
4
4
  belongs_to :page
5
5
  index [:name, :page_id], :unique => true
6
- has_many :settings, :as => :settable
7
6
  end
@@ -20,7 +20,7 @@
20
20
 
21
21
 
22
22
  <%= f.actions do %>
23
- <%= f.resource_submit(current_resource) %>
23
+ <%= f.resource_submit %>
24
24
  <% end %>
25
25
 
26
26
 
@@ -0,0 +1,48 @@
1
+ <%= admin_form_for [:admin, current_resource], :html => {:multipart => true} do |f| %>
2
+ <%= f.errors %>
3
+
4
+ <%= f.inputs do %>
5
+ <%= f.input :email %>
6
+ <% end %>
7
+
8
+ <% if current_resource.persisted? %>
9
+ <%= link_to t('fullstack.admin.edit', :default => "Edit") + " " + t('helpers.label.password', :default => "password"),
10
+ "javascript:void(0);",
11
+ :id => "edit_your_password",
12
+ :class => "btn btn-small" %>
13
+
14
+ <div id="password_fields" style="display:none;">
15
+ <% else %>
16
+ <div>
17
+ <% end %>
18
+ <%= f.inputs do %>
19
+ <%= f.input :password %>
20
+ <%= f.input :password_confirmation %>
21
+ <% end %>
22
+ </div>
23
+
24
+
25
+ <%= f.actions do %>
26
+ <%= f.resource_submit %>
27
+ <% end %>
28
+
29
+ <% end %>
30
+
31
+ <% content_for :javascripts do -%>
32
+ <%= coffee_script_tag do %>
33
+
34
+ html = $("#password_fields").find("fieldset")
35
+ html.remove()
36
+ $("#password_fields").show()
37
+
38
+ $(document).ready ->
39
+
40
+ $("#edit_your_password").click ->
41
+ elems = $(html)
42
+ elems.hide()
43
+ $("#password_fields").empty().append(elems)
44
+ elems.show('slow')
45
+ $(@).remove()
46
+
47
+ <% end %>
48
+ <% end %>
data/config/routes.rb CHANGED
@@ -5,23 +5,7 @@ Rails.application.routes.draw do
5
5
  resources :page_parts, :only => [ :update, :destroy ]
6
6
  end
7
7
 
8
- resources :tags, :only => :index, :format => :json
9
-
10
- resources :photos do
11
- collection do
12
- get "search"
13
- get "chooser"
14
- end
15
- end
16
-
17
- resources :settings, :except => [:show]
18
- resources :menus, :except => [:show]
8
+ resources :tags, :only => :index, :format => :json
19
9
  resources :users, :except => [:show]
20
- resources :links, :except => [:show, :index, :new] do
21
- collection do
22
- post :sort
23
- end
24
- end
25
-
26
10
  end
27
11
  end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "fullstack-cms"
8
- s.version = "0.1.4"
8
+ s.version = "0.1.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["mcasimir"]
12
- s.date = "2012-08-17"
12
+ s.date = "2012-08-19"
13
13
  s.description = "CMS system built on fullstack"
14
14
  s.email = "maurizio.cas@gmail.com"
15
15
  s.extra_rdoc_files = [
@@ -20,8 +20,8 @@ Gem::Specification.new do |s|
20
20
  "Gemfile.lock",
21
21
  "README.md",
22
22
  "Rakefile",
23
+ "TODO.md",
23
24
  "VERSION",
24
- "app/controllers/admin/links_controller.rb",
25
25
  "app/controllers/admin/menus_controller.rb",
26
26
  "app/controllers/admin/page_parts_controller.rb",
27
27
  "app/controllers/admin/pages_controller.rb",
@@ -41,22 +41,12 @@ Gem::Specification.new do |s|
41
41
  "app/models/pageable.rb",
42
42
  "app/models/redirect.rb",
43
43
  "app/models/setting.rb",
44
- "app/views/admin/links/_filter.html.erb",
45
- "app/views/admin/links/_form.html.erb",
46
- "app/views/admin/links/_index.html.erb",
47
- "app/views/admin/links/_links.html.erb",
48
- "app/views/admin/links/_table_row.html.erb",
49
- "app/views/admin/links/create.js.erb",
50
- "app/views/admin/links/sort.js.coffee",
51
- "app/views/admin/links/update.js.coffee",
52
- "app/views/admin/menus/_form.html.erb",
53
- "app/views/admin/menus/_index.html.erb",
54
44
  "app/views/admin/page_parts/_tabs.html.erb",
55
45
  "app/views/admin/page_parts/destroy.js.coffee",
56
46
  "app/views/admin/pages/_collection.html.erb",
57
47
  "app/views/admin/pages/_form.html.erb",
58
48
  "app/views/admin/settings/_form.html.erb",
59
- "app/views/admin/settings/_index.html.erb",
49
+ "app/views/admin/users/_form.html.erb",
60
50
  "config/locales/en.yml",
61
51
  "config/locales/it.yml",
62
52
  "config/routes.rb",
@@ -67,7 +57,6 @@ Gem::Specification.new do |s|
67
57
  "lib/fullstack/cms/engine.rb",
68
58
  "lib/generators/fullstack/cms/install_generator.rb",
69
59
  "lib/generators/fullstack/cms/locale_generator.rb",
70
- "lib/generators/fullstack/cms/templates/rails/app/assets/javascripts/admin/links.js.coffee",
71
60
  "lib/generators/fullstack/cms/templates/rails/app/assets/javascripts/site/lib/jquery.fitvids.js",
72
61
  "lib/generators/fullstack/cms/templates/rails/app/assets/javascripts/site/lib/plugins.js",
73
62
  "lib/generators/fullstack/cms/templates/rails/app/assets/javascripts/site/site.js.coffee",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fullstack-cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
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: 2012-08-17 00:00:00.000000000 Z
12
+ date: 2012-08-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fullstack
@@ -198,8 +198,8 @@ files:
198
198
  - Gemfile.lock
199
199
  - README.md
200
200
  - Rakefile
201
+ - TODO.md
201
202
  - VERSION
202
- - app/controllers/admin/links_controller.rb
203
203
  - app/controllers/admin/menus_controller.rb
204
204
  - app/controllers/admin/page_parts_controller.rb
205
205
  - app/controllers/admin/pages_controller.rb
@@ -219,22 +219,12 @@ files:
219
219
  - app/models/pageable.rb
220
220
  - app/models/redirect.rb
221
221
  - app/models/setting.rb
222
- - app/views/admin/links/_filter.html.erb
223
- - app/views/admin/links/_form.html.erb
224
- - app/views/admin/links/_index.html.erb
225
- - app/views/admin/links/_links.html.erb
226
- - app/views/admin/links/_table_row.html.erb
227
- - app/views/admin/links/create.js.erb
228
- - app/views/admin/links/sort.js.coffee
229
- - app/views/admin/links/update.js.coffee
230
- - app/views/admin/menus/_form.html.erb
231
- - app/views/admin/menus/_index.html.erb
232
222
  - app/views/admin/page_parts/_tabs.html.erb
233
223
  - app/views/admin/page_parts/destroy.js.coffee
234
224
  - app/views/admin/pages/_collection.html.erb
235
225
  - app/views/admin/pages/_form.html.erb
236
226
  - app/views/admin/settings/_form.html.erb
237
- - app/views/admin/settings/_index.html.erb
227
+ - app/views/admin/users/_form.html.erb
238
228
  - config/locales/en.yml
239
229
  - config/locales/it.yml
240
230
  - config/routes.rb
@@ -245,7 +235,6 @@ files:
245
235
  - lib/fullstack/cms/engine.rb
246
236
  - lib/generators/fullstack/cms/install_generator.rb
247
237
  - lib/generators/fullstack/cms/locale_generator.rb
248
- - lib/generators/fullstack/cms/templates/rails/app/assets/javascripts/admin/links.js.coffee
249
238
  - lib/generators/fullstack/cms/templates/rails/app/assets/javascripts/site/lib/jquery.fitvids.js
250
239
  - lib/generators/fullstack/cms/templates/rails/app/assets/javascripts/site/lib/plugins.js
251
240
  - lib/generators/fullstack/cms/templates/rails/app/assets/javascripts/site/site.js.coffee
@@ -297,7 +286,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
297
286
  version: '0'
298
287
  segments:
299
288
  - 0
300
- hash: -1571725266931374814
289
+ hash: 1053948701747284460
301
290
  required_rubygems_version: !ruby/object:Gem::Requirement
302
291
  none: false
303
292
  requirements:
@@ -1,59 +0,0 @@
1
- class Admin::LinksController < Admin::BaseController
2
- respond_to :html, :js
3
-
4
- def index
5
- @search = Link.search(params[:search])
6
- @links = @search.page(params[:page] || 1)
7
- end
8
-
9
- def new
10
- @link = Link.new
11
- end
12
-
13
- def edit
14
- end
15
-
16
- def create
17
- @link = Link.new(params[:link])
18
-
19
- if @link.respond_to?(:author)
20
- @link.author ||= current_user
21
- end
22
-
23
- @link.save
24
- respond_with(@link)
25
- end
26
-
27
- def update
28
- @link.attributes = params[:link]
29
- @link.save
30
- respond_with(@link)
31
- end
32
-
33
- def destroy
34
- @link.destroy
35
- respond_with(@link)
36
- end
37
-
38
- def sort
39
- @error = false
40
- if params[:list]
41
- list_ids = params[:list].split(";")
42
- list_ids.each_with_index {|id, i|
43
- Link.find(id).update_attribute(:position, i)
44
- }
45
-
46
- begin
47
-
48
- rescue
49
- @error = true
50
-
51
- end
52
- else
53
- render :text => "0"
54
- end
55
-
56
- end
57
- end
58
-
59
-
@@ -1,14 +0,0 @@
1
- <!-- https://github.com/ernie/meta_search -->
2
- <!--
3
- f.input :title_contains
4
- f.input :created_at, :as => :daterange
5
- -->
6
-
7
-
8
- <%= f.input :label_contains %>
9
-
10
-
11
-
12
- <%= f.input :created_at, :as => :daterange %>
13
-
14
-
@@ -1,24 +0,0 @@
1
- <%= tabs do |t| %>
2
- <%= t.pane t('fullstack.admin.info', :default => "Info") do %>
3
- <%= admin_form_for [:"admin", current_resource], :html => { :multipart => true, :'data-type' => :script }, :remote => true do |f| -%>
4
-
5
- <%= f.errors %>
6
-
7
- <%= f.inputs do %>
8
- <%= f.input :label %>
9
- <%= f.input :description %>
10
- <%= f.input :url %>
11
- <%= f.input :image %>
12
- <%= f.input :alignment_right %>
13
-
14
- <% end -%>
15
-
16
- <%= f.actions do %>
17
- <%= button (current_resource.persisted? ? t('fullstack.admin.update', :default => "Update") : t('fullstack.admin.create', :default => "Create")), :type => :primary, :size => :large %>
18
- <% end %>
19
-
20
-
21
- <% end -%>
22
-
23
- <% end %>
24
- <% end %>
@@ -1,9 +0,0 @@
1
- <% if thead -%>
2
- <th><%= sort_link title_method_for(current_collection.klass) %></th><th><%= sort_link :created_at %></th><th><%= _("Actions") %></th>
3
- <% end -%>
4
-
5
- <% if tbody -%>
6
- <td><%= link_to title_for(content), [:edit, :admin, content] %></td>
7
- <td><%= l content.created_at, :format => :pubdate %></td>
8
- <td><%= default_collection_actions_for(content) %></td>
9
- <% end -%>
@@ -1,95 +0,0 @@
1
- <table class="table table-bordered">
2
- <thead>
3
- <tr>
4
- <th colspan="2"><%= t("label", :scope => "activerecord.models", :default => "Label").titleize %></th>
5
- <th><%= t("url", :scope => "activerecord.models", :default => "Url").titleize %></th>
6
- <th><%= t('fullstack.admin.actions', :default => "Actions") %></th>
7
- </tr>
8
- </thead>
9
- <tbody id="links_table_body" class="sortable" data-update-url="<%= sort_admin_links_path %>">
10
- <% link_owner.links.each do |link| %>
11
- <%= render :partial => "admin/links/table_row", :locals => {:link => link} %>
12
- <% end %>
13
- </tbody>
14
- </table>
15
-
16
-
17
- <div id="add_link_form">
18
-
19
- <div class="well">
20
- <%= admin_form_for [:"admin", link = Link.new(:link_owner => link_owner)], :html => {:multipart => true}, :remote => true do |f| -%>
21
-
22
- <%= f.errors %>
23
-
24
- <%= f.inputs :class=>"hide" do %>
25
- <%= f.input :link_owner_id, :as => :hidden, :label => false %>
26
- <%= f.input :link_owner_type, :as => :hidden, :label => false %>
27
- <% end %>
28
-
29
- <%= f.inputs _("Add a new link"), :class => "clearable" do %>
30
- <div class="row-fluid">
31
- <div class="span8">
32
- <%= f.input :label %>
33
- <%= f.input :description %>
34
-
35
- <div class="mb1">
36
- </div>
37
-
38
- <%= tabs do |t| %>
39
- <%= t.pane(t('fullstack.admin.link_a_page', :default => "Link a Page")) do %>
40
- <div class="clearfix" style="padding: 18px; min-height: 54px;">
41
- <select class="select-resource-url" data-placeholder="<%= t('fullstack.cms.links.choose_a_page_by_title', :default => 'Choose a page by title') %>">
42
- <option value=""></option>
43
- <% Page.all.each do |page| %>
44
- <option value="content://Page#<%= page.id %>"><%= page.title %></option>
45
- <% end %>
46
- </select>
47
- </div>
48
- <% end %>
49
- <%= t.pane t('fullstack.admin.insert_by_hand', :default => "Insert by hand") do %>
50
- <%= f.input :url %>
51
- <% end %>
52
- <% end %>
53
-
54
-
55
-
56
- </div>
57
- <div class="span4">
58
- <div class="hide">
59
- <%= f.input :alignment_right %>
60
- </div>
61
-
62
- <%= f.inputs do %>
63
- <%= f.input :image %>
64
- <%= f.input :icon %>
65
- <% end %>
66
-
67
- </div>
68
- </div>
69
-
70
-
71
- <% end -%>
72
-
73
- <%= f.actions do %>
74
- <%= button t('fullstack.admin.add_link', :default => "Add Link"), :type => :primary %>
75
- <% end %>
76
-
77
- <% end -%>
78
-
79
- </div>
80
- </div>
81
-
82
-
83
-
84
-
85
- <% content_for :javascripts do -%>
86
- <script type="text/javascript" charset="utf-8">
87
- $(document).ready(function(){
88
- $("select.select-resource-url").change(function(){
89
- $("#link_url").val($("select.select-resource-url").val());
90
- });
91
-
92
- });
93
-
94
- </script>
95
- <% end -%>
@@ -1,9 +0,0 @@
1
- <tr data-link-id="<%= link.id %>">
2
- <td style="width: 12px;" ><img src="/admin/drag-handle.png" class="handle" /></td>
3
- <td><%= link.label %></td>
4
- <td><%= link.url %></td>
5
- <td>
6
- <a href="<%= edit_admin_link_path(link) %>" data-tooltip="<%= _('Edit') %>"><i class="icon-edit"></i></a>
7
- <a href="<%= admin_link_path(link) %>" data-confirm="Are you sure?" data-method="delete" data-remote="true" data-tooltip="<%= _('Delete') %>"><i class="icon-trash"></i></a>
8
- </td>
9
- </tr>
@@ -1,12 +0,0 @@
1
- <%= remotipart_response do %>
2
- <% if @link.errors.empty? %>
3
- $("#links_table_body").append('<%=j render(:partial => "admin/links/table_row", :locals => {:link => @link}) %>');
4
- $("#add_link_form .clearable input").each(function() {
5
- return $(this).val("");
6
- });
7
- $("#add_link_form").collapse('hide');
8
- $.flash.notify('<%=j t("flash.success.create") %>');
9
- <% else %>
10
- $.flash.notify('<%=j t("flash.error.create") %>');
11
- <% end %>
12
- <% end %>
@@ -1,6 +0,0 @@
1
- <% if !@error %>
2
- notify_notice('<%=j t("flash.success.update") %>')
3
- <% else %>
4
- notify_error('<%=j t("flash.error.update") %>')
5
- <% end %>
6
-
@@ -1,6 +0,0 @@
1
- <% if instance_variable_get("@#{controller_name.singularize}").errors.empty? %>
2
- $.flash.notify('<%=j t("flash.success.update") %>')
3
- <% else %>
4
- $.flash.notify('<%=j t("flash.error.update") %>')
5
- <% end %>
6
-
@@ -1,25 +0,0 @@
1
- <%= admin_form_for [:"admin", current_resource], :html => {:multipart => true} do |f| -%>
2
-
3
- <%= f.errors %>
4
-
5
- <%= f.inputs do %>
6
- <%= f.resource_inputs %>
7
- <% end -%>
8
-
9
- <%= render :partial => "associated_resources_table", :locals => {
10
- :resource => current_resource,
11
- :resource_name => resource_name,
12
- :association => :links,
13
- :f => f
14
-
15
- } %>
16
-
17
- <%= f.actions do %>
18
- <%= f.resource_submit %>
19
- <% end %>
20
-
21
- <% end -%>
22
-
23
-
24
-
25
-
@@ -1,18 +0,0 @@
1
- <% if thead -%>
2
- <th><%= sort_link title_method_for(current_collection.klass) %></th>
3
-
4
- <th><%= sort_link :created_at %></th>
5
-
6
-
7
- <th><%= t('fullstack.admin.actions', :default => "Actions") %></th>
8
- <% end -%>
9
-
10
- <% if tbody -%>
11
- <td><%= link_to title_for(content), [:edit, :admin, content] %></td>
12
-
13
-
14
- <td><%= l content.created_at.to_date, :format => :long %></td>
15
-
16
-
17
- <td><%= default_collection_actions_for(content) %></td>
18
- <% end -%>
@@ -1,14 +0,0 @@
1
- <% if thead -%>
2
- <th><%= sort_link title_method_for(current_collection.klass) %></th>
3
-
4
-
5
- <th><%= t('fullstack.admin.actions', :default => "Actions") %></th>
6
- <% end -%>
7
-
8
- <% if tbody -%>
9
- <td><%= link_to title_for(content), [:edit, :admin, content] %></td>
10
-
11
-
12
-
13
- <td><%= default_collection_actions_for(content) %></td>
14
- <% end -%>
@@ -1,20 +0,0 @@
1
- fixHelper = (e, ui) ->
2
- ui.children().each ->
3
- $(this).width $(this).width()
4
-
5
- ui
6
-
7
- $("tbody.sortable").sortable({ axis: 'y', items: 'tr', helper: fixHelper, handle: '.handle' }).disableSelection()
8
- $("tbody.sortable").bind "sortupdate", (e, ui) ->
9
- url = $(this).data("update-url")
10
- if url.length > 0
11
- serialized_list = []
12
- $(this).find("tr").each ->
13
- id = $(this).data("link-id")
14
- serialized_list.push id
15
-
16
- $.ajax
17
- type: 'POST'
18
- url: url
19
- data: {list: serialized_list.join(";")}
20
-