locomotive_cms 2.3.1 → 2.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/locomotive/models/content_entry.js.coffee +4 -0
  3. data/app/assets/javascripts/locomotive/views/content_assets/picker_view.js.coffee +0 -2
  4. data/app/assets/javascripts/locomotive/views/content_entries/_form_view.js.coffee +1 -1
  5. data/app/assets/javascripts/locomotive/views/content_entries/_popup_form_view.js.coffee +7 -0
  6. data/app/assets/javascripts/locomotive/views/inline_editor/application_view.js.coffee +1 -1
  7. data/app/assets/javascripts/locomotive/views/pages/_form_view.js.coffee +2 -1
  8. data/app/assets/javascripts/locomotive/views/shared/fields/_relationship_view.js.coffee +45 -0
  9. data/app/assets/javascripts/locomotive/views/shared/fields/belongs_to_view.js.coffee +4 -20
  10. data/app/assets/javascripts/locomotive/views/shared/fields/many_to_many_view.js.coffee +53 -42
  11. data/app/assets/javascripts/locomotive/views/snippets/_form_view.js.coffee +0 -1
  12. data/app/assets/stylesheets/locomotive/backoffice/application.css.scss +31 -0
  13. data/app/assets/stylesheets/locomotive/backoffice/formtastic_changes.css.scss +19 -0
  14. data/app/controllers/locomotive/api/accounts_controller.rb +6 -0
  15. data/app/controllers/locomotive/content_entries_controller.rb +1 -1
  16. data/app/helpers/locomotive/content_entries_helper.rb +22 -0
  17. data/app/models/locomotive/content_entry.rb +16 -47
  18. data/app/models/locomotive/content_type.rb +19 -3
  19. data/app/models/locomotive/editable_text.rb +7 -1
  20. data/app/models/locomotive/extensions/content_entry/localized.rb +62 -0
  21. data/app/models/locomotive/extensions/page/tree.rb +5 -0
  22. data/app/models/locomotive/extensions/shared/slug.rb +33 -0
  23. data/app/models/locomotive/page.rb +4 -11
  24. data/app/models/locomotive/snippet.rb +6 -7
  25. data/app/models/locomotive/translation.rb +2 -2
  26. data/app/presenters/locomotive/account_presenter.rb +1 -1
  27. data/app/views/locomotive/content_entries/_list.html.haml +3 -1
  28. data/app/views/locomotive/custom_fields/types/_boolean.html.haml +1 -1
  29. data/app/views/locomotive/custom_fields/types/_date.html.haml +1 -1
  30. data/app/views/locomotive/custom_fields/types/_date_time.html.haml +1 -1
  31. data/app/views/locomotive/custom_fields/types/_email.html.haml +1 -1
  32. data/app/views/locomotive/custom_fields/types/_file.html.haml +1 -1
  33. data/app/views/locomotive/custom_fields/types/_float.html.haml +1 -1
  34. data/app/views/locomotive/custom_fields/types/_integer.html.haml +1 -1
  35. data/app/views/locomotive/custom_fields/types/_many_to_many.html.haml +1 -5
  36. data/app/views/locomotive/custom_fields/types/_select.html.haml +1 -1
  37. data/app/views/locomotive/custom_fields/types/_string.html.haml +1 -1
  38. data/app/views/locomotive/custom_fields/types/_tags.html.haml +1 -1
  39. data/app/views/locomotive/custom_fields/types/_text.html.haml +1 -1
  40. data/config/locales/admin_ui.de.yml +4 -0
  41. data/config/locales/default.zh-CN.yml +162 -52
  42. data/config/locales/devise.bg.yml +1 -1
  43. data/config/locales/devise.cs.yml +1 -1
  44. data/config/locales/devise.de.yml +1 -1
  45. data/config/locales/devise.en.yml +1 -1
  46. data/config/locales/devise.es.yml +2 -2
  47. data/config/locales/devise.et.yml +1 -1
  48. data/config/locales/devise.fr.yml +1 -1
  49. data/config/locales/devise.it.yml +1 -1
  50. data/config/locales/devise.ja.yml +1 -1
  51. data/config/locales/devise.nb.yml +1 -1
  52. data/config/locales/devise.nl.yml +2 -2
  53. data/config/locales/devise.pl.yml +1 -1
  54. data/config/locales/devise.pt-BR.yml +2 -2
  55. data/config/locales/devise.ru.yml +1 -1
  56. data/config/locales/devise.zh-CN.yml +1 -1
  57. data/config/routes.rb +2 -2
  58. data/features/api/accounts.feature +19 -1
  59. data/features/api/authorization/accounts.feature +52 -12
  60. data/features/backoffice/content_types/has_many.feature +3 -3
  61. data/features/backoffice/content_types/integer.feature +4 -4
  62. data/features/backoffice/content_types/many_to_many.feature +1 -1
  63. data/features/backoffice/my_account.feature +1 -0
  64. data/features/step_definitions/web_steps.rb +7 -0
  65. data/lib/locomotive/action_controller/public_responder.rb +24 -1
  66. data/lib/locomotive/core_ext.rb +8 -2
  67. data/lib/locomotive/devise.rb +21 -0
  68. data/lib/locomotive/httparty/webservice.rb +17 -9
  69. data/lib/locomotive/liquid.rb +1 -0
  70. data/lib/locomotive/liquid/tags/consume.rb +12 -11
  71. data/lib/locomotive/liquid/tags/link_to.rb +6 -60
  72. data/lib/locomotive/liquid/tags/path_helper.rb +82 -0
  73. data/lib/locomotive/liquid/tags/path_to.rb +21 -0
  74. data/lib/locomotive/liquid/tags/snippet.rb +1 -1
  75. data/lib/locomotive/render.rb +2 -1
  76. data/lib/locomotive/version.rb +1 -1
  77. data/spec/lib/locomotive/liquid/tags/consume_spec.rb +12 -0
  78. data/spec/lib/locomotive/liquid/tags/path_to_spec.rb +111 -0
  79. data/spec/models/locomotive/content_entry_spec.rb +2 -2
  80. data/spec/models/locomotive/snippet_spec.rb +21 -0
  81. metadata +13 -6
