comfortable_mexican_sofa 1.8.0 → 1.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +1 -0
- data/README.md +8 -2
- data/app/assets/javascripts/comfortable_mexican_sofa/application.js.coffee +25 -15
- data/app/assets/stylesheets/comfortable_mexican_sofa/base.css.sass +3 -1
- data/app/controllers/cms_admin/files_controller.rb +49 -54
- data/app/views/cms_admin/files/_file.html.haml +0 -1
- data/app/views/cms_admin/files/_index.html.haml +4 -2
- data/app/views/cms_admin/files/destroy.js.coffee +2 -0
- data/app/views/cms_admin/pages/_form.html.haml +1 -1
- data/app/views/cms_admin/revisions/show.html.haml +1 -1
- data/app/views/cms_admin/sites/_form.html.haml +1 -1
- data/app/views/layouts/cms_admin/_body.html.haml +3 -1
- data/app/views/layouts/cms_admin/_footer.html.haml +1 -5
- data/app/views/layouts/cms_admin/_footer_js.html.haml +7 -0
- data/config/locales/de.yml +2 -0
- data/config/locales/en.yml +2 -0
- data/config/locales/es.yml +2 -0
- data/config/locales/fr.yml +99 -97
- data/config/locales/ja.yml +3 -1
- data/config/locales/pl.yml +2 -0
- data/config/locales/pt-BR.yml +2 -0
- data/config/locales/ru.yml +2 -0
- data/config/locales/sv.yml +2 -0
- data/config/locales/zh-CN.yml +2 -0
- data/lib/comfortable_mexican_sofa/version.rb +1 -1
- data/test/functional/cms_admin/files_controller_test.rb +41 -12
- data/test/functional/cms_admin/layouts_controller_test.rb +1 -1
- data/test/functional/cms_admin/pages_controller_test.rb +1 -1
- data/test/functional/cms_admin/snippets_controller_test.rb +1 -1
- metadata +4 -4
- data/app/views/cms_admin/files/create.js.erb +0 -3
- data/app/views/cms_admin/files/destroy.js.erb +0 -3
data/.gitignore
CHANGED
data/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
# ComfortableMexicanSofa (Rails 3 CMS Engine)
|
|
2
|
-
[](https://travis-ci.org/comfy/comfortable-mexican-sofa) [](https://gemnasium.com/comfy/comfortable-mexican-sofa) [](https://codeclimate.com/github/comfy/comfortable-mexican-sofa) [](https://coveralls.io/r/comfy/comfortable-mexican-sofa)
|
|
1
|
+
# ComfortableMexicanSofa (Rails 3 CMS Engine)
|
|
2
|
+
[](http://rubygems.org/gems/comfortable_mexican_sofa) [](https://travis-ci.org/comfy/comfortable-mexican-sofa) [](https://gemnasium.com/comfy/comfortable-mexican-sofa) [](https://codeclimate.com/github/comfy/comfortable-mexican-sofa) [](https://coveralls.io/r/comfy/comfortable-mexican-sofa)
|
|
3
3
|
|
|
4
4
|
ComfortableMexicanSofa is a powerful CMS Engine for your Rails 3 applications.
|
|
5
5
|
|
|
@@ -60,6 +60,12 @@ For more information please [see Wiki pages](https://github.com/comfy/comfortabl
|
|
|
60
60
|
|
|
61
61
|

|
|
62
62
|
|
|
63
|
+
Help and Contact
|
|
64
|
+
----------------
|
|
65
|
+
|
|
66
|
+
GoogleGroups: http://groups.google.com/group/comfortable-mexican-sofa
|
|
67
|
+
Twitter: [@GroceryBagHead](http://twitter.com/#!/GroceryBagHead)
|
|
68
|
+
|
|
63
69
|
---
|
|
64
70
|
|
|
65
71
|
ComfortableMexicanSofa is released under the [MIT license](https://github.com/comfy/comfortable-mexican-sofa/raw/master/LICENSE)
|
|
@@ -130,18 +130,28 @@ window.CMS.categories = ->
|
|
|
130
130
|
|
|
131
131
|
|
|
132
132
|
window.CMS.uploader = ->
|
|
133
|
-
|
|
134
|
-
$('
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
133
|
+
form = $('.file-uploader form')
|
|
134
|
+
iframe = $('iframe#file-upload-frame')
|
|
135
|
+
|
|
136
|
+
$('input[type=file]', form).change -> form.submit()
|
|
137
|
+
|
|
138
|
+
iframe.load -> upload_loaded()
|
|
139
|
+
|
|
140
|
+
upload_loaded = ->
|
|
141
|
+
i = iframe[0]
|
|
142
|
+
d = if i.contentDocument
|
|
143
|
+
i.contentDocument
|
|
144
|
+
else if i.contentWindow
|
|
145
|
+
i.contentWindow.document
|
|
146
|
+
else
|
|
147
|
+
i.document
|
|
148
|
+
|
|
149
|
+
if d.body.innerHTML
|
|
150
|
+
raw_string = d.body.innerHTML
|
|
151
|
+
json_string = raw_string.match(/\{(.|\n)*\}/)[0]
|
|
152
|
+
json = $.parseJSON(json_string)
|
|
153
|
+
files = $($('<div/>').html(json.view).text()).hide()
|
|
154
|
+
$('.uploaded-files').prepend(files)
|
|
155
|
+
files.map ->
|
|
156
|
+
$(this).fadeIn()
|
|
157
|
+
|
|
@@ -128,6 +128,8 @@ body#comfy
|
|
|
128
128
|
margin: 0
|
|
129
129
|
font-size: 11px
|
|
130
130
|
width: 100%
|
|
131
|
+
iframe#file-upload-frame
|
|
132
|
+
display: none
|
|
131
133
|
|
|
132
134
|
// -- Common Elements -----------------------------------------------------
|
|
133
135
|
table.table, ul.list
|
|
@@ -145,7 +147,7 @@ body#comfy
|
|
|
145
147
|
display: none
|
|
146
148
|
&:hover .dragger
|
|
147
149
|
display: block
|
|
148
|
-
.category
|
|
150
|
+
div.category
|
|
149
151
|
display: inline-block
|
|
150
152
|
vertical-align: top
|
|
151
153
|
font-size: 11px
|
|
@@ -2,73 +2,64 @@ class CmsAdmin::FilesController < CmsAdmin::BaseController
|
|
|
2
2
|
|
|
3
3
|
skip_before_filter :load_fixtures
|
|
4
4
|
|
|
5
|
-
before_filter :
|
|
5
|
+
before_filter :build_file, :only => [:new, :create]
|
|
6
|
+
before_filter :load_file, :only => [:edit, :update, :destroy]
|
|
6
7
|
|
|
7
8
|
def index
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
@files = @site.files.includes(:categories).for_category(params[:category]).order('cms_files.position')
|
|
10
|
+
|
|
11
|
+
if params[:ajax]
|
|
12
|
+
files = @files.images.collect do |file|
|
|
13
|
+
{ :thumb => file.file.url(:cms_thumb),
|
|
14
|
+
:image => file.file.url }
|
|
15
|
+
end
|
|
16
|
+
render :json => files
|
|
17
|
+
else
|
|
18
|
+
return redirect_to :action => :new if @site.files.count == 0
|
|
19
|
+
end
|
|
10
20
|
end
|
|
11
21
|
|
|
12
22
|
def new
|
|
13
|
-
|
|
23
|
+
render
|
|
14
24
|
end
|
|
15
25
|
|
|
16
26
|
def create
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
@file = @site.files.create!(file_params.merge(:label => label))
|
|
29
|
-
end
|
|
27
|
+
@files = []
|
|
28
|
+
|
|
29
|
+
# Sometimes params[:file] comes in as a single file object
|
|
30
|
+
unless params[:file].is_a?(Hash)
|
|
31
|
+
uploaded_file = params[:file]
|
|
32
|
+
params[:file] = { }
|
|
33
|
+
params[:file][:file] = [uploaded_file]
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
file_array = params[:file][:file] || [nil]
|
|
37
|
+
label = params[:file][:label]
|
|
30
38
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
# FIX: No idea why this cannot be simulated in the test
|
|
36
|
-
io = Rails.env.test??
|
|
37
|
-
request.env['RAW_POST_DATA'].clone :
|
|
38
|
-
request.env['rack.input'].clone
|
|
39
|
-
# Unfortunately, this ends up copying the data twice.
|
|
40
|
-
# Once from the stream to the tempfile here, and second, in
|
|
41
|
-
# the file to another tempfile down in PaperClip UploadFileAdapter..
|
|
42
|
-
file = Tempfile.new(request.env["HTTP_X_FILE_NAME"])
|
|
43
|
-
file.binmode
|
|
44
|
-
# FileUtils.copy_stream ends up throwing Conversion Errors from ASCII-8BIT to UTF-8
|
|
45
|
-
# FileUtils.copy_stream(io, file)
|
|
46
|
-
while data = io.read(16*1024)
|
|
47
|
-
file.write(data)
|
|
48
|
-
end
|
|
49
|
-
file.rewind
|
|
50
|
-
# We use a delegation class on the file returned
|
|
51
|
-
upload = ActionDispatch::Http::UploadedFile.new(
|
|
52
|
-
:filename => request.env['HTTP_X_FILE_NAME'],
|
|
53
|
-
:tempfile => file,
|
|
54
|
-
:type => request.env['CONTENT_TYPE'],
|
|
55
|
-
:head => request.headers # Not really needed
|
|
56
|
-
)
|
|
57
|
-
@file = @site.files.create!(
|
|
58
|
-
(params[:file] || { }).merge(:file => upload)
|
|
59
|
-
)
|
|
39
|
+
file_array.each_with_index do |file, i|
|
|
40
|
+
file_params = params[:file].merge(:file => file)
|
|
41
|
+
if file_array.size > 1 && file_params[:label].present?
|
|
42
|
+
label = file_params[:label] + " #{i + 1}"
|
|
60
43
|
end
|
|
44
|
+
@file = @site.files.create!(file_params.merge(:label => label))
|
|
45
|
+
@files << @file
|
|
61
46
|
end
|
|
47
|
+
|
|
48
|
+
if params[:ajax]
|
|
49
|
+
view = render_to_string(:partial => 'cms_admin/files/file', :collection => @files, :layout => false)
|
|
50
|
+
render :json => {:filelink => @file.file.url, :view => view.gsub("\n", '')}
|
|
51
|
+
else
|
|
52
|
+
flash[:success] = I18n.t('cms.files.created')
|
|
53
|
+
redirect_to :action => :edit, :id => @file
|
|
54
|
+
end
|
|
55
|
+
|
|
62
56
|
rescue ActiveRecord::RecordInvalid
|
|
63
57
|
logger.detailed_error($!)
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
format.js do
|
|
70
|
-
render :nothing => true
|
|
71
|
-
end
|
|
58
|
+
if params[:ajax]
|
|
59
|
+
render :nothing => true, :status => :unprocessable_entity
|
|
60
|
+
else
|
|
61
|
+
flash.now[:error] = I18n.t('cms.files.creation_failure')
|
|
62
|
+
render :action => :new
|
|
72
63
|
end
|
|
73
64
|
end
|
|
74
65
|
|
|
@@ -103,6 +94,10 @@ class CmsAdmin::FilesController < CmsAdmin::BaseController
|
|
|
103
94
|
end
|
|
104
95
|
|
|
105
96
|
protected
|
|
97
|
+
|
|
98
|
+
def build_file
|
|
99
|
+
@file = @site.files.new
|
|
100
|
+
end
|
|
106
101
|
|
|
107
102
|
def load_file
|
|
108
103
|
@file = @site.files.find(params[:id])
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
.file{:class => "#{dom_id(file)} #{file.is_image?? 'image' : nil}"}
|
|
2
2
|
.file-name
|
|
3
|
-
|
|
4
3
|
= link_to cms_admin_site_file_path(@site, file), :method => :delete, :remote => true, :data => {:confirm => t('.are_you_sure')}, :class => 'delete' do
|
|
5
4
|
%i.icon-remove-circle
|
|
6
5
|
= link_to file.file_file_name, file.file.url, :target => '_blank', :class => 'filename'
|
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
- files_scope = (type == 'image') ? @site.files.images : @site.files
|
|
3
3
|
|
|
4
4
|
.box.file-uploader
|
|
5
|
-
= form_for :file, :url => cms_admin_site_files_path(@site), :html => {:multipart => true} do |form|
|
|
5
|
+
= form_for :file, :url => cms_admin_site_files_path(@site, :ajax => true), :html => {:multipart => true, :target => 'file-upload-frame'} do |form|
|
|
6
6
|
%span.btn.btn-file
|
|
7
7
|
= t('.button')
|
|
8
8
|
= form.file_field :file, :multiple => true, :id => nil
|
|
9
9
|
|
|
10
10
|
.uploaded-files
|
|
11
11
|
- files_scope.order(:label).each do |file|
|
|
12
|
-
= render :partial => 'cms_admin/files/file', :object => file
|
|
12
|
+
= render :partial => 'cms_admin/files/file', :object => file
|
|
13
|
+
|
|
14
|
+
%iframe#file-upload-frame{:name => 'file-upload-frame', :src => ''}
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
|
|
29
29
|
= render :partial => 'form_blocks'
|
|
30
30
|
|
|
31
|
-
= form.check_box :is_published, :label => '
|
|
31
|
+
= form.check_box :is_published, :label => t('.is_published')
|
|
32
32
|
|
|
33
33
|
.form-actions
|
|
34
34
|
= form.submit t('.preview'), :name => 'preview', :id => nil, :class => 'btn'
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
= form.text_field :hostname
|
|
4
4
|
= form.text_field :path
|
|
5
5
|
= form.select :locale, ComfortableMexicanSofa.config.locales.to_a.collect{|l| [l[1], l[0]]}
|
|
6
|
-
= form.check_box :is_mirrored
|
|
6
|
+
= form.check_box :is_mirrored, :label => t('.is_mirrored')
|
|
7
7
|
|
|
8
8
|
.form-actions
|
|
9
9
|
= form.submit t(@site.new_record?? '.create' : '.update'), :class => 'btn btn-primary'
|
|
@@ -1,7 +1,3 @@
|
|
|
1
1
|
.body-footer
|
|
2
2
|
= link_to 'ComfortableMexicanSofa', 'https://github.com/comfy', :target => '_blank'
|
|
3
|
-
%span.version= ComfortableMexicanSofa::VERSION
|
|
4
|
-
|
|
5
|
-
- if content_for(:javascript)
|
|
6
|
-
:javascript
|
|
7
|
-
#{yield :javascript}
|
|
3
|
+
%span.version= ComfortableMexicanSofa::VERSION
|
data/config/locales/de.yml
CHANGED
|
@@ -121,6 +121,7 @@ de:
|
|
|
121
121
|
form:
|
|
122
122
|
create: Erstelle Web-Site
|
|
123
123
|
update: Web-Site speichern
|
|
124
|
+
is_mirrored: Gespiegelt
|
|
124
125
|
|
|
125
126
|
layouts:
|
|
126
127
|
index:
|
|
@@ -162,6 +163,7 @@ de:
|
|
|
162
163
|
preview: Vorschau
|
|
163
164
|
create: Erstelle Seite
|
|
164
165
|
update: Seite speichern
|
|
166
|
+
is_published: Veröffentlicht
|
|
165
167
|
form_blocks:
|
|
166
168
|
no_tags: |-
|
|
167
169
|
Layout has hat keine Inhalt-Tags definiert.<br/>
|
data/config/locales/en.yml
CHANGED
|
@@ -121,6 +121,7 @@ en:
|
|
|
121
121
|
form:
|
|
122
122
|
create: Create Site
|
|
123
123
|
update: Update Site
|
|
124
|
+
is_mirrored: Mirrored
|
|
124
125
|
|
|
125
126
|
layouts:
|
|
126
127
|
index:
|
|
@@ -162,6 +163,7 @@ en:
|
|
|
162
163
|
preview: Preview
|
|
163
164
|
create: Create Page
|
|
164
165
|
update: Update Page
|
|
166
|
+
is_published: Published
|
|
165
167
|
form_blocks:
|
|
166
168
|
no_tags: |-
|
|
167
169
|
Layout has no content tags defined.<br/>
|
data/config/locales/es.yml
CHANGED
|
@@ -121,6 +121,7 @@ es:
|
|
|
121
121
|
form:
|
|
122
122
|
create: Crear Sitio
|
|
123
123
|
update: Actualizar Sitio
|
|
124
|
+
is_mirrored: Espejo
|
|
124
125
|
|
|
125
126
|
layouts:
|
|
126
127
|
index:
|
|
@@ -162,6 +163,7 @@ es:
|
|
|
162
163
|
preview: Vista Previa
|
|
163
164
|
create: Crear Página
|
|
164
165
|
update: Actualizar Página
|
|
166
|
+
is_published: Publicada
|
|
165
167
|
form_blocks:
|
|
166
168
|
no_tags: |-
|
|
167
169
|
La plantilla no tiene etiquetas de contenido definidas.<br/>
|
data/config/locales/fr.yml
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
fr:
|
|
3
3
|
# -- Models ---------------------------------------------------------------
|
|
4
4
|
attributes:
|
|
5
|
-
label:
|
|
6
|
-
slug:
|
|
5
|
+
label: Nom
|
|
6
|
+
slug: Identifiant
|
|
7
7
|
parent_id: Parent
|
|
8
8
|
content: Contenu
|
|
9
9
|
identifier: Identifiant
|
|
@@ -12,30 +12,30 @@ fr:
|
|
|
12
12
|
cms/site: Site
|
|
13
13
|
cms/layout: Mise en page
|
|
14
14
|
cms/page: Page
|
|
15
|
-
cms/snippet:
|
|
15
|
+
cms/snippet: Fragment
|
|
16
16
|
cms/file: Fichier
|
|
17
17
|
attributes:
|
|
18
18
|
cms/site:
|
|
19
19
|
identifier: Identifiant
|
|
20
|
-
hostname:
|
|
21
|
-
path: Chemin
|
|
22
|
-
locale:
|
|
20
|
+
hostname: Nom d'hôte
|
|
21
|
+
path: Chemin
|
|
22
|
+
locale: Langue
|
|
23
23
|
is_mirrored: En miroir
|
|
24
24
|
cms/layout:
|
|
25
25
|
identifier: Identifiant
|
|
26
|
-
label: Nom de la
|
|
27
|
-
app_layout: Mise en page
|
|
28
|
-
parent_id: Mise en page
|
|
29
|
-
css: Feuille de
|
|
26
|
+
label: Nom de la mise en page
|
|
27
|
+
app_layout: Mise en page de l'application
|
|
28
|
+
parent_id: Mise en page parent
|
|
29
|
+
css: Feuille de style
|
|
30
30
|
js: Javascript
|
|
31
31
|
cms/page:
|
|
32
|
-
label:
|
|
32
|
+
label: Nom de la page
|
|
33
33
|
layout_id: Mise en page
|
|
34
|
-
slug:
|
|
35
|
-
target_page_id: Rediriger vers
|
|
34
|
+
slug: Identifiant
|
|
35
|
+
target_page_id: Rediriger vers
|
|
36
36
|
is_published: Publié
|
|
37
37
|
cms/file:
|
|
38
|
-
file:
|
|
38
|
+
file: Fichier
|
|
39
39
|
description: Description
|
|
40
40
|
cms/snippet:
|
|
41
41
|
identifier: Identifiant
|
|
@@ -43,59 +43,59 @@ fr:
|
|
|
43
43
|
# -- Controllers ----------------------------------------------------------
|
|
44
44
|
cms:
|
|
45
45
|
base:
|
|
46
|
-
site_not_found: Site
|
|
47
|
-
fixtures_enabled:
|
|
46
|
+
site_not_found: Site introuvable
|
|
47
|
+
fixtures_enabled: Fixtures activés. Toutes les modifications seront supprimées.
|
|
48
48
|
|
|
49
49
|
sites:
|
|
50
50
|
created: Site créé
|
|
51
|
-
creation_failure:
|
|
51
|
+
creation_failure: Échec de la création du site
|
|
52
52
|
updated: Site modifié
|
|
53
|
-
update_failure:
|
|
53
|
+
update_failure: Échec de la modification du site
|
|
54
54
|
deleted: Site supprimé
|
|
55
|
-
not_found: Site
|
|
55
|
+
not_found: Site introuvable
|
|
56
56
|
|
|
57
57
|
layouts:
|
|
58
58
|
created: Mise en page créée
|
|
59
|
-
creation_failure:
|
|
59
|
+
creation_failure: Échec de la création de la mise en page
|
|
60
60
|
updated: Mise en page modifiée
|
|
61
|
-
update_failure:
|
|
61
|
+
update_failure: Échec de la modification de la mise en page
|
|
62
62
|
deleted: Mise en page supprimée
|
|
63
|
-
not_found: Mise en page
|
|
63
|
+
not_found: Mise en page introuvable
|
|
64
64
|
|
|
65
65
|
pages:
|
|
66
66
|
created: Page créée
|
|
67
|
-
creation_failure:
|
|
67
|
+
creation_failure: Échec de la création de la page
|
|
68
68
|
updated: Page modifiée
|
|
69
|
-
update_failure:
|
|
69
|
+
update_failure: Échec de la modification de la page
|
|
70
70
|
deleted: Page supprimée
|
|
71
|
-
not_found: Page
|
|
72
|
-
layout_not_found: Aucune
|
|
71
|
+
not_found: Page introuvable
|
|
72
|
+
layout_not_found: Aucune mise en page disponible. Créez-en une nouvelle.
|
|
73
73
|
|
|
74
74
|
snippets:
|
|
75
|
-
created:
|
|
76
|
-
creation_failure:
|
|
77
|
-
updated:
|
|
78
|
-
update_failure:
|
|
79
|
-
deleted:
|
|
80
|
-
not_found:
|
|
75
|
+
created: Fragment créé
|
|
76
|
+
creation_failure: Échec de la création du fragment
|
|
77
|
+
updated: Fragment modifié
|
|
78
|
+
update_failure: Échec de la modification du fragment
|
|
79
|
+
deleted: Fragment supprimé
|
|
80
|
+
not_found: Fragment introuvable
|
|
81
81
|
|
|
82
82
|
revisions:
|
|
83
|
-
reverted: Contenu
|
|
84
|
-
record_not_found: Enregistrement
|
|
85
|
-
not_found:
|
|
83
|
+
reverted: Contenu restauré
|
|
84
|
+
record_not_found: Enregistrement introuvable
|
|
85
|
+
not_found: Révision introuvable
|
|
86
86
|
|
|
87
87
|
files:
|
|
88
88
|
created: Fichier téléchargé
|
|
89
|
-
creation_failure:
|
|
89
|
+
creation_failure: Échec du téléchargement du fichier
|
|
90
90
|
updated: Fichier modifié
|
|
91
|
-
update_failure:
|
|
91
|
+
update_failure: Échec de la modification du fichier
|
|
92
92
|
deleted: Fichier supprimé
|
|
93
|
-
not_found: Fichier
|
|
93
|
+
not_found: Fichier introuvable
|
|
94
94
|
|
|
95
95
|
content:
|
|
96
|
-
site_not_found: Site
|
|
97
|
-
layout_not_found: Mise en page
|
|
98
|
-
page_not_found: Page
|
|
96
|
+
site_not_found: Site introuvable
|
|
97
|
+
layout_not_found: Mise en page introuvable
|
|
98
|
+
page_not_found: Page introuvable
|
|
99
99
|
|
|
100
100
|
# -- Views ----------------------------------------------------------------
|
|
101
101
|
cms_admin:
|
|
@@ -103,125 +103,127 @@ fr:
|
|
|
103
103
|
sites: Sites
|
|
104
104
|
layouts: Mises en page
|
|
105
105
|
pages: Pages
|
|
106
|
-
snippets:
|
|
106
|
+
snippets: Fragments
|
|
107
107
|
files: Fichiers
|
|
108
108
|
|
|
109
109
|
sites:
|
|
110
110
|
index:
|
|
111
111
|
title: Sites
|
|
112
|
-
new_link:
|
|
113
|
-
select: Sélectionner
|
|
112
|
+
new_link: Nouveau site
|
|
113
|
+
select: Sélectionner ce site
|
|
114
114
|
edit: Modifier
|
|
115
115
|
delete: Supprimer
|
|
116
|
-
are_you_sure:
|
|
116
|
+
are_you_sure: Êtes-vous sûr de vouloir supprimer ce site ?
|
|
117
117
|
new:
|
|
118
|
-
title: Nouveau
|
|
118
|
+
title: Nouveau site
|
|
119
119
|
edit:
|
|
120
|
-
title: Modification
|
|
120
|
+
title: Modification du site
|
|
121
121
|
form:
|
|
122
|
-
create: Créer
|
|
123
|
-
update: Modifier
|
|
122
|
+
create: Créer le site
|
|
123
|
+
update: Modifier le site
|
|
124
|
+
is_mirrored: En miroir
|
|
124
125
|
|
|
125
126
|
layouts:
|
|
126
127
|
index:
|
|
127
|
-
title:
|
|
128
|
-
new_link:
|
|
128
|
+
title: Mises en page
|
|
129
|
+
new_link: Nouvelle mise en page
|
|
129
130
|
index_branch:
|
|
130
|
-
add_child_layout: Ajouter
|
|
131
|
+
add_child_layout: Ajouter une mise en page enfant
|
|
131
132
|
edit: Modifier
|
|
132
133
|
delete: Supprimer
|
|
133
|
-
are_you_sure:
|
|
134
|
+
are_you_sure: Êtes-vous sûr de vouloir supprimer cette mise en page ?
|
|
134
135
|
new:
|
|
135
|
-
title: Nouvelle
|
|
136
|
+
title: Nouvelle mise en page
|
|
136
137
|
edit:
|
|
137
|
-
title: Modification
|
|
138
|
-
revision:
|
|
138
|
+
title: Modification de la mise en page
|
|
139
|
+
revision: révision
|
|
139
140
|
form:
|
|
140
|
-
select_parent_layout:
|
|
141
|
-
select_app_layout:
|
|
142
|
-
create: Créer
|
|
143
|
-
update: Modifier
|
|
141
|
+
select_parent_layout: Sélectionner une mise en page parent
|
|
142
|
+
select_app_layout: Sélectionner une mise en page de l'application
|
|
143
|
+
create: Créer la mise en page
|
|
144
|
+
update: Modifier la mise en page
|
|
144
145
|
|
|
145
146
|
pages:
|
|
146
147
|
index:
|
|
147
148
|
title: Pages
|
|
148
|
-
new_link:
|
|
149
|
+
new_link: Nouvelle page
|
|
149
150
|
index_branch:
|
|
150
151
|
toggle: Basculer
|
|
151
|
-
add_child_page: Ajouter
|
|
152
|
+
add_child_page: Ajouter une page enfant
|
|
152
153
|
edit: Modifier
|
|
153
154
|
delete: Supprimer
|
|
154
|
-
are_you_sure:
|
|
155
|
+
are_you_sure: Êtes-vous sûr de vouloir supprimer cette page ?
|
|
155
156
|
new:
|
|
156
|
-
title: Nouvelle
|
|
157
|
+
title: Nouvelle page
|
|
157
158
|
edit:
|
|
158
|
-
title: Modification
|
|
159
|
-
revision:
|
|
159
|
+
title: Modification de la page
|
|
160
|
+
revision: révision
|
|
160
161
|
form:
|
|
161
|
-
select_target_page:
|
|
162
|
+
select_target_page: Pas de redirection
|
|
162
163
|
preview: Prévisualiser
|
|
163
|
-
create: Créer
|
|
164
|
-
update: Modifier
|
|
164
|
+
create: Créer la page
|
|
165
|
+
update: Modifier la page
|
|
166
|
+
is_published: Publié
|
|
165
167
|
form_blocks:
|
|
166
168
|
no_tags: |-
|
|
167
169
|
Mise en page sans aucun tag de contenu.<br/>
|
|
168
|
-
Modifiez le contenu pour y ajouter un tag de page ou de
|
|
170
|
+
Modifiez le contenu pour y ajouter un tag de page ou de champ. Exemple : <code>{{cms:page:content}}</code>
|
|
169
171
|
|
|
170
172
|
snippets:
|
|
171
173
|
index:
|
|
172
|
-
title:
|
|
173
|
-
new_link:
|
|
174
|
+
title: Fragments
|
|
175
|
+
new_link: Nouveau fragment
|
|
174
176
|
edit: Modifier
|
|
175
177
|
delete: Supprimer
|
|
176
|
-
are_you_sure:
|
|
178
|
+
are_you_sure: Êtes-vous sûr de vouloir supprimer ce fragment ?
|
|
177
179
|
new:
|
|
178
|
-
title: Nouveau
|
|
180
|
+
title: Nouveau fragment
|
|
179
181
|
edit:
|
|
180
|
-
title: Modification
|
|
181
|
-
revision:
|
|
182
|
+
title: Modification du fragment
|
|
183
|
+
revision: révision
|
|
182
184
|
form:
|
|
183
|
-
create: Créer
|
|
184
|
-
update: Modifier
|
|
185
|
+
create: Créer le fragment
|
|
186
|
+
update: Modifier le fragment
|
|
185
187
|
|
|
186
188
|
revisions:
|
|
187
189
|
show:
|
|
188
|
-
title: Révisions
|
|
189
|
-
revision:
|
|
190
|
-
full_path: Chemin
|
|
191
|
-
slug:
|
|
192
|
-
update:
|
|
190
|
+
title: "Révisions :"
|
|
191
|
+
revision: révision
|
|
192
|
+
full_path: Chemin complet
|
|
193
|
+
slug: Identifiant
|
|
194
|
+
update: Restaurer cette révision
|
|
193
195
|
current: Actuel
|
|
194
196
|
|
|
195
197
|
files:
|
|
196
198
|
index:
|
|
197
199
|
title: Fichiers
|
|
198
|
-
new_link:
|
|
200
|
+
new_link: Nouveau fichier
|
|
199
201
|
edit: Modifier
|
|
200
202
|
delete: Supprimer
|
|
201
|
-
are_you_sure:
|
|
202
|
-
button:
|
|
203
|
+
are_you_sure: Êtes-vous sûr de vouloir supprimer ce fichier ?
|
|
204
|
+
button: Ajouter des fichiers
|
|
203
205
|
new:
|
|
204
|
-
title: Nouveau
|
|
206
|
+
title: Nouveau fichier
|
|
205
207
|
edit:
|
|
206
|
-
title: Modification
|
|
208
|
+
title: Modification du fichier
|
|
207
209
|
form:
|
|
208
210
|
current_file: Fichier actuel
|
|
209
|
-
create:
|
|
210
|
-
update: Modifier
|
|
211
|
+
create: Envoyer
|
|
212
|
+
update: Modifier le fichier
|
|
211
213
|
page_form:
|
|
212
|
-
are_you_sure:
|
|
214
|
+
are_you_sure: Êtes-vous sûr de vouloir supprimer ce fichier ?
|
|
213
215
|
file:
|
|
214
|
-
are_you_sure:
|
|
216
|
+
are_you_sure: Êtes-vous sûr de vouloir supprimer ce fichier ?
|
|
215
217
|
|
|
216
218
|
categories:
|
|
217
219
|
index:
|
|
218
220
|
label: Catégories
|
|
219
|
-
edit: Modifier
|
|
220
|
-
done:
|
|
221
|
+
edit: Modifier les catégories
|
|
222
|
+
done: Terminé
|
|
221
223
|
all: Tout
|
|
222
224
|
add: Ajouter
|
|
223
225
|
show:
|
|
224
|
-
are_you_sure:
|
|
226
|
+
are_you_sure: Êtes-vous sûr de vouloir supprimer cette catégorie ?
|
|
225
227
|
edit:
|
|
226
228
|
save: Enregistrer
|
|
227
229
|
form:
|
|
@@ -229,6 +231,6 @@ fr:
|
|
|
229
231
|
|
|
230
232
|
dialogs:
|
|
231
233
|
image:
|
|
232
|
-
insert: Insérer
|
|
234
|
+
insert: Insérer une image
|
|
233
235
|
link:
|
|
234
|
-
create:
|
|
236
|
+
create: Insérer un lien
|
data/config/locales/ja.yml
CHANGED
|
@@ -121,7 +121,8 @@ ja:
|
|
|
121
121
|
form:
|
|
122
122
|
create: サイトを作成
|
|
123
123
|
update: サイトを更新
|
|
124
|
-
|
|
124
|
+
is_mirrored: ミラーリング済み
|
|
125
|
+
|
|
125
126
|
layouts:
|
|
126
127
|
index:
|
|
127
128
|
title: レイアウト
|
|
@@ -162,6 +163,7 @@ ja:
|
|
|
162
163
|
preview: プレビュー
|
|
163
164
|
create: ページを作成
|
|
164
165
|
update: ページを更新
|
|
166
|
+
is_published: パブリッシュ済み
|
|
165
167
|
form_blocks:
|
|
166
168
|
no_tags: |-
|
|
167
169
|
レイアウトにはコンテンツタグが定義されていません。<br/>
|
data/config/locales/pl.yml
CHANGED
|
@@ -121,6 +121,7 @@ pl:
|
|
|
121
121
|
form:
|
|
122
122
|
create: Utwórz witrynę
|
|
123
123
|
update: Uaktualnij witrynę
|
|
124
|
+
is_mirrored: Mirror
|
|
124
125
|
|
|
125
126
|
layouts:
|
|
126
127
|
index:
|
|
@@ -162,6 +163,7 @@ pl:
|
|
|
162
163
|
preview: Podgląd
|
|
163
164
|
create: Utwórz stronę
|
|
164
165
|
update: Uaktualnij stronę
|
|
166
|
+
is_published: Opublikowana
|
|
165
167
|
form_blocks:
|
|
166
168
|
no_tags: |-
|
|
167
169
|
Szablon nie ma zdefiniowanych tagów<br/>
|
data/config/locales/pt-BR.yml
CHANGED
|
@@ -121,6 +121,7 @@ pt-BR:
|
|
|
121
121
|
form:
|
|
122
122
|
create: Criar Site
|
|
123
123
|
update: Atualizar Site
|
|
124
|
+
is_mirrored: Espelhado
|
|
124
125
|
|
|
125
126
|
layouts:
|
|
126
127
|
index:
|
|
@@ -162,6 +163,7 @@ pt-BR:
|
|
|
162
163
|
preview: Pré-visualização
|
|
163
164
|
create: Criar Página
|
|
164
165
|
update: Atualizar Página
|
|
166
|
+
is_published: Publicada
|
|
165
167
|
form_blocks:
|
|
166
168
|
no_tags: |-
|
|
167
169
|
O leiaute não possui tags de conteúdo definidas.<br/>
|
data/config/locales/ru.yml
CHANGED
|
@@ -121,6 +121,7 @@ ru:
|
|
|
121
121
|
form:
|
|
122
122
|
create: Создать сайт
|
|
123
123
|
update: Обновить сайт
|
|
124
|
+
is_mirrored: Синхронизирован с другими сайтами
|
|
124
125
|
|
|
125
126
|
layouts:
|
|
126
127
|
index:
|
|
@@ -162,6 +163,7 @@ ru:
|
|
|
162
163
|
preview: Предпросмотр
|
|
163
164
|
create: Создать страницу
|
|
164
165
|
update: Обновить страницу
|
|
166
|
+
is_published: Опубликована
|
|
165
167
|
form_blocks:
|
|
166
168
|
no_tags: |-
|
|
167
169
|
Шаблон не содержит ни одного контент-тега.<br/>
|
data/config/locales/sv.yml
CHANGED
|
@@ -121,6 +121,7 @@ sv:
|
|
|
121
121
|
form:
|
|
122
122
|
create: Skapa Site
|
|
123
123
|
update: Uppdatera Site
|
|
124
|
+
is_mirrored: Speglad
|
|
124
125
|
|
|
125
126
|
layouts:
|
|
126
127
|
index:
|
|
@@ -162,6 +163,7 @@ sv:
|
|
|
162
163
|
preview: Förhandsgranska
|
|
163
164
|
create: Skapa sida
|
|
164
165
|
update: Uppdatera sida
|
|
166
|
+
is_published: Publicerad
|
|
165
167
|
form_blocks:
|
|
166
168
|
no_tags: |-
|
|
167
169
|
Layout har inga innehållstaggar definierade.<br/>
|
data/config/locales/zh-CN.yml
CHANGED
|
@@ -121,6 +121,7 @@ zh-CN:
|
|
|
121
121
|
form:
|
|
122
122
|
create: 创建站点
|
|
123
123
|
update: 更新站点
|
|
124
|
+
is_mirrored: 镜像
|
|
124
125
|
|
|
125
126
|
layouts:
|
|
126
127
|
index:
|
|
@@ -162,6 +163,7 @@ zh-CN:
|
|
|
162
163
|
preview: 预览
|
|
163
164
|
create: 创建页面
|
|
164
165
|
update: 更新页面
|
|
166
|
+
is_published: 发布
|
|
165
167
|
form_blocks:
|
|
166
168
|
no_tags: |-
|
|
167
169
|
布局中没有定义内容标签。<br/>
|
|
@@ -31,6 +31,17 @@ class CmsAdmin::FilesControllerTest < ActionController::TestCase
|
|
|
31
31
|
assert_equal 0, assigns(:files).count
|
|
32
32
|
end
|
|
33
33
|
|
|
34
|
+
def test_get_index_as_ajax
|
|
35
|
+
get :index, :site_id => cms_sites(:default), :ajax => true
|
|
36
|
+
assert_response :success
|
|
37
|
+
r = JSON.parse(response.body)
|
|
38
|
+
file = cms_files(:default)
|
|
39
|
+
assert_equal [{
|
|
40
|
+
'thumb' => file.file.url(:cms_thumb),
|
|
41
|
+
'image' => file.file.url
|
|
42
|
+
}], r
|
|
43
|
+
end
|
|
44
|
+
|
|
34
45
|
def test_get_new
|
|
35
46
|
site = cms_sites(:default)
|
|
36
47
|
get :new, :site_id => site
|
|
@@ -61,7 +72,7 @@ class CmsAdmin::FilesControllerTest < ActionController::TestCase
|
|
|
61
72
|
post :create, :site_id => cms_sites(:default), :file => {
|
|
62
73
|
:label => 'Test File',
|
|
63
74
|
:description => 'Test Description',
|
|
64
|
-
:file => [fixture_file_upload('files/image.jpg',
|
|
75
|
+
:file => [fixture_file_upload('files/image.jpg', 'image/jpeg')]
|
|
65
76
|
}
|
|
66
77
|
assert_response :redirect
|
|
67
78
|
file = Cms::File.last
|
|
@@ -90,8 +101,8 @@ class CmsAdmin::FilesControllerTest < ActionController::TestCase
|
|
|
90
101
|
:label => 'Test File',
|
|
91
102
|
:description => 'Test Description',
|
|
92
103
|
:file => [
|
|
93
|
-
fixture_file_upload('files/image.jpg',
|
|
94
|
-
fixture_file_upload('files/image.gif',
|
|
104
|
+
fixture_file_upload('files/image.jpg', 'image/jpeg'),
|
|
105
|
+
fixture_file_upload('files/image.gif', 'image/gif')
|
|
95
106
|
]
|
|
96
107
|
}
|
|
97
108
|
assert_response :redirect
|
|
@@ -110,18 +121,36 @@ class CmsAdmin::FilesControllerTest < ActionController::TestCase
|
|
|
110
121
|
end
|
|
111
122
|
end
|
|
112
123
|
|
|
113
|
-
def
|
|
114
|
-
request.env['HTTP_X_FILE_NAME'] = 'image.jpg'
|
|
115
|
-
request.env['CONTENT_TYPE'] = 'image/jpeg'
|
|
116
|
-
request.env['RAW_POST_DATA'] = File.open(File.expand_path('../../fixtures/files/image.jpg', File.dirname(__FILE__)))
|
|
117
|
-
|
|
124
|
+
def test_create_as_ajax
|
|
118
125
|
assert_difference 'Cms::File.count' do
|
|
119
|
-
|
|
126
|
+
post :create,
|
|
127
|
+
:ajax => true,
|
|
128
|
+
:site_id => cms_sites(:default),
|
|
129
|
+
:file => {
|
|
130
|
+
:file => [fixture_file_upload('files/image.jpg', 'image/jpeg')]
|
|
131
|
+
}
|
|
120
132
|
assert_response :success
|
|
121
|
-
|
|
122
133
|
file = Cms::File.last
|
|
123
|
-
|
|
124
|
-
assert_equal '
|
|
134
|
+
r = JSON.parse(response.body)
|
|
135
|
+
assert_equal file.file.url, r['filelink']
|
|
136
|
+
assert_present r['view']
|
|
137
|
+
end
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
def test_create_as_ajax_failure
|
|
141
|
+
assert_no_difference 'Cms::File.count' do
|
|
142
|
+
post :create, :ajax => true, :site_id => cms_sites(:default), :file => { }
|
|
143
|
+
assert_response :unprocessable_entity
|
|
144
|
+
end
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
def test_create_as_ajax_as_single_file
|
|
148
|
+
assert_difference 'Cms::File.count' do
|
|
149
|
+
post :create,
|
|
150
|
+
:ajax => true,
|
|
151
|
+
:site_id => cms_sites(:default),
|
|
152
|
+
:file => fixture_file_upload('files/image.jpg', 'image/jpeg')
|
|
153
|
+
assert_response :success
|
|
125
154
|
end
|
|
126
155
|
end
|
|
127
156
|
|
|
@@ -24,7 +24,7 @@ class CmsAdmin::LayoutsControllerTest < ActionController::TestCase
|
|
|
24
24
|
assert_equal '{{ cms:page:content:text }}', assigns(:layout).content
|
|
25
25
|
assert_template :new
|
|
26
26
|
assert_select "form[action=/cms-admin/sites/#{site.id}/layouts]"
|
|
27
|
-
assert_select "form[action='/cms-admin/sites/#{site.id}/files']"
|
|
27
|
+
assert_select "form[action='/cms-admin/sites/#{site.id}/files?ajax=true']"
|
|
28
28
|
end
|
|
29
29
|
|
|
30
30
|
def test_get_edit
|
|
@@ -43,7 +43,7 @@ class CmsAdmin::PagesControllerTest < ActionController::TestCase
|
|
|
43
43
|
assert_template :new
|
|
44
44
|
assert_select "form[action=/cms-admin/sites/#{site.id}/pages]"
|
|
45
45
|
assert_select "select[data-url=/cms-admin/sites/#{site.id}/pages/0/form_blocks]"
|
|
46
|
-
assert_select "form[action='/cms-admin/sites/#{site.id}/files']"
|
|
46
|
+
assert_select "form[action='/cms-admin/sites/#{site.id}/files?ajax=true']"
|
|
47
47
|
end
|
|
48
48
|
|
|
49
49
|
def test_get_new_with_field_datetime
|
|
@@ -41,7 +41,7 @@ class CmsAdmin::SnippetsControllerTest < ActionController::TestCase
|
|
|
41
41
|
assert assigns(:snippet)
|
|
42
42
|
assert_template :new
|
|
43
43
|
assert_select "form[action=/cms-admin/sites/#{site.id}/snippets]"
|
|
44
|
-
assert_select "form[action='/cms-admin/sites/#{site.id}/files']"
|
|
44
|
+
assert_select "form[action='/cms-admin/sites/#{site.id}/files?ajax=true']"
|
|
45
45
|
end
|
|
46
46
|
|
|
47
47
|
def test_get_edit
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: comfortable_mexican_sofa
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.8.
|
|
4
|
+
version: 1.8.1
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -10,7 +10,7 @@ authors:
|
|
|
10
10
|
autorequire:
|
|
11
11
|
bindir: bin
|
|
12
12
|
cert_chain: []
|
|
13
|
-
date: 2013-
|
|
13
|
+
date: 2013-04-24 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: rails
|
|
@@ -231,8 +231,7 @@ files:
|
|
|
231
231
|
- app/views/cms_admin/files/_form.html.haml
|
|
232
232
|
- app/views/cms_admin/files/_index.html.haml
|
|
233
233
|
- app/views/cms_admin/files/_page_form.html.haml
|
|
234
|
-
- app/views/cms_admin/files/
|
|
235
|
-
- app/views/cms_admin/files/destroy.js.erb
|
|
234
|
+
- app/views/cms_admin/files/destroy.js.coffee
|
|
236
235
|
- app/views/cms_admin/files/edit.html.haml
|
|
237
236
|
- app/views/cms_admin/files/index.html.haml
|
|
238
237
|
- app/views/cms_admin/files/new.html.haml
|
|
@@ -264,6 +263,7 @@ files:
|
|
|
264
263
|
- app/views/layouts/cms_admin/_body.html.haml
|
|
265
264
|
- app/views/layouts/cms_admin/_center.html.haml
|
|
266
265
|
- app/views/layouts/cms_admin/_footer.html.haml
|
|
266
|
+
- app/views/layouts/cms_admin/_footer_js.html.haml
|
|
267
267
|
- app/views/layouts/cms_admin/_head.html.haml
|
|
268
268
|
- app/views/layouts/cms_admin/_left.html.haml
|
|
269
269
|
- app/views/layouts/cms_admin/_right.html.haml
|