alchemy-richmedia-essences 0.2.0 → 0.3.0

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: b4aad3cb02328b0f4f7310591cbcfcc0cd4a6a88
4
- data.tar.gz: 4859c2f54981879ddf22564073960d37f8c16c5f
3
+ metadata.gz: c368e688fbed9b1e75d5390132a2e96c8aab3a3a
4
+ data.tar.gz: 1466c1312100108384f41c867705792d2f2a558d
5
5
  SHA512:
6
- metadata.gz: f47703c4adfffa3961b694d07b162195c3106caedcd8de65b97b97666c3122bf270676b6985f996ee3d07d58daa6973e6d7e96b475f8bee963ae626d1a84f7c7
7
- data.tar.gz: a3299b85bbbb07d135c55574875fabfc1dbe12dc79366862f1442d163c600ec1cdce9ab226c60aab468f41431a1045ab0e7f0890204dc10f24db984b9f729ed6
6
+ metadata.gz: 3b4f8af2708993d78972231d631a4c3007474848c2b2cabb1dd972a0b2ffc3e598972294420e7fd9016b6ded9e40b4ce6917fd3c6f60c05a688aa55793ddf162
7
+ data.tar.gz: 0e0ca4a660ad8e1f337beab1fddc44008312170ec41426afd80d78b0374836abb56cbc6b83967ac3c140b3bbc5c320e461fa4eb3ed7ffa5fa843c86549d44747
data/LICENSE.txt CHANGED
@@ -1,22 +1,27 @@
1
- Copyright (c) 2012 Thomas von Deyen
1
+ Copyright (c) 2010-2014, magic labs GmbH, Hamburg Germany
2
+ All rights reserved.
2
3
 
3
- MIT License
4
+ Redistribution and use in source and binary forms, with or without modification,
5
+ are permitted provided that the following conditions are met:
4
6
 
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- "Software"), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
7
+ Redistributions of source code must retain the above copyright notice, this
8
+ list of conditions and the following disclaimer.
12
9
 
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
10
+ Redistributions in binary form must reproduce the above copyright notice, this
11
+ list of conditions and the following disclaimer in the documentation and/or
12
+ other materials provided with the distribution.
15
13
 
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
14
+ Neither the name of the magic labs GmbH nor the names of its
15
+ contributors may be used to endorse or promote products derived from
16
+ this software without specific prior written permission.
17
+
18
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
22
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
25
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
data/README.md CHANGED
@@ -2,7 +2,9 @@
2
2
 
3
3
  Adds EssenceAudio, EssenceFlash and EssenceVideo essences to your Alchemy CMS powered site.
4
4
 
5
- This version is compatible with Alchemy version 2.7 and above.
5
+ This version is compatible with Alchemy version 3.0 and above only.
6
+
7
+ For Alchemy v2.7.0 please use version 0.2.0.
6
8
 
7
9
  For Alchemy v2.6.0 and below please use version 0.1.0.
8
10
 
@@ -8,12 +8,13 @@ Gem::Specification.new do |gem|
8
8
  gem.version = Alchemy::Richmedia::Essences::VERSION
9
9
  gem.authors = ["Thomas von Deyen"]
10
10
  gem.email = ["tvdeyen@gmail.com"]
11
- gem.description = %q{EssenceAudio, EssenceFlash and EssenceVideo for Alchemy CMS}
11
+ gem.description = %q{EssenceAudio, EssenceFlash and EssenceVideo for Alchemy CMS 3.0}
12
12
  gem.summary = %q{Adds EssenceAudio, EssenceFlash and EssenceVideo essences to your Alchemy CMS powered site.}
13
13
  gem.homepage = "http://alchemy-cms.com"
14
+ gem.license = 'BSD New'
14
15
 
15
16
  gem.files = `git ls-files`.split($/)
16
17
  gem.require_paths = ["lib"]
17
18
 
18
- gem.add_runtime_dependency 'alchemy_cms', ['>= 2.7.0', '< 3.0.0']
19
+ gem.add_runtime_dependency 'alchemy_cms', ['>= 3.0.0.rc4']
19
20
  end
@@ -1,21 +1,26 @@
1
1
  module Alchemy
2
2
  class Admin::EssenceAudiosController < Alchemy::Admin::BaseController