@@ -1,4 +1,4 @@
1
1
  = f.input name,
2
- label: field.label,
2
+ label: label_for_custom_field(f.object, field),
3
3
  hint: field.hint,
4
4
  as: :'Locomotive::File'
@@ -1,5 +1,5 @@
1
1
  = f.input name,
2
- label: field.label,
2
+ label: label_for_custom_field(f.object, field),
3
3
  hint: field.hint,
4
4
  as: :number,
5
5
  step: 0.1,
@@ -1,5 +1,5 @@
1
1
  = f.input name,
2
- label: field.label,
2
+ label: label_for_custom_field(f.object, field),
3
3
  hint: field.hint,
4
4
  as: :number,
5
5
  wrapper_html: { class: "#{'highlighted' if highlighted}" }
@@ -19,7 +19,7 @@
19
19
 
20
20
  .new-entry
21
21
 
22
- = select_tag 'entry', []
22
+ = text_field_tag 'entry', '', class: 'selected-entry', data: { url: content_entries_path(target_content_type.slug, :json), per_page: Locomotive.config.ui[:per_page], group_by: target_content_type.group_by_field.try(:name) }
23
23
 
24
24
  %span.actions
25
25
  = link_to t('locomotive.buttons.new_item'), '#', class: 'add'
@@ -34,7 +34,3 @@
34
34
 
35
35
  %span.actions
36
36
  = link_to_icon :trash, '#', class: 'remove', data: { confirm: t('locomotive.messages.confirm') }
37
-
38
- - content_for :backbone_view_data do
39
- :plain
40
- , all_#{name}_entries: #{escape_json target_content_type.list_or_group_entries.to_json(depth: 1).html_safe}
@@ -1,5 +1,5 @@
1
1
  = f.input :"#{name}_id",
2
- label: field.label,
2
+ label: label_for_custom_field(f.object, field),
3
3
  hint: field.hint,
4
4
  as: :select,
5
5
  collection: field.ordered_select_options.map { |option| [option.name, option.id] }
@@ -1,4 +1,4 @@
1
1
  = f.input name,
2
- label: field.label,
2
+ label: label_for_custom_field(f.object, field),
3
3
  hint: field.hint,
4
4
  wrapper_html: { class: "#{'highlighted' if highlighted}" }
@@ -1,4 +1,4 @@
1
1
  = f.input name,
2
- label: field.label,
2
+ label: label_for_custom_field(f.object, field),
3
3
  hint: field.hint,
4
4
  wrapper_html: { class: "tags #{'highlighted' if highlighted}" }
@@ -1,5 +1,5 @@
1
1
  = f.input field.name.to_sym,
2
- label: field.label,
2
+ label: label_for_custom_field(f.object, field),
3
3
  hint: field.hint,
4
4
  as: field.text_formatting == 'html' ? :'Locomotive::Rte' : :text,
5
5
  input_html: { class: field.text_formatting }
@@ -82,6 +82,10 @@ de:
82
82
  sites_picker:
83
83
  new: + Neue Webseite
