radiant-locked_page_parts-extension 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/app/views/admin/page_parts/_lock_page_part.html.haml +2 -1
- data/app/views/admin/pages/_lock_page_part.haml +12 -6
- data/config/locales/en.yml +4 -0
- data/config/locales/nl.yml +4 -0
- data/locked_page_parts_extension.rb +1 -1
- data/pkg/radiant-locked_page_parts-extension-0.1.1.gem +0 -0
- metadata +7 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.2
|
@@ -1,5 +1,6 @@
|
|
1
1
|
- if current_user.admin?
|
2
2
|
%span.lock_page_part
|
3
|
+
~ hidden_field_tag "page[parts_attributes][#{page_part_counter}][locked]", :value => '0'
|
3
4
|
~ check_box_tag "page[parts_attributes][#{params[:index].to_i}][locked]", '1', page_part.locked?
|
4
5
|
%label{:for => "page_parts_attributes_#{params[:index].to_i}_locked"}
|
5
|
-
|
6
|
+
= t('locked_page_parts.locked')
|
@@ -1,14 +1,20 @@
|
|
1
1
|
- page_part_counter = @page.parts.index(page_part)
|
2
2
|
- if current_user.admin?
|
3
3
|
%span.lock_page_part
|
4
|
+
~ hidden_field_tag "page[parts_attributes][#{page_part_counter}][locked]", :value => '0'
|
4
5
|
~ check_box_tag "page[parts_attributes][#{page_part_counter}][locked]", '1', page_part.locked?
|
5
6
|
%label{:for => "page_parts_attributes_#{page_part_counter}_locked"}
|
6
|
-
|
7
|
+
= t('locked_page_parts.locked')
|
7
8
|
- elsif page_part.locked?
|
8
9
|
:javascript
|
9
|
-
(function($){
|
10
10
|
document.observe('dom:loaded', function() {
|
11
|
-
var tab =
|
12
|
-
|
13
|
-
|
14
|
-
|
11
|
+
var tab = $$('.tab')[#{page_part_counter}]
|
12
|
+
var page = $$('#pages .page')[#{page_part_counter}]
|
13
|
+
|
14
|
+
tab.replace("<span class='tab disabled'>" + tab.innerText + "</span>")
|
15
|
+
|
16
|
+
page.select('textarea').first().replace("<div class='locked-part-placeholder'><p>#{t('locked_page_parts.disabled_message')}</p></div>")
|
17
|
+
page.select('select').first().disable()
|
18
|
+
|
19
|
+
$$('a.tab:first').click()
|
20
|
+
})
|
@@ -2,7 +2,7 @@
|
|
2
2
|
# require_dependency 'application_controller'
|
3
3
|
|
4
4
|
class LockedPagePartsExtension < Radiant::Extension
|
5
|
-
version "0.1.
|
5
|
+
version "0.1.2"
|
6
6
|
description "Allows you to hide certain page parts from normal users"
|
7
7
|
url "https://github.com/jomz/radiant_locked_page_parts"
|
8
8
|
|
Binary file
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: radiant-locked_page_parts-extension
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 2
|
10
|
+
version: 0.1.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Benny Degezelle
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-03-
|
18
|
+
date: 2011-03-31 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -49,10 +49,13 @@ files:
|
|
49
49
|
- app/views/admin/page_parts/_lock_page_part.html.haml
|
50
50
|
- app/views/admin/pages/_lock_page_part.haml
|
51
51
|
- app/views/admin/pages/_locked_page_style.erb
|
52
|
+
- config/locales/en.yml
|
53
|
+
- config/locales/nl.yml
|
52
54
|
- db/migrate/20091210124548_add_locked_to_page_parts.rb
|
53
55
|
- lib/page_parts_controller_extensions.rb
|
54
56
|
- lib/tasks/locked_page_parts_extension_tasks.rake
|
55
57
|
- locked_page_parts_extension.rb
|
58
|
+
- pkg/radiant-locked_page_parts-extension-0.1.1.gem
|
56
59
|
has_rdoc: true
|
57
60
|
homepage: https://github.com/jomz/radiant_locked_page_parts
|
58
61
|
licenses: []
|