3
-
3
+ authorize_resource class: Alchemy::EssenceAudio
4
4
  before_filter :load_essence
5
5
 
6
- def edit
7
- render :layout => false
8
- end
9
-
10
6
  def update
11
- @essence_audio.update_attributes(params[:essence_audio])
7
+ @essence_audio.update(essence_audio_params)
12
8
  end
13
9
 
14
- private
10
+ private
15
11
 
16
12
  def load_essence
17
13
  @essence_audio = EssenceAudio.find(params[:id])
18
14
  end
19
15
 
16
+ def essence_audio_params
17
+ params.require(:essence_audio).permit(
18
+ :width,
19
+ :height,
20
+ :show_eq,
21
+ :show_navigation,
22
+ :attachment_id
23
+ )
24
+ end
20
25
  end
21
26
  end
@@ -1,21 +1,25 @@
1
1
  module Alchemy
2
2
  class Admin::EssenceFlashesController < Alchemy::Admin::BaseController
3
-
3
+ authorize_resource class: Alchemy::EssenceFlash
4
4
  before_filter :load_essence
5
5
 
6
- def edit
7
- render :layout => false
8
- end
9
-
10
6
  def update
11
- @essence_flash.update_attributes(params[:essence_flash])
7
+ @essence_flash.update(essence_flash_params)
12
8
  end
13
9
 
14
- private
10
+ private
15
11
 
16
12
  def load_essence
17
13
  @essence_flash = EssenceFlash.find(params[:id])
18
14
  end
19
15
 
16
+ def essence_flash_params
17
+ params.require(:essence_flash).permit(
18
+ :width,
19
+ :height,
20
+ :player_version,
21
+ :attachment_id
22
+ )
23
+ end
20
24
  end
21
25
  end
@@ -1,21 +1,27 @@
1
1
  module Alchemy
2
2
  class Admin::EssenceVideosController < Alchemy::Admin::BaseController
3
-
3
+ authorize_resource class: Alchemy::EssenceVideo
4
4
  before_filter :load_essence
5
5
 
6
- def edit
7
- render :layout => false
8
- end
9
-
10
6
  def update
11
- @essence_video.update_attributes(params[:essence_video])
7
+ @essence_video.update(essence_video_params)
12
8
  end
13
9
 
14
- private
10
+ private
15
11
 
16
12
  def load_essence
17
13
  @essence_video = EssenceVideo.find(params[:id])
18
14
  end
19
15
 
16
+ def essence_video_params
17
+ params.require(:essence_video).permit(
18
+ :width,
19
+ :height,
20
+ :allow_fullscreen,
21
+ :auto_play,
22
+ :show_navigation,
23
+ :attachment_id
24
+ )
25
+ end
20
26
  end
21
27
  end
@@ -1,20 +1,8 @@
1
1
  module Alchemy
2
2
  class EssenceAudio < ActiveRecord::Base
3
-
4
- attr_accessible(
5
- :width,
6
- :height,
7
- :show_eq,
8
- :show_navigation,
9
- :attachment_id
10
- )
11
-
12
- acts_as_essence(
13
- :ingredient_column => :attachment,
14
- :preview_text_method => :name
15
- )
3
+ acts_as_essence ingredient_column: 'attachment',
4
+ preview_text_method: 'name'
16
5
 
17
6
  belongs_to :attachment
18
-
19
7
  end
20
8
  end
@@ -1,19 +1,8 @@
1
1
  module Alchemy
2
2
  class EssenceFlash < ActiveRecord::Base
3
-
4
- attr_accessible(
5
- :width,
6
- :height,
7
- :player_version,
8
- :attachment_id
9
- )
10
-
11
- acts_as_essence(
12
- :ingredient_column => :attachment,
13
- :preview_text_method => :name
14
- )
3
+ acts_as_essence ingredient_column: 'attachment',
4
+ preview_text_method: 'name'
15
5
 
16
6
  belongs_to :attachment
17
-
18
7
  end
19
8
  end
@@ -1,21 +1,8 @@
1
1
  module Alchemy
2
2
  class EssenceVideo < ActiveRecord::Base
