ruby_gallery 0.2.2 → 0.2.4
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/VERSION +1 -1
- data/app/assets/stylesheets/ruby_gallery/main.css +4 -138
- data/app/assets/stylesheets/ruby_gallery/ruby_gallery.css.scss.erb +9 -8
- data/app/helpers/ruby_gallery/ruby_gallery_helper.rb +5 -3
- data/lib/generators/active_record/ruby_gallery_generator.rb +0 -1
- data/lib/generators/ruby_gallery/install_generator.rb +8 -2
- data/lib/generators/ruby_gallery/orm_helpers.rb +2 -0
- data/ruby_gallery.gemspec +1 -1
- metadata +2 -2
    
        data/VERSION
    CHANGED
    
    | @@ -1 +1 @@ | |
| 1 | 
            -
            0.2. | 
| 1 | 
            +
            0.2.4
         | 
| @@ -1,142 +1,10 @@ | |
| 1 | 
            -
            * {
         | 
| 2 | 
            -
            	background: none;
         | 
| 3 | 
            -
            	border: 0;
         | 
| 4 | 
            -
            	font-weight: normal;
         | 
| 5 | 
            -
            	margin: 0;
         | 
| 6 | 
            -
            	padding: 0;
         | 
| 7 | 
            -
            }
         | 
| 8 | 
            -
             | 
| 9 | 
            -
            /*body { 
         | 
| 10 | 
            -
              background: black url(../images/bg.png);
         | 
| 11 | 
            -
              font-family: 'Maven Pro', sans-serif;
         | 
| 12 | 
            -
              color: #111;
         | 
| 13 | 
            -
            }
         | 
| 14 | 
            -
            */
         | 
| 15 | 
            -
            h1 {
         | 
| 16 | 
            -
            	background: url(../images/h1.png) no-repeat;
         | 
| 17 | 
            -
            	height: 43px;
         | 
| 18 | 
            -
            	margin: 80px auto 20px;
         | 
| 19 | 
            -
            	position: relative;
         | 
| 20 | 
            -
            	text-indent: -9999px;
         | 
| 21 | 
            -
            	width: 500px;
         | 
| 22 | 
            -
            }
         | 
| 23 | 
            -
             | 
| 24 | 
            -
            h3 {
         | 
| 25 | 
            -
            	color: #111;
         | 
| 26 | 
            -
            	font-size: 24px;
         | 
| 27 | 
            -
            	margin: 10px 0 5px;
         | 
| 28 | 
            -
            }
         | 
| 29 | 
            -
             | 
| 30 | 
            -
            h4 {
         | 
| 31 | 
            -
            	color: #111;
         | 
| 32 | 
            -
            	font-size: 20px;
         | 
| 33 | 
            -
            	margin: 10px 0;
         | 
| 34 | 
            -
            }
         | 
| 35 | 
            -
             | 
| 36 | 
            -
            p {
         | 
| 37 | 
            -
            	color: #222;
         | 
| 38 | 
            -
            	font-size: 14px;
         | 
| 39 | 
            -
            	line-height: 20px;
         | 
| 40 | 
            -
            	margin-bottom: 10px;
         | 
| 41 | 
            -
            }
         | 
| 42 1 |  | 
| 43 | 
            -
            b {
         | 
| 44 | 
            -
            	background: rgba(1,1,1,.1);
         | 
| 45 | 
            -
            	-webkit-border-radius: 5px;
         | 
| 46 | 
            -
            	-moz-border-radius: 5px;
         | 
| 47 | 
            -
            	border-radius: 5px;
         | 
| 48 | 
            -
            	display: inline-block;
         | 
| 49 | 
            -
            	padding: 1px 3px 1px 3px;
         | 
| 50 | 
            -
            }
         | 
| 51 | 
            -
             | 
| 52 | 
            -
            pre { 
         | 
| 53 | 
            -
            	background: black;
         | 
| 54 | 
            -
            	border-radius: 5px;
         | 
| 55 | 
            -
            	color: #ee8;
         | 
| 56 | 
            -
            	display: block;
         | 
| 57 | 
            -
            	font-family: 'Monaco', 'Anonymous Pro', sans-serif;
         | 
| 58 | 
            -
            	font-size: 11px;
         | 
| 59 | 
            -
            	margin-top: 2px; 
         | 
| 60 | 
            -
            	margin-bottom: 5px;
         | 
| 61 | 
            -
            	padding: 15px; 
         | 
| 62 | 
            -
            }
         | 
| 63 | 
            -
             | 
| 64 | 
            -
            #main {
         | 
| 65 | 
            -
            	background: #bba;
         | 
