ecm_pictures 0.0.12 → 0.0.14
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/README.rdoc +24 -2
 - data/app/helpers/ecm/pictures_helper.rb +11 -0
 - data/lib/ecm/pictures/engine.rb +6 -9
 - data/lib/ecm/pictures/version.rb +1 -1
 - metadata +3 -3
 
    
        data/README.rdoc
    CHANGED
    
    | 
         @@ -1,8 +1,18 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            = EcmPictureGallery
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
       3 
     | 
    
         
            -
             
     | 
| 
      
 3 
     | 
    
         
            +
            = Purpose
         
     | 
| 
       4 
4 
     | 
    
         | 
| 
       5 
     | 
    
         
            -
             
     | 
| 
      
 5 
     | 
    
         
            +
            Create and administrate picture galleries in active admin and display them on
         
     | 
| 
      
 6 
     | 
    
         
            +
            in your ruby on rails applictation. Orangebox is used for lightbox support.
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
            = Features
         
     | 
| 
      
 9 
     | 
    
         
            +
             
     | 
| 
      
 10 
     | 
    
         
            +
              * Drop in module for active admin.
         
     | 
| 
      
 11 
     | 
    
         
            +
              * Render a gallery with one method call in your views.
         
     | 
| 
      
 12 
     | 
    
         
            +
              * Lightbox support.
         
     | 
| 
      
 13 
     | 
    
         
            +
              * Picture and Gallery sorting.
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
      
 15 
     | 
    
         
            +
            = Installation
         
     | 
| 
       6 
16 
     | 
    
         | 
| 
       7 
17 
     | 
    
         
             
            Add it to your gemfile:
         
     | 
| 
       8 
18 
     | 
    
         | 
| 
         @@ -17,3 +27,15 @@ Update your layout to include the needed css and javascript: 
     | 
|
| 
       17 
27 
     | 
    
         
             
              <!-- ecm pictures -->
         
     | 
| 
       18 
28 
     | 
    
         
             
              <%= javascript_include_tag "ecm_pictures" %>
         
     | 
| 
       19 
29 
     | 
    
         
             
              <%= stylesheet_link_tag "ecm_pictures" %>
         
     | 
| 
      
 30 
     | 
    
         
            +
              
         
     | 
| 
      
 31 
     | 
    
         
            +
            = Usage
         
     | 
| 
      
 32 
     | 
    
         
            +
             
     | 
| 
      
 33 
     | 
    
         
            +
            You can administrate your pictures and picture galleries in active admin.
         
     | 
| 
      
 34 
     | 
    
         
            +
             
     | 
| 
      
 35 
     | 
    
         
            +
            Once you have a gallery, you can display it like this:
         
     | 
| 
      
 36 
     | 
    
         
            +
             
     | 
| 
      
 37 
     | 
    
         
            +
              <%= render_picture_gallery 'Holidays 2012' %>
         
     | 
| 
      
 38 
     | 
    
         
            +
             
     | 
| 
      
 39 
     | 
    
         
            +
            = License
         
     | 
| 
      
 40 
     | 
    
         
            +
             
     | 
| 
      
 41 
     | 
    
         
            +
            This project rocks and uses MIT-LICENSE.
         
     | 
| 
         @@ -1,4 +1,12 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            module Ecm::PicturesHelper
         
     | 
| 
      
 2 
     | 
    
         
            +
              # renders picture galleries in your views
         
     | 
| 
      
 3 
     | 
    
         
            +
              #
         
     | 
| 
      
 4 
     | 
    
         
            +
              # = Usage
         
     | 
| 
      
 5 
     | 
    
         
            +
              #
         
     | 
| 
      
 6 
     | 
    
         
            +
              # Assume you have created a picture gallery named "Holidays 2012". You can 
         
     | 
| 
      
 7 
     | 
    
         
            +
              # render it in your view as follows:
         
     | 
| 
      
 8 
     | 
    
         
            +
              # 
         
     | 
| 
      
 9 
     | 
    
         
            +
              #  <%= render_picture_gallery 'Holidays 2012' %>
         
     | 
| 
       2 
10 
     | 
    
         
             
              def render_picture_gallery(name, options = {})
         
     | 
| 
       3 
11 
     | 
    
         
             
                begin  
         
     | 
| 
       4 
12 
     | 
    
         
             
                  options = {:preview_style => :thumb}.merge(options)
         
     | 
| 
         @@ -13,6 +21,7 @@ module Ecm::PicturesHelper 
     | 
|
| 
       13 
21 
     | 
    
         
             
                      end      
         
     | 
| 
       14 
22 
     | 
    
         
             
                    else
         
     | 
| 
       15 
23 
     | 
    
         
             
                      content_tag(:h1, gallery.name) +
         
     | 
| 
      
 24 
     | 
    
         
            +
                      content_tag(:p, gallery.description, {:class => 'picture-gallery-description'}) +
         
     | 
| 
       16 
25 
     | 
    
         
             
                      content_tag(:ul, {:class => 'pictures'}) do
         
     | 
| 
       17 
26 
     | 
    
         
             
                        gallery.pictures.collect do |picture|
         
     | 
| 
       18 
27 
     | 
    
         
             
                         content_tag(:li, {:class => 'picture', :id => "picture-#{picture.to_param}"}) do
         
     | 
| 
         @@ -36,6 +45,7 @@ module Ecm::PicturesHelper 
     | 
|
| 
       36 
45 
     | 
    
         
             
                end  
         
     | 
