alchemy_cms 3.5.0.rc1 → 3.5.0.rc2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4fe515cb79092ae441a7980d07d5da38e3023221
4
- data.tar.gz: e5d16e9d4d83c30b7025cd69b14a9288e5c8ac23
3
+ metadata.gz: 0d26c504af85a3c863cb1f1474afde99b0999b0e
4
+ data.tar.gz: fa93bfde945a32bdec04ba01bbf9c3f594b1e61a
5
5
  SHA512:
6
- metadata.gz: 079aab266840a0ae38173832d45bcceb9eb17a6294e53284cad2182933603b3839ab239bfb7ad601640590db4c4bfca87841f89b232b933e20f7a5a08d471c92
7
- data.tar.gz: 48957ac1b40ed2f58e312e5924f427955605213a2760dfa9eda8f1d704e4ae8706ff750355999ff419aeddf4ea07ef7b32399e786ef34dd26acca557a0cd53df
6
+ metadata.gz: cfbfbaab2496508d73613a1799453e077d3ebe390273b71c1a80543889a5aa28826e56b2cfd7f65ef8da60a5a6f62a95d5c0b6a711777a0432344c3c6012e8fd
7
+ data.tar.gz: 64cb9dfe665da57d5461f17248023d1d485ee022c78e8b406c36aa3d8ccb75da6736d678d68a497ea7d150884922f4f2404e095348c57eb1012a6e7dd5aa79ab
data/CHANGELOG.md CHANGED
@@ -14,6 +14,7 @@ __New Features__
14
14
 
15
15
  __Notable Changes__
16
16
 