| 66 | 
            -
            	-webkit-border-radius: 5px;
         | 
| 67 | 
            -
            	-moz-border-radius: 5px;
         | 
| 68 | 
            -
            	border-radius: 5px;
         | 
| 69 | 
            -
            	border-top: 1px rgba(255,255,255,.6) solid;
         | 
| 70 | 
            -
            	height: 500px;
         | 
| 71 | 
            -
            	width: 500px;
         | 
| 72 | 
            -
            	margin: auto;
         | 
| 73 | 
            -
            }
         | 
| 74 2 |  | 
| 75 | 
            -
             | 
| 3 | 
            +
            .nano {
         | 
| 76 4 | 
             
            	text-shadow: #eee 0 1px;
         | 
| 77 5 | 
             
            }
         | 
| 78 6 |  | 
| 79 | 
            -
            #main pre {
         | 
| 80 | 
            -
            	background: #222;
         | 
| 81 | 
            -
            	border-bottom: 1px solid white;
         | 
| 82 | 
            -
            	border-top: 1px solid black;
         | 
| 83 | 
            -
            	-webkit-box-shadow: black 0 1px 10px inset;
         | 
| 84 | 
            -
            	-moz-box-shadow: black 0 1px 10px inset;
         | 
| 85 | 
            -
            	box-shadow: black 0 1px 10px inset;
         | 
| 86 | 
            -
            	text-shadow: black 0 -1px 1px;
         | 
| 87 | 
            -
            }
         | 
| 88 | 
            -
             | 
| 89 | 
            -
            #main ul, #main ol {
         | 
| 90 | 
            -
            	display: block;
         | 
| 91 | 
            -
            	margin: 10px 0;
         | 
| 92 | 
            -
            }
         | 
| 93 | 
            -
             | 
| 94 | 
            -
            #main ul li, #main ol li {
         | 
| 95 | 
            -
            	margin-left: 20px;
         | 
| 96 | 
            -
            	font-size: 13px;
         | 
| 97 | 
            -
            }
         | 
| 98 7 |  | 
| 99 | 
            -
            #main .content h1 {
         | 
| 100 | 
            -
            	display: block;
         | 
| 101 | 
            -
            	margin: 0;
         | 
| 102 | 
            -
            	padding: 0;
         | 
| 103 | 
            -
            	color: #111;
         | 
| 104 | 
            -
            	text-indent: 0;
         | 
| 105 | 
            -
            	background: none;
         | 
| 106 | 
            -
            	display: none;
         | 
| 107 | 
            -
            }
         | 
| 108 | 
            -
             | 
| 109 | 
            -
            #main a {
         | 
| 110 | 
            -
            	color: #066;
         | 
| 111 | 
            -
            	text-decoration: none;
         | 
| 112 | 
            -
            	text-shadow: none;
         | 
| 113 | 
            -
            }
         | 
| 114 | 
            -
             | 
| 115 | 
            -
            #main a:hover {
         | 
| 116 | 
            -
            	text-decoration: underline;
         | 
| 117 | 
            -
            }
         | 
| 118 | 
            -
             | 
| 119 | 
            -
            #main code {
         | 
| 120 | 
            -
            	font-family: 'Monaco', 'Anonymous Pro', sans-serif;
         | 
| 121 | 
            -
            }
         | 
| 122 | 
            -
             | 
| 123 | 
            -
            #main p code {
         | 
| 124 | 
            -
            	background: #222;
         | 
| 125 | 
            -
            	display: inline-block;
         | 
| 126 | 
            -
            	-webkit-border-radius: 5px;
         | 
| 127 | 
            -
            	-moz-border-radius: 5px;	
         | 
| 128 | 
            -
            	border-radius: 5px;
         | 
| 129 | 
            -
            	font-family: Monaco, 'Anonymous Pro';
         | 
| 130 | 
            -
            	font-size: 11px;
         | 
| 131 | 
            -
            	text-shadow: none;
         | 
| 132 | 
            -
            	color: #ee8;
         | 
| 133 | 
            -
            	padding: 0 3px 0;
         | 
| 134 | 
            -
            	border-bottom: 1px solid #eee;
         | 
| 135 | 
            -
            	-webkit-box-shadow: #000 0 2px 3px inset;
         | 
| 136 | 
            -
            	-moz-box-shadow: #000 0 2px 3px inset;
         | 
| 137 | 
            -
            	box-shadow: #000 0 2px 3px inset;
         | 
| 138 | 
            -
            	text-shadow: black 0 -1px 1px;
         | 
| 139 | 
            -
            } 
         | 
