imagine_cms 3.0.0 → 3.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -1,6 +1,6 @@
1
1
  =About Imagine CMS
2
2
 
3
- Imagine CMS is a content management system developed by {Bigger Bird Creative, Inc.}[https://www.biggerbird.com] in 2006 for its clients. Other systems came with a learning curve: fine for daily users, but clients who only used it once a month or so would never remember how to use the system the next time they logged in. Simpler systems didn't allow us enough flexibility as designers and developers.
3
+ Imagine CMS is a web content management system developed by {Bigger Bird Creative, Inc.}[https://www.biggerbird.com] in 2006 for its clients. Other CMSes came with a learning curve: not a problem for daily users, but clients who only used it once a month or so would forget everything by the next time they logged in. Simpler systems didn't have enough functionality to allow us to do what we wanted to do as designers and developers. Thus, we created a CMS that is easy for clients to use, stays out of our way, and provides useful automation.
4
4
 
5
5
  =Demo
6
6
 
@@ -22,17 +22,17 @@ Of the three original phases of this project, two remain:
22
22
 
23
23
  =Current Status
24
24
 
25
- Imagine 3.0 is finally ready for production use internally at Bigger Bird, but it's not quite ready for general use yet. Probably still buggy, not all functionality has been properly exercised, and there are no tests yet, I'll tackle this for 4.0 as we modernize the internals.
25
+ Imagine 3.0 is finally ready for production use internally at Bigger Bird, but it's not quite ready for general use yet. Probably still buggy, not all functionality has been properly exercised, and there are no tests yet, I'll tackle this for 4.0 as I modernize the internals.
26
26
 
27
- One major feature is still missing: browser-based editing of view layouts and stylesheets. While convenient, this was probably not ever a good idea, so I'm working on a better solution.
27
+ One major feature is still missing: browser-based editing of view layouts and stylesheets. While convenient, this was probably not ever a good idea, so I'm working on a better solution. I've also added a new feature, uploaded images and files can be stored on S3 (galleries still live on the local disk).
28
28
 
29
- Unless you are interested in contributing to development, it might be best to wait until the second phase of this project (Imagine 4). Why? Well, the purpose of Imagine 3 is strictly to port legacy sites to Rails 3.2 as simply as possible. Imagine 3 will always be held back by its need to remain compatible with legacy installations dating back to 2006. The ERB templating language can be dangerous (it allows all Ruby, including shell escapes), and the editor (powered by an ancient version of Dojo) is Firefox-only. It also uses Prototype, which has become a bit unfashionable these days.
29
+ Unless you are already familiar with Imagine and/or interested in contributing to development, it might be best to wait until the second phase of this project (Imagine 4). Why? Well, the purpose of Imagine 3 is strictly to port legacy sites to Rails 3.2 as simply as possible. Imagine 3 will always be held back by its need to remain compatible with legacy installations dating back to 2006. The ERB templating language can be dangerous (it allows all Ruby, including shell escapes), and the editor (powered by an ancient version of Dojo) is still Firefox-only. It also uses Prototype, which has become a bit unfashionable these days.
30
30
 
31
31
  Imagine 4 will be a clean break from all of these "traditions," and thus will be a good time to get on board.
32
32
 
33
33
  =Hosting
34
34
 
35
- Imagine 3 can run on most "standard" Rails hosting platforms, anything that uses Passenger, Unicorn, etc. On hosts that don't allow/recommend writing to the local filesystem (e.g. Heroku) you won't be able to use photo galleries or page caching, but other features should work (this has not been tested).
35
+ Imagine 3 can run on most "standard" Rails hosting platforms, anything that uses Passenger, Unicorn, etc. On hosts that don't allow (or recommend) writing to the local filesystem (e.g. Heroku) you won't be able to use photo galleries or page caching, but other features should work (this has not been tested).
36
36
 
37
37
  =Getting Help
38
38
 
@@ -300,9 +300,9 @@ module Cms # :nodoc:
300
300
 
301
301
  # send feed
302
302
  response.headers["Content-Type"] = "application/rss+xml"
303
- response.headers["Last-Modified"] = @pages.first.published_date.httpdate rescue Time.now
303
+ response.headers["Last-Modified"] = (@pages.first.published_date.httpdate rescue Time.now).to_s
304
304
 
305
- render :layout => false
305
+ render 'rss_feed.xml', :layout => false
306
306
  end
307
307
 
308
308
  def preview_template
@@ -13,6 +13,10 @@ class Management::UsersController < Management::ApplicationController
13
13
  @users = User.all
14
14
  end
15
15
 
16
+ def new
17
+ @user = User.new
18
+ end
19
+
16
20
  def create
17
21
  @user = User.new
18
22
  @user.username = params[:user][:username]
@@ -34,6 +38,17 @@ class Management::UsersController < Management::ApplicationController
34
38
  end
35
39
 
36
40
  def edit
41
+ return update if request.post?
42
+
43
+ user = authenticate_user
44
+ unless user.is_superuser || user.can_manage_users || user.id.to_s == params[:id]
45
+ render :layout => true, :text => "Sorry, you don't have permission to access this section." and return false
46
+ end
47
+
48
+ @user = User.find(params[:id])
49
+ end
50
+
51
+ def update
37
52
  user = authenticate_user
38
53
  unless user.is_superuser || user.can_manage_users || user.id.to_s == params[:id]
39
54
  render :layout => true, :text => "Sorry, you don't have permission to access this section." and return false
@@ -41,28 +56,27 @@ class Management::UsersController < Management::ApplicationController
41
56
 
42
57
  @user = User.find(params[:id])
43
58
 
44
- if request.post?
59
+ if user.is_superuser || user.can_manage_users
60
+ params[:user].each { |k,v| @user.send("#{k}=", v) }
61
+ elsif user.id.to_s == params[:id]
62
+ @user.first_name = params[:user][:first_name]
63
+ @user.last_name = params[:user][:last_name]
64
+ @user.email_address = params[:user][:email_address]
65
+ @user.password = params[:user][:password]
66
+ @user.password_confirmation = params[:user][:password_confirmation]
67
+ end
68
+
69
+ if @user.save
70
+ flash[:notice] = 'User updated successfully. Please note that the user must log out and log back in for permission changes to take effect.'
71
+ user = authenticate_user
45
72
  if user.is_superuser || user.can_manage_users
46
- params[:user].each { |k,v| @user.send("#{k}=", v) }
47
- elsif user.id.to_s == params[:id]
48
- @user.first_name = params[:user][:first_name]
49
- @user.last_name = params[:user][:last_name]
50
- @user.email_address = params[:user][:email_address]
51
- @user.password = params[:user][:password]
52
- @user.password_confirmation = params[:user][:password_confirmation]
53
- end
54
-
55
- if @user.save
56
- flash[:notice] = 'User updated successfully. Please note that the user must log out and log back in for permission changes to take effect.'
57
- user = authenticate_user
58
- if user.is_superuser || user.can_manage_users
59
- redirect_to :action => 'index'
60
- else
61
- redirect_to :controller => '/manage/default', :action => 'index'
62
- end
73
+ redirect_to :action => 'index'
63
74
  else
64
- flash.now[:error] = @user.errors.full_messages
75
+ redirect_to :controller => '/manage/default', :action => 'index'
65
76
  end
77
+ else
78
+ flash.now[:error] = @user.errors.full_messages
79
+ render :action => 'edit'
66
80
  end
67
81
  end
68
82
 
@@ -0,0 +1,28 @@
1
+ xml.instruct!
2
+ xml.rss :version => "2.0", 'xmlns:content' => "http://purl.org/rss/1.0/modules/content/" do
3
+ xml.channel do
4
+ xml.title params[:page_list_name]
5
+ xml.link url_for(:only_path => false,
6
+ :controller => '/cms/content', :action => 'show',
7
+ :content_path => @pg.path.split('/'))
8
+ xml.lastBuildDate CGI.rfc1123_date(@most_recent_pub_date ? @most_recent_pub_date.published_date : Time.now)
9
+ xml.language "en-us"
10
+ xml.description h(@pg.summary)
11
+ @pages.each do |page|
12
+ xml.item do
13
+ xml.title page.title
14
+ xml.link url_for(:only_path => false,
15
+ :controller => '/cms/content', :action => 'show',
16
+ :content_path => page.path.split('/'))
17
+ xml.description strip_tags(@page_contents[page.id])
18
+ xml.tag!('content:encoded') do
19
+ xml.cdata! @page_contents[page.id]
20
+ end
21
+ xml.pubDate CGI.rfc1123_date(page.published_date)
22
+ xml.guid url_for(:only_path => false,
23
+ :controller => '/cms/content', :action => 'show',
24
+ :content_path => page.path.split('/'))
25
+ end
26
+ end
27
+ end
28
+ end
@@ -1,66 +1,54 @@
1
1
  <%= flash_message %>
2
2
 
3
- <%= form_tag do %>
3
+ <%= form_for(@user) do |f| %>
4
4
  <table>
5
5
  <tr>
6
6
  <td>First name:</td>
7
- <td><%= text_field :user, :first_name %></td>
7
+ <td><%= f.text_field :first_name %></td>
8
8
  </tr>
9
9
  <tr>
10
10
  <td>Last name:</td>
11
- <td><%= text_field :user, :last_name %></td>
11
+ <td><%= f.text_field :last_name %></td>
12
12
  </tr>
13
13
  <tr>
14
14
  <td>Email address:</td>
15
- <td><%= text_field :user, :email_address %></td>
15
+ <td><%= f.text_field :email_address %></td>
16
16
  </tr>
17
17
 
18
18
  <tr>
19
19
  <td>Username:</td>
20
- <td><%= text_field :user, :username %></td>
20
+ <td><%= f.text_field :username %></td>
21
21
  </tr>
22
22
  <tr>
23
23
  <td>New Password:</td>
24
- <td><%= password_field :user, :password %></td>
24
+ <td><%= f.password_field :password %></td>
25
25
  </tr>
26
26
  <tr>
27
27
  <td>Confirm:</td>
28
- <td><%= password_field :user, :password_confirmation %></td>
28
+ <td><%= f.password_field :password_confirmation %></td>
29
29
  </tr>
30
30
 
31
- <tr>
32
- <td>Administrator:</td>
33
- <td><%= check_box :user, :is_superuser %></td>
34
- </tr>
35
-
36
- <tr>
37
- <td colspan="2">-- OR -- </td>
38
- </tr>
39
-
40
- <tr>
41
- <td>Manage Restaurants:</td>
42
- <td><%= check_box :user, :can_manage_restaurants %></td>
43
- </tr>
44
- <tr>
45
- <td>Manage Recipes:</td>
46
- <td><%= check_box :user, :can_manage_recipes %></td>
47
- </tr>
48
- <tr>
49
- <td>Manage Blog Posts:</td>
50
- <td><%= check_box :user, :can_manage_blog %></td>
51
- </tr>
52
- <tr>
53
- <td>Manage Requests:</td>
54
- <td><%= check_box :user, :can_manage_reqs %></td>
55
- </tr>
56
- <tr>
57
- <td>Manage Members:</td>
58
- <td><%= check_box :user, :can_manage_members %></td>
59
- </tr>
60
- <tr>
61
- <td>Manage Users:</td>
62
- <td><%= check_box :user, :can_manage_users %></td>
63
- </tr>
31
+ <%- if @user.username != session[:user_username] -%>
32
+ <tr>
33
+ <td>This user is allowed to:</td>
34
+ <td>
35
+ <%= f.check_box :can_manage_cms %>
36
+ <label for="user_can_manage_cms">Create and edit web site content</label><br/>
37
+ <%- if UseCmsAccessLevels -%>
38
+ <%= f.check_box :can_manage_cms_publishing, :style => 'margin-left: 20px;' %>
39
+ <label for="user_can_manage_cms_publishing">Publish new page versions and create new pages</label><br/>
40
+ <div style="margin-left: 40px;" title="Example: /programs/abc, /about/news">
41
+ <label for="user_cms_allowed_sections">...but only in these sections (leave blank for unrestricted access):</label><br/>
42
+ <%= f.text_field :cms_allowed_sections, :style => 'width: 350px;' %>
43
+ </div>
44
+ <%= f.check_box :can_manage_cms_full_access, :style => 'margin-left: 20px;' %>
45
+ <label for="user_can_manage_cms_full_access">Edit templates and snippets</label><br/>
46
+ <%- end -%>
47
+ <%= f.check_box :can_manage_users %>
48
+ <label for="user_can_manage_users">Create users and control their access</label><br/>
49
+ </td>
50
+ </tr>
51
+ <%- end -%>
64
52
 
65
53
  <tr>
66
54
  <td></td>
@@ -1,6 +1,6 @@
1
1
  <h2>CMS &raquo; Users</h2>
2
2
 
3
- <p><%= button_to 'Create New User', :action => 'create' %></p>
3
+ <p><%= button_to 'Create New User', new_user_path, :method => :get %></p>
4
4
 
5
5
  <%= flash_message %>
6
6
 
@@ -2,32 +2,32 @@
2
2
 
3
3
  <%= flash_message %>
4
4
 
5
- <%= form_tag do %>
5
+ <%= form_for(@user) do |f| %>
6
6
  <table>
7
7
  <tr>
8
8
  <td>First name:</td>
9
- <td><%= text_field :user, :first_name %></td>
9
+ <td><%= f.text_field :first_name %></td>
10
10
  </tr>
11
11
  <tr>
12
12
  <td>Last name:</td>
13
- <td><%= text_field :user, :last_name %></td>
13
+ <td><%= f.text_field :last_name %></td>
14
14
  </tr>
15
15
  <tr>
16
16
  <td>Email address:</td>
17
- <td><%= text_field :user, :email_address %></td>
17
+ <td><%= f.text_field :email_address %></td>
18
18
  </tr>
19
19
 
20
20
  <tr>
21
21
  <td>Username:</td>
22
- <td><%= text_field :user, :username %></td>
22
+ <td><%= f.text_field :username %></td>
23
23
  </tr>
24
24
  <tr>
25
25
  <td>Password:</td>
26
- <td><%= password_field :user, :password %></td>
26
+ <td><%= f.password_field :password %></td>
27
27
  </tr>
28
28
  <tr>
29
29
  <td>Confirm:</td>
30
- <td><%= password_field :user, :password_confirmation %></td>
30
+ <td><%= f.password_field :password_confirmation %></td>
31
31
  </tr>
32
32
  <tr>
33
33
  <td></td>
data/config/routes.rb CHANGED
@@ -8,7 +8,17 @@ Rails.application.routes.draw do
8
8
 
9
9
  match 'manage/cms/preview_template' => 'cms/content#preview_template'
10
10
  match 'manage/cms(/:action(/:id))' => 'management/cms'
11
- match 'manage/users(/:action(/:id))' => 'management/users'
11
+
12
+ # slowly convert to resourceful routes
13
+ # match 'manage/users(/:action(/:id))' => 'management/users'
14
+ resources :users, :path => 'manage/users', :controller => 'management/users' do
15
+ member do
16
+ post :enable
17
+ post :disable
18
+ post :edit # COMPAT: Remove for 3.1
19
+ end
20
+ end
21
+ # end
12
22
 
13
23
  match 'util/date_picker' => 'util#date_picker', :as => :date_picker
14
24
 
data/imagine_cms.gemspec CHANGED
@@ -9,12 +9,17 @@ Gem::Specification.new do |s|
9
9
  s.name = "imagine_cms"
10
10
  s.version = ImagineCms::VERSION
11
11
  s.platform = Gem::Platform::RUBY
12
- s.authors = ["Aaron Namba"]
13
- s.email = ["aaron@biggerbird.com"]
12
+ s.author = "Aaron Namba"
13
+ s.email = "aaron@biggerbird.com"
14
14
  s.homepage = "https://github.com/anamba/imagine_cms"
15
15
  s.summary = %q{Imagine Content Management System for Rails}
16
16
  s.description = %q{See README for details.}
17
17
 
18
+ s.required_ruby_version = '>= 1.9.3'
19
+ s.required_rubygems_version = '>= 1.8.11'
20
+
21
+ s.license = 'AGPLv3'
22
+
18
23
  s.rubyforge_project = "imagine_cms"
19
24
 
20
25
  s.files = `git ls-files`.split("\n")
@@ -1,3 +1,3 @@
1
1
  module ImagineCms
2
- VERSION = "3.0.0"
2
+ VERSION = "3.0.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: imagine_cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.0.1
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-12-01 00:00:00.000000000 Z
12
+ date: 2012-12-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -172,8 +172,7 @@ dependencies:
172
172
  - !ruby/object:Gem::Version
173
173
  version: '0'
174
174
  description: See README for details.
175
- email:
176
- - aaron@biggerbird.com
175
+ email: aaron@biggerbird.com
177
176
  executables: []
178
177
  extensions: []
179
178
  extra_rdoc_files: []
@@ -350,6 +349,7 @@ files:
350
349
  - app/models/user.rb
351
350
  - app/models/user_group.rb
352
351
  - app/sweepers/cms_content_sweeper.rb
352
+ - app/views/cms/content/rss_feed.xml.builder
353
353
  - app/views/imagine_cms/_dialogs.html.erb
354
354
  - app/views/imagine_cms/_header.html.erb
355
355
  - app/views/imagine_cms/_toolbar.html.erb
@@ -406,9 +406,9 @@ files:
406
406
  - app/views/management/default/index.html.erb
407
407
  - app/views/management/user/create_first.html.erb
408
408
  - app/views/management/user/login.html.erb
409
- - app/views/management/users/create.html.erb
410
409
  - app/views/management/users/edit.html.erb
411
410
  - app/views/management/users/index.html.erb
411
+ - app/views/management/users/new.html.erb
412
412
  - app/views/management/users/permission_denied.html.erb
413
413
  - app/views/util/_calendar_days.html.erb
414
414
  - app/views/util/_calendar_month_year.html.erb
@@ -518,7 +518,8 @@ files:
518
518
  - test/test_helper.rb
519
519
  - vendor/.DS_Store
520
520
  homepage: https://github.com/anamba/imagine_cms
521
- licenses: []
521
+ licenses:
522
+ - AGPLv3
522
523
  post_install_message:
523
524
  rdoc_options: []
524
525
  require_paths:
@@ -528,13 +529,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
528
529
  requirements:
529
530
  - - ! '>='
530
531
  - !ruby/object:Gem::Version
531
- version: '0'
532
+ version: 1.9.3
532
533
  required_rubygems_version: !ruby/object:Gem::Requirement
533
534
  none: false
534
535
  requirements:
535
536
  - - ! '>='
536
537
  - !ruby/object:Gem::Version
537
- version: '0'
538
+ version: 1.8.11
538
539
  requirements: []
539
540
  rubyforge_project: imagine_cms
540
541
  rubygems_version: 1.8.24