17
+ * The essence date input field is now 100% width (#1191)
17
18
  * The essence view partials don't get cached anymore (#1099)
18
19
  * The essence editor partials don't get cached anymore (#1171)
19
20
  * Removes update_essence_select_elements (#1103)
@@ -33,11 +34,14 @@ __Notable Changes__
33
34
  * Upgrade tasks can now be run separately (#1152)
34
35
  * Update to Tinymce 4.4.3
35
36
  * New sitemap UI (#1172)
37
+ * Removed picture cache flushing (#1185)
38
+ * Removed Mountpoint class (#1186)
36
39
 
37
40
  __Fixed Bugs__
38
41
 
39
42
  * Fix setting of locale when `current_alchemy_user.language` doesn't return a Symbol (#1097)
40
43
  * Presence validation of EssenceFile is not working (#1096)
44
+ * Allow to define unique nestable elements (#852)
41
45
 
42
46
  ## 3.4.2 (unreleased)
43
47
 
@@ -45,6 +49,10 @@ __Notable Changes__
45
49
 
46
50
  * Allow users to manually publish changes on global pages
47
51
 
52
+ __Fixed Bugs__
53
+
54
+ * The `language_links` helper now only renders languages from the current site
55
+
48
56
  ## 3.4.1 (2016-08-31)
49
57
 
50
58
  __Fixed Bugs__
@@ -58,6 +58,9 @@ Alchemy.FileProgress::setCancelled = ->
58
58
  @$fileProgressCancel.hide()
59
59
  @$fileProgressWrapper.delay(1500).fadeOut ->
60
60
  $(this).remove()
61
+ if $('.upload-progress-container').is(':empty')
62
+ $('.overall-upload').removeClass('visible')
63
+ return
61
64
 
62
65
  Alchemy.FileProgress::setStatus = (status) ->
63
66
  @$fileProgressStatus.text Alchemy.t(status)
@@ -434,17 +434,6 @@
434
434
  }
435
435
  }
436
436
 
437
- .content_editor.essence_date {
438
- float: none;
439
- display: inline-block;
440
- vertical-align: middle;
441
- vertical-align: top;
442
-
443
- input.date {
444
- width: 154px;
445
- }
446
- }
447
-
448
437
  .essence_picture_editor {
449
438
  position: relative;
450
439
 
@@ -745,17 +734,6 @@ select.long {
745
734
  }
746
735
  }
747
736
 
748
- &.essence_date {
749
- float: none;
750
- display: inline-block;
751
- vertical-align: middle;
752
- vertical-align: top;
753
-
754
- input.date {
755
- width: 154px;
756
- }
757
- }
758
-
759
737
  &.essence_picture_editor {
760
738
  float: none;
761
739
  height: auto;
@@ -850,3 +828,9 @@ textarea.has_tinymce {
850
828
  .add-nestable-element-button {
851
829
  margin-top: 0;
852
830
  }
831
+
832
+ .essence_date--label {
833
+ position: absolute;
834
+ right: 5px;
835
+ top: 31px;
836
+ }
@@ -25,7 +25,7 @@ module Alchemy
25
25
  def new
26
26
  @page = Page.find(params[:page_id])
27
27
  @parent_element = Element.find_by(id: params[:parent_element_id])
28
- @elements = @page.available_element_definitions(@parent_element.try(:name))
28
+ @elements = @page.available_elements_within_current_scope(@parent_element)
29
29
  @element = @page.elements.build
30
30
  @clipboard = get_clipboard('elements')
31
31
  @clipboard_items = Element.all_from_clipboard_for_page(@clipboard, @page)
@@ -106,11 +106,6 @@ module Alchemy
106
106
  redirect_to_index
107
107
  end
108
108
 
109
- def flush
110
- FileUtils.rm_rf Rails.root.join('public', Alchemy::MountPoint.get, 'pictures')
111
- @notice = Alchemy.t('Picture cache flushed')
112
- end
113
-
114
109
  private
115
110
 
116
111
  def pictures_per_page_for_size(size)
@@ -29,7 +29,7 @@ module Alchemy
29
29
  spacer: '',
30
30
  reverse: false
31
31
  }.merge(options)
32
- languages = Language.published.with_root_page.order("name #{options[:reverse] ? 'DESC' : 'ASC'}")
32
+ languages = Language.on_current_site.published.with_root_page.order("name #{options[:reverse] ? 'DESC' : 'ASC'}")
33
33
  return nil if languages.count < 2
34
34
  render(
35
35
  partial: "alchemy/language_links/language",
@@ -134,6 +134,19 @@ module Alchemy
134
134
  @_available_element_names ||= available_element_definitions.map { |e| e['name'] }
135
135
  end
136
136
 
137
+ # Available element definitions excluding nested unique elements.
138
+ #
139
+ def available_elements_within_current_scope(parent)
140
+ @_available_elements = if parent
141
+ parents_unique_nested_elements = parent.nested_elements.where(unique: true).pluck(:name)
142
+ available_element_definitions(parent.name).reject do |e|
143
+ parents_unique_nested_elements.include? e['name']
144
+ end
145
+ else
146
+ available_element_definitions
147
+ end
148
+ end
149
+
137
150
  # All element definitions defined for page's page layout
138
151
  #
139
152
  # Warning: Since elements can be unique or limited in number,
@@ -24,7 +24,6 @@ module Alchemy
24
24
 
25
25
  include Alchemy::NameConversions
26
26
  include Alchemy::Touching
27
- include Alchemy::Picture::Sweeping
28
27
  include Alchemy::Picture::Transformations
29
28
  include Alchemy::Picture::Url
30
29
 
@@ -1,5 +1,5 @@
1
1
  <% if !@preview_mode && @page && can?(:edit_content, @page) %>
2
- <div id="alchemy_menubar" style="display: none">
2
+ <div id="alchemy_menubar" style="display: none" data-turbolinks="false">
3
3
  <ul>
4
4
  <li><%= link_to Alchemy.t(:to_alchemy), alchemy.admin_dashboard_url %></li>
5
5
  <li><%= link_to Alchemy.t(:edit_page), alchemy.edit_admin_page_url(@page) %></li>
@@ -20,9 +20,15 @@
20
20
  {{/unless}}
21
21
  </div>
22
22
  <div class="page_infos">
23
- <span class="page_status {{#unless public}}not_{{/unless}}public" title="{{status_titles.public}}"></span>
24
- <span class="page_status {{#unless visible}}not_{{/unless}}visible" title="{{status_titles.visible}}"></span>
25
- <span class="page_status {{#unless restricted}}not_{{/unless}}restricted" title="{{status_titles.restricted}}"></span>
23
+ <span class="page_status">
24
+ <span class="icon {{#unless public}}not_{{/unless}}public"></span>
25
+ </span>
26
+ <span class="page_status">
27
+ <span class="icon {{#unless visible}}not_{{/unless}}visible"></span>
28
+ </span>
29
+ <span class="page_status">
30
+ <span class="icon {{#unless restricted}}not_{{/unless}}restricted"></span>
31
+ </span>
26
32
  </div>
27
33
  <div class="sitemap_sitename" id="sitemap_sitename_{{id}}" name="/<%= "#{Alchemy::Language.current.code}/" if multi_language? %>{{urlname}}">
28
34
  {{#if redirects_to_external}}
@@ -38,22 +38,6 @@
38
38
  <label><%= Alchemy.t('Image size') %></label>
39
39
  <%= hidden_field_tag('size', @size, id: 'overlay_thumbnails_size') %>
40
40
  </div>
41
- <% if can?(:flush, Alchemy::Picture) %>
42
- <div class="toolbar_spacer"></div>
43
- <%= toolbar_button(
44
- icon: 'flush',
45
- url: alchemy.flush_admin_pictures_path,
46
- dialog: false,
47
- link_options: {
48
- remote: true,
49
- method: :post
50
- },
51
- label: Alchemy.t('Flush picture cache'),
52
- class: 'icon_button please_wait',
53
- title: Alchemy.t('Flush picture cache'),
54
- skip_permission_check: true
55
- ) %>
56
- <% end %>
57
41
  <div class="toolbar_spacer"></div>
58
42
  <div class="button_with_label">
59
43
  <%= link_to(
@@ -2,7 +2,7 @@
2
2
  buttons: [
3
3
  {
4
4
  icon: 'back',
5
- url: request.referer || "#{Alchemy::MountPoint.get}/admin/dashboard",
5
+ url: request.referer || alchemy.admin_dashboard_path,
6
6
  label: Alchemy.t(:back),
7
7
  title: Alchemy.t(:back),
8
8
  hotkey: 'alt+z',
@@ -7,7 +7,7 @@
7
7
  value: content.settings_value(:default_value, local_assigns.fetch(:options, {}))
8
8
  }
9
9
  ) %>
10
- <label for="<%= content.form_field_id %>" style="cursor: pointer; display: inline; display: inline-block; position: relative; top: 3px; margin: 0;">
10
+ <label for="<%= content.form_field_id %>" class="essence_date--label">
11
11
  <span class="ui-icon ui-icon-calendar"></span>
12
12
  </label>
13
13
  </div>
@@ -238,7 +238,6 @@ de:
238
238
  "Picture renamed successfully": "Bild wurde erfolgreich von %{from} nach %{to} umbenannt"
239
239
  "Picture deleted successfully": "%{name} wurde gelöscht"
240
240
  "Pictures updated successfully": "Die Bilder wurden gespeichert"
241
- "Picture cache flushed": "Bildercache wurde geleert"
242
241
  "Please Signup": "Um Ihre Homepage bearbeiten zu können, müssen Sie als erstes einen Admin Benutzer einrichten."
243
242
  "Please choose": "Bitte wählen"
244
243
  "Please enter a new password": "Bitte geben Sie Ihr neues Passwort ein."
@@ -237,7 +237,6 @@ en:
237
237
  "Picture renamed successfully": "Picture renamed successfully from %{from} to %{to}"
238
238
  "Picture deleted successfully": "Picture %{name} successfully deleted"
239
239
  "Pictures updated successfully": "Pictures updated successfully"
240
- "Picture cache flushed": "Picture cache flushed"
241
240
  "Please Signup": "Please signup to edit your Website."
242
241
  "Please choose": "Please choose"
243
242
  "Please enter a new password": "Please enter a new password."
@@ -238,7 +238,6 @@ es:
238
238
  "Picture renamed successfully": "Imagen renombrada correctamente de %{from} a %{to}"
239
239
  "Picture deleted successfully": "Imagen %{name} eliminada correctamente"
240
240
  "Pictures updated successfully": "Imágenes actualizadas correctamente"
241
- "Picture cache flushed": "Cache de imágenes vaciada"
242
241
  "Please Signup": "Por favor inicia sesión para editar tu web."
243
242
  "Please choose": "Por favor selecciona"
244
243
  "Please enter a new password": "Por favor introduce una nueva contraseña."
@@ -256,7 +256,6 @@ fr:
256
256
  "Picture deleted successfully": "%{name} A été effacé"
257
257
  "Pictures deleted successfully": "Les images %{names} ont été effacées"
258
258
  "Pictures updated successfully": "Les images ont été enregistrées"
259
- "Picture cache flushed": "Le cache de l'image a été vidé"
260
259
  "Please Signup": "Pour être en mesure de modifier votre site Web, vous devez d'abord configurer un utilisateur Admin."
261
260
  "Please choose": "S'il vous plaît Choisir"
262
261
  "Please enter a new password": "S'il vous plaît, entrez votre nouveau mot de passe."
@@ -238,7 +238,6 @@ it:
238
238
  "Picture renamed successfully": "Immagine rinominata con successo da %{from} a %{to}"
239
239
  "Picture deleted successfully": "Immagine %{name} eliminata con successo"
240
240
  "Pictures updated successfully": "Immagini caricate con successo"
241
- "Picture cache flushed": "Cache delle immagini svuotata"
242
241
  "Please Signup": "Registrati per modificare il tuo sito web."
243
242
  "Please choose": "Scegli"
244
243
  "Please enter a new password": "Inserisci una nuova password."
@@ -236,7 +236,6 @@ nl:
236
236
  "Picture renamed successfully": "Afbeelding hernoemd van %{from} naar %{to}"
237
237
  "Picture deleted successfully": "Afbeelding %{name} verwijderd"
238
238
  "Pictures updated successfully": "De afbeelding is geüpdatet"
239
- "Picture cache flushed": "Afbeeldingscache is geleegd"
240
239
  "Please Signup": "Om de homepagina te kunnen bewerken moet er eerst een Admin account gemaakt worden."
241
240
  "Please choose": "Maak een keuze"
242
241
  "Please enter a new password": "Geef een nieuw wachtwoord op"
@@ -237,7 +237,6 @@ ru:
237
237
  "Picture renamed successfully": "Изображение успешно переименовано из %{from} в %{to}"
238
238
  "Picture deleted successfully": "Изображение %{name} успешно удалено"
239
239
  "Pictures updated successfully": "Изображение успешно обновлено"
240
- "Picture cache flushed": "Кэш изображения очищен"
241
240
  "Please Signup": "Пожалуйста, войдите, чтобы редактировать Ваш сайт."
242
241
  "Please choose": "Пожалуйста, выберите"
243
242
  "Please enter a new password": "Пожалуйста, введите новый пароль."
data/config/routes.rb CHANGED
@@ -61,7 +61,7 @@ Alchemy::Engine.routes.draw do
61
61
 
62
62
  resources :pictures, except: [:new] do
63
63
  collection do
64
- post :flush, :update_multiple
64
+ post :update_multiple
65
65
  delete :delete_multiple
66
66
  get :edit_multiple
67
67
  end
@@ -35,7 +35,6 @@ require_relative './hints'
35
35
  require_relative './i18n'
36
36
  require_relative './logger'
37
37
  require_relative './modules'
38
- require_relative './mount_point'
39
38
  require_relative './name_conversions'
40
39
  require_relative './on_page_layout'
41
40
  require_relative './on_page_layout/callbacks_runner'
@@ -1,5 +1,5 @@
1
1
  module Alchemy
2
- VERSION = "3.5.0.rc1"
2
+ VERSION = "3.5.0.rc2"
3
3
 
4
4
  def self.version
5
5
  VERSION
@@ -20,7 +20,7 @@ module Alchemy
20
20
 
21
21
  def copy_templates
22
22
  template "controller.rb.tt", "app/controllers/admin/#{@controller_name}_controller.rb"
23
- template "ability.rb.tt", 'app/models', "alchemy_#{@module_name}_ability.rb"
23
+ template "ability.rb.tt", "app/models/#{@module_name}_ability.rb"
24
24
  template "module_config.rb.tt", "config/initializers/alchemy_#{@module_name}.rb"
25
25
  end
26
26
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alchemy_cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.0.rc1
4
+ version: 3.5.0.rc2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas von Deyen
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2016-11-06 00:00:00.000000000 Z
16
+ date: 2016-12-19 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: active_model_serializers
@@ -531,7 +531,6 @@ files:
531
531
  - app/models/alchemy/page/page_scopes.rb
532
532
  - app/models/alchemy/page/page_users.rb
533
533
  - app/models/alchemy/picture.rb
534
- - app/models/alchemy/picture/sweeping.rb
535
534
  - app/models/alchemy/picture/transformations.rb
536
535
  - app/models/alchemy/picture/url.rb
537
536
  - app/models/alchemy/site.rb
@@ -818,7 +817,6 @@ files:
818
817
  - lib/alchemy/kaminari/scoped_pagination_url_helper.rb
819
818
  - lib/alchemy/logger.rb
820
819
  - lib/alchemy/modules.rb
821
- - lib/alchemy/mount_point.rb
822
820
  - lib/alchemy/name_conversions.rb
823
821
  - lib/alchemy/on_page_layout.rb
824
822
  - lib/alchemy/on_page_layout/callbacks_runner.rb
@@ -1,17 +0,0 @@
1
- module Alchemy
2
- module Picture::Sweeping
3
- extend ActiveSupport::Concern
4
-
5
- included do
6
- after_update { expire_cache_for(self) }
7
- after_destroy { expire_cache_for(self) }
8
- end
9
-
10
- private
11
-
12
- # Removing all variants of the picture with FileUtils.
13
- def expire_cache_for(picture)
14
- FileUtils.rm_rf(Rails.root.join('public', Alchemy::MountPoint.get.gsub(/^\//, ''), 'pictures', picture.id.to_s))
15
- end
16
- end
17
- end
@@ -1,45 +0,0 @@
1
- require 'rails'
2
-
3
- module Alchemy
4
- # Utilities for Alchemy's mount point in the host rails app.
5
- #
6
- class MountPoint
7
- MOUNT_POINT_REGEXP = /mount\sAlchemy::Engine\s=>\s['|"](\/\w*)['|"]/
8
-
9
- class << self
10
- # Returns the path of Alchemy's mount point in current rails app.
11
- #
12
- # @param [Boolean] remove_leading_slash_if_blank
13
- # Pass false to not return a leading slash on empty mount point.
14
- #
15
- def get(remove_leading_slash_if_blank = true)
16
- if path == "/" && remove_leading_slash_if_blank
17
- path.gsub(/\A\/\z/, '')
18
- else
19
- path
20
- end
21
- end
22
-
23
- # Returns the mount point path from the Rails app routes.
24
- #
25
- def path
26
- match = File.read(routes_file_path).match(MOUNT_POINT_REGEXP)
27
- if match.nil?
28
- raise NotMountedError
29
- else
30
- match[1]
31
- end
32
- end
33
-
34
- private
35
-
36
- def routes_file_path
37
- if Rails.root
38
- Rails.root.join('config/routes.rb')
39
- else
40
- 'config/routes.rb'
41
- end
42
- end
43
- end
44
- end
45
- end