| 140 8 |  | 
| 141 9 | 
             
            .small.nano {
         | 
| 142 10 | 
             
            	background: #ffa;
         | 
| @@ -147,15 +15,13 @@ pre { | |
| 147 15 | 
             
            	border-radius: 5px;
         | 
| 148 16 | 
             
            }
         | 
| 149 17 |  | 
| 150 | 
            -
             | 
| 151 18 | 
             
            .nano .content {
         | 
| 152 | 
            -
            padding: 20px;
         | 
| 19 | 
            +
              padding: 20px;
         | 
| 153 20 | 
             
            }
         | 
| 154 21 |  | 
| 22 | 
            +
             | 
| 23 | 
            +
             | 
| 155 24 | 
             
            .nano .pane {
         | 
| 156 | 
            -
            background: #555;
         | 
| 157 | 
            -
            width: 8px;
         | 
| 158 | 
            -
            right: 1px;
         | 
| 159 25 | 
             
              margin: 5px;
         | 
| 160 26 | 
             
            }
         | 
| 161 27 |  | 
| @@ -18,10 +18,7 @@ span.entypo-icon-1{ | |
| 18 18 | 
             
              cursor: pointer;
         | 
| 19 19 | 
             
            }
         | 
| 20 20 |  | 
| 21 | 
            -
             | 
| 22 | 
            -
              width:75px;
         | 
| 23 | 
            -
              float:left;
         | 
| 24 | 
            -
            }
         | 
| 21 | 
            +
             | 
| 25 22 |  | 
| 26 23 | 
             
            div.upload-box{
         | 
| 27 24 | 
             
              @include clearfix;
         | 
| @@ -45,17 +42,21 @@ div.upload-box{ | |
| 45 42 | 
             
              }
         | 
| 46 43 | 
             
            }
         | 
| 47 44 |  | 
| 45 | 
            +
            form.fileupload{
         | 
| 46 | 
            +
              width:75px;
         | 
| 47 | 
            +
              float:left;
         | 
| 48 | 
            +
            }
         | 
