radiant 1.0.1 → 1.1.0.alpha

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of radiant might be problematic. Click here for more details.

Files changed (51) hide show
  1. data/CHANGELOG.md +1 -1
  2. data/Gemfile +12 -2
  3. data/Gemfile.lock +1 -0
  4. data/README.md +1 -1
  5. data/app/models/standard_tags.rb +0 -75
  6. data/app/models/user_action_observer.rb +1 -1
  7. data/config/locales/en.yml +0 -11
  8. data/config/routes.rb +0 -1
  9. data/features/admin/configuration.feature +0 -1
  10. data/features/admin/layouts_management.feature +1 -1
  11. data/features/admin/user_permissions.feature +2 -39
  12. data/features/navigation_rendering.feature +1 -1
  13. data/features/step_definitions/admin/content_negotiation_steps.rb +0 -8
  14. data/features/step_definitions/admin/pagination_steps.rb +1 -19
  15. data/features/support/datasets_loader.rb +1 -1
  16. data/features/support/paths.rb +0 -6
  17. data/lib/generators/instance/templates/instance_environment.rb +2 -0
  18. data/lib/generators/instance/templates/instance_gemfile +11 -0
  19. data/lib/radiant.rb +3 -3
  20. data/lib/radiant/admin_ui.rb +1 -20
  21. data/radiant.gemspec +0 -10
  22. data/spec/controllers/admin/paginated_controller_spec.rb +3 -4
  23. data/spec/datasets/markup_pages_dataset.rb +14 -2
  24. data/spec/helpers/admin/pages_helper_spec.rb +0 -5
  25. data/spec/helpers/admin/references_helper_spec.rb +10 -8
  26. data/spec/helpers/application_helper_spec.rb +1 -2
  27. data/spec/lib/radiant/admin_ui/nav_tabs_spec.rb +3 -3
  28. data/spec/lib/radiant/admin_ui_spec.rb +2 -17
  29. data/spec/lib/radiant/initializer_spec.rb +4 -4
  30. data/spec/lib/radiant/taggable_spec.rb +1 -1
  31. data/spec/models/page_part_spec.rb +9 -8
  32. data/spec/models/page_spec.rb +19 -25
  33. data/spec/models/standard_tags_spec.rb +1 -60
  34. data/spec/models/text_filter_spec.rb +2 -2
  35. data/spec/models/user_action_observer_spec.rb +3 -5
  36. data/test/fixtures/extensions/basic/app/models/basic_extension_page.rb +2 -0
  37. metadata +789 -164
  38. data/app/controllers/admin/snippets_controller.rb +0 -8
  39. data/app/helpers/admin/snippets_helper.rb +0 -41
  40. data/app/models/snippet.rb +0 -23
  41. data/app/views/admin/snippets/_form.html.haml +0 -33
  42. data/app/views/admin/snippets/edit.html.haml +0 -9
  43. data/app/views/admin/snippets/index.html.haml +0 -33
  44. data/app/views/admin/snippets/new.html.haml +0 -7
  45. data/app/views/admin/snippets/remove.html.haml +0 -17
  46. data/features/admin/resource_pagination.feature +0 -27
  47. data/features/admin/snippets_management.feature +0 -57
  48. data/spec/controllers/admin/snippets_controller_spec.rb +0 -110
  49. data/spec/datasets/snippets_dataset.rb +0 -38
  50. data/spec/helpers/admin/snippets_helper_spec.rb +0 -4
  51. data/spec/models/snippet_spec.rb +0 -59
data/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- ## 1.0.1 (March 6, 2012)
3
+ ## Edge
4
4
 
5
5
  * Ruby 1.9.3 compatibility [Jim Gay]
6
6
  * Allow page menus to be overridden by additional modules [Jim Gay]
data/Gemfile CHANGED
@@ -8,15 +8,25 @@ source :rubygems
8
8
  # dependency mentioned in radiant.gemspec.
