ecm_pictures 1.0.0.pre → 1.0.1.pre

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.
@@ -0,0 +1,9 @@
1
+ class Ecm::Pictures::PictureGalleriesController < ApplicationController
2
+ def index
3
+ @picture_galleries = Ecm::Pictures::PictureGallery.all
4
+ end
5
+
6
+ def show
7
+ @picture_gallery = Ecm::Pictures::PictureGallery.find(params[:id])
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ class Ecm::Pictures::PicturesController < ApplicationController
2
+ def index
3
+ @pictures = Ecm::Pictures::Picture.all
4
+ end
5
+
6
+ def show
7
+ @picture = Ecm::Pictures::Picture.find(params[:id])
8
+ end
9
+ end
@@ -59,7 +59,9 @@ module Ecm::PicturesHelper
59
59
  content_tag(:p, I18n.t('ecm.pictures.picture.warnings.missing', :name => name.to_s))
60
60
  end
61
61
  else
62
- render picture
62
+ content_tag(:div, :class => 'row') do
63
+ render picture
64
+ end
63
65
  end
64
66
 
65
67
  rescue Exception => e
@@ -1,7 +1,9 @@
1
1
  <div class="thumbnail picture_gallery-preview span3" id="picture-gallery-<%= picture_gallery.id %>">
2
- <div class="picture-image">
3
- <%= image_tag picture_gallery.pictures.first.image.url(:default_thumb) %>
4
- </div>
2
+ <% if picture_gallery.pictures.first.respond_to?(:image) %>
3
+ <div class="picture-image">
4
+ <%= image_tag picture_gallery.pictures.first.image.url(:default_thumb) %>
5
+ </div>
6
+ <% end %>
5
7
  <div class="caption">
6
8
  <h3><%= picture_gallery.name %></h3>
7
9
  <div class="description"><%= mu(picture_gallery, :description) %></div>
@@ -0,0 +1,5 @@
1
+ <h1>Picture Galleries</h1>
2
+
3
+ <% @picture_galleries.each do |pg| %>
4
+ <%= render :partial => 'ecm/pictures/picture_galleries/picture_gallery_for_index', :locals => { :picture_gallery => pg } %>
5
+ <% end %>
@@ -0,0 +1,7 @@
1
+ <h1><%= @picture_gallery.to_s %></h1>
2
+
3
+ <%= render @picture_gallery %>
4
+
5
+ <p><%= link_to Ecm::Pictures::PictureGallery.model_name.human(:count => :other), ecm_pictures_picture_galleries_path, :class => 'btn' %></p>
6
+
7
+ <p><%= link_to t('back'), :back %></p>
@@ -1,7 +1,6 @@
1
- <div class="row">
2
- <div class="picture span3" id="picture-<%= picture.to_param %>">
3
- <%= link_to("#{picture.image.url}#{File.extname(picture.image_file_name)}", :class => 'thumbnail') do %>
4
- <%= image_tag(picture.image.url(:default_thumb)) %>
5
- <% end %>
6
- </div>
1
+ <div class="picture span3" id="picture-<%= picture.to_param %>">
2
+ <%= link_to("#{picture.image.url}#{File.extname(picture.image_file_name).downcase}", :class => 'thumbnail') do %>
3
+ <% image_tag(picture.image.url(:default_thumb)) %>
4
+ <% end %>
7
5
  </div>
6
+
@@ -0,0 +1,10 @@
1
+ <h1><%= Ecm::Pictures::Picture.model_name.human %></h1>
2
+
3
+ <% @pictures.each do |picture| %>
4
+ <p>
5
+ <h2><%= picture %></h2>
6
+ <div class="row">
7
+ <%= render picture %>
8
+ </div>
9
+ </p>
10
+ <% end %>
@@ -0,0 +1,11 @@
1
+ <h1><%= @picture.to_s %></h1>
2
+
3
+ <p>
4
+ <div class="row">
5
+ <%= render @picture %>
6
+ </div>
7
+ </p>
8
+
9
+ <p><%= link_to @picture.picture_gallery, @picture.picture_gallery, :class => 'btn' %></p>
10
+
11
+ <p><%= link_to t('back'), :back %></p>
@@ -20,3 +20,6 @@ de:
20
20
  position: Position
21
21
  thumbnail: Vorschau
22
22
  updated_at: Aktualisiert am
23
+ resources:
24
+ ecm_pictures_pictures: bilder
25
+
@@ -20,4 +20,6 @@ en:
20
20
  position: position