| 48 49 |  | 
| 49 50 | 
             
            div.file-box{
         | 
| 50 51 | 
             
              float: left;
         | 
| 51 | 
            -
              @include clearfix;
         | 
| 52 52 | 
             
              display:block;
         | 
| 53 53 | 
             
              margin-bottom: 5px;
         | 
| 54 54 | 
             
              width: 100%;
         | 
| 55 55 |  | 
| 56 56 | 
             
              ul#photos_album {
         | 
| 57 | 
            +
                margin: 0px;
         | 
| 58 | 
            +
                padding: 0px;
         | 
| 57 59 | 
             
                width: 100%;
         | 
| 58 | 
            -
                float: left;
         | 
| 59 60 | 
             
                @include clearfix;
         | 
| 60 61 | 
             
                height: 100%;
         | 
| 61 62 | 
             
                list-style: none;
         | 
| @@ -66,11 +67,11 @@ div.file-box{ | |
| 66 67 | 
             
                  float: left;
         | 
| 67 68 | 
             
                  width: 130px;
         | 
| 68 69 | 
             
                  height: 125px;
         | 
| 69 | 
            -
                  margin- | 
| 70 | 
            +
                  margin-bottom: 15px;
         | 
| 70 71 | 
             
                  text-align: center;
         | 
| 71 72 | 
             
                  span.remove-photo {
         | 
| 72 73 | 
             
                    position: absolute;
         | 
| 73 | 
            -
                    top: - | 
| 74 | 
            +
                    top: -17px ;
         | 
| 74 75 | 
             
                    right: 10px;
         | 
| 75 76 | 
             
                    line-height: 55px;
         | 
| 76 77 | 
             
                  }
         | 
| @@ -1,6 +1,8 @@ | |
| 1 1 | 
             
            module RubyGallery::RubyGalleryHelper
         | 
| 2 | 
            -
              def show_gallery_images( | 
| 3 | 
            -
                object = model_name.to_s.singularize.classify.constantize. | 
| 2 | 
            +
              def show_gallery_images(model_obj, opts={})
         | 
| 3 | 
            +
                # object = model_name.to_s.singularize.classify.constantize.find_by_id(parent_model_id)
         | 
| 4 | 
            +
                object = model_obj
         | 
| 5 | 
            +
                model_name = model_obj.class.to_s.tableize
         | 
| 4 6 | 
             
                opts = {reorder: true, close: true}.merge(opts)
         | 
| 5 7 | 
             
                content = ""
         | 
| 6 8 | 
             
                content = content_tag(:div, class: "upload-box") do
         | 
| @@ -8,7 +10,7 @@ module RubyGallery::RubyGalleryHelper | |
| 8 10 | 
             
                    content_tag(:div, t("ruby_gallery.web_content.upload_album"), class: "legend"),
         | 
| 9 11 | 
             
                    content_tag(:div, class: "form-box") do
         | 
| 10 12 | 
             
                      [
         | 
| 11 | 
            -
                        content_tag(:form, id: "fileupload", class: "fileupload", method: "POST", enctype: "multipart/form-data", action: "/#{model_name}/upload_album?id=#{ | 
| 13 | 
            +
                        content_tag(:form, id: "fileupload", class: "fileupload", method: "POST", enctype: "multipart/form-data", action: "/#{model_name}/upload_album?id=#{model_obj.id}", multipart: true) do
         | 
| 12 14 | 
             
                          content_tag(:span, id: "upload_button", class: "upload-button btn btn-success fileinput-button", status: "") do
         | 
| 13 15 | 
             
                            [content_tag(:i, "", class: "icon-plus icon-white"),
         | 
| 14 16 | 
             
                            content_tag(:span, t("ruby_gallery.web_content.upload_button")),
         | 
| @@ -13,7 +13,6 @@ module ActiveRecord | |
| 13 13 | 
             
                    route "post '/#{table_name}/upload_album', controller: :#{table_name}, action: :upload_album"
         | 
| 14 14 | 
             
                    route "delete '/#{table_name}/:id/delete_photo', controller: :#{table_name}, action: :delete_photo"
         | 
| 15 15 | 
             
                    if migration_exists?("album_photos") && migration_add_columns_exists?("album_photos")
         | 
| 16 | 
            -
                      # migration_template "migration.rb", "db/migrate/ruby_gallery_add_columns_to_album_photos" unless migration_add_columns_exists?("album_photos")
         | 
| 17 16 | 
             
                    else
         | 
| 18 17 | 
             
                      migration_template "album_photo_migration.rb", "db/migrate/ruby_gallery_create_album_photos"
         | 
| 19 18 | 
             
                      migration_template "migration.rb", "db/migrate/ruby_gallery_add_columns_to_album_photos"
         | 
| @@ -1,7 +1,6 @@ | |
| 1 1 | 
             
            require 'securerandom'
         | 
| 2 2 | 
             
            require 'rails/generators'
         | 
| 3 3 | 
             
            require 'rails/generators/migration'
         | 
| 4 | 
            -
             | 
| 5 4 | 
             
            module RubyGallery
         | 
| 6 5 | 
             
              module Generators
         | 
| 7 6 | 
             
                class InstallGenerator < Rails::Generators::Base
         | 
| @@ -20,12 +19,19 @@ module RubyGallery | |
| 20 19 | 
             
                  end
         | 
| 21 20 |  | 
| 22 21 | 
             
                  def inject_css
         | 
| 23 | 
            -
                     | 
| 22 | 
            +
                    file_to_append = 'app/assets/stylesheets/application.css'
         | 
| 23 | 
            +
                    if File.exist?('app/assets/stylesheets/application.css.scss')
         | 
| 24 | 
            +
                      file_to_append = 'app/assets/stylesheets/application.css.scss'
         | 
| 25 | 
            +
                    end
         | 
| 26 | 
            +
                      
         | 
| 27 | 
            +
                    append_to_file file_to_append do
         | 
| 24 28 | 
             
                      out = "\n"
         | 
| 25 29 | 
             
                      out << "/* *= require ruby_gallery/styles */"
         | 
| 26 30 | 
             
                    end      
         | 
| 31 | 
            +
                      
         | 
| 27 32 | 
             
                  end
         | 
| 28 33 |  | 
| 34 | 
            +
                  
         | 
| 29 35 | 
             
                end
         | 
| 30 36 | 
             
              end
         | 
| 31 37 | 
             
            end
         | 
    
        data/ruby_gallery.gemspec
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: ruby_gallery
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.2. | 
| 4 | 
            +
              version: 0.2.4
         | 
| 5 5 | 
             
              prerelease: 
         | 
| 6 6 | 
             
            platform: ruby
         | 
| 7 7 | 
             
            authors:
         | 
| @@ -212,7 +212,7 @@ required_ruby_version: !ruby/object:Gem::Requirement | |
| 212 212 | 
             
                  version: '0'
         | 
| 213 213 | 
             
                  segments:
         | 
| 214 214 | 
             
                  - 0
         | 
| 215 | 
            -
                  hash:  | 
| 215 | 
            +
                  hash: 2270418184149514019
         | 
| 216 216 | 
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 217 217 | 
             
              none: false
         | 
| 218 218 | 
             
              requirements:
         |