Compare commits

..

76 Commits

Author SHA1 Message Date
Didier Lafforgue fbcda9cdd6 simply re-organize little piece of code (cleaning stuff) 2012-06-10 01:31:10 +02:00
Didier Lafforgue 6350652e4b Merge pull request #437 from paulsponagl/devise_2_1
Upgrade to devise 2.1
2012-06-09 15:52:05 -07:00
Paul Sponagl a6ba124a9e need to require devise-encryptable 2012-06-09 09:54:58 +02:00
Paul Sponagl 702283322d Upgrade to devise 2.1
rspec and cucumber tests working
untest within a real app
2012-06-08 12:52:00 +02:00
Didier Lafforgue ef66f88f5a forgot to update Gemfile.lock 2012-06-08 11:06:17 +02:00
Didier Lafforgue bae2fe4432 releasing new version: 2.0.0.rc8 2012-06-08 11:04:23 +02:00
Didier Lafforgue 50204b6556 dependency conflict with carrierwave and custom_fields (fixed) 2012-06-08 10:57:09 +02:00
did 11c4f98efc asset picker was not accessible from the Aloha toolbar (fixed now) 2012-06-06 01:34:37 -07:00
did 55b7d4dbf2 status of a redirect page is now 301 (previously 302) 2012-06-05 09:32:10 -07:00
Didier Lafforgue 2bd9e254c8 rails 3.2.5 + remove warnings + fix broken features + enhance upgrade script 2012-06-04 23:23:03 +02:00
did 3f1380408e fix issue #427 + make the content types API features more predictable 2012-06-04 08:26:10 -07:00
Didier Lafforgue 5f9c46b42c Merge pull request #419 from colibri-software/api_auth
API auth
2012-06-02 10:02:23 -07:00
Didier Lafforgue b4dd590f9a Merge pull request #432 from colibri-software/fix_page_drop
Fixed issue with page drop slug on templatized pages
2012-06-02 09:47:08 -07:00
Didier Lafforgue 34ba62c15c Merge pull request #431 from klaffenboeck/master
updated german locale with proper encoding (UTF-8)
2012-06-02 09:36:35 -07:00
did acd46f1c10 fix issue #430 2012-06-02 06:54:16 -07:00
Manfred Klaffenboeck 30557ef8b0 updated german locale with propper encoding (UTF-8) 2012-06-01 19:36:33 +02:00
Alex Sanford 6f5eec18c6 Fixed issue with page drop slug on templatized pages 2012-06-01 14:28:10 -03:00
Didier Lafforgue bc63cd8acf Merge pull request #429 from klaffenboeck/master
Updated german locale
2012-06-01 01:12:23 -07:00
Manfred Klaffenboeck b993b4f0ca Updated german locale 2012-05-31 21:14:46 +02:00
Manfred Klaffenboeck 590c4bb048 added translation for de.locomotive.messages.sending_form 2012-05-31 20:42:42 +02:00
did 2bec96e9f1 add a default message for the locomotive.messages.sending_form translation key (fix issue #428) 2012-05-31 10:03:57 -07:00
did 2568510f01 fix issue #426 2012-05-31 09:41:37 -07:00
did f8725ede67 fix issue #414 2012-05-31 01:41:19 -07:00
did f4ee99b72b fix issue #425 2012-05-30 15:41:11 -07:00
did 763fe5215f fix issue #407 (ie: boolean fields take the false value by default) 2012-05-30 15:30:42 -07:00
did 261575eb94 a little bit of cleaning for the upgrade scripts 2012-05-29 16:24:28 -07:00
Didier Lafforgue b706d50bdf Merge pull request #424 from Sharagoz/master
Update Norwegian locale for v2.0
2012-05-29 16:21:54 -07:00
did 3a4654e8f7 the upgrade script v1.1 did not work correctly + fix issue #403 (more generally, enhance the way jQuery modals were used within the back-office) + select the first inverse_of value of a has_many field (UI) 2012-05-29 15:53:48 -07:00
Bjørn Trondsen a662366637 bug in prev commit 2012-05-29 22:34:38 +02:00
Bjørn Trondsen 6ac3d72aed rename norwegian locale when upgrading 2012-05-29 22:13:41 +02:00
Bjørn Trondsen 8b56ee5889 update norwegian locale 2012-05-29 21:17:17 +02:00
Didier Lafforgue b751e3d990 trying to fix the big problem with jQuery UI modals (if modals have the same z-index, it causes weird behaviours) (WIP) 2012-05-29 01:26:51 +02:00
Didier Lafforgue ae16661286 trying to fix cucumber tests 2012-05-26 15:21:47 +02:00
Didier Lafforgue da2d689bdc fix issue #412 2012-05-26 14:35:04 +02:00
Didier Lafforgue 2ac74c9a50 fix issue #411 2012-05-25 13:24:10 +02:00
Didier Lafforgue 24ae75c6f5 Gemfile.lock gets updated 2012-05-24 23:37:48 +02:00
Didier Lafforgue c58075b7c3 Merge branch 'master' of github.com:locomotivecms/engine 2012-05-24 19:19:57 +02:00
Didier Lafforgue 662e359acb fix issue #393 2012-05-24 19:19:46 +02:00
Mario Visic 8be23f1cc2 Updated the readme a tad with PhantomJS info. 2012-05-25 00:23:13 +08:00
Mario Visic fbef06f103 Merge branch 'poltergeist' 2012-05-25 00:16:33 +08:00
Mario Visic 38098e93da Updated the doco to instruct users to install PhantomJS for testing. 2012-05-25 00:16:25 +08:00
Mario Visic 3a27845fe5 Small fix for poltergeist. 2012-05-25 00:13:55 +08:00
Mario Visic 4c5d6c92d0 Added poltergeist and a small JS fix. 2012-05-25 00:06:07 +08:00
Mario Visic 817ee8b0e5 Merge branch 'master' of github.com:locomotivecms/engine 2012-05-24 23:13:56 +08:00
Mario Visic 13b4d8c606 Do not pass the host option to URL helpers for sitemaps. Fixes #415. 2012-05-24 23:13:25 +08:00
did 6342b94ede Merge branch 'master' of github.com:locomotivecms/engine 2012-05-24 06:47:15 -07:00
did d3e219018b fix issue #388 2012-05-24 06:46:48 -07:00
Mario Visic 415817e20b Merge pull request #409 from waynegerard/label_field_name
Added a setter method for label_field_id in content_types.rb model
2012-05-24 03:35:30 -07:00
did 04d9fe17f8 Merge branch 'master' of github.com:locomotivecms/engine 2012-05-23 15:03:37 -07:00
did d90123e321 public forms are now protected from csrf attacks (see issue #382 2012-05-23 15:03:21 -07:00
waynegerard 2fa81112fc Removing inline rescue in favor of where/try combination for label ID in setter method. Thanks @mariovisic\! 2012-05-22 18:27:38 -07:00
waynegerard be26ae3059 Added a setter method for label_field_id in content_types.rb model. Should resolve issue where label_field_name was not being updated properly through the UI. Fix for issue #398. 2012-05-19 13:51:41 -07:00
Mario Visic 7e0fcb62ee Merge pull request #395 from willcosgrove/patch-1
Fixed typo for bootstrap setting: `data-toogle` to `data-toggle`
2012-05-08 20:49:23 -07:00
Will Cosgrove c0627bf8a7 Fixed typo for bootstrap setting: `data-toogle` to `data-toggle` 2012-05-08 22:31:20 -05:00
Didier Lafforgue e225ad2278 fix issue #385 2012-05-07 00:31:59 +02:00
did a939629cbf new multi_json gem 2012-05-05 02:39:23 -07:00
Didier Lafforgue f42fb1afe1 finally the new version of the multi_json gem (issue #387) 2012-05-05 11:17:18 +02:00
did 03d13d92d0 fix issue #387 2012-05-04 03:35:07 -07:00
Alex Sanford 24e5eb855a Added auth feature for memberships 2012-04-30 16:29:32 -03:00
Alex Sanford 9c15f1cbab Added API sites_controller and auth feature 2012-04-27 14:52:09 -03:00
Alex Sanford 06e493477c Added auth feature for current site 2012-04-27 12:05:21 -03:00
Alex Sanford 96007174cb Added auth feature for content_assets 2012-04-27 08:27:05 -03:00
Alex Sanford a921c44ce9 Fixed access denied error checking step 2012-04-26 16:12:39 -03:00
Alex Sanford 37f87e694c Added auth feature for theme assets 2012-04-26 12:48:05 -03:00
Alex Sanford 4e6c106772 Added auth feature for snippets 2012-04-25 10:56:38 -03:00
Alex Sanford d2da4b659e Added auth feature for content entries 2012-04-25 09:51:11 -03:00
Alex Sanford 44aadb8926 Added auth feature for content_types 2012-04-24 15:48:23 -03:00
Alex Sanford 75e694a6f0 Cleaned up API features 2012-04-24 13:37:29 -03:00
Alex Sanford 7dcc1ba3f6 Merge branch 'master' into api_auth
Conflicts:
	features/step_definitions/api_steps.rb
2012-04-24 13:22:35 -03:00
Alex Sanford 1344463222 Cleaned up features 2012-04-24 12:47:32 -03:00
Alex Sanford bf65fa47f3 Added destroy API method for pages and fixed feature 2012-04-24 12:13:26 -03:00
Alex Sanford f53ab18f90 Added features for destroying pages 2012-04-24 12:04:24 -03:00
Alex Sanford 494e3c9b51 Fixed author page update scenario 2012-04-17 12:02:29 -03:00
Alex Sanford edd236b202 Got authorization working for pages 2012-04-17 10:12:42 -03:00
Alex Sanford 97edb0e4b7 Added show action to page API and fixed some features 2012-04-16 15:36:39 -03:00
Alex Sanford 4f12c2cd10 Created some initial features for API authentication 2012-04-16 15:17:11 -03:00
167 changed files with 3755 additions and 1299 deletions

View File

@ -8,7 +8,6 @@ gemspec # Include gemspec dependencies
# The rest of the dependencies are for use when in the locomotive development environment
group :development do
# gem 'locomotive-mongoid-tree', :path => '../gems/custom_fields' # for Developers
# gem 'custom_fields', :path => '../gems/custom_fields' # for Developers
# gem 'custom_fields', :git => 'git://github.com/locomotivecms/custom_fields.git', :branch => '2.0.0.rc' # Branch on Github
@ -23,9 +22,8 @@ end
group :assets do
gem 'sass-rails', '~> 3.2.4'
gem 'coffee-rails', '~> 3.2.2'
gem 'uglifier', '~> 1.2.3'
gem 'compass', :git => 'git://github.com/chriseppstein/compass.git', :branch => 'no_rails_integration'
gem 'compass-rails', :git => 'git://github.com/Compass/compass-rails.git'
gem 'uglifier', '~> 1.2.4'
gem 'compass-rails'
end
group :test do
@ -37,6 +35,7 @@ group :test do
# gem 'growl-glue'
gem 'cucumber-rails', :require => false
gem 'poltergeist'
gem 'rspec-rails', '~> 2.8.0'
gem 'shoulda-matchers'
@ -51,4 +50,6 @@ group :test do
gem 'json_spec'
gem 'database_cleaner'
# gem 'debugger', :git => 'git://github.com/cldwalker/debugger.git'
end

View File

@ -1,42 +1,25 @@
GIT
remote: git://github.com/Compass/compass-rails.git
revision: 47d889ad8dabdab1e9f44da4447f94846c089c50
specs:
compass-rails (1.0.0.rc.3)
compass (~> 0.12.rc.0)
GIT
remote: git://github.com/chriseppstein/compass.git
revision: 0f96e881019c364aa6124845cbd83b1fd75c4ffe
branch: no_rails_integration
specs:
compass (0.12.rc.4.0f96e88)
chunky_png (~> 1.2)
fssm (>= 0.2.7)
sass (~> 3.1)
PATH
remote: .
specs:
locomotive_cms (2.0.0.rc7)
locomotive_cms (2.0.0.rc8)
RedCloth (~> 4.2.8)
actionmailer-with-request (~> 0.3.0)
bson_ext (~> 1.5.2)
cancan (~> 1.6.7)
carrierwave (~> 0.6.0)
carrierwave-mongoid (~> 0.1.3)
carrierwave-mongoid (~> 0.2.1)
cells (~> 3.8.0)
codemirror-rails (~> 2.21)
custom_fields (~> 2.0.0.rc10)
devise (~> 1.5.3)
custom_fields (~> 2.0.0.rc12)
devise (~> 2.1.0)
devise-encryptable (~> 0.1.1)
dragonfly (~> 0.9.8)
flash_cookie_session (~> 1.1.1)
fog (~> 1.3.1)
formtastic (~> 2.0.2)
haml (~> 3.1.4)
haml (~> 3.1.6)
highline (~> 1.6.2)
httparty (~> 0.8.1)
jquery-rails (~> 1.0.16)
jquery-rails (~> 1.0.19)
kaminari (~> 0.13.0)
locomotive-aloha-rails (~> 0.20.1.4)
locomotive-mongoid-tree (~> 0.6.2)
@ -45,9 +28,9 @@ PATH
mimetype-fu (~> 0.1.2)
mongo (~> 1.5.2)
mongoid (~> 2.4.9)
multi_json (= 1.2.0)
multi_json (~> 1.3.4)
rack-cache (~> 1.1)
rails (~> 3.2.3)
rails (~> 3.2.5)
rails-backbone (~> 0.6.1)
rake (~> 0.9.2)
responders (~> 0.6.4)
@ -59,36 +42,36 @@ GEM
remote: http://rubygems.org/
specs:
RedCloth (4.2.9)
actionmailer (3.2.3)
actionpack (= 3.2.3)
actionmailer (3.2.5)
actionpack (= 3.2.5)
mail (~> 2.4.4)
actionmailer-with-request (0.3.0)
rails (>= 3)
actionpack (3.2.3)
activemodel (= 3.2.3)
activesupport (= 3.2.3)
actionpack (3.2.5)
activemodel (= 3.2.5)
activesupport (= 3.2.5)
builder (~> 3.0.0)
erubis (~> 2.7.0)
journey (~> 1.0.1)
rack (~> 1.4.0)
rack-cache (~> 1.2)
rack-test (~> 0.6.1)
sprockets (~> 2.1.2)
activemodel (3.2.3)
activesupport (= 3.2.3)
sprockets (~> 2.1.3)
activemodel (3.2.5)
activesupport (= 3.2.5)
builder (~> 3.0.0)
activerecord (3.2.3)
activemodel (= 3.2.3)
activesupport (= 3.2.3)
activerecord (3.2.5)
activemodel (= 3.2.5)
activesupport (= 3.2.5)
arel (~> 3.0.2)
tzinfo (~> 0.3.29)
activeresource (3.2.3)
activemodel (= 3.2.3)
activesupport (= 3.2.3)
activesupport (3.2.3)
activeresource (3.2.5)
activemodel (= 3.2.5)
activesupport (= 3.2.5)
activesupport (3.2.5)
i18n (~> 0.6)
multi_json (~> 1.0)
addressable (2.2.7)
addressable (2.2.8)
arel (3.0.2)
bcrypt-ruby (3.0.1)
bson (1.5.2)
@ -103,14 +86,16 @@ GEM
rack-test (>= 0.5.4)
selenium-webdriver (~> 2.0)
xpath (~> 0.1.4)
carrierwave (0.6.1)
carrierwave-mongoid (0.1.3)
carrierwave (>= 0.5.6)
carrierwave (0.6.2)
activemodel (>= 3.2.0)
activesupport (>= 3.2.0)
carrierwave-mongoid (0.2.1)
carrierwave (~> 0.6.1)
mongoid (~> 2.1)
cells (3.8.3)
cells (3.8.5)
actionpack (~> 3.0)
railties (~> 3.0)
childprocess (0.3.1)
childprocess (0.3.2)
ffi (~> 1.0.6)
chunky_png (1.2.5)
codemirror-rails (2.24)
@ -121,39 +106,50 @@ GEM
coffee-script (2.2.0)
coffee-script-source
execjs
coffee-script-source (1.3.1)
cucumber (1.1.9)
coffee-script-source (1.3.3)
compass (0.12.1)
chunky_png (~> 1.2)
fssm (>= 0.2.7)
sass (~> 3.1)
compass-rails (1.0.2)
compass (>= 0.12.0, < 0.14)
cucumber (1.2.1)
builder (>= 2.1.2)
diff-lcs (>= 1.1.2)
gherkin (~> 2.9.0)
diff-lcs (>= 1.1.3)
gherkin (~> 2.11.0)
json (>= 1.4.6)
term-ansicolor (>= 1.0.6)
cucumber-rails (1.3.0)
capybara (>= 1.1.2)
cucumber (>= 1.1.8)
nokogiri (>= 1.5.0)
custom_fields (2.0.0.rc10)
custom_fields (2.0.0.rc12)
activesupport (~> 3.2.1)
carrierwave-mongoid (~> 0.1.3)
mongoid (~> 2.4.7)
database_cleaner (0.7.2)
devise (1.5.3)
carrierwave-mongoid (~> 0.2.1)
mongoid (~> 2.4.9)
database_cleaner (0.8.0)
devise (2.1.0)
bcrypt-ruby (~> 3.0)
orm_adapter (~> 0.0.3)
warden (~> 1.1)
orm_adapter (~> 0.0.7)
railties (~> 3.1)
warden (~> 1.1.1)
devise-encryptable (0.1.1)
devise (>= 2.1.0.rc)
diff-lcs (1.1.3)
dragonfly (0.9.12)
rack
ejs (1.0.0)
erubis (2.7.0)
excon (0.13.3)
execjs (1.3.0)
eventmachine (0.12.10)
excon (0.13.4)
execjs (1.4.0)
multi_json (~> 1.0)
factory_girl (2.5.2)
activesupport (>= 2.3.9)
factory_girl_rails (1.6.0)
factory_girl (~> 2.5.0)
railties (>= 3.0.0)
faye-websocket (0.4.5)
eventmachine (>= 0.12.0)
ffi (1.0.11)
flash_cookie_session (1.1.3)
rails (~> 3.0)
@ -167,15 +163,16 @@ GEM
net-ssh (>= 2.1.3)
nokogiri (~> 1.5.0)
ruby-hmac
formatador (0.2.1)
formatador (0.2.3)
formtastic (2.0.2)
rails (~> 3.0)
fssm (0.2.9)
gherkin (2.9.3)
gherkin (2.11.0)
json (>= 1.4.6)
haml (3.1.4)
highline (1.6.11)
haml (3.1.6)
highline (1.6.12)
hike (1.2.1)
http_parser.rb (0.5.3)
httparty (0.8.3)
multi_json (~> 1.0)
multi_xml
@ -184,8 +181,8 @@ GEM
jquery-rails (1.0.19)
railties (~> 3.0)
thor (~> 0.14)
json (1.6.6)
json_spec (1.0.0)
json (1.7.3)
json_spec (1.0.3)
multi_json (~> 1.0)
rspec (~> 2.0)
kaminari (0.13.0)
@ -213,20 +210,26 @@ GEM
mocha (0.9.12)
mongo (1.5.2)
bson (= 1.5.2)
mongoid (2.4.9)
mongoid (2.4.11)
activemodel (~> 3.1)
mongo (~> 1.3)
mongo (<= 1.6.2)
tzinfo (~> 0.3.22)
multi_json (1.2.0)
multi_xml (0.4.4)
multi_json (1.3.6)
multi_xml (0.5.1)
net-scp (1.0.4)
net-ssh (>= 1.99.1)
net-ssh (2.3.0)
nokogiri (1.5.2)
net-ssh (2.5.2)
nokogiri (1.5.3)
orm_adapter (0.0.7)
pickle (0.4.10)
cucumber (>= 0.8)
rake
poltergeist (0.6.0)
capybara (~> 1.0)
childprocess (~> 0.3)
faye-websocket (~> 0.4, >= 0.4.4)
http_parser.rb (~> 0.5.3)
multi_json (~> 1.0)
polyglot (0.3.3)
rack (1.4.1)
rack-cache (1.2)
@ -235,26 +238,26 @@ GEM
rack
rack-test (0.6.1)
rack (>= 1.0)
rails (3.2.3)
actionmailer (= 3.2.3)
actionpack (= 3.2.3)
activerecord (= 3.2.3)
activeresource (= 3.2.3)
activesupport (= 3.2.3)
rails (3.2.5)
actionmailer (= 3.2.5)
actionpack (= 3.2.5)
activerecord (= 3.2.5)
activeresource (= 3.2.5)
activesupport (= 3.2.5)
bundler (~> 1.0)
railties (= 3.2.3)
railties (= 3.2.5)
rails-backbone (0.6.1)
coffee-script (~> 2.2.0)
ejs (~> 1.0.0)
railties (>= 3.1.0)
railties (3.2.3)
actionpack (= 3.2.3)
activesupport (= 3.2.3)
railties (3.2.5)
actionpack (= 3.2.5)
activesupport (= 3.2.5)
rack-ssl (~> 1.3.2)
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (~> 0.14.6)
raindrops (0.8.0)
thor (>= 0.14.6, < 2.0)
raindrops (0.9.0)
rake (0.9.2.2)
rdoc (3.12)
json (~> 1.4)
@ -278,28 +281,27 @@ GEM
railties (>= 3.0)
rspec (~> 2.8.0)
ruby-hmac (0.4.0)
rubyzip (0.9.7)
rubyzip (0.9.8)
sanitize (2.0.3)
nokogiri (>= 1.4.4, < 1.6)
sass (3.1.15)
sass (3.1.19)
sass-rails (3.2.5)
railties (~> 3.2.0)
sass (>= 3.1.10)
tilt (~> 1.3)
selenium-webdriver (2.21.1)
selenium-webdriver (2.22.2)
childprocess (>= 0.2.5)
ffi (~> 1.0)
libwebsocket (~> 0.1.3)
multi_json (< 1.3)
multi_json (~> 1.0)
rubyzip
shoulda-matchers (1.1.0)
activesupport (>= 3.0.0)
sprockets (2.1.2)
sprockets (2.1.3)
hike (~> 1.2)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
term-ansicolor (1.0.7)
thor (0.14.6)
thor (0.15.2)
tilt (1.3.3)
treetop (1.4.10)
polyglot
@ -308,7 +310,7 @@ GEM
uglifier (1.2.4)
execjs (>= 0.3.0)
multi_json (>= 1.0.2)
unicorn (4.2.1)
unicorn (4.3.1)
kgio (~> 2.6)
rack
raindrops (~> 0.7)
@ -324,8 +326,7 @@ PLATFORMS
DEPENDENCIES
capybara
coffee-rails (~> 3.2.2)
compass!
compass-rails!
compass-rails
cucumber-rails
database_cleaner
factory_girl_rails (~> 1.6.0)
@ -334,10 +335,11 @@ DEPENDENCIES
locomotive_cms!
mocha (= 0.9.12)
pickle
poltergeist
rspec-cells
rspec-rails (~> 2.8.0)
sass-rails (~> 3.2.4)
shoulda-matchers
uglifier (~> 1.2.3)
uglifier (~> 1.2.4)
unicorn
xpath (~> 0.1.4)

View File

@ -24,8 +24,8 @@ h2. Gems
Here is a short list of main gems / technologies used in the application.
* Rails 3.2.3
* Mongoid 2.4.6 (with MongoDB 2.0)
* Rails 3.2.5
* Mongoid 2.4.9 (with MongoDB 2.0)
* Liquid
* Devise
* Carrierwave
@ -46,7 +46,7 @@ h2. Community
* Get help or discuss locomotive CMS at the "LocomotiveCMS Google group":https://groups.google.com/forum/?fromgroups#!forum/locomotivecms or the "LocomotiveCMS Discussion Forums":http://locomotive.vanillaforums.com/ (deprecated)
* Join us on IRC "#locomotivecms at irc.freenode.net!":http://webchat.freenode.net/
* "Follow us on twitter":http://twitter.com/locomotiveapp
* "Follow us on twitter":http://twitter.com/locomotivecms
h2. Contributing to Locomotive
@ -55,6 +55,7 @@ Locomotive CMS is an open source project, we encourage contributions. If you hav
* Install ruby and mongoDB
* Clone the project <code>git clone git@github.com:locomotivecms/engine.git</code>
* Setup a virtual host entry for <code>test.example.com</code> to point to localhost
* Install PhantomJS (Required for the cucumber suite See: https://github.com/jonleighton/poltergeist)
* Run the tests <code>rake</code>
* Write your failing tests
* Make the tests pass

View File

Before

Width:  |  Height:  |  Size: 611 B

After

Width:  |  Height:  |  Size: 611 B

View File

@ -25,7 +25,7 @@ define(
picker.close();
}
picker.render()
picker.fetch_assets();
},
/**

View File

@ -21,4 +21,7 @@ class Locomotive.Models.Page extends Backbone.Model
delete hash['editable_elements']
hash.editable_elements = @get('editable_elements').toJSONForSave() if @get('editable_elements')? && @get('editable_elements').length > 0
delete hash['target_klass_name']
hash.target_klass_name = @get('target_klass_name') if @get('templatized') == true
class Locomotive.Models.PagesCollection extends Backbone.Collection

View File

@ -69,5 +69,7 @@
doc.head.appendChild(stylesheet);
}
$.ui.dialog.prototype.overlayEl = function() { return this.overlay.$el; }
})();

View File

@ -83,3 +83,10 @@ class Locomotive.Views.ApplicationView extends Backbone.View
locale = $(@).attr('data-locale')
window.addParameterToURL 'content_locale', locale
unique_dialog_zindex: ->
# returns the number of jQuery UI modals created in order to set a valid zIndex for each of them.
# Each modal window should have a different zIndex, otherwise there will be conflicts between them.
window.Locomotive.jQueryModals ||= 0
998 + window.Locomotive.jQueryModals++

View File

@ -12,7 +12,10 @@ class Locomotive.Views.ContentAssets.PickerView extends Locomotive.Views.Shared.
ich.content_asset_picker
fetch_assets: ->
@collection.fetch()
@_reset()
@collection.fetch
success: () =>
@open()
build_uploader: (el, link) ->
link.bind 'click', (event) ->

View File

@ -50,11 +50,13 @@ class Locomotive.Views.ContentEntries.FormView extends Locomotive.Views.Shared.F
settings = _.extend {}, @tinyMCE_settings(),
oninit: ((editor) =>
$.cmd 'S', (() =>
$(textarea).val(editor.getBody().innerHTML).trigger('change')
editor.save()
$(textarea).trigger('changeSilently')
@$('form').trigger('submit')
), [], ignoreCase: true, document: editor.dom.doc),
onchange_callback: (editor) =>
$(textarea).val(editor.getBody().innerHTML).trigger('change')
editor.save()
$(textarea).trigger('changeSilently')
$(textarea).tinymce(settings)

View File

@ -26,11 +26,9 @@ class Locomotive.Views.ContentEntries.PopupFormView extends Locomotive.Views.Con
@dialog = $(@el).dialog
autoOpen: false
modal: true
zIndex: 998
zIndex: window.application_view.unique_dialog_zindex()
width: 770,
create: (event, ui) =>
$('.ui-widget-overlay').bind 'click', => @close()
$(@el).prev().find('.ui-dialog-title').html(@$('h2').html())
@$('h2').remove()
actions = @$('.dialog-actions').appendTo($(@el).parent()).addClass('ui-dialog-buttonpane ui-widget-content ui-helper-clearfix')
@ -39,6 +37,7 @@ class Locomotive.Views.ContentEntries.PopupFormView extends Locomotive.Views.Con
actions.find('input[type=submit]').click (event) => @save(event)
open: (event, ui, extra) =>
$(@el).dialog('overlayEl').bind 'click', => @close()
# nothing to do
open: ->
@ -57,6 +56,7 @@ class Locomotive.Views.ContentEntries.PopupFormView extends Locomotive.Views.Con
close: (event) ->
event.stopPropagation() & event.preventDefault() if event?
@clear_errors()
$(@el).dialog('overlayEl').unbind('click')
$(@el).dialog('close')
center: ->
@ -71,6 +71,9 @@ class Locomotive.Views.ContentEntries.PopupFormView extends Locomotive.Views.Con
else
@refresh()
slugify_label_field: ->
# disabled in a popup form
enable_has_many_fields: ->
# disabled in a popup form

View File

@ -12,8 +12,6 @@ class Locomotive.Views.ContentTypes.FormView extends Locomotive.Views.Shared.For
initialize: ->
@model = new Locomotive.Models.ContentType(@options.content_type)
window.foo = @model
Backbone.ModelBinding.bind @
render: ->

View File

@ -58,11 +58,18 @@ class Locomotive.Views.ContentTypes.CustomFieldEntryView extends Backbone.View
fetch_inverse_of_list: ->
@$('li.input.inverse-of select option').remove()
_.each @inverse_of_list[@model.get('type')], (data) =>
list = @inverse_of_list[@model.get('type')] || []
_.each list, (data) =>
if data.class_name == @model.get('class_name')
option = new Option(data.label, data.name, data.class_name == @model.get('inverse_of') || @inverse_of_list.length == 1)
option = new Option(data.label, data.name, data.name == @model.get('inverse_of') || list.length == 1)
@$('li.input.inverse-of select').append(option)
# by default, select the first option
if !@model.get('inverse_of')? && list.length > 0
@model.set
inverse_of: list[0].name
render_select_options_view: ->
@select_options_view = new Locomotive.Views.ContentTypes.SelectOptionsView
model: @model

View File

@ -15,8 +15,6 @@ class Locomotive.Views.CurrentSite.EditView extends Locomotive.Views.Shared.Form
Backbone.ModelBinding.bind @, checkbox: 'class'
window.foo = @model
render: ->
super()
@ -57,6 +55,7 @@ class Locomotive.Views.CurrentSite.EditView extends Locomotive.Views.Shared.Form
@$('#site_memberships_input').append(@memberships_view.render().el)
enable_liquid_editing: ->
if($('#site_robots_txt').length)
input = @$('#site_robots_txt')
@editor = CodeMirror.fromTextArea input.get()[0],
mode: 'liquid'

View File

@ -24,6 +24,8 @@ class Locomotive.Views.InlineEditor.ApplicationView extends Backbone.View
@toolbar_view.render()
@content_assets_picker_view.render()
enable_iframe_autoheight: ->
iframe = @iframe
@ -89,6 +91,13 @@ class Locomotive.Views.InlineEditor.ApplicationView extends Backbone.View
toolbar_view.show_status 'loading'
window.history.pushState('Object', 'Title', link.attr('href').replace('_edit', '_admin'))
unique_dialog_zindex: ->
# returns the number of jQuery UI modals created in order to set a valid zIndex for each of them.
# Each modal window should have a different zIndex, otherwise there will be conflicts between them.
window.Locomotive.jQueryModals ||= 0
1050 + window.Locomotive.jQueryModals++
_$: (selector) ->
$(selector, @iframe[0].contentWindow.document)

View File

@ -16,14 +16,14 @@ class Locomotive.Views.Pages.FormView extends Locomotive.Views.Shared.FormView
@model = new Locomotive.Models.Page(@options.page)
window.foo = @model
@touched_url = false
@image_picker_view = new Locomotive.Views.ThemeAssets.ImagePickerView
collection: new Locomotive.Models.ThemeAssetsCollection()
on_select: @insert_image
@image_picker_view.render()
Backbone.ModelBinding.bind @
@editable_elements_view = new Locomotive.Views.EditableElements.EditAllView(collection: @model.get('editable_elements'))
@ -41,7 +41,7 @@ class Locomotive.Views.Pages.FormView extends Locomotive.Views.Shared.FormView
@enable_response_type_select()
# enable check boxes
@enable_wildcard_checkbox()
@enable_templatized_checkbox()
@enable_redirect_checkbox()
@ -58,7 +58,7 @@ class Locomotive.Views.Pages.FormView extends Locomotive.Views.Shared.FormView
open_image_picker: (event) ->
event.stopPropagation() & event.preventDefault()
@image_picker_view.editor = @editor
@image_picker_view.render()
@image_picker_view.fetch_assets()
insert_image: (path) ->
text = "{{ '#{path}' | theme_image_url }}"
@ -72,7 +72,7 @@ class Locomotive.Views.Pages.FormView extends Locomotive.Views.Shared.FormView
@editor = CodeMirror.fromTextArea input.get()[0],
mode: 'liquid'
autoMatchParens: false
lineNumbers: true
lineNumbers: false
passDelay: 50
tabMode: 'shift'
theme: 'default'
@ -109,9 +109,14 @@ class Locomotive.Views.Pages.FormView extends Locomotive.Views.Shared.FormView
url: @$('#page_slug').attr('data-url')
type: 'get'
dataType: 'json'
data: { parent_id: @$('#page_parent_id').val(), slug: @$('#page_slug').val(), wildcard: @model.get('wildcard') }
data: { parent_id: @$('#page_parent_id').val(), slug: @$('#page_slug').val() }
success: (data) =>
@$('#page_slug_input .inline-hints').html(data.url).effect('highlight')
if data.templatized_parent
@$('li#page_slug_input').show()
@$('li#page_templatized_input, li#page_target_klass_name_input').hide()
else
@$('li#page_templatized_input').show() unless @model.get('redirect')
enable_response_type_select: ->
@$('li#page_response_type_input').change (event) =>
@ -121,13 +126,19 @@ class Locomotive.Views.Pages.FormView extends Locomotive.Views.Shared.FormView
@model.set redirect: false
@$('li#page_redirect_input, li#page_redirect_url_input').hide()
enable_wildcard_checkbox: ->
@_enable_checkbox 'wildcard',
features: ['redirect', 'listed']
enable_templatized_checkbox: ->
@_enable_checkbox 'templatized',
features: ['slug', 'redirect', 'listed']
on_callback: =>
@$('li#page_target_klass_name_input').show()
off_callback: =>
@$('li#page_target_klass_name_input').hide()
@$('li#page_templatized_input').hide() if @model.get('templatized_from_parent') == true
enable_redirect_checkbox: ->
@_enable_checkbox 'redirect',
features: ['wildcard', 'cache_strategy']
features: ['templatized', 'cache_strategy']
on_callback: =>
@$('li#page_redirect_url_input').show()
off_callback: =>

View File

@ -11,11 +11,9 @@ class Locomotive.Views.Shared.AssetPickerView extends Backbone.View
@collection.bind('remove', @remove_asset)
render: ->
@_reset()
$(@el).html(@template()())
@fetch_assets()
@create_dialog()
return @
@ -29,33 +27,32 @@ class Locomotive.Views.Shared.AssetPickerView extends Backbone.View
# please overide build_uploader
create_dialog: ->
@dialog = $(@el).dialog
@dialog ||= $(@el).dialog
autoOpen: false
modal: true
zIndex: 998
zIndex: window.application_view.unique_dialog_zindex()
width: 650,
create: (event, ui) =>
$('.ui-widget-overlay').bind 'click', => @close()
$(@el).prev().find('.ui-dialog-title').html(@$('h2').html())
@$('h2').remove()
actions = @$('.dialog-actions').appendTo($(@el).parent()).addClass('ui-dialog-buttonpane ui-widget-content ui-helper-clearfix')
actions.find('#close-link').click (event) => @close(event)
open: (event, ui, extra) =>
actions = $(@el).parent().find('.ui-dialog-buttonpane')
el = actions.find('input[type=file]')
input = actions.find('input[type=file]')
link = actions.find('#upload-link')
@build_uploader(el, link)
@build_uploader(input, link)
@open()
open: (event, ui, extra) =>
$(@el).dialog('overlayEl').bind 'click', => @close()
open: ->
$(@el).dialog('open')
close: (event) ->
event.stopPropagation() & event.preventDefault() if event?
$(@el).dialog('overlayEl').unbind('click')
$(@el).dialog('close')
shake: ->
@ -70,8 +67,6 @@ class Locomotive.Views.Shared.AssetPickerView extends Backbone.View
@_refresh()
setTimeout (=> @create_dialog()), 30 # disable flickering
add_asset: (asset, first) ->
# please overide add_asset (the 'first' param is to know if it comes from the first collection fetch)
@ -94,6 +89,4 @@ class Locomotive.Views.Shared.AssetPickerView extends Backbone.View
_on_refresh: ->
_reset: ->
$('.ui-widget-overlay').unbind 'click'
@$('.actions input[type=file]').remove()
@dialog.dialog('destroy') if @dialog?
# for nothing to do

View File

@ -37,6 +37,7 @@ class Locomotive.Views.Shared.FormView extends Backbone.View
@model.save {},
headers: options.headers
silent: true # since we pass an empty hash above, no need to trigger the callbacks
success: (model, response, xhr) =>
form.trigger('ajax:complete')

View File

@ -19,6 +19,8 @@ class Locomotive.Views.Snippets.FormView extends Locomotive.Views.Shared.FormVie
collection: new Locomotive.Models.ThemeAssetsCollection()
on_select: @insert_image
@image_picker_view.render()
Backbone.ModelBinding.bind @
render: ->
@ -38,7 +40,7 @@ class Locomotive.Views.Snippets.FormView extends Locomotive.Views.Shared.FormVie
open_image_picker: (event) ->
event.stopPropagation() & event.preventDefault()
@image_picker_view.editor = @editor
@image_picker_view.render()
@image_picker_view.fetch_assets()
insert_image: (path) ->
text = "{{ '#{path}' | theme_image_url }}"

View File

@ -15,10 +15,10 @@ class Locomotive.Views.ThemeAssets.FormView extends Locomotive.Views.Shared.Form
@model = new Locomotive.Models.ThemeAsset(@options.theme_asset)
window.foo = @model
@image_picker_view = new Locomotive.Views.ThemeAssets.ImagePickerView on_select: @insert_image
@image_picker_view.render()
Backbone.ModelBinding.bind @
render: ->
@ -72,10 +72,10 @@ class Locomotive.Views.ThemeAssets.FormView extends Locomotive.Views.Shared.Form
open_image_picker: (event) ->
event.stopPropagation() & event.preventDefault()
@image_picker_view.editor = @editor
@image_picker_view.render()
@image_picker_view.fetch_assets()
insert_image: (path) ->
text = "{{ '#{path}' | theme_image_url }}"
text = "'#{path}'"
@editor.replaceSelection(text)
@image_picker_view.close()

View File

@ -15,7 +15,12 @@ class Locomotive.Views.ThemeAssets.ImagePickerView extends Locomotive.Views.Shar
ich.theme_image_picker
fetch_assets: ->
@collection.fetch data: { content_type: 'image' }
@_reset()
@collection.fetch
data:
content_type: 'image'
success: () =>
@open()
build_uploader: (el, link) ->
link.bind 'click', (event) ->
@ -38,3 +43,6 @@ class Locomotive.Views.ThemeAssets.ImagePickerView extends Locomotive.Views.Shar
add_asset: (asset) ->
@$('ul.list').append(ich.theme_asset(asset.toJSON()))
@_refresh()
_reset: ->
@$('ul.list').empty()

View File

@ -43,13 +43,16 @@
'collection': new Locomotive.Models.ContentAssetsCollection()
});
view.render();
// Register commands
ed.addCommand('locomotiveMedia', function() {
view.options.on_select = function(asset) {
insertImage(ed, asset);
view.close();
}
view.render();
view.fetch_assets();
});
// Register buttons

View File

@ -271,7 +271,7 @@ ul.list {
cursor: move;
}
&.wildcard > .inner > a {
&.templatized > .inner > a {
padding-right: 24px;
background: transparent image-url("locomotive/list/icons/template.png") no-repeat right 2px;
}

View File

@ -7,6 +7,7 @@
font-size: 13px;
font-weight: normal;
line-height: 15px;
@include background-image(linear-gradient(top, #f0f0f0, #f9f9f9 4px, #f9f9f9 4px, #ffffff 12px, #ffffff));

View File

@ -60,7 +60,7 @@
.ui-dialog-content {
position: relative;
z-index: 999;
z-index: 1200;
text-align: left;
@ -124,14 +124,14 @@
top: 8px;
right: 10px;
z-index: 1003;
z-index: 1203;
a, input[type=submit] {
@include light-button;
}
input[type=file] {
z-index: 1003;
z-index: 1203;
}
} // .button-wrapper

View File

@ -421,8 +421,10 @@ form.formtastic {
}
&.no-label {
padding-top: 12px;
> textarea, .CodeMirror, .CodeMirror-scroll {
margin-top: 12px;
margin-top: 0px;
width: 868px;
}
}

View File

@ -24,7 +24,7 @@ module Locomotive
add :switch, :url => '#', :id => 'sites-picker-link'
end
add :help, :url => '#', :class => 'tutorial', :id => 'help'
add :help, :url => 'http://doc.locomotivecms.com/templates/basics', :class => 'tutorial', :id => 'help'
add :logout, :url => destroy_locomotive_session_url, :confirm => t('locomotive.messages.confirm'), :method => :delete
end

View File

@ -7,15 +7,13 @@ module Locomotive
skip_before_filter :verify_authenticity_token
skip_load_and_authorize_resource
before_filter :require_account
before_filter :require_site
before_filter :set_locale
# before_filter :validate_site_membership
before_filter :set_current_thread_variables
self.responder = Locomotive::ActionController::Responder # custom responder
@ -23,6 +21,11 @@ module Locomotive
protected
def set_current_thread_variables
Thread.current[:account] = current_locomotive_account
Thread.current[:site] = current_site
end
def current_ability
@current_ability ||= Ability.new(current_locomotive_account, current_site)
end

View File

@ -2,11 +2,18 @@ module Locomotive
module Api
class ContentAssetsController < BaseController
load_and_authorize_resource :class => Locomotive::ContentAsset
def index
@content_assets = current_site.content_assets
respond_with(@content_assets)
end
def show
@content_asset = current_site.content_assets.find(params[:id])
respond_with(@content_asset)
end
def create
@content_asset = current_site.content_assets.create(params[:content_asset])
respond_with @content_asset, :location => main_app.locomotive_api_content_assets_url
@ -18,6 +25,12 @@ module Locomotive
respond_with @content_asset, :location => main_app.locomotive_api_content_assets_url
end
def destroy
@content_asset = current_site.content_assets.find(params[:id])
@content_asset.destroy
respond_with @content_asset
end
end
end
end

View File

@ -2,11 +2,18 @@ module Locomotive
module Api
class ContentTypesController < BaseController
load_and_authorize_resource :class => Locomotive::ContentType
def index
@content_types = current_site.content_types
@content_types = current_site.content_types.order_by([[:name, :asc]])
respond_with(@content_types)
end
def show
@content_type = current_site.content_types.find(params[:id])
respond_with @content_type
end
def create
@content_type = current_site.content_types.create(params[:content_type])
respond_with @content_type, :location => main_app.locomotive_api_content_types_url
@ -18,6 +25,12 @@ module Locomotive
respond_with @content_type, :location => main_app.locomotive_api_content_types_url
end
def destroy
@content_type = current_site.content_types.find(params[:id])
@content_type.destroy
respond_with @content_type
end
end
end
end

View File

@ -3,7 +3,9 @@ module Locomotive
class CurrentSiteController < BaseController
def show
respond_with(current_site)
@site = current_site
authorize! :show, @site
respond_with(@site)
end
end

View File

@ -0,0 +1,49 @@
module Locomotive
module Api
class MembershipsController < BaseController
# It's an embedded document, so we'll just load manually
before_filter :load_membership, :only => [ :show, :update, :destroy ]
before_filter :load_memberships, :only => [ :index ]
authorize_resource :class => Locomotive::Membership
def index
respond_with(@memberships)
end
def show
respond_with(@membership)
end
def create
build_params = params[:membership].merge({ :role => 'author' }) # force author by default
@membership = current_site.memberships.create(build_params)
respond_with(@membership)
end
def update
@membership.update_attributes(params[:membership])
respond_with(@membership)
end
def destroy
@membership.destroy
respond_with(@membership)
end
protected
def load_membership
@membership ||= load_memberships.find(params[:id])
end
def load_memberships
@memberships ||= current_site.memberships
end
end
end
end

View File

@ -2,11 +2,18 @@ module Locomotive
module Api
class PagesController < BaseController
load_and_authorize_resource :class => Locomotive::Page
def index
@pages = current_site.pages.all
@pages = current_site.pages.order_by([[:depth, :asc], [:position, :asc]])
respond_with(@pages)
end
def show
@page = current_site.pages.find(params[:id])
respond_with(@page)
end
def create
@page = current_site.pages.create(params[:page])
respond_with @page, :location => main_app.locomotive_api_pages_url
@ -18,6 +25,12 @@ module Locomotive
respond_with @page, :location => main_app.locomotive_api_pages_url
end
def destroy
@page = current_site.pages.find(params[:id])
@page.destroy
respond_with @page
end
end
end

View File

@ -0,0 +1,44 @@
module Locomotive
module Api
class SitesController < BaseController
load_and_authorize_resource :class => Locomotive::Site
# FIXME: the auto-loaded site won't pass authorization for show, update, or destroy
skip_load_and_authorize_resource :only => [ :show, :update, :destroy ]
def index
@sites = Locomotive::Site.all
respond_with(@sites)
end
def show
@site = Locomotive::Site.find(params[:id])
authorize! :show, @site
respond_with(@site)
end
def create
@site = Locomotive::Site.create(params[:site])
respond_with(@site)
end
def update
@site = Locomotive::Site.find(params[:id])
authorize! :update, @site
@site.update_attributes(params[:site])
respond_with @site
end
def destroy
@site = Locomotive::Site.find(params[:id])
authorize! :destroy, @site
@site.destroy
respond_with @site
end
end
end
end

View File

@ -2,11 +2,18 @@ module Locomotive
module Api
class SnippetsController < BaseController
load_and_authorize_resource :class => Locomotive::Snippet
def index
@snippets = current_site.snippets.all
@snippets = current_site.snippets.order_by([[:name, :asc]])
respond_with(@snippets)
end
def show
@snippet = current_site.snippets.find(params[:id])
respond_with @snippet
end
def create
@snippet = current_site.snippets.create(params[:snippet])
respond_with @snippet, :location => main_app.locomotive_api_snippets_url
@ -18,6 +25,12 @@ module Locomotive
respond_with @snippet, :location => main_app.locomotive_api_snippets_url
end
def destroy
@snippet = current_site.snippets.find(params[:id])
@snippet.destroy
respond_with @snippet
end
end
end
end

View File

@ -2,11 +2,18 @@ module Locomotive
module Api
class ThemeAssetsController < BaseController
load_and_authorize_resource :class => Locomotive::ThemeAsset
def index
@theme_assets = current_site.theme_assets.all
respond_with(@theme_assets)
end
def show
@theme_asset = current_site.theme_assets.find(params[:id])
respond_with @theme_asset
end
def create
@theme_asset = current_site.theme_assets.create(params[:theme_asset])
respond_with @theme_asset, :location => main_app.locomotive_api_theme_assets_url
@ -18,6 +25,12 @@ module Locomotive
respond_with @theme_asset, :location => main_app.locomotive_api_theme_assets_url
end
def destroy
@theme_asset = current_site.theme_assets.find(params[:id])
@theme_asset.destroy
respond_with @theme_asset
end
end
end
end

View File

@ -53,10 +53,10 @@ module Locomotive
end
def get_path
page = current_site.pages.build(:parent => current_site.pages.find(params[:parent_id]), :slug => params[:slug].permalink, :wildcard => params[:wildcard]).tap do |p|
page = current_site.pages.build(:parent => current_site.pages.find(params[:parent_id]), :slug => params[:slug].permalink).tap do |p|
p.valid?; p.send(:build_fullpath)
end
render :json => { :url => public_page_url(page), :slug => page.slug }
render :json => { :url => public_page_url(page), :slug => page.slug, :templatized_parent => page.templatized_from_parent? }
end
end

View File

@ -6,8 +6,6 @@ module Locomotive
before_filter :sanitize_entry_params, :only => :create
skip_before_filter :verify_authenticity_token
skip_load_and_authorize_resource
self.responder = Locomotive::ActionController::PublicResponder # custom responder
@ -17,7 +15,6 @@ module Locomotive
def create
@entry = @content_type.entries.create(params[:entry] || params[:content])
flash[@content_type.slug.singularize] = @entry.to_presenter(:include_errors => true).as_json
Rails.logger.debug @entry.to_presenter(:include_errors => true).as_json
respond_with @entry, :location => self.callback_url
end
@ -48,6 +45,13 @@ module Locomotive
end
end
def handle_unverified_request
if Locomotive.config.csrf_protection
reset_session
redirect_to '/', :status => 302
end
end
end
end
end

View File

@ -99,13 +99,13 @@ module Locomotive
Locomotive.config.multi_sites?
end
# def public_page_url(page, options = {})
# if content = options.delete(:content)
# File.join(current_site_public_url, page.fullpath.gsub('content_type_template', ''), content._slug)
# else
# File.join(current_site_public_url, page.fullpath)
# end
# end
def public_page_url(page, options = {})
if content = options.delete(:content)
File.join(current_site_public_url, page.fullpath.gsub('content_type_template', ''), content._slug)
else
File.join(current_site_public_url, page.fullpath)
end
end
# memberships

View File

@ -2,7 +2,7 @@ module Locomotive
module PagesHelper
def css_for_page(page)
%w(index not_found wildcard redirect).inject([]) do |memo, state|
%w(index not_found templatized redirect).inject([]) do |memo, state|
memo << state.dasherize if page.send(:"#{state}?")
memo
end.join(' ')
@ -32,6 +32,13 @@ module Locomotive
list
end
def options_for_target_klass_name
base_models = current_site.content_types.map do |type|
[type.name.humanize, type.klass_with_custom_fields(:entries)]
end
base_models + Locomotive.config.models_for_templatization.map { |name| [name.underscore.humanize, name] }
end
def options_for_page_cache_strategy
[
[t('.cache_strategy.none'), 'none'],

View File

@ -37,6 +37,8 @@ module Locomotive
can :touch, Site do |site|
site == @site
end
can :read, ContentType
end
def setup_designer_permissions!

View File

@ -5,6 +5,20 @@ module Locomotive
devise *Locomotive.config.devise_modules
## devise fields (need to be declared since 2.x) ##
field :remember_created_at, :type => Time
field :email, :type => String, :null => false
field :encrypted_password, :type => String, :null => false
field :authentication_token, :type => String
field :reset_password_token, :type => String
field :reset_password_sent_at, :type => Time
field :password_salt, :type => String
field :sign_in_count, :type => Integer
field :current_sign_in_at, :type => Time
field :last_sign_in_at, :type => Time
field :current_sign_in_ip, :type => String
field :last_sign_in_ip, :type => String
## attributes ##
field :name
field :locale, :default => Locomotive.config.default_locale.to_s or 'en'

View File

@ -45,9 +45,11 @@ module Locomotive
self.send((type || self.content_type).label_field_name.to_sym)
end
value.respond_to?(:to_label) ? value.to_label : value
value.respond_to?(:to_label) ? value.to_label : value.to_s
end
alias :to_label :_label
def translated?
if self.respond_to?(:"#{self._label_field_name}_translations")
self.send(:"#{self._label_field_name}_translations").key?(::Mongoid::Fields::I18n.locale.to_s) #rescue false

View File

@ -84,6 +84,13 @@ module Locomotive
self.class.class_name_to_content_type(class_name, self.site)
end
def label_field_id=(value)
# update the label_field_name if the label_field_id is changed
new_label_field_name = self.entries_custom_fields.where(:_id => value).first.try(:name)
self.label_field_name = new_label_field_name
super(value)
end
def label_field_name=(value)
# mandatory if we allow the API to set the label field name without an id of the field
@new_label_field_name = value unless value.blank?

View File

@ -27,7 +27,7 @@ module Locomotive
def set_label_field
if @new_label_field_name.present?
self.label_field_id = self.entries_custom_fields.detect { |f| f.name == @new_label_field_name.underscore }._id
self.label_field_id = self.entries_custom_fields.detect { |f| f.name == @new_label_field_name.underscore }.try(:_id)
end
# unknown label_field_name, get the first one instead

View File

@ -1,196 +0,0 @@
module Locomotive
module Extensions
module Page
module Fullpath
extend ActiveSupport::Concern
included do
## fields ##
field :fullpath, :localize => true
field :wildcard, :type => Boolean, :default => false
field :wildcards, :type => Array
## callbacks ##
before_validation :get_wildcards_from_parent
before_validation :add_slug_to_wildcards
before_save :build_fullpath
after_update :propagate_fullpath_changes
# before_save :set_children_autosave
# before_rearrange :foo #propagate_fullpath_changes
# after_save :propagate_fullpath_changes
# after_save { |p| puts "[after_save] #{p.fullpath} / #{p.wildcards.inspect} / #{p.wildcard?}" }
## scopes ##
# scope :fullpath, lambda { |fullpath| { :where => { :fullpath => fullpath } } } # used ?
## virtual attributes ##
attr_accessor :wildcards_hash
end
# def foo
# Rails.logger.debug "----> rearranging #{self.slug}.......\n\n"
# puts "[rearranging]"
# end
# This method returns true if the fullpath is enhanced
# by wildcards. It is different from the wildcard? method
# because it includes the ancestors when determining if
# the current page has wildcards or not.
#
def has_wildcards?
self.wildcard? || !self.fullpath.try(:index, '*').nil?
end
# It returns a pretty output of the fullpath. The "*" characters
# are replaced by the following pattern ":<slug>" like the ones you can find
# in the Ruby on Rails routes.
#
def pretty_fullpath
return self.fullpath unless self.has_wildcards?
index = 0
self.fullpath.split('/').map do |segment|
if segment == '*'
":#{self.wildcards[index]}".tap { index += 1 }
else
segment
end
end.join('/')
end
# It returns the fullpath with wildcard segments replaced by the values
# specified in the first argument.
#
# @param [ Hash ] values The map assigning to a wildcard name its value
# @return [ String ] The compiled fullpath
#
def compiled_fullpath(values)
return self.fullpath unless self.has_wildcards?
index = 0
self.fullpath.split('/').map do |segment|
if segment == '*'
"#{values[self.wildcards[index]]}".tap { index += 1 }
else
segment
end
end.join('/')
end
# It builds the map associating the name of a wildcard
# with its value within the path.
# The map is also stored in the wildcards_hash attribute
# of the page.
#
# @param [ String ] path the path from the HTTP request
# @return [ Hash ] The map
#
def match_wildcards(path)
self.wildcards_hash, wildcard_index, segments = {}, 0, self.fullpath.split('/')
path.split('/').each_with_index do |segment, index|
if segments[index] == '*'
self.wildcards_hash[self.wildcards[wildcard_index].underscore] = segment
wildcard_index += 1
end
end
self.wildcards_hash
end
protected
# def set_children_autosave
# @autosave_for_children = !must_propagate_fullpath_changes?
# true
# end
def get_wildcards_from_parent
return true if self.parent.nil?
if self.parent.has_wildcards?
# puts "[get_wildcards_from_parent] #{self.slug} - #{self.parent.wildcards.inspect}"
self.wildcards = self.parent.wildcards.clone
else
# puts "[get_wildcards_from_parent] #{self.slug} - reset wildcards"
self.wildcards = []
end
end
def add_slug_to_wildcards
# puts "[add_slug_to_wildcards] #{self.slug} / #{self.wildcard?}"
(self.wildcards ||= []) << self.slug if self.wildcard?
end
def build_fullpath
if self.index? || self.not_found?
self.fullpath = self.slug
else
segments = (self.parent.fullpath.try(:split, '/') || [nil]) + [self.wildcard? ? '*' : self.slug]
segments.shift if segments.first == 'index'
self.fullpath = File.join segments.compact
end
end
def propagate_fullpath_changes
if self.fullpath_changed? || self.wildcards_changed?
self.rearrange_children!
end
end
# def must_propagate_fullpath_changes?
# self.wildcard_changed? || self.slug_changed?
# end
#
# def propagate_fullpath_changes
# return true unless must_propagate_fullpath_changes?
#
# parent_identities = { self._id => self }
#
# Rails.logger.debug "[propagate_fullpath_changes] BEGIN page #{self.slug} #{self.fullpath} / #{self.wildcards.inspect} / #{self._parent.try(:has_wildcards?).inspect}"
# puts "[propagate_fullpath_changes] BEGIN page #{self.slug} #{self.fullpath} / #{self.wildcards.inspect} / #{self._parent.try(:has_wildcards?).inspect}"
#
# self.descendants.order_by([[:depth, :asc]]).each do |page|
# _parent = parent_identities[page.parent_id]
# _fullpath = {}
# _wildcards = nil
#
# puts "[propagate_fullpath_changes] #{page.fullpath} / #{page.wildcards.inspect} / #{page._parent.try(:has_wildcards?).inspect}"
#
# if _parent.has_wildcards?
# _wildcards = _parent.wildcards + (page.wildcard? ? [page.slug] : [])
# end
#
# self.site.locales.each do |locale|
# base_fullpath = _parent.fullpath_translations[locale]
# slug = page.wildcard? ? '*' : page.slug_translations[locale]
#
# next if base_fullpath.blank?
#
# _fullpath[locale] = File.join(base_fullpath, slug)
# end
#
# selector = { 'id' => page._id }
# operations = {
# '$set' => {
# 'wildcards' => _wildcards,
# 'fullpath' => _fullpath
# }
# }
# self.collection.update selector, operations
#
# parent_identities[page._id] = page
# end
# end
end
end
end
end

View File

@ -23,7 +23,6 @@ module Locomotive
## scopes ##
scope :pages, lambda { |domain| { :any_in => { :domains => [*domain] } } }
scope :dependent_from, lambda { |id| { :where => { :template_dependencies.in => [id] } } }
end
def template

View File

@ -9,7 +9,7 @@ module Locomotive
## fields ##
field :redirect, :type => Boolean, :default => false
field :redirect_url, :type => String
field :redirect_url, :type => String, :localize => true
## validations ##
validates_presence_of :redirect_url, :if => :redirect

View File

@ -11,10 +11,11 @@ module Locomotive
module ClassMethods
# Given both a site and a path, this method retrieves
# the matching page if it exists.
# If the found page owns wildcards in its fullpath, then
# assigns the value for each wildcard and store the result within the page.
# Given both a site and a path, this method tries
# to get the matching page.
# If the page is templatized, the related content entry is
# associated to the page (page.content_entry stores the entry).
# If no page is found, then it returns the 404 one instead.
#
# @param [ Site ] site The site where to find the page
# @param [ String ] path The fullpath got from the request
@ -32,7 +33,17 @@ module Locomotive
if !_page.published? && !logged_in
next
else
_page.match_wildcards(path)
if _page.templatized?
%r(^#{_page.fullpath.gsub('content_type_template', '([^\/]+)')}$) =~ path
permalink = $1
_page.content_entry = _page.fetch_target_entry(permalink)
if _page.content_entry.nil? || (!_page.content_entry.visible? && !logged_in) # content instance not found or not visible
next
end
end
end
page = _page
@ -45,7 +56,9 @@ module Locomotive
# Calculate all the combinations possible based on the
# fact that one of the segment of the path could be
# a wildcard.
# a content type from a templatized page.
# We postulate that there is only one templatized page in a path
# (ie: no nested templatized pages)
#
# @param [ String ] path The path to the page
#
@ -56,13 +69,13 @@ module Locomotive
end
#:nodoc:
def _path_combinations(segments)
def _path_combinations(segments, can_include_template = true)
return nil if segments.empty?
segment = segments.shift
[segment, '*'].map do |_segment|
if (_combinations = _path_combinations(segments.clone))
(can_include_template ? [segment, 'content_type_template'] : [segment]).map do |_segment|
if (_combinations = _path_combinations(segments.clone, can_include_template && _segment != 'content_type_template'))
[*_combinations].map do |_combination|
File.join(_segment, _combination)
end

View File

@ -1,136 +1,136 @@
# module Locomotive
# module Extensions
# module Page
# module Templatized
module Locomotive
module Extensions
module Page
module Templatized
extend ActiveSupport::Concern
included do
## fields ##
field :templatized, :type => Boolean, :default => false
field :templatized_from_parent, :type => Boolean, :default => false
field :target_klass_name
## validations ##
validates_presence_of :target_klass_name, :if => :templatized?
validate :ensure_target_klass_name_security
## callbacks ##
before_validation :get_templatized_from_parent
before_validation :set_slug_if_templatized
before_validation :ensure_target_klass_name_security
after_save :propagate_templatized
## scopes ##
scope :templatized, :where => { :templatized => true }
## virtual attributes ##
attr_accessor :content_entry
end
# Returns the class specified by the target_klass_name property
#
# extend ActiveSupport::Concern
# @example
#
# included do
# page.target_klass_name = 'Locomotive::Entry12345'
# page.target_klass = Locomotive::Entry12345
#
# ## fields ##
# field :templatized, :type => Boolean, :default => false
# field :templatized_from_parent, :type => Boolean, :default => false
# field :target_klass_name
# @return [ Class ] The target class
#
# ## validations ##
# validates_presence_of :target_klass_name, :if => :templatized?
# validate :ensure_target_klass_name_security
def target_klass
target_klass_name.constantize
end
# Gives the name which can be used in a liquid template in order
# to reference an entry. It uses the slug property if the target klass
# is a Locomotive content type or the class name itself for the other classes.
#
# ## callbacks ##
# before_validation :get_templatized_from_parent
# before_validation :set_slug_if_templatized
# before_validation :ensure_target_klass_name_security
# after_save :propagate_templatized
# @example
#
# ## scopes ##
# scope :templatized, :where => { :templatized => true }
# page.target_klass_name = 'Locomotive::Entry12345' # related to the content type Articles
# page.target_entry_name = 'article'
#
# ## virtual attributes ##
# attr_accessor :content_entry
# end
# page.target_klass_name = 'OurProduct'
# page.target_entry_name = 'our_product'
#
# # Returns the class specified by the target_klass_name property
# #
# # @example
# #
# # page.target_klass_name = 'Locomotive::Entry12345'
# # page.target_klass = Locomotive::Entry12345
# #
# # @return [ Class ] The target class
# #
# def target_klass
# target_klass_name.constantize
# end
# @return [ String ] The name in lowercase and underscored
#
# # Gives the name which can be used in a liquid template in order
# # to reference an entry. It uses the slug property if the target klass
# # is a Locomotive content type or the class name itself for the other classes.
# #
# # @example
# #
# # page.target_klass_name = 'Locomotive::Entry12345' # related to the content type Articles
# # page.target_entry_name = 'article'
# #
# # page.target_klass_name = 'OurProduct'
# # page.target_entry_name = 'our_product'
# #
# # @return [ String ] The name in lowercase and underscored
# #
# def target_entry_name
# if self.target_klass_name =~ /^Locomotive::Entry([a-z0-9]+)$/
# @content_type ||= self.site.content_types.find($1)
# @content_type.slug.singularize
# else
# self.target_klass_name.underscore
# end
# end
def target_entry_name
if self.target_klass_name =~ /^Locomotive::Entry([a-z0-9]+)$/
@content_type ||= self.site.content_types.find($1)
@content_type.slug.singularize
else
self.target_klass_name.underscore
end
end
# Finds the entry both specified by the target klass and identified by the permalink
#
# # Finds the entry both specified by the target klass and identified by the permalink
# #
# # @param [ String ] permalink The permalink of the entry
# #
# # @return [ Object ] The document
# #
# def fetch_target_entry(permalink)
# target_klass.find_by_permalink(permalink)
# end
# @param [ String ] permalink The permalink of the entry
#
# protected
# @return [ Object ] The document
#
# def get_templatized_from_parent
# return if self.parent.nil?
def fetch_target_entry(permalink)
target_klass.find_by_permalink(permalink)
end
protected
def get_templatized_from_parent
return if self.parent.nil?
if self.parent.templatized?
self.templatized = self.templatized_from_parent = true
self.target_klass_name = self.parent.target_klass_name
elsif !self.templatized?
self.templatized = self.templatized_from_parent = false
self.target_klass_name = nil
end
end
def set_slug_if_templatized
self.slug = 'content_type_template' if self.templatized? && !self.templatized_from_parent?
end
# Makes sure the target_klass is owned by the site OR
# if it belongs to the models allowed by the application
# thanks to the models_for_templatization option.
#
# if self.parent.templatized?
# self.templatized = self.templatized_from_parent = true
# self.target_klass_name = self.parent.target_klass_name
# elsif !self.templatized?
# self.templatized = self.templatized_from_parent = false
# self.target_klass_name = nil
# end
# end
def ensure_target_klass_name_security
return if !self.templatized? || self.target_klass_name.blank?
if self.target_klass_name =~ /^Locomotive::Entry([a-z0-9]+)$/
content_type = Locomotive::ContentType.find($1)
if content_type.site_id != self.site_id
self.errors.add :target_klass_name, :security
end
elsif !Locomotive.config.models_for_templatization.include?(self.target_klass_name)
self.errors.add :target_klass_name, :security
end
end
# Sets the templatized, templatized_from_parent properties of
# the children of the current page ONLY IF the templatized
# attribute got changed.
#
# def set_slug_if_templatized
# self.slug = 'content_type_template' if self.templatized? && !self.templatized_from_parent?
# end
#
# # Makes sure the target_klass is owned by the site OR
# # if it belongs to the models allowed by the application
# # thanks to the models_for_templatization option.
# #
# def ensure_target_klass_name_security
# return if !self.templatized? || self.target_klass_name.blank?
#
# if self.target_klass_name =~ /^Locomotive::Entry([a-z0-9]+)$/
# content_type = Locomotive::ContentType.find($1)
#
# if content_type.site_id != self.site_id
# self.errors.add :target_klass_name, :security
# end
# elsif !Locomotive.config.models_for_templatization.include?(self.target_klass_name)
# self.errors.add :target_klass_name, :security
# end
# end
#
# # Sets the templatized, templatized_from_parent properties of
# # the children of the current page ONLY IF the templatized
# # attribute got changed.
# #
# def propagate_templatized
# return unless self.templatized_changed?
#
# selector = { 'parent_ids' => { '$in' => [self._id] } }
# operations = {
# '$set' => {
# 'templatized' => self.templatized,
# 'templatized_from_parent' => self.templatized,
# 'target_klass_name' => self.target_klass_name
# }
# }
#
# self.collection.update selector, operations, :multi => true
# end
#
# end
# end
# end
# end
def propagate_templatized
return unless self.templatized_changed?
selector = { 'parent_ids' => { '$in' => [self._id] } }
operations = {
'$set' => {
'templatized' => self.templatized,
'templatized_from_parent' => self.templatized,
'target_klass_name' => self.target_klass_name
}
}
self.collection.update selector, operations, :multi => true
end
end
end
end
end

View File

@ -26,7 +26,7 @@ module Locomotive
module ClassMethods
# Returns the pages tree from the site with the most minimal amount of queries.
# Returns the tree of pages from the site with the most minimal amount of queries.
# This method should only be used for read-only purpose since
# the mongodb returns the minimal set of required attributes to build
# the tree.
@ -77,10 +77,6 @@ module Locomotive
end
# def autosave_for_children?
# @autosave_for_children != false
# end
# Returns the children of this node but with the minimal set of required attributes
#
# @return [ Array ] The children pages ordered by their position

View File

@ -56,10 +56,6 @@ module Locomotive
self.locales_was.first || Locomotive.config.site_locales.first
end
def default_locale_changed?
self.default_locale != self.default_locale_was
end
def locale_fallbacks(locale)
[locale.to_s] + (locales - [locale.to_s])
end
@ -98,21 +94,3 @@ module Locomotive
end
end
end
#
# %w(index 404).each do |slug|
# page = self.pages.where("slug.#{self.default_locale}" => slug).first
#
# self.locales.each do |locale|
# if .blank?
# page.collection.update({ :_id => page._id }, { '$set' => { "slug.#{locale}" => slug } })
# end
#
# if page.attributes['title'][locale.to_s].blank?
# page.collection.update({ :_id => page._id }, {
# '$set' => { "title.#{locale}" => }
# })
# end
# end
# end
# end

View File

@ -8,7 +8,7 @@ module Locomotive
include Extensions::Page::EditableElements
include Extensions::Page::Parse
include Extensions::Page::Render
include Extensions::Page::Fullpath
include Extensions::Page::Templatized
include Extensions::Page::Redirect
include Extensions::Page::Listed
include Extensions::Shared::Seo
@ -16,6 +16,7 @@ module Locomotive
## fields ##
field :title, :localize => true
field :slug, :localize => true
field :fullpath, :localize => true
field :handle
field :raw_template, :localize => true
field :locales, :type => Array
@ -34,13 +35,14 @@ module Locomotive
## callbacks ##
after_initialize :set_default_raw_template
before_validation :normalize_slug
before_save :build_fullpath
before_save :record_current_locale
before_destroy :do_not_remove_index_and_404_pages
## validations ##
validates_presence_of :site, :title, :slug
validates_uniqueness_of :slug, :scope => [:site_id, :parent_id]
validates_uniqueness_of :handle, :allow_blank => true, :scope => [:site_id]
validates_uniqueness_of :handle, :allow_blank => true
validates_exclusion_of :slug, :in => Locomotive.config.reserved_slugs, :if => Proc.new { |p| p.depth <= 1 }
## named scopes ##
@ -48,8 +50,10 @@ module Locomotive
scope :root, :where => { :slug => 'index', :depth => 0 }
scope :not_found, :where => { :slug => '404', :depth => 0 }
scope :published, :where => { :published => true }
scope :fullpath, lambda { |fullpath| { :where => { :fullpath => fullpath } } }
scope :handle, lambda { |handle| { :where => { :handle => handle } } }
scope :minimal_attributes, lambda { |attrs = []| { :only => (attrs || []) + %w(title slug fullpath position depth published with_wildcards redirect listed wildcard response_type parent_id parent_ids site_id created_at updated_at) } }
scope :minimal_attributes, lambda { |attrs = []| { :only => (attrs || []) + %w(title slug fullpath position depth published templatized redirect listed response_type parent_id parent_ids site_id created_at updated_at) } }
scope :dependent_from, lambda { |id| { :where => { :template_dependencies.in => [id] } } }
## methods ##
@ -110,6 +114,16 @@ module Locomotive
self.raw_template ||= ::I18n.t('attributes.defaults.pages.other.body')
end
def build_fullpath
if self.index? || self.not_found?
self.fullpath = self.slug
else
slugs = self.ancestors_and_self.map(&:slug)
slugs.shift unless slugs.size == 1
self.fullpath = File.join slugs.compact
end
end
def record_current_locale
self.locales ||= []
self.locales << ::Mongoid::Fields::I18n.locale

View File

@ -64,21 +64,20 @@ module Locomotive
protected
# FIXME: Currently there is no t/translate method on the
# Extensions::Site::I18n module which is breaking the testing. The
# namespaced ::I18n should be replaced by simply I18n when the t()
# method will be available.
# FIXME: Currently there is no t/translate method on the I18n module
# Extensions::Site::I18n which is breaking the testing. The
# namespaced ::I18n should be changed to just I18n when the t()
# method is available
def create_default_pages!
%w(index 404).each do |slug|
page = self.pages.build(:title => '', :slug => '', :raw_template => '', :published => true)
self.locales.each do |locale|
page.attributes['slug'][locale] = slug
page.attributes['title'][locale] = ::I18n.t("attributes.defaults.pages.#{slug}.title", :locale => locale)
page.attributes['raw_template'][locale] = ::I18n.t("attributes.defaults.pages.#{slug}.body", :locale => locale)
::Mongoid::Fields::I18n.with_locale(self.default_locale) do
%w{index 404}.each do |slug|
self.pages.create({
:slug => slug,
:title => ::I18n.t("attributes.defaults.pages.#{slug}.title"),
:raw_template => ::I18n.t("attributes.defaults.pages.#{slug}.body"),
:published => true
})
end
page.save
end
end

View File

@ -145,7 +145,7 @@ module Locomotive
def escape_shortcut_urls(text)
return if text.blank?
text.gsub(/[("'](\/(stylesheets|javascripts|images|media)\/(([^;.]+)\/)*([a-z_\-0-9]+)\.[a-z]{2,3})[)"']/) do |path|
text.gsub(/[("'](\/(stylesheets|javascripts|images|media)\/(([^;.]+)\/)*([a-zA-Z_\-0-9]+)\.[a-z]{2,3})[)"']/) do |path|
sanitized_path = path.gsub(/[("')]/, '').gsub(/^\//, '')

View File

@ -1,7 +1,7 @@
module Locomotive
class PagePresenter < BasePresenter
delegate :title, :slug, :fullpath, :handle, :raw_template, :published, :listed, :wildcard, :wildcards, :redirect, :redirect_url, :template_changed, :cache_strategy, :response_type, :to => :source
delegate :title, :slug, :fullpath, :handle, :raw_template, :published, :listed, :templatized, :templatized_from_parent, :redirect, :redirect_url, :template_changed, :cache_strategy, :response_type, :to => :source
def escaped_raw_template
h(self.source.raw_template)
@ -12,7 +12,7 @@ module Locomotive
end
def included_methods
super + %w(title slug fullpath handle raw_template published listed wildcard wildcards redirect redirect_url cache_strategy response_type template_changed editable_elements localized_fullpaths)
super + %w(title slug fullpath handle raw_template published listed templatized templatized_from_parent redirect redirect_url cache_strategy response_type template_changed editable_elements localized_fullpaths)
end
def localized_fullpaths

View File

@ -11,9 +11,9 @@
= link_to t('locomotive.buttons.close'), '#', :id => 'close-link'
.button-wrapper.upload
= form_tag theme_assets_url(:json), :class => 'quick-upload' do
= file_field_tag 'theme_asset[source]', :multiple => 'multiple'
= link_to t('locomotive.theme_assets.image_picker.upload'), theme_assets_url(:json), :class => 'new', :id => 'upload-link'
= form_tag content_assets_url(:json), :class => 'quick-upload' do
= file_field_tag 'content_asset[source]', :multiple => 'multiple'
= link_to t('locomotive.content_assets.image_picker.upload'), content_assets_url(:json), :class => 'new', :id => 'upload-link'
%script{ :type => 'text/html', :id => 'content_asset' }

View File

@ -3,7 +3,7 @@
- content_for :backbone_view_data do
:plain
content_entry: #{@content_entry.to_json}
content_entry: #{j @content_entry.to_json.html_safe}
= f.inputs :name => :attributes do
- @content_type.ordered_entries_custom_fields.each_with_index do |field, index|

View File

@ -3,8 +3,8 @@
- content_for :backbone_view_data do
:plain
content_type: #{@content_type.persisted? ? @content_type.to_json : 'null'},
inverse_of_list: #{options_for_content_type_inverse_of.to_json}
content_type: #{j @content_type.persisted? ? @content_type.to_json.html_safe : 'null'},
inverse_of_list: #{j options_for_content_type_inverse_of.to_json.html_safe}
= f.inputs :name => :information do

View File

@ -4,7 +4,7 @@
- content_for :backbone_view_data do
:plain
site: #{@site.to_json(:current_account => current_locomotive_account, :current_site => current_site)},
site: #{j @site.to_json(:current_account => current_locomotive_account, :current_site => current_site).html_safe},
errors: #{@site.errors.to_json}
= f.inputs :name => :information do

View File

@ -38,4 +38,4 @@
- content_for :backbone_view_data do
:plain
, all_#{name}_entries: #{target_content_type.list_or_group_entries.to_json(:depth => 1)}
, all_#{name}_entries: #{j target_content_type.list_or_group_entries.to_json(:depth => 1).html_safe}

View File

@ -2,7 +2,7 @@
- content_for :backbone_view_data do
:plain
account: #{@account.to_json}
account: #{j @account.to_json.html_safe}
- content_for :submenu do
= render_cell 'locomotive/settings_menu', :show

View File

@ -5,7 +5,7 @@
- content_for :backbone_view_data do
:plain
page: #{@page.to_presenter.as_json_for_html_view.to_json}
page: #{j @page.to_presenter.as_json_for_html_view.to_json.html_safe}
- if can?(:manage, @page)
@ -16,7 +16,7 @@
- if not @page.index? and not @page.not_found?
= f.input :parent_id, :as => :select, :collection => parent_pages_options, :include_blank => false
= f.input :slug, :required => false, :hint => @page.slug.blank? ? t('.empty_slug') : public_page_url(@page), :input_html => { :'data-url' => get_path_pages_url, :disabled => @page.index? || @page.not_found? }, :class => 'em-inline-hints'
= f.input :slug, :required => false, :hint => @page.slug.blank? ? t('.empty_slug') : public_page_url(@page), :input_html => { :'data-url' => get_path_pages_url, :disabled => @page.index? || @page.not_found? }, :wrapper_html => { :style => "#{'display: none' if @page.templatized? && !@page.templatized_from_parent?};", :class => 'em-inline-hints' }
= f.inputs :name => :seo, :class => "inputs foldable #{'folded' if inputs_folded?(@page)}" do
@ -34,13 +34,15 @@
= f.input :response_type, :as => :select, :collection => options_for_page_response_type, :include_blank => false
= f.input :wildcard, :as => :'Locomotive::Toggle', :style => "#{'display: none' if @page.redirect?}"
= f.input :templatized, :as => :'Locomotive::Toggle', :style => "#{'display: none' if @page.redirect? || @page.templatized_from_parent?}"
= f.input :target_klass_name, :as => :select, :collection => options_for_target_klass_name, :include_blank => false, :wrapper_html => { :style => "#{'display: none' if !@page.templatized? || @page.templatized_from_parent?}" }
= f.input :published, :as => :'Locomotive::Toggle'
= f.input :listed, :as => :'Locomotive::Toggle', :wrapper_html => { :style => "#{'display: none' if @page.has_wildcards?}" }
= f.input :listed, :as => :'Locomotive::Toggle'
= f.input :redirect, :as => :'Locomotive::Toggle', :wrapper_html => { :style => "#{'display: none' if !@page.default_response_type? || @page.has_wildcards?}" }
= f.input :redirect, :as => :'Locomotive::Toggle', :wrapper_html => { :style => "#{'display: none' if @page.templatized? || !@page.default_response_type?}" }
= f.input :cache_strategy, :as => :select, :collection => options_for_page_cache_strategy, :include_blank => false, :wrapper_html => { :style => "#{'display: none' if @page.redirect?}" }

View File

@ -3,7 +3,7 @@
%li{ :id => "item-#{page.id}", :class => "page #{css_for_page(page)}" }
- children = page.children
- children = can?(:manage, page) ? page.children : page.children.find_all { |p| !p.templatized? }
- with_children = !children.empty?

View File

@ -20,8 +20,8 @@
window.content_locale = '#{::Mongoid::Fields::I18n.locale}';
Locomotive.mounted_on = '#{Locomotive.mounted_on}';
Locomotive.current_site = new Locomotive.Models.Site(#{current_site.to_json});
Locomotive.current_account = new Locomotive.Models.Account(#{current_locomotive_account.to_json});
Locomotive.current_site = new Locomotive.Models.Site(#{j current_site.to_json.html_safe});
Locomotive.current_account = new Locomotive.Models.Account(#{j current_locomotive_account.to_json.html_safe});
$(document).ready(function() {

View File

@ -8,11 +8,17 @@ xml.urlset "xmlns" => "http://www.sitemaps.org/schemas/sitemap/0.9" do
@pages.each do |page|
if not page.index_or_not_found?
if page.wildcard?
# FIXME (Didier L.) unable for now to generate all the pages
if page.templatized?
page.content_type.entries.visible.each do |c|
xml.url do
xml.loc page_url(page, { :content => c })
xml.lastmod c.updated_at.to_date.to_s('%Y-%m-%d')
xml.priority 0.9
end
end
else
xml.url do
xml.loc page_url(page, { :host => true })
xml.loc page_url(page)
xml.lastmod page.updated_at.to_date.to_s('%Y-%m-%d')
xml.priority 0.9
end

View File

@ -9,6 +9,6 @@
.span-12.last
%p
= submit_tag button_label.is_a?(Symbol) ? t(".#{button_label}") : button_label, :disable_with => t('.disable_with'), :'data-sending-form-message' => t('locomotive.messages.sending_form')
= submit_tag button_label.is_a?(Symbol) ? t(".#{button_label}") : button_label, :'data-disable-with' => t('.disable_with'), :'data-sending-form-message' => t('locomotive.messages.sending_form')
.clear

View File

@ -19,8 +19,8 @@
window.locale = '#{I18n.locale}';
window.content_locale = '#{::Mongoid::Fields::I18n.locale}';
Locomotive.current_site = new Locomotive.Models.Site(#{current_site.to_presenter.as_json_for_html_view.to_json});
Locomotive.current_account = new Locomotive.Models.Account(#{current_locomotive_account.to_json});
Locomotive.current_site = new Locomotive.Models.Site(#{j current_site.to_presenter.as_json_for_html_view.to_json.html_safe});
Locomotive.current_account = new Locomotive.Models.Account(#{j current_locomotive_account.to_json.html_safe});
$(document).ready(function() {

View File

@ -3,7 +3,7 @@
- content_for :backbone_view_data do
:plain
snippet: #{@snippet.persisted? ? @snippet.to_presenter.as_json_for_html_view.to_json : 'null'}
snippet: #{j @snippet.persisted? ? @snippet.to_presenter.as_json_for_html_view.to_json.html_safe : 'null'}
= f.inputs :name => :information do
= f.input :name, :wrapper_html => { :class => 'highlighted' }

View File

@ -3,7 +3,7 @@
- content_for :backbone_view_data do
:plain
theme_asset: #{@theme_asset.persisted? ? @theme_asset.to_json : 'null'}
theme_asset: #{j @theme_asset.persisted? ? @theme_asset.to_json.html_safe : 'null'}
= f.hidden_field :performing_plain_text

View File

@ -16,11 +16,11 @@
- content_for :backbone_view_data do
:plain
snippets: #{can?(:manage, Locomotive::Snippet) ? @snippets.map { |snippet| snippet.to_presenter.as_json_for_html_view }.to_json : 'null'},
images: #{theme_assets_to_json(@assets[:images])},
media: #{theme_assets_to_json(@assets[:media])},
js_and_css_assets: #{can?(:manage, Locomotive::ThemeAsset) ? theme_assets_to_json(@js_and_css_assets) : 'null'},
fonts: #{can?(:manage, Locomotive::ThemeAsset) ? theme_assets_to_json(@assets[:fonts]) : 'null'}
snippets: #{j can?(:manage, Locomotive::Snippet) ? @snippets.map { |snippet| snippet.to_presenter.as_json_for_html_view }.to_json.html_safe : 'null'},
images: #{j theme_assets_to_json(@assets[:images]).html_safe},
media: #{j theme_assets_to_json(@assets[:media]).html_safe},
js_and_css_assets: #{j can?(:manage, Locomotive::ThemeAsset) ? theme_assets_to_json(@js_and_css_assets).html_safe : 'null'},
fonts: #{j can?(:manage, Locomotive::ThemeAsset) ? theme_assets_to_json(@assets[:fonts]).html_safe : 'null'}
- content_for :submenu do
= render_cell 'locomotive/settings_menu', :show

View File

@ -1,5 +1,26 @@
de:
locomotive:
errors:
"500":
title: Anwendungs-Fehler
notice: "Entschuldigung, irgendetwas ist hier schief gelaufen."
link: "&rarr; Zurück zur Anwendung"
"404":
title: Seite nicht gefunden
notice: "Die angefragte Seite existiert nicht."
link: "&rarr; Zurück zur Anwendung"
locales:
en: Englisch
de: Deutsch
fr: Französisch
pt-BR: "Bras. Portugiesisch"
it: Italienisch
nl: Niederländisch
nb: Norwegisch
es: Spanisch
ru: Russisch
buttons:
login: Einloggen
send_password: Senden
@ -9,19 +30,9 @@ de:
delete: "Löschen"
close: "Schließen"
locales:
en: Englisch
de: Deutsch
fr: Französisch
pt-BR: "Bras. Portugiesisch"
it: Italienisch
nl: Niederländisch
"no": Norwegisch
es: Spanisch
ru: Russisch
messages:
confirm: Sind Sie sicher ?
sending_form: "Formular wird gesendet"
shared:
header:
@ -39,8 +50,10 @@ de:
account: Mein Zugang
site: Webseite
theme_assets: Dateien
list:
untranslated: "Nicht übersetzt"
form:
change_file: Ändern
change_file: ändern
delete_file: Löschen
cancel: Abbrechen
form_actions:
@ -48,24 +61,14 @@ de:
create: Neu
update: Speichern
send: Senden
disable_with: "locomotive.disable_with.form_actions"
disable_with: "Transfer..."
footer:
who_is_behind: "Dienst entwickelt von %{development} und entworfen von <a href=\"http://www.sachagreif.com\">Sacha Greif</a> &mdash; <small>version</small> %{version}"
errors:
"500":
title: Anwendungs-Fehler
notice: "Entschuldigung, irgendetwas ist hier schief gelaufen."
link: "&rarr; Zurück zur Anwendung"
"404":
title: Seite nicht gefunden
notice: "Die angefragte Seite existiert nicht."
link: "&rarr; Zurück zur Anwendung"
who_is_behind: "LocomitveCMS - entwickelt von %{development} und entworfen von <a href=\"http://www.sachagreif.com\">Sacha Greif</a> &mdash; <small>version</small> %{version}"
notifications:
new_content_entry:
subject: "[%{type}] neu"
title: "Hi %{name}, nur damit Sie Bescheid wissen! Am %{date} wurde folgende neue Instanz erstellt."
title: "Hi %{name}, nur damit Sie Bescheid wissen, am %{date} wurde eine neue Instanz erstellt."
type: "Model: %{type}"
sites_picker:
@ -157,16 +160,16 @@ de:
sites:
new:
title: Neuer Webseite
help: "Fülle das folgende Formular aus, um einen neuen Webseiteen zu erstellen."
title: Neue Webseite
help: "Füllen Sie das folgende Formular aus, um eine neue Webseite zu erstellen."
domains:
empty: "Bisher sind keine Domains/Hostnamen an diese Seite gebunden. Wenn Sie unten Domains/Hostnamen angeben, achten Sie bitte darauf <b>Ihren DNS Server zu prüfen/aktualisieren.</b>"
current_site:
edit:
new_membership: Account hinzufügen
help: "Der Name des Webseiteen kann durch einen Klick auf den Namen bearbeitet werden."
ask_for_name: "Bitte geben Sie den neuen Namen der Webseite an"
help: "Der Name der Webseiten kann durch einen Klick auf den Namen bearbeitet werden."
ask_for_name: "Bitte geben Sie den neuen Namen der Webseite ein"
memberships:
roles:
@ -195,10 +198,11 @@ de:
new: neue Datei
snippets: Snippets
css_and_js: Style und Javascript
fonts: Fonts
images: Bilder
media: Medien
fonts: Fonts
no_items: "Momentan gibt es keine Dateien. Klicken Sie einfach <a href='%{url}'>hier</a>, um die erste Datei zu erstellen."
quick_upload: Schneller Upload
asset:
updated_at: Aktualisiert am
new:
@ -292,12 +296,14 @@ de:
default_site_locale: Sprachauswahl
default_site_locales_hints: Sie können später weitere Sprachen im Einstellungsdialog vornehmen.
next: Webseite erstellen
back_to_default_template: "Klicken Sie <a href='#'>hier</a> um die Standardeinstellungen wieder herzustellen"
public:
pages:
show_toolbar:
statuses:
loading: "Lade...."
loading: "Laden..."
disabled: "Inline Editor deaktiviert"
labels:
save_changes: "Änderungen speichern: "

View File

@ -16,7 +16,7 @@ en:
pt-BR: "Brazilian Portuguese"
it: Italian
nl: Dutch
"no": Norwegian
nb: Norwegian
es: Spanish
ru: Russian

View File

@ -20,6 +20,7 @@ es:
messages:
confirm: Por favor confirme
sending_form: "locomotive.messages.sending_form"
shared:
header:
@ -165,7 +166,7 @@ es:
pt-BR: "Portugués (Brasil)"
it: Italiano
nl: holandés
"no": Noruego
nb: Noruego
es: Español
ru: Ruso
ask_for_name: "Por favor escriba su nuevo nombre"

View File

@ -17,7 +17,7 @@ fr:
pt-BR: "Portugais"
it: "Italien"
nl: "Hollandais"
"no": "Norvégien"
nb: "Norvégien"
es: Espagnol
ru: Russe

View File

@ -10,6 +10,7 @@ it:
messages:
confirm: Sicuro?
sending_form: "locomotive.messages.sending_form"
shared:
header:
@ -165,7 +166,7 @@ it:
pt-BR: "Portoghese Brasiliano"
it: Italiano
nl: Olandese
"no": Norvegese
nb: Norvegese
es: Spagnolo
ru: Russo
ask_for_name: "Prego, digita il tuo nome"

View File

@ -1,4 +1,4 @@
"no":
nb:
locomotive:
buttons:
login: Logg inn
@ -6,10 +6,23 @@
change_password: Endre
new_item: "+ ny"
switch_to_site: Vis
delete: "Slett"
delete: Slett
close: Lukk
locales:
en: Engelsk
de: Tysk
fr: Fransk
pt-BR: "Brazilian Portuguese"
it: Italiensk
nl: Nederlandsk
nb: Norsk
es: Spansk
ru: Russisk
messages:
confirm: Er du sikker?
sending_form: Skjemaet blir sendt
shared:
header:
@ -27,14 +40,20 @@
account: Min konto
site: Siden
theme_assets: Temafiler
footer:
who_is_behind: "Tjenesten utviklet av %{development} og designet av <a href=\"http://www.sachagreif.com\">Sacha Greif</a>"
form:
change_file: Endre
delete_file: Slett
cancel: Avbryt
form_actions:
back: Tilbake uten å lagre
create: Opprett
update: Lagre
send: Send
disable_with: "locomotive.disable_with.form_actions"
disable_with: "Vent litt.."
list:
untranslated: ikke oversatt
footer:
who_is_behind: "LocomotiveCMS er utviklet av %{development} og designet av <a href=\"http://www.sachagreif.com\">Sacha Greif</a> &mdash; <small>versjon</small> %{version}"
errors:
"500":
@ -66,9 +85,16 @@
delete_file: Slett fil
has_many:
empty: Tom
index:
is_required: er nødvendig
new_entry: + Legg til ny
many_to_many:
empty: Listen er tom. Legg til ny fra listen nedenfor.
form:
required: Nødvendig
optional: Valgfri
default_label: Feltnavn
select_options:
ask_name: "Skriv inn etiketten for dette valget"
sessions:
new:
@ -105,7 +131,9 @@
help: "Tittelen til siden kan oppdateres ved å klikke på den. For å lagre endringene, klikk på \"Lagre\" -knappen."
ask_for_title: "Endre tittelen"
form:
delete_file: Slett fil
change_file: endre
delete_file: slett fil
cancel: avbryt
default_block: Standard
cache_strategy:
none: Ingen
@ -134,14 +162,14 @@
new:
title: Ny nettside
help: "Fyll ut skjemaet nedenfor for å opprette en ny nettside."
domains:
empty: "Det er ingen domener tilknyttet denne siden ennå. Legg til domenene dine nedenfor. <b>Ikke glem å oppdatere DNS-pekerene.</b>"
current_site:
edit:
export: eksporter
import: importer
new_membership: nytt medlemskap
new_membership: legg til konto
help: "Navnet på siden kan oppdateres ved å trykke på det. For å lagre endringen, trykk på \"Lagre\" -knappen."
ask_for_name: "Rediger navnet"
ask_for_name: "Skriv inn det nye navnet"
memberships:
roles:
@ -161,21 +189,13 @@
edit:
help: "Navnet ditt kan endres ved å trykke på det. For å lagre endringen, trykk på \"Lagre\" -knappen."
new_site: ny nettside
en: Engelsk
de: Tysk
fr: Fransk
pt-BR: "Brasiliansk Portugisisk"
it: Italiensk
nl: Nederlandsk
"no": Norsk
es: Spansk
ru: Russisk
ask_for_name: "Rediger navnet ditt"
theme_assets:
index:
title: Temafiler
help: "I denne seksjonen kan du håndtere alle layout-relaterte filer. Hvis du trenger et bildegalleri så opprett en ny innholdstype i stedet.<br/><b>Advarsel:</b> hvis det er enkelte filer du ikke ser så kan dette skyldes manglende rettigheter."
quick_upload: Hurtigopplasting
new: ny fil
snippets: HTML-snutter
css_and_js: Stilark og javascript
@ -198,29 +218,29 @@
picker_link: Sett inn en fil i koden
choose_file: Velg fil
choose_plain_text: Velg klartekst
images:
title: Bilder
no_items: "Det er ingen filer her ennå."
image_picker:
title: "Sett inn bilde"
no_items: "Det finnes ingen bilder foreløpig."
upload: "Last opp bilder"
assets:
new:
title: New asset
help: "Fill in the form below to create your asset."
edit:
title: Edit asset
help: "Fill in the form below to update your asset."
content_assets:
picker:
title: "Sett inn media"
no_items: "Det finnes ingen media foreløpig."
upload: "Last opp media"
content_types:
index:
new: Ny modell
edit: Rediger modell
new:
title: Ny modell
help: "Lag din egen datamodell (Prosjekter, Ansatte, ...etc). Modellen må ha minst ett felt. Det første feltet vil være obligatorisk for elementer som opprettes av denne innholdstypen."
edit:
title: Rediger modellen
title: Redigerer modell
help: "Modellen må ha minst ett felt. Det første feltet vil være obligatorisk for elementer som opprettes av denne innholdstypen."
show_items: vis elementer
new_item: nytt element
show_entries: vis elementer
new_entry: nytt element
form:
order_by:
created_at: 'Etter dato opprettet'
@ -241,7 +261,7 @@
latest_entries: "Siste elementer"
updated_at: "Sist oppdatert"
list:
no_entries: "Det har ikke blitt opprettet noen elementer her ennå. Klikk <a href=\"%{url}\">her</a> for å opprette det første."
no_entries: "Det finnes ingen elementer her ennå. Klikk <a href=\"%{url}\">her</a> for å opprette det første."
new:
title: '%{type} &mdash; nytt element'
edit:
@ -258,25 +278,6 @@
title: Cross-domain authentication
notice: Du blir sendt videre til nettsiden i løpet av noen få sekunder.
import:
new:
title: Importer en mal for siden
help: "Be careful when you upload a new template for your existing website, your current data could be modified or even removed."
help: "Vær forsiktig hvis du laster opp en ny mal til en ekisterende side. Dataene dine kan bli slettet eller endret."
show:
title: Import pågår
help: "Your site is being updated from the theme zip file you have just uploaded. It lasts a couple of seconds."
help: "Siden blir oppdatert fra temafilen som ble lastet opp. Dette vil ta noen sekunder."
steps:
site: Sideinformasjon
content_types: Tilpassede innholdstyper
assets: Temafiler
snippets: HTML-snutter
pages: Sider
messages:
success: "Importen var velykket og siden har blitt oppdatert."
failure: "Importen kunne ikke gjennomføres."
installation:
common:
title: Locomotive førstegangsoppsett
@ -292,5 +293,21 @@
step_2:
title: "Steg 2/2 &mdash; Lag din første nettside"
explanations: "Hvis du allerede har lastet opp standardmalen (se instruksjoner), så kan du bruke denne med en gang. Du kan også laste opp en sidemal som en zip-fil (gratis maler finnes <a href=\"http://www.locomotivecms.com/support/themes\">her</a>)."
back_to_default_template: "Trykk <a href='#'>her</a> for å velge standardmalen i stedet"
default_site_locale: Språk
default_site_locales_hints: Du kan legge til flere språk under Innstilinger senere
next: Opprett side
public:
pages:
show_toolbar:
statuses:
loading: "Vent litt...."
disabled: "Inline Editor disabled"
labels:
save_changes: "Lagre endringer: "
editing_mode: "Redigeringsmodus: "
lang: "Språk: "
buttons:
back: Tilbake til admin-siden
confirm: Bekreft
cancel: Avbryt

View File

@ -9,6 +9,7 @@ nl:
messages:
confirm: Weet u het zeker ?
sending_form: "locomotive.messages.sending_form"
shared:
header:
@ -153,7 +154,7 @@ nl:
pt-BR: "Braziliaans Portugees"
it: Italiaans
nl: Nederlands
"no": Noors
nb: Noors
ru: Russisch
ask_for_name: "Voer uw nieuwe naam in"

View File

@ -9,6 +9,7 @@ pt-BR:
messages:
confirm: Você tem certeza ?
sending_form: "locomotive.messages.sending_form"
shared:
header:
@ -151,7 +152,7 @@ pt-BR:
pt-BR: "Português do Brasil"
it: Italiano
nl: Holandês
"no": Norueguês
nb: Norueguês
es: Espanhol
ru: Russo
ask_for_name: "Por favor preencha o novo nome"

View File

@ -16,7 +16,7 @@ ru:
pt-BR: "Браз. - Португальский"
it: Итальянский
nl: Голландский
"no": Норвежский
nb: Норвежский
es: Испанский
ru: Русский

View File

@ -1,4 +1,4 @@
"no":
nb:
carrierwave:
errors:
integrity: 'er ikke en tillatt filtype.'

View File

@ -34,10 +34,13 @@ de:
array_too_short: "ist zu kurz (minimale Element-Zahl ist %{count})"
liquid_syntax: "Liquid Syntax-Fehler, bitte überprüfe die Syntax ('%{error}')"
invalid_theme_file: "darf nicht leer sein oder ist keine zip-Datei"
security: "stellt ein Sicherheitproblem dar"
site:
default_locale_removed: Die vorige Standard-Spracheinstellung kann noch nicht gelöscht werden
page:
liquid_syntax: "Liquid Syntax-Fehler, bitte überprüfe die Syntax ('%{error}'/'%{fullpath}')"
liquid_extend: "Die Seite '%{fullpath}' verwendet eine Vorlage, die gar nicht existiert"
liquid_translation: "Die Seite '%{fullpath}' erweitert eine Vorlage die noch nicht übersetzt wurde"
attributes:
defaults:
@ -52,17 +55,24 @@ de:
body: "{% extends 'parent' %}"
mongoid:
errors:
messages:
blank_on_locale: "darf nicht leer sein"
attributes:
page:
title: Titel
parent: Parent
parent: Elternprozess
pared_id: Elternprozess
slug: Slug
wildcard: Wildcard
published: Veröffentlicht
listed: Im Menü
templatized: Templatized
published: Veröffentlicht
redirect: Umleitung
redirect_url: Umleitungs-URL
cache_strategy: Cache
response_type: Antworttyp
seo_title: SEO-Titel
content_type:
name: Name
description: Beschreibung

View File

@ -3,6 +3,11 @@ en:
formats:
default: "%m/%d/%Y"
mongoid:
errors:
messages:
blank_on_locale: "can't be blank"
errors:
messages:
domain_taken: "%{value} is already taken"

View File

@ -58,7 +58,7 @@ es:
parent_id: Padre
slug: Enlace
listed: Menu
wildcard: Wildcard
templatized: Templatizada
published: Publicada
redirect: Redirección
redirect_url: Url de redirección

View File

@ -53,6 +53,10 @@ fr:
body: "{% extends 'parent' %}"
mongoid:
errors:
messages:
blank_on_locale: "doit être rempli(e)"
attributes:
locomotive/page:
title: Titre
@ -60,7 +64,7 @@ fr:
parent_id: Dossier parent
slug: Raccourci
listed: Menu
wildcard: Wildcard
templatized: Templatisée
published: Publiée
redirect: Redirection
redirect_url: Url de redirection

View File

@ -64,7 +64,7 @@ it:
parent_id: Pagina superiore
slug: Slug
listed: In menù
wildcard: Wildcard
templatized: Templatized
published: Pubblicata
redirect: Redirezione
redirect_url: Url di redirezione

View File

@ -1,4 +1,46 @@
"no":
nb:
date:
formats:
default: "%d.%m.%Y"
mongoid:
errors:
messages:
blank_on_locale: "må fylles ut"
errors:
messages:
domain_taken: "%{value} er alerede tatt"
invalid_domain: "%{value} er ugyldig"
needs_admin_account: "Det må være minst en admin-konto"
protected_page: "Du kan ikke fjerne index eller 404 sidene"
extname_changed: "Den nye filen har ikke det opprinnelige filetternavnet"
array_too_short: "er for liten (minimum elementnummer er %{count})"
invalid_theme_file: "må være en zip-fil"
site:
default_locale_removed: Forrige standardspråk kan ikke fjernes før nytt er valgt.
page:
liquid_syntax: "Liquid Syntax error ('%{error}' on '%{fullpath}')"
liquid_extend: "The page '%{fullpath}' extends a template which does not exist"
liquid_translation: "The page '%{fullpath}' extends a template which is not translated"
too_few_custom_fields: "At least, one custom field is required"
security: "presents a security problem"
attributes:
defaults:
pages:
index:
title: "Startside"
body: "Startsidens innholds"
"404":
title: "Siden finnes ikke"
body: "Sidens innhold"
other:
body: "{% extends 'parent' %}"
pagination:
previous: "&laquo; Previous"
next: "Next &raquo;"
support:
array:
words_connector: ", "
@ -221,7 +263,7 @@
parent: Tilhører
parent_id: Tilhører
slug: Slug
wildcard: Wildcard
templatized: Templatized
published: Publisert
listed: I meny
redirect: Videresending

View File

@ -60,7 +60,7 @@ pt-BR:
title: Título
parent: Pai
slug: Slug
wildcard: Wildcard
templatized: Template
published: Publicado
cache_strategy: Cache
content_type:

View File

@ -35,7 +35,7 @@ ru:
title: Имя
parent: Родитель
slug: Ссылка
wildcard: Wildcard
templatized: Шаблонизирована
published: Опубликована
listed: Меню
redirect: Перенаправлена

View File

@ -1,4 +1,4 @@
"no":
nb:
errors:
messages:
not_found: "finnes ikke"
@ -7,7 +7,7 @@
devise:
failure:
locomotive:
locomotive_account:
unauthenticated: 'Du må logge inn eller registrere deg før du kan fortsette.'
unconfirmed: 'Kontoen må aktiveres før du kan fortsette.'
locked: 'Brukerkontoen er sperret.'
@ -17,34 +17,34 @@
timeout: 'Innloggingen har utløpt. Logg inn på nytt for å fortsette.'
inactive: 'Kontoen din er ikke aktivert ennå.'
sessions:
locomotive:
locomotive_account:
signed_in: 'Du er nå logget inn.'
signed_out: 'Du har blitt logget ut.'
passwords:
locomotive:
locomotive_account:
send_instructions: 'Du vil motta en epost med instruksjoner for hvordan du kan tilbakestille passordet i løpet av kort tid.'
updated: 'Passordendringen var vellykket. Du er nå logget inn.'
confirmations:
locomotive:
locomotive_account:
send_instructions: 'Du vil motta en epost med instrusksjoner for hvordan brukerkontoen aktiveres i løpet av kort tid.'
confirmed: 'Aktiveringen av brukerkontoen var vellykket. Du er nå logget inn.'
registrations:
locomotive:
locomotive_account:
signed_up: 'Registreringen var vellykket.'
updated: 'Oppdateringen av kontoen var vellykket'
destroyed: 'Kontoen din har blitt kansellert. Vi håper å se deg igjen en annen gang.'
unlocks:
locomotive:
locomotive_account:
send_instructions: 'Du vil motta en epost med instruksjoner for hvordan du kan åpne kontoen i løpet av kort tid.'
unlocked: 'Kontoen har blitt åpnet og du er nå logget inn.'
mailer:
locomotive:
locomotive_account:
confirmation_instructions: 'Bekreftelsesinstrukser'
reset_password_instructions: 'Instrukser for tilbakestilling av passord'
unlock_instructions: 'Instrukser for åpning'
locomotive:
locomotive_account:
mailer:
common:
hello: Hallo

View File

@ -1,4 +1,4 @@
"no":
nb:
flash:
locomotive:
pages:

View File

@ -55,7 +55,9 @@ de:
page:
published: "Nur authentifizierte Accounts können nicht publizierte Seiten ansehen."
cache_strategy: "Cache die Seiten, um eine bessere Geschwindigkeit zu erzielen. Die 'Einfach' Option ist ein guter Kompromiss."
templatized: "Nutze diese Seite als Vorlage für einen Baustein, den du erstellt hast."
listed: "Regele, ob die Seite in den generierten Menüs angezeigt werden soll."
content_type_id: "Der Baustein für den diese Seite als Vorlage dienen soll."
seo_title: "Wähle einen Titel für den 'title' Tag im Seiten Header. Lass es leer, wenn der Seitentitel verwendet werden soll."
meta_keywords: "Meta-Schlagworte, die im HEAD-Bereich der Webseite genutzt werden. Die einzelnen Wörter werden durch eine Leertaste getrennt. Diese werden für die Suchmaschinen benötigt."
meta_description: "Meta-Beschreibung, die im HEAD-Bereich der Webseite genutzt wird. Diese wird für die Suchmaschinen benötigt."

View File

@ -57,8 +57,9 @@ en:
handle: "Unique identifier to retrieve this page within an external controller instance"
published: "Only authenticated accounts can view unpublished pages."
cache_strategy: "Cache the page for better performance. The 'Simple' choice is a good compromise."
wildcard: "Make the page have a wildcard segment in its path. Then the slug will be used as the name of the wildcard in the template"
templatized: "Use the page as a template for a model you defined."
listed: "Control whether to show the page from generated menus."
target_klass_name: "The type of content this page will be a template for."
seo_title: "Define a page title which should be used as the value for the title tag in the head section. Leave it empty if you want to use the default value from the site settings."
meta_keywords: "Overrides the site's meta keywords used within the head tag of the page. They are separated by a comma."
meta_description: "Overrides the site's meta description used within the head tag of the page."
@ -83,7 +84,7 @@ en:
source: "The current file is available here %{url}"
content_entry:
_slug: "Property used to generate the url of a page working as a template for this content type (ex: \"template_page/{{ your_object._permalink }})\"."
seo_title: "The value you fill in can be used to replace the SEO title in any pages."
seo_title: "The value you fill in will replace the SEO title of the templatized page related to your model."
meta_keywords: "Overrides the site's meta keywords used within the head tag of the page. They are separated by a comma."
meta_description: "Overrides the site's meta description used within the head tag of the page."
import:

View File

@ -49,7 +49,9 @@ es:
page:
published: "Las páginas no publicadas son únicamente visibles tras iniciar sesión."
cache_strategy: "Utilizar una caché de página para un mejor rendimiento. La opción 'Simple' es un buen compromiso."
templatized: "Usar la página como plantilla de un modelo."
listed: "Controla si la página se enseña o no en los menús."
content_type_id: "El modelo del cual será una plantilla esta página."
meta_keywords: "Reescribir las palabras clave SEO utilizadas en la cabecera de la página. Deben estar separadas por comas."
meta_description: "Reescribir la metadescripción que se utiliza en la cabecera de la página."
snippet:

View File

@ -53,8 +53,9 @@ fr:
page:
published: "Seuls les administrateurs authentifiés peuvent voir une page non publiée."
cache_strategy: "Cache la page pour de meilleure performance. L'option 'Simple' est le meilleur compromis."
wildcard: "Détermine si la page aura la dernière partie de son URL dynamique. Si oui, le slug sera utilisé comme nom du segment dans le template."
templatized: "Utilise la page comme un template pour un modèle défini."
listed: "Controle si la page doit être visible depuis les menus automatiquement générés."
target_klass_name: "Le type du contenu pour lequel cette page est un template."
seo_title: "Définit un titre de page à mettre dans la balise TITLE de la page. Laissez le blanc pour utiliser la valeur par défaut (voir configuration du site)."
meta_keywords: "Redéfinit les mots-clés du site. Utilisés à l'intérieur de la balise HEAD. Ils sont séparés par une virgule."
meta_description: "Redéfinit la description du site. Utilisée à l'intérieur de la balise HEAD."

View File

@ -55,7 +55,9 @@ it:
page:
published: "Solo gli account autenticati possono visualizzare le pagine non pubblicate."
cache_strategy: "Attiva il cache della pagina per miglirare le prestazioni. L'opzione 'Semplice' è un buon compromesso."
templatized: "Utilizzare la pagina come template per un modello che hai definito."
listed: "Determina se la pagina deve essere mostrata nei menù generati."
content_type_id: "Il tipo di contenuto di cui questa pagina sarà il template."
seo_title: "Definisce il titolo della pagina inserito nel tag title della sezione head. Lascia vuoto se vuoi che venga utilizzato il titolo definito per il sito."
meta_keywords: "Sovrascrive per questa pagina le meta keywords definite per il sito all'interno del tag head della pagina. Sono separate da virgola."
meta_description: "Sovrascrive per questa pagina la meta description definita per il sito."

View File

@ -1,4 +1,4 @@
"no":
nb:
formtastic:
titles:
information: Generell informasjon
@ -33,35 +33,40 @@
custom_fields:
field:
name: Alias
import:
new:
source: Fil
samples: Kopier testdata
reset: Reset side
default_site_template: "Bruk standardmalen. Klikk <a href='#'>her</a> for å laste opp en mal fra en zip-fil i stedet."
content_type:
item_template: Elementmal
api_accounts: Varslede kontoer
raw_item_template: Elementmal
public_submission_enabled: Kan opprettes utenfra
public_submission_accounts: Kontoer som varsles
"custom_fields/field":
select_options: "Valg"
content_entry:
_slug: Permalink
account:
edit:
locale: Språk
password: Nytt passord
password_confirmation: Bekreft nytt passord
page:
seo_title: Tittel
target_klass_name: Modell
site:
locales: Språk
hints:
page:
handle: "En unik ID for å hente siden fra en ekstern controller"
published: "Kun autoriserte kontoer kan se ikke-publiserte sider"
cache_strategy: "Buffre siden for å bedre ytelsen. \"Enkel\" er et bra kompromiss."
templatized: "Bruk denne siden som mal for en modell."
listed: "Styr om siden skal vises i de genererte menyene."
target_klass_name: "Innholdstypen denne siden skal være mal for."
seo_title: "Definer en egen tittel for siden. Denne blir benyttet av nettleseren. Hvis denne står tom blir standardverdien fra sideinnstillingene benyttet."
meta_keywords: "Overstyr søkemotor-metadata for denne siden. Separer med komma."
meta_description: "Overstyr søkemotorbeskrivelsen for denne siden."
snippet:
slug: "Denne brukes for å inkludere HTML-snutten i en side."
site:
locales: "Dra et flagg til første posisjon for å sette som standard."
seo_title: "Definer en global verdi her som brukes som verdi for titteltaggen i sidens head-seksjon."
meta_keywords: "Meta-nøkkelord blir brukt i head-seksjonen og leses av søkemotorer. Separeres med komma."
meta_description: "Meta-beskrivelse brukes i head-seksjonen og leses av søkemotorer."
@ -77,10 +82,6 @@
source: "Filen er tilgjengelig her: %{url}"
update:
source: "Filen er tilgjengelig her: %{url}"
custom_fields:
field:
name: "Verdi tilgjengelig i liquid-maler"
hint: "Tekst som vises i skjemaet rett under feltet"
content_entry:
_slug: "Verdien brukes til å generere en url for en side som fungerer som en mal for denne innholdstypen (f.eks: \"template_page/{{ your_object._permalink }})\"."
seo_title: "Verdien benyttes til å erstatte sidetittelen for malen knyttet til modellen. Leses av søkemotorer."
@ -91,7 +92,12 @@
samples: "Vil gjøre at importen kopierer innhold og assets"
reset: "Vil gjøre at alle data slettes for den nye siden importeres."
content_type:
item_template: "Du kan justere teksten som vises for hvert element i listen. Bruk liquid, f.eks: {{ entry.name }}"
api_enabled: "Brukes for å la sidebrukere opprette ny elementer (f.eks: meldinger i et kontaktskjema)"
api_accounts: "En varslingsepost vil bli sendt til alle kontoene ovenfor når et nytt element blir opprettet."
name: "Vi foreslår at du bruker flertals form (E.G: Personer)"
slug: "It will be used as the name of the collection in the liquid templates. Ex: <span class='code'>{{ contents.my_projects }}</span>"
raw_item_template: "You can customize the text displayed for each item in the list. Simply use Liquid. Ex: <span class='code'>{{ entry.name }})</span>"
public_submission_enabled: "It is used to let people from outside to create new entries (example: messages in a contact form)"
public_submission_accounts: "If the public submission option is enabled and for each entry created, sends a notification email to the accounts listed above."
"custom_fields/field":
name: "Name of the property for liquid templates. Ex: <span class='code'>&#123;&#123; your_object.&lt;name_of_your_field&gt; &#125;&#125;</span>"
hint: "Text displayed in the model form just below the field"

View File

@ -49,7 +49,9 @@ nl:
page:
published: "Alleen geauthenticeerde accounts kunnen niet gepubliceerde pagina's zien."
cache_strategy: "Cache de pagina voor betere prestaties. De 'Simpele' keus is een goed compromis."
templatized: "Gebruik de pagina als template voor een door u gedefinieerd model."
listed: "Controleer of de pagina getoond wordt van de gegenereerde menu's."
content_type_id: "Het type inhoud waar deze pagina als template voor dient"
meta_keywords: "Overschrijft de meta keywords van de website in de head tag van deze pagina. Gescheiden door een komma"
meta_description: "Overschrijft de meta description van de website in de head tag van deze pagina."
snippet:

View File

@ -46,6 +46,7 @@ pt-BR:
page:
published: "Apenas contas autenticadas podem ver páginas não publicadas."
cache_strategy: 'Faça o Cache da página para obter melhor desempenho. A escolha do "Simples" é um bom compromisso'
templatized: "Utilize a página como template para o modelo definido."
snippet:
slug: "Você precisa saber a ordem para inserir fragmentos dentro da página."
site:

View File

@ -57,7 +57,9 @@ ru:
handle: "Уникальный идентификатор для поиска этой страницы из экземпляра внешнего rails-контроллера"
published: "Только аутентифицированным пользователям разрешается просматривать неопубликованные страницы."
cache_strategy: "Кэшировать страницу для лучшей производительности. Вариант 'Простое' является хорошим компромиссом."
templatized: "Используйте страницу в качестве шаблона для определенной вами модели."
listed: "Контролируйте возможность показа страницы из сгенерированных меню."
target_klass_name: "Тип контента (модели), для которого эта страница будет выступать в качестве шаблона."
seo_title: "Определите заголовок страницы, который будет использоваться как значение тэга title в секции head. Оставьте пустым, если вы хотите использовать значение по умолчанию из настроек сайта."
meta_keywords: "Переопределяет meta keywords сайта, используемые внутри тэга head страницы. Они разделены запятыми."
meta_description: "Переопределяет meta description сайта, используемые внутри тэга head страницы."

Some files were not shown because too many files have changed in this diff Show More