21
21
  thumbnail: thumbnail
22
22
  updated_at: updated at
23
+ resources:
24
+ ecm_pictures_pictures: pictures
23
25
 
@@ -16,3 +16,6 @@ de:
16
16
  pictures_count: Bilder
17
17
  position: Position
18
18
  updated_at: Aktualisiert am
19
+ resources:
20
+ ecm_pictures_picture_galleries: bildgalerien
21
+
@@ -16,4 +16,6 @@ en:
16
16
  pictures_count: pictures
17
17
  position: position
18
18
  updated_at: updated at
19
+ resources:
20
+ ecm_pictures_picture_galleries: picture-galleries
19
21
 
@@ -0,0 +1,22 @@
1
+ module Ecm
2
+ module Pictures
3
+ class Routing
4
+ # Creates the routes for pictures and galleries. You can pass options to
5
+ # specify the actions for both pictures and/or galleries.
6
+ #
7
+ # Ecm::Pictures::Routing.routes(self, { :picture_gallery_actions => [ :show ]})
8
+ #
9
+ # This will only create the show action for picture galleries, but omit the index action.
10
+ def self.routes(router, options = {})
11
+ options.reverse_merge!(
12
+ { :picture_gallery_actions => [:index, :show],
13
+ :picture_actions => [:index, :show]
14
+ }
15
+ )
16
+
17
+ router.resources :ecm_pictures_picture_galleries, :only => options[:picture_gallery_actions], :controller => 'ecm/pictures/picture_galleries'
18
+ router.resources :ecm_pictures_pictures,:only => options[:picture_actions], :controller => 'ecm/pictures/pictures'
19
+ end
20
+ end
21
+ end
22
+ end
@@ -1,5 +1,5 @@
1
1
  module Ecm
2
2
  module Pictures
3
- VERSION = "1.0.0.pre"
3
+ VERSION = "1.0.1.pre"
4
4
  end
5
5
  end
data/lib/ecm_pictures.rb CHANGED
@@ -6,6 +6,7 @@ require 'paperclip'
6
6
 
7
7
  require 'ecm/pictures/engine'
8
8
  require 'ecm/pictures/configuration'
9
+ require 'ecm/pictures/routing'
9
10
  require 'ecm/pictures/version'
10
11
 
11
12
  module Ecm
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ecm_pictures
3
3
  version: !ruby/object:Gem::Version
4
- hash: 961915988
4
+ hash: 961915984
5
5
  prerelease: 6
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 0
9
+ - 1
10
10
  - pre
11
- version: 1.0.0.pre
11
+ version: 1.0.1.pre
12
12
  platform: ruby
13
13
  authors:
14
14
  - Roberto Vasquez Angel
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2012-10-03 00:00:00 Z
19
+ date: 2012-11-07 00:00:00 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  name: rails
@@ -351,12 +351,18 @@ extensions: []
351
351
  extra_rdoc_files: []
352
352
 
353
353
  files:
354
+ - app/controllers/ecm/pictures/picture_galleries_controller.rb
355
+ - app/controllers/ecm/pictures/pictures_controller.rb
354
356
  - app/helpers/ecm/pictures_helper.rb
355
357
  - app/helpers/markup_helper.rb
358
+ - app/views/ecm/pictures/picture_galleries/show.html.erb
356
359
  - app/views/ecm/pictures/picture_galleries/_picture_gallery.html.erb
360
+ - app/views/ecm/pictures/picture_galleries/index.html.erb
357
361
  - app/views/ecm/pictures/picture_galleries/_picture_gallery_for_index.html.erb
358
362
  - app/views/ecm/pictures/pictures/_picture.html.erb
363
+ - app/views/ecm/pictures/pictures/show.html.erb
359
364
  - app/views/ecm/pictures/pictures/_picture_for_gallery.html.erb
365
+ - app/views/ecm/pictures/pictures/index.html.erb
360
366
  - app/models/ecm/pictures/picture_gallery.rb
361
367
  - app/models/ecm/pictures/picture.rb
362
368
  - config/locales/ecm.pictures.picture_gallery.de.yml
@@ -376,6 +382,7 @@ files:
376
382
  - lib/ecm/pictures/active_admin/ecm_pictures_pictures.rb
377
383
  - lib/ecm/pictures/engine.rb
378
384
  - lib/ecm/pictures/version.rb
385
+ - lib/ecm/pictures/routing.rb
379
386
  - lib/ecm/pictures/configuration.rb
380
387
  - MIT-LICENSE
381
388
  - Rakefile