3
-
4
- attr_accessible(
5
- :width,
6
- :height,
7
- :allow_fullscreen,
8
- :auto_play,
9
- :show_navigation,
10
- :attachment_id
11
- )
12
-
13
- acts_as_essence(
14
- :ingredient_column => :attachment,
15
- :preview_text_method => :name
16
- )
3
+ acts_as_essence ingredient_column: 'attachment',
4
+ preview_text_method: 'name'
17
5
 
18
6
  belongs_to :attachment
19
-
20
7
  end
21
8
  end
@@ -1,25 +1,7 @@
1
- <%= form_for([:admin, @essence_audio], :remote => true) do |f| %>
2
- <table>
3
- <tr>
4
- <td class="label"><%= f.label "width" %></td>
5
- <td class="input"><%= f.text_field "width", :class => 'thin_border' %></td>
6
- </tr>
7
- <tr>
8
- <td class="label"><%= f.label "height" %></td>
9
- <td class="input"><%= f.text_field "height", :class => 'thin_border' %></td>
10
- </tr>
11
- <tr>
12
- <td class="label"><%= f.label "show_eq" %></td>
13
- <td class="checkbox"><%= f.check_box "show_eq" %></td>
14
- </tr>
15
- <tr>
16
- <td class="label"><%= f.label "show_navigation" %></td>
17
- <td class="checkbox"><%= f.check_box "show_navigation" %></td>
18
- </tr>
19
- <tr>
20
- <td colspan="2" class="submit">
21
- <%= f.button t("save"), :class => 'button' %>
22
- </td>
23
- </tr>
24
- </table>
1
+ <%= alchemy_form_for [:admin, @essence_audio] do |f| %>
2
+ <%= f.input :width %>
3
+ <%= f.input :height %>
4
+ <%= f.input :show_eq %>
5
+ <%= f.input :show_navigation %>
6
+ <%= f.submit _t(:save) %>
25
7
  <% end %>
@@ -1,21 +1,6 @@
1
- <%= form_for([:admin, @essence_flash], :remote => true) do |f| %>
2
- <table>
3
- <tr>
4
- <td class="label"><%= f.label "width" %></td>
5
- <td class="input"><%= f.text_field "width", :class => 'thin_border' %></td>
6
- </tr>
7
- <tr>
8
- <td class="label"><%= f.label "height" %></td>
9
- <td class="input"><%= f.text_field "height", :class => 'thin_border' %></td>
10
- </tr>
11
- <tr>
12
- <td class="label"><%= f.label "player_version" %></td>
13
- <td class="input"><%= f.text_field "player_version", :class => 'thin_border' %></td>
14
- </tr>
15
- <tr>
16
- <td colspan="2" class="submit">
17
- <%= f.button t("save"), :class => 'button' %>
18
- </td>
19
- </tr>
20
- </table>
1
+ <%= alchemy_form_for [:admin, @essence_flash] do |f| %>
2
+ <%= f.input :width %>
3
+ <%= f.input :height %>
4
+ <%= f.input :player_version %>
5
+ <%= f.submit _t(:save) %>
21
6
  <% end %>
@@ -1,29 +1,8 @@
1
- <%= form_for([:admin, @essence_video], :remote => true) do |f| %>
2
- <table>
3
- <tr>
4
- <td class="label"><%= f.label "width" %></td>
5
- <td class="input"><%= f.text_field "width", :class => 'thin_border' %></td>
6
- </tr>
7
- <tr>
8
- <td class="label"><%= f.label "height" %></td>
9
- <td class="input"><%= f.text_field "height", :class => 'thin_border' %></td>
10
- </tr>
11
- <tr>
12
- <td class="label"><%= f.label "allow_fullscreen" %></td>
13
- <td class="checkbox"><%= f.check_box "allow_fullscreen" %></td>
14
- </tr>
15
- <tr>
16
- <td class="label"><%= f.label "auto_play" %></td>
17
- <td class="checkbox"><%= f.check_box "auto_play" %></td>
18
- </tr>
19
- <tr>
20
- <td class="label"><%= f.label "show_navigation" %></td>
21
- <td class="checkbox"><%= f.check_box "show_navigation" %></td>
22
- </tr>
23
- <tr>
24
- <td colspan="2" class="submit">
25
- <%= f.button t("save"), :class => 'button' %>
26
- </td>
27
- </tr>
28
- </table>
1
+ <%= alchemy_form_for [:admin, @essence_video] do |f| %>
2
+ <%= f.input :width %>
3
+ <%= f.input :height %>
4
+ <%= f.input :allow_fullscreen %>
5
+ <%= f.input :auto_play %>
6
+ <%= f.input :show_navigation %>
7
+ <%= f.submit _t(:save) %>
29
8
  <% end %>