| 
       37 
46 
     | 
    
         
             
              end
         
     | 
| 
       38 
47 
     | 
    
         | 
| 
      
 48 
     | 
    
         
            +
              # helper method to build link options for images inside a gallery.
         
     | 
| 
       39 
49 
     | 
    
         
             
              def build_link_options_for_picture_in_gallery(gallery_identifier, picture)
         
     | 
| 
       40 
50 
     | 
    
         
             
                link_options = {}
         
     | 
| 
       41 
51 
     | 
    
         | 
| 
         @@ -51,6 +61,7 @@ module Ecm::PicturesHelper 
     | 
|
| 
       51 
61 
     | 
    
         
             
                return link_options
         
     | 
| 
       52 
62 
     | 
    
         
             
              end
         
     | 
| 
       53 
63 
     | 
    
         | 
| 
      
 64 
     | 
    
         
            +
              # TODO: Implement this.
         
     | 
| 
       54 
65 
     | 
    
         
             
              def render_picture(name, options = {})
         
     | 
| 
       55 
66 
     | 
    
         
             
              end
         
     | 
| 
       56 
67 
     | 
    
         
             
            end
         
     | 
    
        data/lib/ecm/pictures/engine.rb
    CHANGED
    
    | 
         @@ -15,16 +15,13 @@ module Ecm 
     | 
|
| 
       15 
15 
     | 
    
         
             
                class Engine < Rails::Engine
         
     | 
| 
       16 
16 
     | 
    
         
             
                  paths["config/locales"] << File.dirname(__FILE__) + '/../../../config/locales'
         
     | 
| 
       17 
17 
     | 
    
         | 
| 
       18 
     | 
    
         
            -
             
     | 
| 
       19 
     | 
    
         
            -
             
     | 
| 
       20 
     | 
    
         
            -
             
     | 
| 
       21 
     | 
    
         
            -
             
     | 
| 
       22 
     | 
    
         
            -
             
     | 
| 
       23 
     | 
    
         
            -
             
     | 
| 
       24 
     | 
    
         
            -
                    app.config.assets.precompile << 'ecm_pictures.js'
         
     | 
| 
       25 
     | 
    
         
            -
                    app.config.assets.precompile << 'ecm_pictures.css'
         
     | 
| 
      
 18 
     | 
    
         
            +
                  # Enabling assets precompiling under rails 3.1 or greater
         
     | 
| 
      
 19 
     | 
    
         
            +
                  if Rails.version >= '3.1'
         
     | 
| 
      
 20 
     | 
    
         
            +
                    initializer "ecm_pictures.asset_pipeline" do |app|
         
     | 
| 
      
 21 
     | 
    
         
            +
                      app.config.assets.precompile << 'ecm_pictures.js'
         
     | 
| 
      
 22 
     | 
    
         
            +
                      app.config.assets.precompile << 'ecm_pictures.css'
         
     | 
| 
      
 23 
     | 
    
         
            +
                    end
         
     | 
| 
       26 
24 
     | 
    
         
             
                  end
         
     | 
| 
       27 
     | 
    
         
            -
                end
         
     | 
| 
       28 
25 
     | 
    
         | 
| 
       29 
26 
     | 
    
         
             
                  config.to_prepare do
         
     | 
| 
       30 
27 
     | 
    
         
             
                    ApplicationController.helper(Ecm::PicturesHelper)
         
     | 
    
        data/lib/ecm/pictures/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | 
         @@ -2,7 +2,7 @@ 
     | 
|
| 
       2 
2 
     | 
    
         
             
            name: ecm_pictures
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version 
         
     | 
| 
       4 
4 
     | 
    
         
             
              prerelease: 
         
     | 
| 
       5 
     | 
    
         
            -
              version: 0.0. 
     | 
| 
      
 5 
     | 
    
         
            +
              version: 0.0.14
         
     | 
| 
       6 
6 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       7 
7 
     | 
    
         
             
            authors: 
         
     | 
| 
       8 
8 
     | 
    
         
             
            - Roberto Vasquez Angel
         
     | 
| 
         @@ -10,7 +10,7 @@ autorequire: 
     | 
|
| 
       10 
10 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       11 
11 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       12 
12 
     | 
    
         | 
| 
       13 
     | 
    
         
            -
            date: 2012-06- 
     | 
| 
      
 13 
     | 
    
         
            +
            date: 2012-06-23 00:00:00 Z
         
     | 
| 
       14 
14 
     | 
    
         
             
            dependencies: 
         
     | 
| 
       15 
15 
     | 
    
         
             
            - !ruby/object:Gem::Dependency 
         
     | 
| 
       16 
16 
     | 
    
         
             
              name: rails
         
     | 
| 
         @@ -211,7 +211,7 @@ files: 
     | 
|
| 
       211 
211 
     | 
    
         
             
            - MIT-LICENSE
         
     | 
| 
       212 
212 
     | 
    
         
             
            - Rakefile
         
     | 
| 
       213 
213 
     | 
    
         
             
            - README.rdoc
         
     | 
| 
       214 
     | 
    
         
            -
            homepage:  
     | 
| 
      
 214 
     | 
    
         
            +
            homepage: https://github.com/robotex82/ecm_pictures
         
     | 
| 
       215 
215 
     | 
    
         
             
            licenses: []
         
     | 
| 
       216 
216 
     | 
    
         | 
| 
       217 
217 
     | 
    
         
             
            post_install_message: 
         
     |