84
84
 
85
+ api_key:
86
+ none: Bitte auf den Knopf klicken um den API Schlüssel zu generieren.
87
+ button: Neu generieren
88
+
85
89
  custom_fields:
86
90
  edit:
87
91
  title: Benutzerdefinierte Felder bearbeiten
@@ -1,38 +1,169 @@
1
1
  zh-CN:
2
+ errors:
3
+ # The default format use in full error messages.
4
+ format: "%{attribute} %{message}"
5
+
6
+ # The values :model, :attribute and :value are always available for interpolation
7
+ # The value :count is available when applicable. Can be used for pluralization.
8
+ messages:
9
+ inclusion: "包含"
10
+ exclusion: "不包含"
11
+ invalid: "无效"
12
+ confirmation: "确认"
13
+ accepted: "接受"
14
+ empty: "为空"
15
+ blank: "为空"
16
+ too_long: "太长"
17
+ too_short: "太短"
18
+ wrong_length: "长度错误"
19
+ taken: "已占用"
20
+ not_a_number: "不是数字"
21
+ greater_than: "大于%{count}"
22
+ greater_than_or_equal_to: "大于等于%{count}"
23
+ equal_to: "等于%{count}"
24
+ less_than: "小于%{count}"
25
+ less_than_or_equal_to: "小于等于%{count}"
26
+ odd: "奇数"
27
+ even: "偶数"
28
+
29
+ domain_taken: "%{value} 已经被占用"
30
+ invalid_domain: "%{value} 不正确"
31
+ needs_admin_account: "至少需要一个管理员账户"
32
+ protected_page: "你不能删除index和404页面"
33
+ extname_changed: "新的文件没有原来的扩展名"
34
+ array_too_short: "太小了(最少的元素数量是 %{count})"
35
+ security: "存在一个安全问题"
36
+ site:
37
+ default_locale_removed: 先前的默认语言不能被正确删除。
38
+ page:
39
+ liquid_syntax: "Liquid 语法错误('%{error}' on '%{fullpath}')"
40
+ liquid_extend: "页面 '%{fullpath}' 扩展了一个不存在的模板"
41
+ liquid_translation: "页面 '%{fullpath}' 扩展了一个未被翻译的模板"
42
+
43
+ attributes:
44
+ defaults:
45
+ pages:
46
+ index:
47
+ title: "首页"
48
+ body: "首页内容"
49
+ "404":
50
+ title: "页面找不到"
51
+ body: "404页面内容"
52
+ other:
53
+ body: "{% extends 'parent' %}"
54
+
55
+ mongoid:
56
+ errors:
57
+ messages:
58
+ blank_in_locale: "不能为空"
59
+
60
+ attributes:
61
+ locomotive/page:
62
+ title: 标题
63
+ parent: 父页面
64
+ parent_id: 父页面ID
65
+ slug: Slug
66
+ listed: 列出
67
+ templatized: 模板化
68
+ published: 已发布
69
+ redirect: 重定向
70
+ redirect_url: 重定向Url
71
+ cache_strategy: 缓存策略
72
+ response_type: 响应类型
73
+ seo_title: SEO标题
74
+ locomotive/content_type:
75
+ name: 名称
76
+ description: 描述
77
+ slug: Slug
78
+ order_by: 排序
79
+ order_direction: 排序方向
80
+ label_field_name: 字段名称
81
+ label_field_id: 字段ID
82
+ group_by_field_name: 分组字段名称
83
+ group_by_field_id: 分组字段ID
84
+ public_submission_enabled: Activation API
85
+ public_submission_accounts: Comptes à notifier
86
+ locomotive/content_entry:
87
+ created_at: 创建于
88
+ locomotive/asset:
89
+ source: Fichier
90
+ locomotive/account:
91
+ email: E-mail
92
+ name: 姓名
93
+ language: 语言
94
+ password: 密码
95
+ password_confirmation: 验证密码
96
+ locomotive/snippet:
97
+ body: Code
98
+ slug: Raccourci
99
+ name: Nom
100
+ locomotive/translation:
101
+ key: Clé de traduction
102
+ locomotive/theme_asset:
103
+ content_type: Type du fichier
104
+ locomotive/site:
105
+ name: 名称
106
+ locales: 语言
107
+ domain_name: 域名
108
+ subdomain: 子域名
109
+ restricted_access: Activer ?
110
+ access_login: Identifiant
111
+ access_password: "Mot de passe"
112
+ custom_fields/field:
113
+ name: 名称
114
+ hint: 提示
115
+ required: 必填?
116
+ text_formatting: 文字格式
117
+ localized: 多语言化 ?
118
+ select_options: 选项
119
+
120
+ date_picker:
121
+ close_text: Fermer
122
+ prev_text: '<Préc'
123
+ next_text: 'Suiv>'
124
+ current_text: 'Courant'
125
+
2
126
  date:
