galleriable 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +28 -0
- data/Rakefile +37 -0
- data/app/assets/config/galleriable_manifest.js +2 -0
- data/app/assets/javascripts/galleriable/application.js +13 -0
- data/app/assets/javascripts/galleriable/galleries.js +2 -0
- data/app/assets/javascripts/galleriable/photos.js +2 -0
- data/app/assets/javascripts/galleriable/slides.js +2 -0
- data/app/assets/stylesheets/galleriable/application.css +15 -0
- data/app/assets/stylesheets/galleriable/galleries.css +4 -0
- data/app/assets/stylesheets/galleriable/photos.css +4 -0
- data/app/assets/stylesheets/galleriable/slides.css +4 -0
- data/app/assets/stylesheets/scaffold.css +84 -0
- data/app/concerns/gallerify.rb +18 -0
- data/app/controllers/galleriable/application_controller.rb +4 -0
- data/app/controllers/galleriable/photos_controller.rb +63 -0
- data/app/helpers/galleriable/application_helper.rb +4 -0
- data/app/helpers/galleriable/photos_helper.rb +4 -0
- data/app/jobs/galleriable/application_job.rb +4 -0
- data/app/mailers/galleriable/application_mailer.rb +6 -0
- data/app/models/galleriable/application_record.rb +5 -0
- data/app/models/galleriable/gallery.rb +18 -0
- data/app/models/galleriable/photo.rb +18 -0
- data/app/models/galleriable/slide.rb +9 -0
- data/app/views/galleriable/photos/_form.html.erb +47 -0
- data/app/views/galleriable/photos/edit.html.erb +6 -0
- data/app/views/galleriable/photos/index.html.erb +37 -0
- data/app/views/galleriable/photos/new.html.erb +5 -0
- data/app/views/galleriable/photos/show.html.erb +34 -0
- data/app/views/layouts/galleriable/application.html.erb +14 -0
- data/config/routes.rb +5 -0
- data/db/migrate/20160913003004_create_galleriable_photos.rb +14 -0
- data/db/migrate/20160913042947_create_galleriable_galleries.rb +10 -0
- data/db/migrate/20160913051502_create_galleriable_slides.rb +16 -0
- data/lib/galleriable.rb +5 -0
- data/lib/galleriable/engine.rb +24 -0
- data/lib/galleriable/version.rb +3 -0
- data/lib/generators/galleriable/USAGE +8 -0
- data/lib/generators/galleriable/galleriable_generator.rb +13 -0
- data/lib/tasks/galleriable_tasks.rake +4 -0
- metadata +323 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 8858506e2dcf060cedcb88496cf2cb8d596c5631
|
4
|
+
data.tar.gz: 381810770ea25c3f559b4fb02080ee0e0b8cb0eb
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 330a90336698e6024953e8935dea48ed9e30a6736a2cb2bb1bc185f79fc517e698964f4a679acfb3002185472d612b8cddf102741048c54cb872f9df31ad2979
|
7
|
+
data.tar.gz: 2e52512a8d3b1b8df30519f9d9aaeca19ba32f0d03f3d3fd9a88fd587eb27d28279ee3d4d7b151f5e7e33d4b1b5286633490ea853c148328f564f8ab0adac204
|
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright 2016 schadenfred
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
# Galleriable
|
2
|
+
Short description and motivation.
|
3
|
+
|
4
|
+
## Usage
|
5
|
+
How to use my plugin.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
Add this line to your application's Gemfile:
|
9
|
+
|
10
|
+
```ruby
|
11
|
+
gem 'galleriable'
|
12
|
+
```
|
13
|
+
|
14
|
+
And then execute:
|
15
|
+
```bash
|
16
|
+
$ bundle
|
17
|
+
```
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
```bash
|
21
|
+
$ gem install galleriable
|
22
|
+
```
|
23
|
+
|
24
|
+
## Contributing
|
25
|
+
Contribution directions go here.
|
26
|
+
|
27
|
+
## License
|
28
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
begin
|
2
|
+
require 'bundler/setup'
|
3
|
+
rescue LoadError
|
4
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
5
|
+
end
|
6
|
+
|
7
|
+
require 'rdoc/task'
|
8
|
+
|
9
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
10
|
+
rdoc.rdoc_dir = 'rdoc'
|
11
|
+
rdoc.title = 'Galleriable'
|
12
|
+
rdoc.options << '--line-numbers'
|
13
|
+
rdoc.rdoc_files.include('README.md')
|
14
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
|
+
end
|
16
|
+
|
17
|
+
APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
|
18
|
+
load 'rails/tasks/engine.rake'
|
19
|
+
|
20
|
+
|
21
|
+
load 'rails/tasks/statistics.rake'
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
require 'bundler/gem_tasks'
|
26
|
+
|
27
|
+
require 'rake/testtask'
|
28
|
+
|
29
|
+
Rake::TestTask.new(:test) do |t|
|
30
|
+
t.libs << 'lib'
|
31
|
+
t.libs << 'test'
|
32
|
+
t.pattern = 'test/**/*_test.rb'
|
33
|
+
t.verbose = false
|
34
|
+
end
|
35
|
+
|
36
|
+
|
37
|
+
task default: :test
|
@@ -0,0 +1,13 @@
|
|
1
|
+
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
+
// listed below.
|
3
|
+
//
|
4
|
+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
+
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
|
6
|
+
//
|
7
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
+
// compiled file. JavaScript code in this file should be added after the last require_* statement.
|
9
|
+
//
|
10
|
+
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
|
11
|
+
// about supported directives.
|
12
|
+
//
|
13
|
+
//= require_tree .
|
@@ -0,0 +1,15 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
+
* listed below.
|
4
|
+
*
|
5
|
+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
+
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
|
7
|
+
*
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
9
|
+
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
|
10
|
+
* files in this directory. Styles in this file should be added after the last require_* statement.
|
11
|
+
* It is generally better to create a new file per style scope.
|
12
|
+
*
|
13
|
+
*= require_tree .
|
14
|
+
*= require_self
|
15
|
+
*/
|
@@ -0,0 +1,84 @@
|
|
1
|
+
body {
|
2
|
+
background-color: #fff;
|
3
|
+
color: #333;
|
4
|
+
}
|
5
|
+
|
6
|
+
body, p, ol, ul, td {
|
7
|
+
font-family: verdana, arial, helvetica, sans-serif;
|
8
|
+
font-size: 13px;
|
9
|
+
line-height: 18px;
|
10
|
+
margin: 33px;
|
11
|
+
}
|
12
|
+
|
13
|
+
pre {
|
14
|
+
background-color: #eee;
|
15
|
+
padding: 10px;
|
16
|
+
font-size: 11px;
|
17
|
+
}
|
18
|
+
|
19
|
+
a {
|
20
|
+
color: #000;
|
21
|
+
}
|
22
|
+
|
23
|
+
a:visited {
|
24
|
+
color: #666;
|
25
|
+
}
|
26
|
+
|
27
|
+
a:hover {
|
28
|
+
color: #fff;
|
29
|
+
background-color: #000;
|
30
|
+
}
|
31
|
+
|
32
|
+
th {
|
33
|
+
padding-bottom: 5px;
|
34
|
+
}
|
35
|
+
|
36
|
+
td {
|
37
|
+
padding-bottom: 7px;
|
38
|
+
padding-left: 5px;
|
39
|
+
padding-right: 5px;
|
40
|
+
}
|
41
|
+
|
42
|
+
div.field,
|
43
|
+
div.actions {
|
44
|
+
margin-bottom: 10px;
|
45
|
+
}
|
46
|
+
|
47
|
+
#notice {
|
48
|
+
color: green;
|
49
|
+
}
|
50
|
+
|
51
|
+
.field_with_errors {
|
52
|
+
padding: 2px;
|
53
|
+
background-color: red;
|
54
|
+
display: table;
|
55
|
+
}
|
56
|
+
|
57
|
+
#error_explanation {
|
58
|
+
width: 450px;
|
59
|
+
border: 2px solid red;
|
60
|
+
padding: 7px;
|
61
|
+
padding-bottom: 0;
|
62
|
+
margin-bottom: 20px;
|
63
|
+
background-color: #f0f0f0;
|
64
|
+
}
|
65
|
+
|
66
|
+
#error_explanation h2 {
|
67
|
+
text-align: left;
|
68
|
+
font-weight: bold;
|
69
|
+
padding: 5px 5px 5px 15px;
|
70
|
+
font-size: 12px;
|
71
|
+
margin: -7px;
|
72
|
+
margin-bottom: 0;
|
73
|
+
background-color: #c00;
|
74
|
+
color: #fff;
|
75
|
+
}
|
76
|
+
|
77
|
+
#error_explanation ul li {
|
78
|
+
font-size: 12px;
|
79
|
+
list-style: square;
|
80
|
+
}
|
81
|
+
|
82
|
+
label {
|
83
|
+
display: block;
|
84
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Gallerify
|
2
|
+
|
3
|
+
extend ActiveSupport::Concern
|
4
|
+
|
5
|
+
included do
|
6
|
+
has_many :galleries, as: :galleriable
|
7
|
+
has_many :slides, through: :galleries
|
8
|
+
has_many :photos, as: :photographable, class_name: "Galleriable::Photo"
|
9
|
+
end
|
10
|
+
|
11
|
+
def default_gallery
|
12
|
+
galleries.find_by(name: "default") || nil
|
13
|
+
end
|
14
|
+
|
15
|
+
def default_photo
|
16
|
+
default_gallery ? default_gallery.slides.first.photo : nil
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
require_dependency "galleriable/application_controller"
|
2
|
+
|
3
|
+
module Galleriable
|
4
|
+
class PhotosController < ApplicationController
|
5
|
+
before_action :set_photo, only: [:show, :edit, :update, :destroy]
|
6
|
+
|
7
|
+
# GET /photos
|
8
|
+
def index
|
9
|
+
@photos = Photo.all
|
10
|
+
end
|
11
|
+
|
12
|
+
# GET /photos/1
|
13
|
+
def show
|
14
|
+
end
|
15
|
+
|
16
|
+
# GET /photos/new
|
17
|
+
def new
|
18
|
+
debugger
|
19
|
+
@photo = Photo.new
|
20
|
+
end
|
21
|
+
|
22
|
+
# GET /photos/1/edit
|
23
|
+
def edit
|
24
|
+
end
|
25
|
+
|
26
|
+
# POST /photos
|
27
|
+
def create
|
28
|
+
@photo = Photo.new(photo_params)
|
29
|
+
|
30
|
+
if @photo.save
|
31
|
+
redirect_to @photo, notice: 'Photo was successfully created.'
|
32
|
+
else
|
33
|
+
render :new
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
# PATCH/PUT /photos/1
|
38
|
+
def update
|
39
|
+
if @photo.update(photo_params)
|
40
|
+
redirect_to @photo, notice: 'Photo was successfully updated.'
|
41
|
+
else
|
42
|
+
render :edit
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
# DELETE /photos/1
|
47
|
+
def destroy
|
48
|
+
@photo.destroy
|
49
|
+
redirect_to :back, notice: 'Photo was successfully destroyed.'
|
50
|
+
end
|
51
|
+
|
52
|
+
private
|
53
|
+
# Use callbacks to share common setup or constraints between actions.
|
54
|
+
def set_photo
|
55
|
+
@photo = Photo.find(params[:id])
|
56
|
+
end
|
57
|
+
|
58
|
+
# Only allow a trusted parameter "white list" through.
|
59
|
+
def photo_params
|
60
|
+
params.require(:photo).permit(:image_uid, :image_name, :name, :caption, :photographer_id, :photographable_id, :photographable_type)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Galleriable
|
2
|
+
class Gallery < ApplicationRecord
|
3
|
+
|
4
|
+
# associations
|
5
|
+
belongs_to :galleriable, polymorphic: true
|
6
|
+
|
7
|
+
has_many :photos, through: :slides
|
8
|
+
has_many :slides
|
9
|
+
|
10
|
+
accepts_nested_attributes_for :photos
|
11
|
+
|
12
|
+
# validations
|
13
|
+
validates :name, :galleriable, presence: true
|
14
|
+
validates :name, uniqueness: {
|
15
|
+
scope: [:galleriable_id, :galleriable_type] }
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Galleriable
|
2
|
+
class Photo < ApplicationRecord
|
3
|
+
|
4
|
+
dragonfly_accessor :image
|
5
|
+
|
6
|
+
belongs_to :photographable, polymorphic: true, class_name: "User"
|
7
|
+
|
8
|
+
belongs_to :photographer, class_name: "User",
|
9
|
+
foreign_key: "photographer_id"
|
10
|
+
|
11
|
+
has_many :slides
|
12
|
+
|
13
|
+
accepts_nested_attributes_for :slides
|
14
|
+
|
15
|
+
# validates :photographer, presence: true
|
16
|
+
# validates :image, presence: true
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
<%= form_for(photo) do |f| %>
|
2
|
+
<% if photo.errors.any? %>
|
3
|
+
<div id="error_explanation">
|
4
|
+
<h2><%= pluralize(photo.errors.count, "error") %> prohibited this photo from being saved:</h2>
|
5
|
+
|
6
|
+
<ul>
|
7
|
+
<% photo.errors.full_messages.each do |message| %>
|
8
|
+
<li><%= message %></li>
|
9
|
+
<% end %>
|
10
|
+
</ul>
|
11
|
+
</div>
|
12
|
+
<% end %>
|
13
|
+
|
14
|
+
<div class="field">
|
15
|
+
<%= f.label :image_uid %>
|
16
|
+
<%= f.text_field :image_uid %>
|
17
|
+
</div>
|
18
|
+
|
19
|
+
<div class="field">
|
20
|
+
<%= f.label :image_name %>
|
21
|
+
<%= f.text_field :image_name %>
|
22
|
+
</div>
|
23
|
+
|
24
|
+
<div class="field">
|
25
|
+
<%= f.label :name %>
|
26
|
+
<%= f.text_field :name %>
|
27
|
+
</div>
|
28
|
+
|
29
|
+
<div class="field">
|
30
|
+
<%= f.label :caption %>
|
31
|
+
<%= f.text_field :caption %>
|
32
|
+
</div>
|
33
|
+
|
34
|
+
<div class="field">
|
35
|
+
<%= f.label :photographer_id %>
|
36
|
+
<%= f.number_field :photographer_id %>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<div class="field">
|
40
|
+
<%= f.label :photographable_id %>
|
41
|
+
<%= f.text_field :photographable_id %>
|
42
|
+
</div>
|
43
|
+
|
44
|
+
<div class="actions">
|
45
|
+
<%= f.submit %>
|
46
|
+
</div>
|
47
|
+
<% end %>
|
@@ -0,0 +1,37 @@
|
|
1
|
+
<p id="notice"><%= notice %></p>
|
2
|
+
|
3
|
+
<h1>Photos</h1>
|
4
|
+
|
5
|
+
<table>
|
6
|
+
<thead>
|
7
|
+
<tr>
|
8
|
+
<th>Image uid</th>
|
9
|
+
<th>Image name</th>
|
10
|
+
<th>Name</th>
|
11
|
+
<th>Caption</th>
|
12
|
+
<th>Photographer</th>
|
13
|
+
<th>Photographable</th>
|
14
|
+
<th colspan="3"></th>
|
15
|
+
</tr>
|
16
|
+
</thead>
|
17
|
+
|
18
|
+
<tbody>
|
19
|
+
<% @photos.each do |photo| %>
|
20
|
+
<tr>
|
21
|
+
<td><%= photo.image_uid %></td>
|
22
|
+
<td><%= photo.image_name %></td>
|
23
|
+
<td><%= photo.name %></td>
|
24
|
+
<td><%= photo.caption %></td>
|
25
|
+
<td><%= photo.photographer_id %></td>
|
26
|
+
<td><%= photo.photographable %></td>
|
27
|
+
<td><%= link_to 'Show', photo %></td>
|
28
|
+
<td><%= link_to 'Edit', edit_photo_path(photo) %></td>
|
29
|
+
<td><%= link_to 'Destroy', photo, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
30
|
+
</tr>
|
31
|
+
<% end %>
|
32
|
+
</tbody>
|
33
|
+
</table>
|
34
|
+
|
35
|
+
<br>
|
36
|
+
|
37
|
+
<%= link_to 'New Photo', new_photo_path %>
|
@@ -0,0 +1,34 @@
|
|
1
|
+
<p id="notice"><%= notice %></p>
|
2
|
+
|
3
|
+
<p>
|
4
|
+
<strong>Image uid:</strong>
|
5
|
+
<%= @photo.image_uid %>
|
6
|
+
</p>
|
7
|
+
|
8
|
+
<p>
|
9
|
+
<strong>Image name:</strong>
|
10
|
+
<%= @photo.image_name %>
|
11
|
+
</p>
|
12
|
+
|
13
|
+
<p>
|
14
|
+
<strong>Name:</strong>
|
15
|
+
<%= @photo.name %>
|
16
|
+
</p>
|
17
|
+
|
18
|
+
<p>
|
19
|
+
<strong>Caption:</strong>
|
20
|
+
<%= @photo.caption %>
|
21
|
+
</p>
|
22
|
+
|
23
|
+
<p>
|
24
|
+
<strong>Photographer:</strong>
|
25
|
+
<%= @photo.photographer_id %>
|
26
|
+
</p>
|
27
|
+
|
28
|
+
<p>
|
29
|
+
<strong>Photographable:</strong>
|
30
|
+
<%= @photo.photographable %>
|
31
|
+
</p>
|
32
|
+
|
33
|
+
<%= link_to 'Edit', edit_photo_path(@photo) %> |
|
34
|
+
<%= link_to 'Back', photos_path %>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Galleriable</title>
|
5
|
+
<%= stylesheet_link_tag "galleriable/application", media: "all" %>
|
6
|
+
<%= javascript_include_tag "galleriable/application" %>
|
7
|
+
<%= csrf_meta_tags %>
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
|
11
|
+
<%= yield %>
|
12
|
+
|
13
|
+
</body>
|
14
|
+
</html>
|
data/config/routes.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
class CreateGalleriablePhotos < ActiveRecord::Migration[5.0]
|
2
|
+
def change
|
3
|
+
create_table :galleriable_photos do |t|
|
4
|
+
t.string :image_uid
|
5
|
+
t.string :image_name
|
6
|
+
t.string :name
|
7
|
+
t.string :caption
|
8
|
+
t.integer :photographer_id
|
9
|
+
t.references :photographable, polymorphic: true, index: { name: "by_photographable" }
|
10
|
+
|
11
|
+
t.timestamps
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class CreateGalleriableSlides < ActiveRecord::Migration[5.0]
|
2
|
+
def change
|
3
|
+
|
4
|
+
enable_extension "hstore"
|
5
|
+
|
6
|
+
create_table :galleriable_slides do |t|
|
7
|
+
t.integer :photo_id
|
8
|
+
t.integer :gallery_id
|
9
|
+
t.hstore :properties
|
10
|
+
|
11
|
+
t.timestamps
|
12
|
+
end
|
13
|
+
|
14
|
+
add_index :galleriable_slides, [:photo_id, :gallery_id]
|
15
|
+
end
|
16
|
+
end
|
data/lib/galleriable.rb
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
module Galleriable
|
2
|
+
|
3
|
+
class Engine < ::Rails::Engine
|
4
|
+
isolate_namespace Galleriable
|
5
|
+
|
6
|
+
initializer "initialize_migrations", before: :load_config_initializers do |app|
|
7
|
+
|
8
|
+
# config.paths["db/migrate"].expanded.each do |expanded_path|
|
9
|
+
# Rails.application.config.paths["db/migrate"] << expanded_path
|
10
|
+
# end
|
11
|
+
end
|
12
|
+
|
13
|
+
config.generators do |g|
|
14
|
+
g.factory_girl false
|
15
|
+
end
|
16
|
+
# initializer :append_migrations do |app|
|
17
|
+
# unless app.root.to_s.match root.to_s
|
18
|
+
# config.paths["db/migrate"].expanded.each do |expanded_path|
|
19
|
+
# app.config.paths["db/migrate"] << expanded_path
|
20
|
+
# end
|
21
|
+
# end
|
22
|
+
# end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class GalleriableGenerator < Rails::Generators::NamedBase
|
2
|
+
namespace "galleriable"
|
3
|
+
|
4
|
+
source_root File.expand_path('../templates', __FILE__)
|
5
|
+
|
6
|
+
def add_engine_route_to_app
|
7
|
+
route "mount Galleriable::Engine => \"\/galleriable\""
|
8
|
+
end
|
9
|
+
|
10
|
+
def add_galleriable_to_models
|
11
|
+
insert_into_file "app/models/#{file_name}.rb", " include Gallerify\n", :after => "ApplicationRecord\n"
|
12
|
+
end
|
13
|
+
end
|
metadata
ADDED
@@ -0,0 +1,323 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: galleriable
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- schadenfred
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-03-23 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rails
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: jquery-rails
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: sass
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: dragonfly
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: dragonfly-s3_data_store
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: dropzonejs-rails
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: factory_girl_rails
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: minitest-rails-capybara
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: minitest-given
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: launchy
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: guard-minitest
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: database_cleaner
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - ">="
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0'
|
174
|
+
type: :development
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - ">="
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '0'
|
181
|
+
- !ruby/object:Gem::Dependency
|
182
|
+
name: guard-livereload
|
183
|
+
requirement: !ruby/object:Gem::Requirement
|
184
|
+
requirements:
|
185
|
+
- - ">="
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
version: '0'
|
188
|
+
type: :development
|
189
|
+
prerelease: false
|
190
|
+
version_requirements: !ruby/object:Gem::Requirement
|
191
|
+
requirements:
|
192
|
+
- - ">="
|
193
|
+
- !ruby/object:Gem::Version
|
194
|
+
version: '0'
|
195
|
+
- !ruby/object:Gem::Dependency
|
196
|
+
name: byebug
|
197
|
+
requirement: !ruby/object:Gem::Requirement
|
198
|
+
requirements:
|
199
|
+
- - ">="
|
200
|
+
- !ruby/object:Gem::Version
|
201
|
+
version: '0'
|
202
|
+
type: :development
|
203
|
+
prerelease: false
|
204
|
+
version_requirements: !ruby/object:Gem::Requirement
|
205
|
+
requirements:
|
206
|
+
- - ">="
|
207
|
+
- !ruby/object:Gem::Version
|
208
|
+
version: '0'
|
209
|
+
- !ruby/object:Gem::Dependency
|
210
|
+
name: better_errors
|
211
|
+
requirement: !ruby/object:Gem::Requirement
|
212
|
+
requirements:
|
213
|
+
- - ">="
|
214
|
+
- !ruby/object:Gem::Version
|
215
|
+
version: '0'
|
216
|
+
type: :development
|
217
|
+
prerelease: false
|
218
|
+
version_requirements: !ruby/object:Gem::Requirement
|
219
|
+
requirements:
|
220
|
+
- - ">="
|
221
|
+
- !ruby/object:Gem::Version
|
222
|
+
version: '0'
|
223
|
+
- !ruby/object:Gem::Dependency
|
224
|
+
name: binding_of_caller
|
225
|
+
requirement: !ruby/object:Gem::Requirement
|
226
|
+
requirements:
|
227
|
+
- - ">="
|
228
|
+
- !ruby/object:Gem::Version
|
229
|
+
version: '0'
|
230
|
+
type: :development
|
231
|
+
prerelease: false
|
232
|
+
version_requirements: !ruby/object:Gem::Requirement
|
233
|
+
requirements:
|
234
|
+
- - ">="
|
235
|
+
- !ruby/object:Gem::Version
|
236
|
+
version: '0'
|
237
|
+
- !ruby/object:Gem::Dependency
|
238
|
+
name: pg
|
239
|
+
requirement: !ruby/object:Gem::Requirement
|
240
|
+
requirements:
|
241
|
+
- - ">="
|
242
|
+
- !ruby/object:Gem::Version
|
243
|
+
version: '0'
|
244
|
+
type: :development
|
245
|
+
prerelease: false
|
246
|
+
version_requirements: !ruby/object:Gem::Requirement
|
247
|
+
requirements:
|
248
|
+
- - ">="
|
249
|
+
- !ruby/object:Gem::Version
|
250
|
+
version: '0'
|
251
|
+
description: Rails engine that allows you to add photos, and galleries of photos,
|
252
|
+
to galleriable models in your rails app.
|
253
|
+
email:
|
254
|
+
- fred.schoeneman@gmail.com
|
255
|
+
executables: []
|
256
|
+
extensions: []
|
257
|
+
extra_rdoc_files: []
|
258
|
+
files:
|
259
|
+
- MIT-LICENSE
|
260
|
+
- README.md
|
261
|
+
- Rakefile
|
262
|
+
- app/assets/config/galleriable_manifest.js
|
263
|
+
- app/assets/javascripts/galleriable/application.js
|
264
|
+
- app/assets/javascripts/galleriable/galleries.js
|
265
|
+
- app/assets/javascripts/galleriable/photos.js
|
266
|
+
- app/assets/javascripts/galleriable/slides.js
|
267
|
+
- app/assets/stylesheets/galleriable/application.css
|
268
|
+
- app/assets/stylesheets/galleriable/galleries.css
|
269
|
+
- app/assets/stylesheets/galleriable/photos.css
|
270
|
+
- app/assets/stylesheets/galleriable/slides.css
|
271
|
+
- app/assets/stylesheets/scaffold.css
|
272
|
+
- app/concerns/gallerify.rb
|
273
|
+
- app/controllers/galleriable/application_controller.rb
|
274
|
+
- app/controllers/galleriable/photos_controller.rb
|
275
|
+
- app/helpers/galleriable/application_helper.rb
|
276
|
+
- app/helpers/galleriable/photos_helper.rb
|
277
|
+
- app/jobs/galleriable/application_job.rb
|
278
|
+
- app/mailers/galleriable/application_mailer.rb
|
279
|
+
- app/models/galleriable/application_record.rb
|
280
|
+
- app/models/galleriable/gallery.rb
|
281
|
+
- app/models/galleriable/photo.rb
|
282
|
+
- app/models/galleriable/slide.rb
|
283
|
+
- app/views/galleriable/photos/_form.html.erb
|
284
|
+
- app/views/galleriable/photos/edit.html.erb
|
285
|
+
- app/views/galleriable/photos/index.html.erb
|
286
|
+
- app/views/galleriable/photos/new.html.erb
|
287
|
+
- app/views/galleriable/photos/show.html.erb
|
288
|
+
- app/views/layouts/galleriable/application.html.erb
|
289
|
+
- config/routes.rb
|
290
|
+
- db/migrate/20160913003004_create_galleriable_photos.rb
|
291
|
+
- db/migrate/20160913042947_create_galleriable_galleries.rb
|
292
|
+
- db/migrate/20160913051502_create_galleriable_slides.rb
|
293
|
+
- lib/galleriable.rb
|
294
|
+
- lib/galleriable/engine.rb
|
295
|
+
- lib/galleriable/version.rb
|
296
|
+
- lib/generators/galleriable/USAGE
|
297
|
+
- lib/generators/galleriable/galleriable_generator.rb
|
298
|
+
- lib/tasks/galleriable_tasks.rake
|
299
|
+
homepage: https://github.com/schadenfred/bacchanal
|
300
|
+
licenses:
|
301
|
+
- MIT
|
302
|
+
metadata: {}
|
303
|
+
post_install_message:
|
304
|
+
rdoc_options: []
|
305
|
+
require_paths:
|
306
|
+
- lib
|
307
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
308
|
+
requirements:
|
309
|
+
- - ">="
|
310
|
+
- !ruby/object:Gem::Version
|
311
|
+
version: '0'
|
312
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
313
|
+
requirements:
|
314
|
+
- - ">="
|
315
|
+
- !ruby/object:Gem::Version
|
316
|
+
version: '0'
|
317
|
+
requirements: []
|
318
|
+
rubyforge_project:
|
319
|
+
rubygems_version: 2.5.1
|
320
|
+
signing_key:
|
321
|
+
specification_version: 4
|
322
|
+
summary: Provides galleries and photos to different parent objects
|
323
|
+
test_files: []
|