@@ -1,4 +1,4 @@
1
- <div class="content_editor" id="<%= content_dom_id(content) %>">
1
+ <div class="content_editor essence_file" id="<%= content.dom_id %>">
2
2
  <label style="display: inline">
3
3
  <%= render_content_name(content) %>
4
4
  <%= delete_content_link(content) %>
@@ -6,59 +6,60 @@
6
6
  <div class="file" id="file_<%= content.id %>">
7
7
  <div class="file_icon">
8
8
  <% if content.ingredient.nil? %>
9
- <%= link_to_overlay_window("",
9
+ <%= link_to_dialog '',
10
10
  alchemy.admin_attachments_path(
11
- :content_id => content.id,
12
- :only => options[:file_assign_show_only],
13
- :except => options[:file_assign_do_not_show],
14
- :options => options
11
+ content_id: content.id,
12
+ only: options[:file_assign_show_only],
13
+ except: options[:file_assign_do_not_show],
14
+ options: options.to_json
15
15
  ),
16
16
  {
17
- :title => t('assign_file'),
18
- :size => '520x400',
19
- :resizable => 'true'
17
+ title: _t(:assign_file),
18
+ size: '780x585',
19
+ padding: false
20
20
  },
21
- :class => 'assign_file',
22
- :title => t('assign_file')
23
- ) %>
21
+ class: 'assign_file',
22
+ title: _t(:assign_file)
23
+ %>
24
24
  <% else %>
25
25
  <%= render_icon(content.ingredient.icon_css_class) %>
26
26
  <% end %>
27
27
  </div>
28
28
  <div class="file_name">
29
- <%= content.ingredient.name rescue ("&#x2190;" + t('assign_file_from_archive')).html_safe %>
29
+ <%= content.ingredient.name rescue ("&#x2190;" + _t(:assign_file_from_archive)).html_safe %>
30
30
  </div>
31
31
  <% unless content.ingredient.nil? %>
32
32
  <%= hidden_field_tag content.form_field_name(:attachment_id), content.ingredient.id %>
33
33
  <div class="essence_file_tools">
34
- <%= link_to_overlay_window("",
34
+ <%= link_to_dialog '',
35
35
  alchemy.admin_attachments_path(
36
- :content_id => content.id,
37
- :only => options[:file_assign_show_only],
38
- :except => options[:file_assign_do_not_show],
39
- :options => options
36
+ content_id: content.id,
37
+ only: options[:file_assign_show_only],
38
+ except: options[:file_assign_do_not_show],
39
+ options: options.to_json
40
40
  ),
41
41
  {
42
- :title => t('assign_file'),
43
- :size => '520x400',
44
- :resizable => 'true'
42
+ title: _t(:assign_file),
43
+ size: '780x585',
44
+ padding: false
45
45
  },
46
- :class => 'assign_file',
47
- :title => t('assign_file')
48
- ) %>
49
- <%= link_to_overlay_window("",
46
+ class: 'assign_file',
47
+ title: _t(:assign_file)
48
+ %>
49
+ <%= link_to_dialog '',
50
50
  url_for(
51
- :controller => controller,
52
- :action => 'edit',
53
- :id => content.essence.id
51
+ controller: controller,
52
+ action: 'edit',
53
+ options: options.to_json,
54
+ id: content
54
55
  ),
55
56
  {
56
- :title => t('edit_file_properties'),
57
- :size => '400x150'
57
+ title: _t(:edit_file_properties),
58
+ size: '400x165'
58
59
  },
59
- :class => 'edit_file',
60
- :title => t('edit_file_properties')
61
- ) %>
60
+ class: 'edit_file',
61
+ title: _t(:edit_file_properties)
62
+ %>
62
63
  </div>
63
64
  <% end %>
64
65
  </div>
@@ -1 +1,9 @@
1
+ require "alchemy_cms"
1
2
  require "alchemy-richmedia-essences/engine"