3
127
  formats:
4
128
  default: "%m/%d/%Y"
5
129
  short: "%b %d"
6
130
  long: "%B %d, %Y"
131
+ long_ordinal: "%e %B %Y"
132
+ only_day: "%e"
7
133
 
8
134
  day_names: [星期日, 星期一, 星期二, 星期三, 星期四, 星期五, 星期六]
9
135
  abbr_day_names: [Sun, Mon, Tue, Wed, Thu, Fri, Sat]
10
-
11
- # Don't forget the nil at the beginning; there's no such thing as a 0th month
12
136
  month_names: [~, 一月, 二月, 三月, 四月, 五月, 六月, 七月, 八月, 九月, 十月, 十一月, 十二月]
13
137
  abbr_month_names: [~, Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec]
14
- # Used in date_select and datetime_select.
15
- order:
16
- - :year
17
- - :month
18
- - :day
138
+ order: [ day, month, year ]
139
+
140
+ pagination:
141
+ previous: "« 前一页"
142
+ next: "后一页 »"
143
+
19
144
  time:
20
145
  formats:
21
146
  default: "%m/%d/%Y %H:%M"
147
+ time: "%H:%M"
22
148
  short: "%d %b %H:%M"
23
149
  long: "%B %d, %Y %H:%M"
150
+ long_ordinal: "%A %d %B %Y %H:%M:%S %Z"
151
+ only_second: "%S"
24
152
  am: "am"
25
153
  pm: "pm"
154
+
26
155
  datetime:
27
156
  distance_in_words:
28
157
  half_a_minute: "半分钟"
29
158
  less_than_x_seconds:
159
+ zero: "0秒"
30
160
  one: "少于1秒"
31
161
  other: "少于%{count}秒"
32
162
  x_seconds:
33
163
  one: "1秒"
34
164
  other: "%{count}秒"
35
165
  less_than_x_minutes:
166
+ zero: "0分钟"
36
167
  one: "少于一分钟"
37
168
  other: "少于%{count}分钟"
38
169
  x_minutes:
@@ -56,9 +187,6 @@ zh-CN:
56
187
  over_x_years:
57
188
  one: "超过1年"
58
189
  other: "超过%{count}年"
59
- almost_x_years:
60
- one: "几乎1年"
61
- other: "几乎%{count}年"
62
190
  prompts:
63
191
  year: "年"
64
192
  month: "月"
@@ -67,50 +195,32 @@ zh-CN:
67
195
  minute: "分"
68
196
  second: "秒"
69
197
 
198
+ number:
199
+ format:
200
+ precision: 3
201
+ separator: ','
202
+ delimiter: ' '
203
+ currency:
204
+ format:
205
+ unit: '€'
206
+ precision: 2
207
+ format: '%n %u'
208
+ human:
209
+ format:
210
+ precision: 2
211
+ storage_units:
212
+ format: '%n %u'
213
+ units:
214
+ byte: 'Octet'
215
+ kb: 'ko'
216
+ mb: 'Mo'
217
+ gb: 'Go'
218
+ tb: 'To'
219
+
70
220
  support:
71
221
  array:
222
+ sentence_connector: 'et'
223
+ skip_last_comma: true
72
224
  words_connector: ","
73
225
  two_words_connector: ""
74
226
  last_word_connector: ","
75
-
76
- mongoid:
77
- errors:
78
- messages:
79
- blank_in_locale: "不能为空"
80
- attributes:
81
- locomotive/content_entry:
82
- created_at: 创建于
83
-
84
- errors:
85
- messages:
86
- domain_taken: "%{value} 已经被占用"
87
- invalid_domain: "%{value} 不正确"
88
- needs_admin_account: "至少需要一个管理员账户"
89
- protected_page: "你不能删除index和404页面"
90
- extname_changed: "新的文件没有原来的扩展名"
91
- array_too_short: "太小了(最少的元素数量是 %{count})"
92
- invalid_theme_file: "不能为空或不是一个zip文件"
93
- site:
94
- default_locale_removed: 先前的默认语言不能被正确删除。
95
- page:
96
- liquid_syntax: "Liquid 语法错误('%{error}' on '%{fullpath}')"
97
- liquid_extend: "页面 '%{fullpath}' 扩展了一个不存在的模板"
98
- liquid_translation: "页面 '%{fullpath}' 扩展了一个未被翻译的模板"
99
- too_few_custom_fields: "至少需要一个自定义字段"
100
- security: "存在一个安全问题"
101
-
102
- attributes:
103
- defaults:
104
- pages:
105
- index:
106
- title: "首页"
107
- body: "首页内容"
108
- "404":
109
- title: "页面找不到"
110
- body: "404页面内容"
111
- other:
112
- body: "{% extends 'parent' %}"
113
-
114
- pagination:
115
- previous: "« 前一页"
116
- next: "后一页 »"
@@ -45,7 +45,7 @@ en:
45
45
  unlock_instructions: 'Инструкции за отключване'
