refinerycms-core 0.9.9.20 → 0.9.9.21
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/app/views/shared/_content_page.html.erb +2 -2
- data/app/views/shared/_menu_branch.html.erb +3 -3
- data/config/locales/fi.yml +78 -0
- data/lib/generators/templates/config/initializers/devise.rb +1 -1
- data/lib/refinery/application.rb +3 -7
- data/lib/refinery/application_controller.rb +4 -4
- data/lib/refinery/configuration.rb +10 -2
- data/lib/refinerycms-core.rb +11 -11
- data/public/javascripts/wymeditor/jquery.refinery.wymeditor.js +58 -16
- data/public/javascripts/wymeditor/lang/fi.js +57 -0
- data/refinerycms-core.gemspec +6 -4
- data/spec/lib/refinery/plugin_spec.rb +48 -48
- metadata +6 -4
@@ -48,9 +48,9 @@
|
|
48
48
|
dom_id = section[:id] || section[:yield]
|
49
49
|
if section[:html].present?
|
50
50
|
if section[:title]
|
51
|
-
section[:html] = "<h1 id='#{dom_id}'>#{section[:html]}</h1>"
|
51
|
+
section[:html] = "<h1 id='#{dom_id}'>#{section[:html]}</h1>".html_safe
|
52
52
|
else
|
53
|
-
section[:html] = "<section id='#{dom_id}'><div class='inner'>#{section[:html]}</div></section>"
|
53
|
+
section[:html] = "<section id='#{dom_id}'><div class='inner'>#{section[:html]}</div></section>".html_safe
|
54
54
|
end
|
55
55
|
else
|
56
56
|
css << "no_#{dom_id}"
|
@@ -1,12 +1,12 @@
|
|
1
1
|
<%
|
2
2
|
if !!local_assigns[:apply_css] and (classes = menu_branch_css(local_assigns)).any?
|
3
|
-
css = "class='#{classes.join(' ')}'"
|
3
|
+
css = "class='#{classes.join(' ')}'".html_safe
|
4
4
|
end
|
5
|
-
dom_id = "id='item_#{menu_branch_counter}'"
|
5
|
+
dom_id = "id='item_#{menu_branch_counter}'".html_safe
|
6
6
|
|
7
7
|
children = menu_branch.children.live.in_menu unless hide_children
|
8
8
|
-%>
|
9
|
-
<li<%= ['', css, dom_id].compact.join(' ').gsub(/\ *$/, '') %>>
|
9
|
+
<li<%= ['', css, dom_id].compact.join(' ').gsub(/\ *$/, '').html_safe %>>
|
10
10
|
<%= link_to menu_branch.title, menu_branch.url -%>
|
11
11
|
<% if children.present? -%>
|
12
12
|
<ul class='clearfix'>
|
@@ -0,0 +1,78 @@
|
|
1
|
+
fi:
|
2
|
+
js:
|
3
|
+
admin:
|
4
|
+
confirm_changes: "Kaikki muutoksesi menetetään. Oletko varma, että haluat jatkaa tallentamatta?"
|
5
|
+
plugins:
|
6
|
+
refinery_core:
|
7
|
+
title: Refinery
|
8
|
+
description: Refineryn keskuspalikka
|
9
|
+
refinery_dialogs:
|
10
|
+
title: Dialogit
|
11
|
+
description: Refineryn dialogipalikka
|
12
|
+
welcome:
|
13
|
+
there_are_no_users: "Käyttäjiä ei vielä ole, joten asennetaan sinut ensin."
|
14
|
+
remember_admin_location: "Muista, että Refineryn ylläpito on seuraavassa osoitteessa:"
|
15
|
+
lets_start: "Tehdään sinulle käyttäjä, että voit kirjautua..."
|
16
|
+
continue: Jatka...
|
17
|
+
admin:
|
18
|
+
menu:
|
19
|
+
reorder_menu: Uudelleenjärjestä valikko
|
20
|
+
reorder_menu_done: Olen valmis
|
21
|
+
dialogs:
|
22
|
+
show:
|
23
|
+
save: Tallenna
|
24
|
+
cancel: Peru
|
25
|
+
refinery:
|
26
|
+
crudify:
|
27
|
+
created: '%{what} lisättiin onnistuneesti.'
|
28
|
+
updated: '%{what} päivitettiin onnistuneesti.'
|
29
|
+
destroyed: '%{what} poistettiin onnistuneesti.'
|
30
|
+
shared:
|
31
|
+
site_bar:
|
32
|
+
log_out: Kirjaudu ulos
|
33
|
+
switch_to_your_website: Siirry nettisivustollesi
|
34
|
+
switch_to_your_website_editor: Siirry sivueditoriin
|
35
|
+
admin:
|
36
|
+
continue_editing:
|
37
|
+
save_and_continue_editing: 'Tallenna & jatka muokkausta'
|
38
|
+
form_actions:
|
39
|
+
save: Tallenna
|
40
|
+
cancel: Peru
|
41
|
+
cancel_lose_changes: "Jos perut, menetät kaikki tekemäsi muutokset"
|
42
|
+
delete: Poista
|
43
|
+
close: Sulje
|
44
|
+
image_picker:
|
45
|
+
none_selected: '%{what}a ei ole valittu, klikkaa tästä valitaksesi yhden.'
|
46
|
+
remove_current: 'Poista nykyinen %{what}'
|
47
|
+
change: Klikkaa tästä valitaksesi kuvan
|
48
|
+
show: Näytä
|
49
|
+
resource_picker:
|
50
|
+
download_current: Lataa nykyinen tiedosto
|
51
|
+
opens_in_new_window: Aukeaa uudessa ikkunassa
|
52
|
+
remove_current: Poista nykyinen tiedosto
|
53
|
+
no_resource_selected: 'Tiedostoa ei ole valittu, klikkaa tästä lisätäksesi tiedoston.'
|
54
|
+
name: Lisää tiedosto
|
55
|
+
current: Nykyinen tiedosto
|
56
|
+
search:
|
57
|
+
button_text: Etsi
|
58
|
+
results_for: "Hakutulokset haulle '%{query}'"
|
59
|
+
no_results: 'Valitettavasti mitään ei löytynyt'
|
60
|
+
delete:
|
61
|
+
message: "Oletko varma, että haluat poistaa sivun '%{title}'?"
|
62
|
+
error_messages:
|
63
|
+
problems_in_following_fields: Seuraavissa kentissä oli virheitä
|
64
|
+
help: apua
|
65
|
+
message:
|
66
|
+
close: Sulje
|
67
|
+
close_this_message: Sulje tämä viesti
|
68
|
+
draft_page_message:
|
69
|
+
not_live: Tämä sivu EI ole julkisena
|
70
|
+
footer:
|
71
|
+
copyright: "Copyright © %{year} %{site_name}"
|
72
|
+
no_script:
|
73
|
+
enable_javascript: Sivuston täydelliseen toimimiseen vaaditaan JavaScript- tuen päälle pistäminen
|
74
|
+
here_are: Täällä on
|
75
|
+
instructions_enable_javascript: ohjeet JavaScriptin päälle pistämiseen selaimessasi
|
76
|
+
time:
|
77
|
+
formats:
|
78
|
+
short: "%A, %d %B %Y"
|
@@ -22,7 +22,7 @@ require 'devise'
|
|
22
22
|
# authenticating an user, both parameters are required. Remember that those
|
23
23
|
# parameters are used only when authenticating and not when retrieving from
|
24
24
|
# session. If you need permissions, you should implement that in a before filter.
|
25
|
-
config.authentication_keys = [ :
|
25
|
+
# config.authentication_keys = [ :email ]
|
26
26
|
|
27
27
|
# Tell if authentication through request.params is enabled. True by default.
|
28
28
|
# config.params_authenticatable = true
|
data/lib/refinery/application.rb
CHANGED
@@ -4,9 +4,7 @@ module Refinery
|
|
4
4
|
class << self
|
5
5
|
|
6
6
|
def refinery!
|
7
|
-
::Refinery.config.before_inclusion_procs.each
|
8
|
-
proc.call if proc.respond_to?(:call)
|
9
|
-
end
|
7
|
+
::Refinery.config.before_inclusion_procs.each(&:call)
|
10
8
|
|
11
9
|
::ApplicationHelper.send :include, ::Refinery::ApplicationHelper
|
12
10
|
|
@@ -17,9 +15,7 @@ module Refinery
|
|
17
15
|
|
18
16
|
::Admin::BaseController.send :include, ::Refinery::Admin::BaseController
|
19
17
|
|
20
|
-
::Refinery.config.after_inclusion_procs.each
|
21
|
-
proc.call if proc.respond_to?(:call)
|
22
|
-
end
|
18
|
+
::Refinery.config.after_inclusion_procs.each(&:call)
|
23
19
|
end
|
24
20
|
|
25
21
|
def included(base)
|
@@ -33,7 +29,7 @@ module Refinery
|
|
33
29
|
base.config.action_view.javascript_expansions[:defaults] = %w()
|
34
30
|
|
35
31
|
# Configure the default encoding used in templates for Ruby 1.9.
|
36
|
-
base.config.encoding =
|
32
|
+
base.config.encoding = 'utf-8'
|
37
33
|
|
38
34
|
# Configure sensitive parameters which will be filtered from the log file.
|
39
35
|
base.config.filter_parameters += [:password, :password_confirmation]
|
@@ -57,7 +57,7 @@ module Refinery
|
|
57
57
|
end
|
58
58
|
|
59
59
|
def from_dialog?
|
60
|
-
params[:dialog] ==
|
60
|
+
params[:dialog] == 'true' or params[:modal] == 'true'
|
61
61
|
end
|
62
62
|
|
63
63
|
def home_page?
|
@@ -80,7 +80,7 @@ module Refinery
|
|
80
80
|
|
81
81
|
# get all the pages to be displayed in the site menu.
|
82
82
|
def find_pages_for_menu
|
83
|
-
raise NotImplementedError,
|
83
|
+
raise NotImplementedError, 'Please implement protected method find_pages_for_menu'
|
84
84
|
end
|
85
85
|
|
86
86
|
# use a different model for the meta information.
|
@@ -90,8 +90,8 @@ module Refinery
|
|
90
90
|
end
|
91
91
|
|
92
92
|
def show_welcome_page?
|
93
|
-
if just_installed? and
|
94
|
-
render :template =>
|
93
|
+
if just_installed? and controller_name != 'users'
|
94
|
+
render :template => '/welcome', :layout => 'login'
|
95
95
|
end
|
96
96
|
end
|
97
97
|
|
@@ -6,7 +6,11 @@ module Refinery
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def after_inclusion(&blk)
|
9
|
-
|
9
|
+
if blk && blk.respond_to?(:call)
|
10
|
+
after_inclusion_procs << blk
|
11
|
+
else
|
12
|
+
raise 'Anything added to be called before_inclusion must be callable.'
|
13
|
+
end
|
10
14
|
end
|
11
15
|
|
12
16
|
def before_inclusion_procs
|
@@ -14,7 +18,11 @@ module Refinery
|
|
14
18
|
end
|
15
19
|
|
16
20
|
def before_inclusion(&blk)
|
17
|
-
|
21
|
+
if blk && blk.respond_to?(:call)
|
22
|
+
before_inclusion_procs << blk
|
23
|
+
else
|
24
|
+
raise 'Anything added to be called before_inclusion must be callable.'
|
25
|
+
end
|
18
26
|
end
|
19
27
|
|
20
28
|
end
|
data/lib/refinerycms-core.rb
CHANGED
@@ -94,8 +94,8 @@ module Refinery
|
|
94
94
|
# Register the plugin
|
95
95
|
config.after_initialize do
|
96
96
|
::Refinery::Plugin.register do |plugin|
|
97
|
-
plugin.name =
|
98
|
-
plugin.class_name =
|
97
|
+
plugin.name = 'refinery_core'
|
98
|
+
plugin.class_name = 'RefineryEngine'
|
99
99
|
plugin.version = ::Refinery.version
|
100
100
|
plugin.hide_from_menu = true
|
101
101
|
plugin.always_allow_access = true
|
@@ -104,7 +104,7 @@ module Refinery
|
|
104
104
|
|
105
105
|
# Register the dialogs plugin
|
106
106
|
::Refinery::Plugin.register do |plugin|
|
107
|
-
plugin.name =
|
107
|
+
plugin.name = 'refinery_dialogs'
|
108
108
|
plugin.version = ::Refinery.version
|
109
109
|
plugin.hide_from_menu = true
|
110
110
|
plugin.always_allow_access = true
|
@@ -113,7 +113,7 @@ module Refinery
|
|
113
113
|
end
|
114
114
|
|
115
115
|
# Run other initializer code that used to be in config/initializers/
|
116
|
-
initializer
|
116
|
+
initializer 'serve static assets' do |app|
|
117
117
|
app.middleware.insert_after ::ActionDispatch::Static, ::ActionDispatch::Static, "#{root}/public"
|
118
118
|
end
|
119
119
|
|
@@ -123,13 +123,13 @@ module Refinery
|
|
123
123
|
|
124
124
|
initializer 'add presenters' do |app|
|
125
125
|
app.config.autoload_paths += [
|
126
|
-
Rails.root.join(
|
127
|
-
Rails.root.join(
|
128
|
-
Refinery.roots.map{|r| r.join(
|
126
|
+
Rails.root.join('app', 'presenters'),
|
127
|
+
Rails.root.join('vendor', '**', '**', 'app', 'presenters'),
|
128
|
+
Refinery.roots.map{|r| r.join('**', 'app', 'presenters')}
|
129
129
|
].flatten
|
130
130
|
end
|
131
131
|
|
132
|
-
initializer
|
132
|
+
initializer 'configure acts_as_indexed' do |app|
|
133
133
|
ActsAsIndexed.configure do |config|
|
134
134
|
config.index_file = Rails.root.join('tmp', 'index')
|
135
135
|
config.index_file_depth = 3
|
@@ -137,11 +137,11 @@ module Refinery
|
|
137
137
|
end
|
138
138
|
end
|
139
139
|
|
140
|
-
initializer
|
140
|
+
initializer 'fix rack <= 1.2.1' do |app|
|
141
141
|
::Rack::Utils.module_eval do
|
142
142
|
def escape(s)
|
143
143
|
regexp = case
|
144
|
-
when RUBY_VERSION >=
|
144
|
+
when RUBY_VERSION >= '1.9' && s.encoding === Encoding.find('UTF-8')
|
145
145
|
/([^ a-zA-Z0-9_.-]+)/u
|
146
146
|
else
|
147
147
|
/([^ a-zA-Z0-9_.-]+)/n
|
@@ -150,7 +150,7 @@ module Refinery
|
|
150
150
|
'%'+$1.unpack('H2'*bytesize($1)).join('%').upcase
|
151
151
|
}.tr(' ', '+')
|
152
152
|
end
|
153
|
-
end if ::Rack.version <=
|
153
|
+
end if ::Rack.version <= '1.2.1'
|
154
154
|
end
|
155
155
|
|
156
156
|
initializer 'set will_paginate link labels' do |app|
|
@@ -2164,7 +2164,9 @@ WYMeditor.XhtmlValidator = {
|
|
2164
2164
|
"style",
|
2165
2165
|
"title",
|
2166
2166
|
"accesskey",
|
2167
|
-
"tabindex"
|
2167
|
+
"tabindex",
|
2168
|
+
"data",
|
2169
|
+
"^data-.*"
|
2168
2170
|
]
|
2169
2171
|
},
|
2170
2172
|
"language":
|
@@ -2760,28 +2762,68 @@ WYMeditor.XhtmlValidator = {
|
|
2760
2762
|
},
|
2761
2763
|
"38":"tt",
|
2762
2764
|
"39":"ul",
|
2763
|
-
"40":"var"
|
2765
|
+
"40":"var",
|
2766
|
+
"41":"section",
|
2767
|
+
"42":"article",
|
2768
|
+
"43":"aside",
|
2769
|
+
"44":"details",
|
2770
|
+
"45":"header",
|
2771
|
+
"46":"footer",
|
2772
|
+
"47":"nav",
|
2773
|
+
"48":"dialog",
|
2774
|
+
"49":"figure",
|
2775
|
+
"50":"figcaption",
|
2776
|
+
"51":"address",
|
2777
|
+
"52":"hgroup",
|
2778
|
+
"53":"mark",
|
2779
|
+
"54":"time",
|
2780
|
+
"55":"canvas",
|
2781
|
+
"56":"audio",
|
2782
|
+
"57":"video",
|
2783
|
+
"58":"source",
|
2784
|
+
"59":"output",
|
2785
|
+
"60":"progress",
|
2786
|
+
"61":"ruby",
|
2787
|
+
"62":"rt",
|
2788
|
+
"63":"rp",
|
2789
|
+
"64":"summary",
|
2790
|
+
"65":"command"
|
2764
2791
|
},
|
2765
2792
|
|
2766
|
-
// Temporary
|
2767
|
-
|
2768
|
-
|
2793
|
+
// Temporary skipped attributes
|
2794
|
+
skipped_attributes : [],
|
2795
|
+
skipped_attribute_values : [],
|
2769
2796
|
|
2770
2797
|
getValidTagAttributes: function(tag, attributes)
|
2771
2798
|
{
|
2772
2799
|
var valid_attributes = {};
|
2773
2800
|
var possible_attributes = this.getPossibleTagAttributes(tag);
|
2801
|
+
var regexp_attributes = [];
|
2802
|
+
$.each((possible_attributes || []), function(i, val) {
|
2803
|
+
if (val.indexOf("*") > -1) {
|
2804
|
+
regexp_attributes.push(new RegExp(val));
|
2805
|
+
}
|
2806
|
+
});
|
2807
|
+
var h = WYMeditor.Helper;
|
2774
2808
|
for(var attribute in attributes) {
|
2775
2809
|
var value = attributes[attribute];
|
2776
|
-
|
2777
|
-
|
2778
|
-
|
2779
|
-
|
2780
|
-
|
2810
|
+
if(!h.contains(this.skipped_attributes, attribute) && !h.contains(this.skipped_attribute_values, value)){
|
2811
|
+
if (typeof value != 'function') {
|
2812
|
+
if (h.contains(possible_attributes, attribute)) {
|
2813
|
+
if (this.doesAttributeNeedsValidation(tag, attribute)) {
|
2814
|
+
if(this.validateAttribute(tag, attribute, value)){
|
2815
|
+
valid_attributes[attribute] = value;
|
2816
|
+
}
|
2817
|
+
}else{
|
2781
2818
|
valid_attributes[attribute] = value;
|
2782
2819
|
}
|
2783
|
-
}
|
2784
|
-
|
2820
|
+
}
|
2821
|
+
else {
|
2822
|
+
$.each(regexp_attributes, function(i, val) {
|
2823
|
+
if (attribute.match(val)) {
|
2824
|
+
valid_attributes[attribute] = value;
|
2825
|
+
}
|
2826
|
+
});
|
2785
2827
|
}
|
2786
2828
|
}
|
2787
2829
|
}
|
@@ -3956,16 +3998,16 @@ WYMeditor.XhtmlSaxListener.prototype.closeUnopenedTag = function(tag)
|
|
3956
3998
|
WYMeditor.XhtmlSaxListener.prototype.avoidStylingTagsAndAttributes = function()
|
3957
3999
|
{
|
3958
4000
|
this.avoided_tags = ['div','span'];
|
3959
|
-
this.validator.
|
3960
|
-
this.validator.
|
4001
|
+
this.validator.skipped_attributes = ['style'];
|
4002
|
+
this.validator.skipped_attribute_values = ['MsoNormal','main1']; // MS Word attributes for class
|
3961
4003
|
this._avoiding_tags_implicitly = true;
|
3962
4004
|
};
|
3963
4005
|
|
3964
4006
|
WYMeditor.XhtmlSaxListener.prototype.allowStylingTagsAndAttributes = function()
|
3965
4007
|
{
|
3966
4008
|
this.avoided_tags = [];
|
3967
|
-
this.validator.
|
3968
|
-
this.validator.
|
4009
|
+
this.validator.skipped_attributes = [];
|
4010
|
+
this.validator.skipped_attribute_values = [];
|
3969
4011
|
this._avoiding_tags_implicitly = false;
|
3970
4012
|
};
|
3971
4013
|
|
@@ -0,0 +1,57 @@
|
|
1
|
+
WYMeditor.STRINGS['fi'] = {
|
2
|
+
Strong: 'Vahvenna',
|
3
|
+
Bold: 'Lihavoi',
|
4
|
+
Emphasis: 'Kursivoi',
|
5
|
+
Superscript: 'Yläindeksi',
|
6
|
+
Subscript: 'Alaindeksi',
|
7
|
+
Ordered_List: 'Numeroitu lista',
|
8
|
+
Unordered_List: 'Numeroimaton lista',
|
9
|
+
Indent: 'Sisennä',
|
10
|
+
Outdent: 'Epäsisennä',
|
11
|
+
Undo: 'Kumoa',
|
12
|
+
Redo: 'Tee uudelleen',
|
13
|
+
Link: 'Lisää linkki',
|
14
|
+
Unlink: 'Poista linkki',
|
15
|
+
Image: 'Lisää kuva',
|
16
|
+
Table: 'Lisää taulukko',
|
17
|
+
HTML: 'HTML',
|
18
|
+
Paragraph: 'Kappale',
|
19
|
+
Heading_1: 'Otsikko 1',
|
20
|
+
Heading_2: 'Otsikko 2',
|
21
|
+
Heading_3: 'Otsikko 3',
|
22
|
+
Heading_4: 'Otsikko 4',
|
23
|
+
Heading_5: 'Otsikko 5',
|
24
|
+
Heading_6: 'Otsikko 6',
|
25
|
+
Preformatted: 'Esimuotoiltu',
|
26
|
+
Blockquote: 'Sitaatti',
|
27
|
+
Table_Header: 'Taulukon otsake',
|
28
|
+
URL: 'URL',
|
29
|
+
Title: 'Otsikko',
|
30
|
+
Alternative_Text: 'Vaihtoehtoinen teksti',
|
31
|
+
Caption: 'Kuvateksti',
|
32
|
+
Summary: 'Yhteenveto',
|
33
|
+
Number_Of_Rows: 'Rivien määrä',
|
34
|
+
Number_Of_Cols: 'Sarakkeitten määrä',
|
35
|
+
Insert: 'Lisää',
|
36
|
+
Submit: 'Lähetä',
|
37
|
+
Cancel: 'Peru',
|
38
|
+
Choose: 'Valitse',
|
39
|
+
Preview: 'Esikatsele',
|
40
|
+
Paste_From_Word: 'Liitä tekstisi alle',
|
41
|
+
Tools: 'Työkalut',
|
42
|
+
Containers: 'Containers',
|
43
|
+
Classes: 'Luokat',
|
44
|
+
Status: 'Status',
|
45
|
+
Source_Code: 'Lähdekoodi',
|
46
|
+
Text_Align: 'Tekstin ryhmitys',
|
47
|
+
Image_Align: 'Kuvan ryhmitys',
|
48
|
+
Font_Size: 'Fonttikoko',
|
49
|
+
Left: 'Vasen',
|
50
|
+
Right: 'Oikea',
|
51
|
+
Center: 'Keskitys',
|
52
|
+
Justify: 'Tasaus',
|
53
|
+
Small: 'Pieni',
|
54
|
+
Normal: 'Normaali',
|
55
|
+
Large: 'Suuri',
|
56
|
+
Apply_Style: 'Tyyli'
|
57
|
+
};
|
data/refinerycms-core.gemspec
CHANGED
@@ -2,10 +2,10 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{refinerycms-core}
|
5
|
-
s.version = %q{0.9.9.
|
5
|
+
s.version = %q{0.9.9.21}
|
6
6
|
s.summary = %q{Core engine for Refinery CMS}
|
7
7
|
s.description = %q{The core of Refinery CMS. This handles the common functionality and is required by most engines}
|
8
|
-
s.date = %q{2011-
|
8
|
+
s.date = %q{2011-05-03}
|
9
9
|
s.email = %q{info@refinerycms.com}
|
10
10
|
s.homepage = %q{http://refinerycms.com}
|
11
11
|
s.rubyforge_project = %q{refinerycms}
|
@@ -14,8 +14,8 @@ Gem::Specification.new do |s|
|
|
14
14
|
s.require_paths = %w(lib)
|
15
15
|
s.executables = %w()
|
16
16
|
|
17
|
-
s.add_dependency 'refinerycms-base', '= 0.9.9.
|
18
|
-
s.add_dependency 'refinerycms-settings', '= 0.9.9.
|
17
|
+
s.add_dependency 'refinerycms-base', '= 0.9.9.21'
|
18
|
+
s.add_dependency 'refinerycms-settings', '= 0.9.9.21'
|
19
19
|
s.add_dependency 'refinerycms-generators', '~> 1.0'
|
20
20
|
s.add_dependency 'acts_as_indexed', '~> 0.7'
|
21
21
|
s.add_dependency 'friendly_id_globalize3', '~> 3.2.1'
|
@@ -84,6 +84,7 @@ Gem::Specification.new do |s|
|
|
84
84
|
'config/locales/el.yml',
|
85
85
|
'config/locales/en.yml',
|
86
86
|
'config/locales/es.yml',
|
87
|
+
'config/locales/fi.yml',
|
87
88
|
'config/locales/fr.yml',
|
88
89
|
'config/locales/it.yml',
|
89
90
|
'config/locales/jp.yml',
|
@@ -365,6 +366,7 @@ Gem::Specification.new do |s|
|
|
365
366
|
'public/javascripts/wymeditor/lang/en.js',
|
366
367
|
'public/javascripts/wymeditor/lang/es.js',
|
367
368
|
'public/javascripts/wymeditor/lang/fa.js',
|
369
|
+
'public/javascripts/wymeditor/lang/fi.js',
|
368
370
|
'public/javascripts/wymeditor/lang/fr.js',
|
369
371
|
'public/javascripts/wymeditor/lang/he.js',
|
370
372
|
'public/javascripts/wymeditor/lang/hu.js',
|
@@ -1,10 +1,10 @@
|
|
1
|
-
require
|
1
|
+
require 'spec_helper'
|
2
2
|
|
3
3
|
module Refinery
|
4
4
|
module RefineryRspec
|
5
5
|
class Engine < ::Rails::Engine
|
6
6
|
::Refinery::Plugin.register do |plugin|
|
7
|
-
plugin.name =
|
7
|
+
plugin.name = 'refinery_rspec'
|
8
8
|
end
|
9
9
|
end
|
10
10
|
end
|
@@ -13,94 +13,94 @@ end
|
|
13
13
|
module Refinery
|
14
14
|
describe Plugin do
|
15
15
|
|
16
|
-
let(:plugin) { Refinery::Plugins.registered.detect { |plugin| plugin.name ==
|
16
|
+
let(:plugin) { Refinery::Plugins.registered.detect { |plugin| plugin.name == 'refinery_rspec' } }
|
17
17
|
|
18
18
|
def setup_i18n
|
19
19
|
::I18n.backend = ::I18n::Backend::Simple.new
|
20
20
|
::I18n.backend.store_translations :en, :plugins => {
|
21
21
|
:refinery_rspec => {
|
22
|
-
:title =>
|
23
|
-
:description =>
|
22
|
+
:title => 'RefineryCMS RSpec',
|
23
|
+
:description => 'RSpec tests for plugin.rb'
|
24
24
|
}
|
25
25
|
}
|
26
|
-
end
|
26
|
+
end
|
27
27
|
|
28
|
-
describe
|
29
|
-
it
|
28
|
+
describe '.register' do
|
29
|
+
it 'must have a name' do
|
30
30
|
lambda { Plugin.register {} }.should raise_error
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
|
-
describe
|
35
|
-
it
|
36
|
-
plugin.class_name.should ==
|
34
|
+
describe '#class_name' do
|
35
|
+
it 'returns class name' do
|
36
|
+
plugin.class_name.should == 'RefineryRspec'
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
|
-
describe
|
40
|
+
describe '#title' do
|
41
41
|
before { setup_i18n }
|
42
42
|
|
43
|
-
it
|
44
|
-
plugin.title.should ==
|
43
|
+
it 'returns plugin title defined by I18n' do
|
44
|
+
plugin.title.should == 'RefineryCMS RSpec'
|
45
45
|
end
|
46
46
|
end
|
47
47
|
|
48
|
-
describe
|
48
|
+
describe '#description' do
|
49
49
|
before { setup_i18n }
|
50
50
|
|
51
|
-
it
|
52
|
-
plugin.description.should ==
|
51
|
+
it 'returns plugin description defined by I18n' do
|
52
|
+
plugin.description.should == 'RSpec tests for plugin.rb'
|
53
53
|
end
|
54
54
|
end
|
55
55
|
|
56
|
-
describe
|
56
|
+
describe '#activity' do
|
57
57
|
|
58
58
|
end
|
59
59
|
|
60
|
-
describe
|
60
|
+
describe '#activity=' do
|
61
61
|
|
62
62
|
end
|
63
63
|
|
64
|
-
describe
|
65
|
-
it
|
64
|
+
describe '#always_allow_access?' do
|
65
|
+
it 'returns false if @always_allow_access is not set or its set to false' do
|
66
66
|
plugin.always_allow_access?.should be_false
|
67
67
|
end
|
68
68
|
|
69
|
-
it
|
69
|
+
it 'returns true if set so' do
|
70
70
|
plugin.stub(:always_allow_access?).and_return(true)
|
71
71
|
plugin.always_allow_access?.should be
|
72
72
|
end
|
73
73
|
end
|
74
74
|
|
75
|
-
describe
|
76
|
-
it
|
75
|
+
describe '#dashboard?' do
|
76
|
+
it 'returns false if @dashboard is not set or its set to false' do
|
77
77
|
plugin.dashboard.should be_false
|
78
78
|
end
|
79
79
|
|
80
|
-
it
|
80
|
+
it 'returns true if set so' do
|
81
81
|
plugin.stub(:dashboard).and_return(true)
|
82
82
|
plugin.dashboard.should be
|
83
83
|
end
|
84
84
|
end
|
85
85
|
|
86
|
-
describe
|
87
|
-
it
|
86
|
+
describe '#menu_match' do
|
87
|
+
it 'returns regexp based on plugin name' do
|
88
88
|
plugin.menu_match.should == /(admin|refinery)\/refinery_rspec$/
|
89
89
|
end
|
90
90
|
end
|
91
91
|
|
92
|
-
describe
|
93
|
-
it
|
94
|
-
plugin.highlighted?({:controller =>
|
92
|
+
describe '#highlighted?' do
|
93
|
+
it 'returns true if params[:controller] match menu_match regexp' do
|
94
|
+
plugin.highlighted?({:controller => 'refinery/refinery_rspec'}).should be
|
95
95
|
end
|
96
96
|
|
97
|
-
it
|
97
|
+
it 'returns true if dashboard? is true and params[:action] == error_404' do
|
98
98
|
plugin.stub(:dashboard?).and_return(true)
|
99
|
-
plugin.highlighted?({:action =>
|
99
|
+
plugin.highlighted?({:action => 'error_404'}).should be
|
100
100
|
end
|
101
101
|
end
|
102
102
|
|
103
|
-
describe
|
103
|
+
describe '#url' do
|
104
104
|
class Plugin
|
105
105
|
def reset_url!
|
106
106
|
@url = nil
|
@@ -109,31 +109,31 @@ module Refinery
|
|
109
109
|
|
110
110
|
before(:each) { plugin.reset_url! }
|
111
111
|
|
112
|
-
context
|
113
|
-
it
|
114
|
-
plugin.stub(:url).and_return({:controller =>
|
115
|
-
plugin.url.should == {:controller =>
|
112
|
+
context 'when @url is already defined' do
|
113
|
+
it 'returns hash' do
|
114
|
+
plugin.stub(:url).and_return({:controller => '/admin/testa'})
|
115
|
+
plugin.url.should == {:controller => '/admin/testa'}
|
116
116
|
end
|
117
117
|
end
|
118
118
|
|
119
|
-
context
|
120
|
-
it
|
121
|
-
plugin.stub(:controller).and_return(
|
122
|
-
plugin.url.should == {:controller =>
|
119
|
+
context 'when controller is present' do
|
120
|
+
it 'returns hash based on it' do
|
121
|
+
plugin.stub(:controller).and_return('testb')
|
122
|
+
plugin.url.should == {:controller => '/admin/testb'}
|
123
123
|
end
|
124
124
|
end
|
125
125
|
|
126
|
-
context
|
126
|
+
context 'when directory is present' do
|
127
127
|
|
128
|
-
it
|
129
|
-
plugin.stub(:directory).and_return(
|
130
|
-
plugin.url.should == {:controller =>
|
128
|
+
it 'returns hash based on it' do
|
129
|
+
plugin.stub(:directory).and_return('first/second/testc')
|
130
|
+
plugin.url.should == {:controller => '/admin/testc'}
|
131
131
|
end
|
132
132
|
end
|
133
133
|
|
134
|
-
context
|
135
|
-
it
|
136
|
-
plugin.url.should == {:controller =>
|
134
|
+
context 'when controller and directory not present' do
|
135
|
+
it 'returns hash based on plugins name' do
|
136
|
+
plugin.url.should == {:controller => '/admin/refinery_rspec'}
|
137
137
|
end
|
138
138
|
end
|
139
139
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: refinerycms-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.9.9.
|
5
|
+
version: 0.9.9.21
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Resolve Digital
|
@@ -13,7 +13,7 @@ autorequire:
|
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
15
|
|
16
|
-
date: 2011-
|
16
|
+
date: 2011-05-03 00:00:00 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: refinerycms-base
|
@@ -23,7 +23,7 @@ dependencies:
|
|
23
23
|
requirements:
|
24
24
|
- - "="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.9.9.
|
26
|
+
version: 0.9.9.21
|
27
27
|
type: :runtime
|
28
28
|
version_requirements: *id001
|
29
29
|
- !ruby/object:Gem::Dependency
|
@@ -34,7 +34,7 @@ dependencies:
|
|
34
34
|
requirements:
|
35
35
|
- - "="
|
36
36
|
- !ruby/object:Gem::Version
|
37
|
-
version: 0.9.9.
|
37
|
+
version: 0.9.9.21
|
38
38
|
type: :runtime
|
39
39
|
version_requirements: *id002
|
40
40
|
- !ruby/object:Gem::Dependency
|
@@ -179,6 +179,7 @@ files:
|
|
179
179
|
- config/locales/el.yml
|
180
180
|
- config/locales/en.yml
|
181
181
|
- config/locales/es.yml
|
182
|
+
- config/locales/fi.yml
|
182
183
|
- config/locales/fr.yml
|
183
184
|
- config/locales/it.yml
|
184
185
|
- config/locales/jp.yml
|
@@ -427,6 +428,7 @@ files:
|
|
427
428
|
- public/javascripts/wymeditor/lang/en.js
|
428
429
|
- public/javascripts/wymeditor/lang/es.js
|
429
430
|
- public/javascripts/wymeditor/lang/fa.js
|
431
|
+
- public/javascripts/wymeditor/lang/fi.js
|
430
432
|
- public/javascripts/wymeditor/lang/fr.js
|
431
433
|
- public/javascripts/wymeditor/lang/he.js
|
432
434
|
- public/javascripts/wymeditor/lang/hu.js
|