3
+
4
+ module Alchemy
5
+ module Richmedia
6
+ module Essences
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,18 @@
1
+ module Alchemy
2
+ module Richmedia
3
+ module Essences
4
+ class Ability
5
+ include CanCan::Ability
6
+
7
+ def initialize(user)
8
+ return if user.nil?
9
+ if user.has_role?(:author) || user.has_role?(:editor) || user.has_role?(:admin)
10
+ can :manage, Alchemy::EssenceAudio
11
+ can :manage, Alchemy::EssenceFlash
12
+ can :manage, Alchemy::EssenceVideo
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -1,3 +1,5 @@
1
+ require "alchemy-richmedia-essences/ability"
2
+
1
3
  module Alchemy
2
4
  module Richmedia
3
5
  module Essences
@@ -5,10 +7,9 @@ module Alchemy
5
7
  engine_name 'alchemy_richmedia_essences'
6
8
  config.mount_at = '/'
7
9
 
8
- initializer "alchemy_richmedia_essences.add_authorization_rules" do
9
- Alchemy::Auth::Engine.get_instance.load(File.join(File.dirname(__FILE__), '../..', 'config/authorization_rules.rb'))
10
+ initializer "alchemy_richmedia_essences.register_ability" do
11
+ Alchemy.register_ability Alchemy::Richmedia::Essences::Ability
10
12
  end
11
-
12
13
  end
13
14
  end
14
15
  end
@@ -1,7 +1,7 @@
1
1
  module Alchemy
2
2
  module Richmedia
3
3
  module Essences
4
- VERSION = "0.2.0"
4
+ VERSION = "0.3.0"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alchemy-richmedia-essences
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas von Deyen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-18 00:00:00.000000000 Z
11
+ date: 2014-08-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: alchemy_cms
@@ -16,21 +16,15 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 2.7.0
20
- - - "<"
21
- - !ruby/object:Gem::Version
22
- version: 3.0.0
19
+ version: 3.0.0.rc4
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
24
  - - ">="
28
25
  - !ruby/object:Gem::Version
29
- version: 2.7.0
30
- - - "<"
31
- - !ruby/object:Gem::Version
32
- version: 3.0.0
33
- description: EssenceAudio, EssenceFlash and EssenceVideo for Alchemy CMS
26
+ version: 3.0.0.rc4
27
+ description: EssenceAudio, EssenceFlash and EssenceVideo for Alchemy CMS 3.0
34
28
  email:
35
29
  - tvdeyen@gmail.com
36
30
  executables: []
@@ -59,14 +53,15 @@ files:
59
53
  - app/views/alchemy/essences/_essence_video_editor.html.erb
60
54
  - app/views/alchemy/essences/_essence_video_view.html.erb
61
55
  - app/views/alchemy/essences/_richmedia_essence_editor.html.erb
62
- - config/authorization_rules.rb
63
56
  - config/routes.rb
64
57
  - db/migrate/20121113171023_create_alchemy_richmedia_essences.rb
65
58
  - lib/alchemy-richmedia-essences.rb
59
+ - lib/alchemy-richmedia-essences/ability.rb
66
60
  - lib/alchemy-richmedia-essences/engine.rb
67
61
  - lib/alchemy-richmedia-essences/version.rb
68
62
  homepage: http://alchemy-cms.com
69
- licenses: []
63
+ licenses:
64
+ - BSD New
70
65
  metadata: {}
71
66
  post_install_message:
72
67
  rdoc_options: []
@@ -84,7 +79,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
84
79
  version: '0'
85
80
  requirements: []
86
81
  rubyforge_project:
87
- rubygems_version: 2.2.0
82
+ rubygems_version: 2.2.2
88
83
  signing_key:
89
84
  specification_version: 4
90
85
  summary: Adds EssenceAudio, EssenceFlash and EssenceVideo essences to your Alchemy
@@ -1,9 +0,0 @@
1
- authorization do
2
-
3
- role :author do
4
- has_permission_on :alchemy_admin_essence_audios, :to => [:edit, :update]
5
- has_permission_on :alchemy_admin_essence_flashes, :to => [:edit, :update]
6
- has_permission_on :alchemy_admin_essence_videos, :to => [:edit, :update]
7
- end
8
-
9
- end