46
46
 
47
47
 
48
- locomotive_account:
48
+ locomotive:
49
49
  devise_mailer:
50
50
  common:
51
51
  hello: Здрасти
@@ -45,7 +45,7 @@ cs:
45
45
  unlock_instructions: 'Intrukce k odemčení'
46
46
 
47
47
 
48
- locomotive_account:
48
+ locomotive:
49
49
  devise_mailer:
50
50
  common:
51
51
  hello: Ahoj
@@ -44,7 +44,7 @@ de:
44
44
  unlock_instructions: 'Anleitung zur Entsperrung'
45
45
 
46
46
 
47
- locomotive_account:
47
+ locomotive:
48
48
  devise_mailer:
49
49
  common:
50
50
  hello: Hallo
@@ -45,7 +45,7 @@ en:
45
45
  unlock_instructions: 'Unlock Instructions'
46
46
 
47
47
 
48
- locomotive_account:
48
+ locomotive:
49
49
  devise_mailer:
50
50
  common:
51
51
  hello: Hello
@@ -45,7 +45,7 @@ es:
45
45
  unlock_instructions: 'Instrucciones de desbloqueo'
46
46
 
47
47
 
48
- locomotive_account:
48
+ locomotive:
49
49
  devise_mailer:
50
50
  common:
51
51
  hello: Hola
@@ -61,4 +61,4 @@ es:
61
61
  unlock_instructions:
62
62
  locked_account_message: "Su clave fue bloqueada debido a un excesivo número de accesos fallidos."
63
63
  unlock_account_instruction: "Haga click en el siguiente enlace para desbloquear su cuenta:"
64
- unlock_my_account: "Desbloquear mi cuenta"
64
+ unlock_my_account: "Desbloquear mi cuenta"
@@ -46,7 +46,7 @@ et:
46
46
  unlock_instructions: 'Lahti lukustamise juhised'
47
47
 
48
48
 
49
- locomotive_account:
49
+ locomotive:
50
50
  devise_mailer:
51
51
  common:
52
52
  hello: Tere
@@ -43,7 +43,7 @@ fr:
43
43
  reset_password_instructions: "Instructions pour la réinitialisation du mot de passe"
44
44
  unlock_instructions: "Instructions pour le déverrouillage"
45
45
 
46
- locomotive_account:
46
+ locomotive:
47
47
  devise_mailer:
48
48
  common:
49
49
  hello: Bienvenue
@@ -45,7 +45,7 @@ it:
45
45
  unlock_instructions: "Istruzioni per lo sblocco dell'account"
46
46
 
47
47
 
48
- locomotive_account:
48
+ locomotive:
49
49
  devise_mailer:
50
50
  common:
51
51
  hello: Ciao
@@ -44,7 +44,7 @@ ja:
44
44
  reset_password_instructions: "パスワードのリセット方法"
45
45
  unlock_instructions: "アカウントのロック解除方法"
46
46
 
47
- locomotive_account:
47
+ locomotive:
48
48
  devise_mailer:
49
49
  common:
50
50
  hello: "こんにちは"
@@ -46,7 +46,7 @@ nb:
46
46
  unlock_instructions: 'Instrukser for åpning'
47
47
 
48
48
 
49
- locomotive_account:
49
+ locomotive:
50
50
  devise_mailer:
51
51
  common:
52
52
  hello: Hallo
@@ -45,7 +45,7 @@ nl:
45
45
  unlock_instructions: 'Unlock Instructions'
46
46
 
47
47
 
48
- locomotive_account:
48
+ locomotive:
49
49
  devise_mailer:
50
50
  common:
51
51
  hello: Hello
@@ -61,4 +61,4 @@ nl:
61
61
  unlock_instructions:
62
62
  locked_account_message: "Your account has been locked due to an excessive amount of unsuccessful sign in attempts."
63
63
  unlock_account_instruction: "Click the link below to unlock your account:"
64
- unlock_my_account: "Unlock my account"
64
+ unlock_my_account: "Unlock my account"