9
9
 
10
10
  gem "rails", "2.3.14"
11
- gem "sqlite3", "1.3.4", :group => [:development, :test]
11
+ gem "sqlite3", "1.3.4", :group => [:development, :test], :platform => :ruby
12
12
 
13
13
  # When radiant is installed as a gem you can run all of
14
14
  # its tests and specs from an instance. If you're working
15
15
  # on radiant itself and you want to run specs from the
16
- # radiant root directory, uncomment the line below and
16
+ # radiant root directory, uncomment the lines below and
17
17
  # run `bundle install`.
18
18
 
19
19
  # gemspec
20
+ # gem "radiant-archive-extension", "~> 1.0.7"
21
+ # gem "radiant-clipped-extension", "~> 1.0.16"
22
+ # gem "radiant-debug-extension", "~> 1.0.2"
23
+ # gem "radiant-exporter-extension", "~> 1.1.0"
24
+ # gem "radiant-markdown_filter-extension", "~> 1.0.2"
25
+ # gem "radiant-sheets-extension", "~> 1.0.9"
26
+ # gem "radiant-site_templates-extension", "~> 1.0.4"
27
+ # gem "radiant-smarty_pants_filter-extension", "~> 1.0.2"
28
+ # gem "radiant-snippets-extension", "~> 1.0.0"
29
+ # gem "radiant-textile_filter-extension", "~> 1.0.4"
20
30
 
21
31
  if ENV['TRAVIS']
22
32
  gemspec :development_group => :test
data/Gemfile.lock CHANGED
@@ -23,6 +23,7 @@ GEM
23
23
  sqlite3 (1.3.4)
24
24
 
25
25
  PLATFORMS
26
+ java
26
27
  ruby
27
28
 
28
29
  DEPENDENCIES
data/README.md CHANGED
@@ -4,7 +4,7 @@ Radiant is a no-fluff, open source content management system designed for
4
4
  small teams. It is similar to Textpattern or MovableType, but is a general
5
5
  purpose content management system (not just a blogging engine).
6
6
 
