tandem 0.2.0 → 0.2.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
  = Tandem CMS
2
2
 
3
- Tandme is a content management system (CMS) for Rails 3.1+. We felt like it was
3
+ Tandem is a content management system (CMS) for Rails 3.1+. We felt like it was
4
4
  needed because too many of the CMS options for Rails are either
5
5
  unpolished—something we wouldn't want to put in front of our clients or bloated
6
6
  and heavy, causing many headaches when trying to integrate into existing
@@ -6,7 +6,6 @@ module Tandem
6
6
  end
7
7
 
8
8
  def image_content_tag(image_content, options = {}, format = :original)
9
- options = {style: ""}.merge(options) if format == :thumb
10
9
  image_tag image_content_url(image_content, format), options
11
10
  end
12
11
 
@@ -172,35 +172,39 @@ module Tandem
172
172
  end
173
173
  end
174
174
 
175
- def tandem_page_links(options ={})
176
- return if cannot?(:create, @page) && cannot?(:update, @page) && cannot?(:destroy, @page)
175
+ def tandem_page_links(options = {})
176
+ using_tandem_abilities do
177
+ return if cannot?(:create, @page) && cannot?(:update, @page) && cannot?(:destroy, @page) && cannot?(:index, ::Tandem::Page)
177
178
 
178
- options[:id] ||= 'tandem_page_links'
179
+ options[:id] ||= 'tandem_page_links'
179
180
 
180
- content_tag(:ul, options) do
181
- links = []
182
-
183
- if can?(:create, @page)
184
- links << link_to('New Page', tandem.new_page_path(parent_id: @page.id), :class => :page_link, :id => :page_new_link)
185
- end
181
+ content_tag(:ul, options) do
182
+ links = []
183
+
184
+ if can?(:create, ::Tandem::Page)
185
+ links << link_to('New Page', tandem.new_page_path(parent_id: @page.try(:id)), :class => :page_link, :id => :page_new_link)
186
+ end
186
187
 
187
- if @page.persisted? && can?(:update, @page)
188
- links << link_to('Edit Page', tandem.edit_page_path(@page), :class => :page_link, :id => :page_edit_link)
189
- end
188
+ if @page.present?
189
+ if @page.persisted? && can?(:update, @page)
190
+ links << link_to('Edit Page', tandem.edit_page_path(@page), :class => :page_link, :id => :page_edit_link)
191
+ end
190
192
 
191
- if @page.persisted? && can?(:destroy, @page)
192
- links << link_to('Destroy Page', tandem.page_path(@page), :confirm => 'Are you sure?', :method => :delete)
193
- end
193
+ if @page.persisted? && can?(:destroy, @page)
194
+ links << link_to('Destroy Page', tandem.page_path(@page), :confirm => 'Are you sure?', :method => :delete)
195
+ end
196
+ end
194
197
 
195
- if can?(:index, ::Tandem::Page)
196
- links << link_to('Page Listing', tandem.pages_path)
197
- end
198
+ if can?(:index, ::Tandem::Page)
199
+ links << link_to('Page Listing', tandem.pages_path)
200
+ end
198
201
 
199
- links.collect! do |link|
200
- content_tag(:li, link)
201
- end
202
+ links.collect! do |link|
203
+ content_tag(:li, link)
204
+ end
202
205
 
203
- raw(links.join)
206
+ raw(links.join)
207
+ end
204
208
  end
205
209
  end
206
210
 
@@ -1,3 +1,3 @@
1
1
  module Tandem
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tandem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2012-04-19 00:00:00.000000000 Z
16
+ date: 2012-04-24 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: rails
@@ -111,22 +111,6 @@ dependencies:
111
111
  - - ! '>='
112
112
  - !ruby/object:Gem::Version
113
113
  version: '0'
114
- - !ruby/object:Gem::Dependency
115
- name: cucumber-rails
116
- requirement: !ruby/object:Gem::Requirement
117
- none: false
118
- requirements:
119
- - - ! '>='
120
- - !ruby/object:Gem::Version
121
- version: '0'
122
- type: :development
123
- prerelease: false
124
- version_requirements: !ruby/object:Gem::Requirement
125
- none: false
126
- requirements:
127
- - - ! '>='
128
- - !ruby/object:Gem::Version
129
- version: '0'
130
114
  - !ruby/object:Gem::Dependency
131
115
  name: factory_girl_rails
132
116
  requirement: !ruby/object:Gem::Requirement