7
- [![Build Status](https://secure.travis-ci.org/radiant/radiant.png)](http://travis-ci.org/radiant/radiant)
7
+ [![Build Status](https://secure.travis-ci.org/radiant/radiant.png?branch=version1)](http://travis-ci.org/radiant/radiant)
8
8
 
9
9
  Radiant features:
10
10
 
@@ -832,81 +832,6 @@ module StandardTags
832
832
  breadcrumbs.join(separator)
833
833
  end
834
834
 
835
- desc %{
836
- Renders the snippet specified in the @name@ attribute within the context of a page.
837
-
838
- *Usage:*
839
-
840
- <pre><code><r:snippet name="snippet_name" /></code></pre>
841
-
842
- When used as a double tag, the part in between both tags may be used within the
843
- snippet itself, being substituted in place of @<r:yield/>@.
844
-
845
- *Usage:*
846
-
847
- <pre><code><r:snippet name="snippet_name">Lorem ipsum dolor...</r:snippet></code></pre>
848
- }
849
- tag 'snippet' do |tag|
850
- required_attr(tag, 'name')
851
- name = tag['name']
852
-
853
- snippet = snippet_cache(name.strip)
854
-
855
- if snippet
856
- tag.locals.yield = tag.expand if tag.double?
857
- tag.globals.page.render_snippet(snippet)
858
- else
859
- raise TagError.new("snippet '#{name}' not found")
860
- end
861
- end
862
-
863
- def snippet_cache(name)
864
- @snippet_cache ||= {}
865
-
866
- snippet = @snippet_cache[name]
867
- unless snippet
868
- snippet = Snippet.find_by_name(name)
869
- @snippet_cache[name] = snippet
870
- end
871
- snippet
872
- end
873
- private :snippet_cache
874
-
875
- desc %{
876
- Used within a snippet as a placeholder for substitution of child content, when
877
- the snippet is called as a double tag.
878
-
879
- *Usage (within a snippet):*
880
-
881
- <pre><code>
882
- <div id="outer">
883
- <p>before</p>
884
- <r:yield/>
885
- <p>after</p>
886
- </div>
887
- </code></pre>
888
-
889
- If the above snippet was named "yielding", you could call it from any Page,
890
- Layout or Snippet as follows:
891
-
892
- <pre><code><r:snippet name="yielding">Content within</r:snippet></code></pre>
893
-
894
- Which would output the following:
895
-
896
- <pre><code>
897
- <div id="outer">
898
- <p>before</p>
899
- Content within
900
- <p>after</p>
901
- </div>
902
- </code></pre>
903
-
904
- When called in the context of a Page or a Layout, @<r:yield/>@ outputs nothing.
905
- }
906
- tag 'yield' do |tag|
907
- tag.locals.yield
908
- end
909
-
910
835
  desc %{
911
836
  Inside this tag all page related tags refer to the page found at the @path@ attribute.
912
837
  @path@s may be relative or absolute paths.
@@ -1,5 +1,5 @@
1
1
  class UserActionObserver < ActiveRecord::Observer
2
- observe User, Page, Layout, Snippet
2
+ observe User, Page, Layout
3
3
 
4
4
  def current_user=(user)
5
5
  self.class.current_user = user
@@ -51,8 +51,6 @@ en:
51
51
  filter: "page filter"
52
52
  parts: "page parts"
53
53
  status: "page status"
54
- snippet:
55
- filter: "snippet filter"
56
54
  dev:
57
55
  host: "dev site domain"
58
56
  local:
@@ -81,7 +79,6 @@ en:
81
79
  - :day
82
80
  delete_layout: 'Delete Layout'
83
81
  delete_pages: 'Delete %{pages}'
84
- delete_snippet: 'Delete Snippet'
85
82
  delete_user: 'Delete User'
86
83
  description: 'Description'
87
84
  design: 'Design'
@@ -93,7 +90,6 @@ en:
93
90
  edit_page: 'Edit Page'
94
91
  edit_preferences: 'Edit Preferences'
95
92
  edit_settings: 'Edit Settings'
96
- edit_snippet: 'Edit Snippet'
97
93
  edit_user: 'Edit User'
98
94
  email_address: 'E-mail Address'
99
95
  extension: 'Extension'
@@ -116,12 +112,10 @@ en:
116
112
  new_layout: 'New Layout'
117
113
  new_page: 'New Page'
118
114
  new_password: 'New Password'
119
- new_snippet: 'New Snippet'
120
115
  new_user: 'New User'
121
116
  'no': 'No'
122
117
  no_layouts: 'No Layouts'
123
118
  no_pages: 'No Pages'
124
- no_snippets: 'No Snippets'
125
119
  normal_page: 'Normal Page'
126
120
  notes: 'Notes'
127
121
  optional: 'Optional'
@@ -158,7 +152,6 @@ en:
158
152
  remove_layout: 'Remove Layout'
159
153
  remove_page: 'Remove Page'
160
154
  remove_pages: 'Remove %{pages}'
161
- remove_snippet: 'Remove Snippet'
162
155
  remove_tab: 'Remove Tab'
163
156
  remove_user: 'Remove user'
164
157
  required: 'Required'
@@ -182,8 +175,6 @@ en:
182
175
  settings: 'Settings'
183
176
  show_all: 'Show all'
184
177
  slug: 'Slug'
185
- snippet: 'Snippet'
186
- snippets: 'Snippets'
187
178
  status: 'Status'
188
179
  # Warnings and info text:
189
180
  testing: Testing
@@ -192,8 +183,6 @@ en:
192
183
  remove_warning: 'Are you sure you want to <strong class="warning">permanently remove</strong> the following layout?'
193
184
  pages:
194
185
  remove_warning: 'Are you sure you want to <strong class="warning">permanently remove</strong> the following %{pages}?'
195
- snippets:
196
- remove_warning: 'Are you sure you want to <strong class="warning">permanently remove</strong> the following snippet?'
197
186
  users:
198
187
  remove_warning: 'Are you sure you want to <strong class="warning">permanently remove</strong> the following user?'
199
188
  this_file_language: "English"
data/config/routes.rb CHANGED
@@ -6,7 +6,6 @@ ActionController::Routing::Routes.draw do |map|
6
6
  pages.resources :children, :controller => "pages"
7
7
  end
8
8
  admin.resources :layouts
9
- admin.resources :snippets
10
9
  admin.resources :users
11
10
  end
12
11
  map.preview 'admin/preview', :controller => 'admin/pages', :action => 'preview', :conditions => {:method => [:post, :put]}
@@ -18,7 +18,6 @@ Feature: Rich configuration
18
18
  And I should see "Page Parts"
19
19
  And I should see "Page Fields"
20
20
  And I should see "Page Status"
21
- And I should see "Snippet Filter"
22
21
  And I should see "Allow Password Reset"
23
22
 
24
23
  Scenario: Editing configuration
@@ -1,4 +1,4 @@
1
- Feature: Managing snippets
1
+ Feature: Managing layouts
2
2
  In order to properly display the content
3
3
  As a designer I want to manage the layouts
4
4
 
@@ -41,26 +41,12 @@ Feature: User authentication and permissions
41
41
  | admin |
42
42
  | existing |
43
43
  | designer |
44
-
45
- Scenario Outline: Admins and designers can see and edit snippets
46
- Given I am logged in as "<username>"
47
- And I should see "Design"
48
- When I follow "Design" within "#navigation"
49
- And I follow "Snippets"
50
- And I should not see "You must have designer privileges"
51
- And I follow "first"
52
- Then I should see "Edit Snippet"
53
-
54
- Examples:
55
- | username |
56
- | admin |
57
- | designer |
58
44
 
59
45
  Scenario Outline: Admins and designers can see and edit layouts
60
46
  Given I am logged in as "<username>"
61
47
  And I should see "Design"
62
48
  When I follow "Design" within "#navigation"
63
- And I follow "Layouts"
49
+ # And I follow "Layouts"
64
50
  And I should not see "You must have designer privileges"
65
51
  And I follow "Main"
66
52
  Then I should see "Edit Layout"
@@ -80,17 +66,6 @@ Feature: User authentication and permissions
80
66
  | username |
81
67
  | existing |
82
68
  | another |
83
-
84
- Scenario Outline: Ordinary users cannot edit snippets
85
- Given I am logged in as "<username>"
86
- And I should not see "Design"
87
- When I go to the "snippets" admin page
88
- Then I should see "You must have designer privileges"
89
-
90
- Examples:
91
- | username |
92
- | existing |
93
- | another |
94
69
 
95
70
  Scenario: Admins can see and edit users
96
71
  Given I am logged in as "admin"
@@ -128,7 +103,7 @@ Feature: User authentication and permissions
128
103
  Given I am logged in as "admin"
129
104
  When I follow "Settings"
130
105
  And I follow "Extensions"
131
- Then I should see "Archive"
106
+ Then I should see "Basic"
132
107
 
133
108
  Scenario Outline: Non-admin users cannot see extensions
134
109
  Given I am logged in as "<username>"
@@ -141,16 +116,4 @@ Feature: User authentication and permissions
141
116
  | username |
142
117
  | existing |
143
118
  | another |
144
- | designer |
145
-
146
- Scenario Outline: Anyone can export YAML
147
- Given I am logged in as "<username>"
148
- When I go to the export page
149
- Then I should see "id:"
150
-
151
- Examples:
152
- | username |
153
- | admin |
154
- | existing |
155
- | another |
156
119
  | designer |
@@ -9,7 +9,7 @@ Feature: Rendering the navigation tag
9
9
  And I follow "Main"
10
10
  And I fill in the "layout_content" content with the text
11
11
  """
12
- <r:navigation urls="First: /first | Another: /another | Parent: /parent">
12
+ <r:navigation paths="First: /first | Another: /another | Parent: /parent">
13
13
  <r:normal><a href="<r:path />"><r:title /></a></r:normal>
14
14
  <r:here><strong><r:title /></strong></r:here>
15
15
  <r:selected><strong><a href="<r:path />"><r:title /></a></strong></r:selected>
@@ -8,14 +8,6 @@ When /^I view a page$/ do
8
8
  visit "/admin/pages/#{pages(:home).id}"
9
9
  end
10
10
 
11
- When /^I view a snippet$/ do
12
- visit "/admin/snippets/#{snippets(:first).id}"
13
- end
14
-
15
- When /^I view a filtered snippet$/ do
16
- visit "/admin/snippets/#{snippets(:markdown).id}"
17
- end
18
-
19
11
  When /^I view a layout$/ do
20
12
  visit "/admin/layouts/#{layouts(:main).id}"
21
13
  end
@@ -1,13 +1,3 @@
1
- Given /^There are many snippets$/ do
2
- 100.times do |i|
3
- Snippet.create(:name => "snippet_#{i}", :content => "This is snippet #{i}")
4
- end
5
- end
6
-
7
- Given /^There are few snippets$/ do
8
- #
9
- end
10
-
11
1
  Then /^I should not see pagination controls$/ do
12
2
  response.body.should_not have_tag('div.pagination')
13
3
  end
@@ -33,12 +23,4 @@ end
33
23
  Then /^I should mention the request parameters$/ do
34
24
  puts "!! params: #{request.params.inspect}"
35
25
  true
36
- end
37
-
38
- Then /^I should see all the snippets$/ do
39
- Snippet.all.each do |snippet|
40
- response.body.should have_tag('tr.snippet') do
41
- with_tag("a", :text => snippet.name)
42
- end
43
- end
44
- end
26
+ end
@@ -1,3 +1,3 @@
1
1
  Cucumber::Rails::World.class_eval do
2
- dataset :users, :config, :pages, :layouts, :pages_with_layouts, :snippets, :users_and_pages, :file_not_found, :markup_pages
2
+ dataset :users, :config, :pages, :layouts, :pages_with_layouts, :users_and_pages, :file_not_found, :markup_pages
3
3
  end
@@ -40,8 +40,6 @@ module NavigationHelpers
40
40
  login_path(:format => format)
41
41
  when /preferences/i
42
42
  admin_preferences_path(:format => format)
43
- when /snippets/i
44
- admin_snippets_path(:format => format)
45
43
  when /login/i
46
44
  login_path(:format => format)
47
45
  when /users/i
@@ -50,16 +48,12 @@ module NavigationHelpers
50
48
  admin_pages_path(:format => format)
51
49
  when /layouts/i
52
50
  admin_layouts_path(:format => format)
53
- when /snippets/i
54
- admin_snippets_path(:format => format)
55
51
  when /users/i
56
52
  admin_users_path(:format => format)
57
53
  when /configuration/i
58
54
  admin_configuration_path(:format => format)
59
55
  when /extensions/i
60
56
  admin_extensions_path(:format => format)
61
- when /export/i
62
- export_path(:format => format)
63
57
  else
64
58
  raise "Can't find mapping from \"#{page_name}\" to a path.\n" +
65
59
  "Now, go and add a mapping in #{__FILE__}"
@@ -9,6 +9,8 @@ require File.join(File.dirname(__FILE__), 'boot')
9
9
 
10
10
  require 'radius'
11
11
 
12
+ YAML::ENGINE.yamler = 'syck' if RUBY_VERSION =~ /1.9/
13
+
12
14
  Radiant::Initializer.run do |config|
13
15
  # Skip frameworks you're not going to use (only works if using vendor/rails).
14
16
  # To use Rails without a database, you must remove the Active Record framework
@@ -32,6 +32,17 @@ gem "radiant", "~> <%= radiant_version %>"
32
32
  <%= '# ' unless db == 'sqlserver' %>gem "tiny_tds"
33
33
  <%= '# ' unless db == 'sqlserver' %>gem "activerecord-sqlserver-adapter", "~> 3.1.0"
34
34
 
35
+ # Default Extensions
36
+ gem "radiant-archive-extension", "~> 1.0.7"
37
+ gem "radiant-clipped-extension", "~> 1.0.16"
38
+ gem "radiant-debug-extension", "~> 1.0.2"
39
+ gem "radiant-exporter-extension", "~> 1.0.2"
40
+ gem "radiant-markdown_filter-extension", "~> 1.0.2"
41
+ gem "radiant-sheets-extension", "~> 1.0.9"
42
+ gem "radiant-site_templates-extension", "~> 1.0.4"
43
+ gem "radiant-smarty_pants_filter-extension", "~> 1.0.2"
44
+ gem "radiant-textile_filter-extension", "~> 1.0.4"
45
+
35
46
  # Language packs
36
47
  # gem "radiant-dutch_language_pack-extension", "~> 1.0.0"
37
48
  # gem "radiant-french_language_pack-extension", "~> 1.0.0"
data/lib/radiant.rb CHANGED
@@ -4,9 +4,9 @@ unless defined? Radiant::Version
4
4
  module Radiant
5
5
  module Version
6
6
  Major = '1'
7
- Minor = '0'
8
- Tiny = '1'
9
- Patch = nil # set to nil for normal release
7
+ Minor = '1'
8
+ Tiny = '0'
9
+ Patch = 'alpha' # set to nil for normal release
10
10
 
11
11
  class << self
12
12
  def to_s
@@ -120,7 +120,7 @@ module Radiant
120
120
  end
121
121
 
122
122
  # Region sets
123
- %w{page snippet layout user configuration extension}.each do |controller|
123
+ %w{page layout user configuration extension}.each do |controller|
124
124
  attr_accessor controller
125
125
  alias_method "#{controller}s", controller
126
126
  end
@@ -142,7 +142,6 @@ module Radiant
142
142
 
143
143
  design = nav_tab("Design")
144
144
  design << nav_item("Layouts", "/admin/layouts")
145
- design << nav_item("Snippets", "/admin/snippets")
146
145
  nav << design
147
146
 
148
147
  settings = nav_tab("Settings")
@@ -155,7 +154,6 @@ module Radiant
155
154
 
156
155
  def load_default_regions
157
156
  @page = load_default_page_regions
158
- @snippet = load_default_snippet_regions
159
157
  @layout = load_default_layout_regions
160
158
  @user = load_default_user_regions
161
159
  @configuration = load_default_configuration_regions
@@ -203,23 +201,6 @@ module Radiant
203
201
  end
204
202
  end
205
203
 
206
- def load_default_snippet_regions
207
- OpenStruct.new.tap do |snippet|
208
- snippet.edit = RegionSet.new do |edit|
209
- edit.main.concat %w{edit_header edit_form}
210
- edit.form.concat %w{edit_title edit_content edit_filter}
211
- edit.form_bottom.concat %w{edit_buttons edit_timestamp}
212
- end
213
- snippet.index = RegionSet.new do |index|
214
- index.top.concat %w{}
215
- index.thead.concat %w{title_header actions_header}
216
- index.tbody.concat %w{title_cell actions_cell}
217
- index.bottom.concat %w{new_button}
218
- end
219
- snippet.new = snippet.edit
220
- end
221
- end
222
-
223
204
  def load_default_layout_regions
224
205
  OpenStruct.new.tap do |layout|
225
206
  layout.edit = RegionSet.new do |edit|