pettanr_pettan_public_v01_licenses 0.1.10 → 0.1.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/app/controllers/pettanr_pettan_public_v01_licenses/attributes_controller.rb +0 -42
- data/app/models/pettanr_pettan_public_v01_licenses/attribute.rb +0 -43
- data/app/models/pettanr_pettan_public_v01_licenses/license.rb +11 -11
- data/app/views/pettanr_pettan_public_v01_licenses/attributes/_credit.html.erb +1 -1
- data/app/views/pettanr_pettan_public_v01_licenses/attributes/_full_credit.html.erb +4 -4
- data/db/migrate/20121008012741_create_pettanr_pettan_public_v01_licenses_attributes.rb +0 -1
- data/lib/pettanr_pettan_public_v01_licenses/version.rb +1 -1
- metadata +16 -38
- data/app/views/pettanr_pettan_public_v01_licenses/attributes/_confirm.html.erb +0 -8
- data/app/views/pettanr_pettan_public_v01_licenses/attributes/_form.html.erb +0 -39
- data/app/views/pettanr_pettan_public_v01_licenses/attributes/_note.html.erb +0 -1
- data/app/views/pettanr_pettan_public_v01_licenses/attributes/new.html.erb +0 -4
- data/db/migrate/20140414094239_fix_pettanr_pettan_public_v01_licenses_attributes_system_picture_id.rb +0 -8
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
ODgyMjdiYzg2Njg5ZjVhNTYyMDJiZTEyNWY1N2JiODhlZDBmNzcxYQ==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
NGUxMTY1ZTdlMWEzNjI2NzFhODhiNzBiOGU4OGQyYTRmMTkwMmUzMQ==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
ZWUzNTEzNDIyZTBlNWU4ZWZkZTExNTk2Nzk3YTdkNmZiNGMwNzA5OGExMDFl
|
10
|
+
ZWViNzQyNTQxNzYwMGE5ZGNjMDBiNTkwZTZhZjg3ZjdhMGRiMmQ1MzUzNjYy
|
11
|
+
YWU5NDc5N2U2NTQ1OTNjMjJjMGRlMWQzNThkZWU0NDcyZWMwYjk=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
ODYxNzE2YmIxNjhjZWQ3MmY5NmRiMDc5OTczNjkyNGEwMTcyNGQ4NDc4Mzk4
|
14
|
+
NzMwZDk4MzBhNzFiNjlhMzZmNjg4NTc0MjdhMTE1OWU5MWMzZDhhYjljNjBm
|
15
|
+
ZWQ0Y2RkNTQ0MjI5ZWNmMzBjOTUzOGY0NjkwYzk2NjY3MjZhODA=
|
@@ -2,47 +2,5 @@ require_dependency "pettanr_pettan_public_v01_licenses/application_controller"
|
|
2
2
|
|
3
3
|
module PettanrPettanPublicV01Licenses
|
4
4
|
class AttributesController < ApplicationController
|
5
|
-
before_filter :authenticate_user, :only => [:new, :create]
|
6
|
-
before_filter :authenticate_artist, :only => [:new, :create]
|
7
|
-
|
8
|
-
def self.my_module
|
9
|
-
PettanrPettanPublicV01Licenses
|
10
|
-
end
|
11
|
-
|
12
|
-
def self.my_model
|
13
|
-
PettanrPettanPublicV01Licenses::Attribute
|
14
|
-
end
|
15
|
-
|
16
|
-
def new
|
17
|
-
@original_picture, @original_picture_license_group, @license_group =
|
18
|
-
self.class.my_model.remember_params params, @operators
|
19
|
-
@attr = @license_group.my_engine.new_attribute {}
|
20
|
-
# rare case !
|
21
|
-
# Attribute need artist name by @operators
|
22
|
-
@attr.supply_default @operators
|
23
|
-
|
24
|
-
respond_to do |format|
|
25
|
-
format.html
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
def create
|
30
|
-
@original_picture, @original_picture_license_group, @license_group =
|
31
|
-
self.class.my_model.remember_params params, @operators
|
32
|
-
@attr = self.class.my_module.new_attribute params[:attributes]
|
33
|
-
@license = ::License.show @attr.license_id, @operators
|
34
|
-
@resource_picture = @original_picture.resource_picture || ResourcePicture.new
|
35
|
-
@resource_picture.attributes = @attr.resource_picture_attributes @original_picture, @license
|
36
|
-
@resource_picture.overwrite @original_picture
|
37
|
-
respond_to do |format|
|
38
|
-
if @attr.valid?
|
39
|
-
format.html { render main_app.new_resource_picture_path }
|
40
|
-
format.json { render json: @resource_picture.to_json(ResourcePicture.show_json_opt), status: :created }
|
41
|
-
else
|
42
|
-
format.html { render action: "new" }
|
43
|
-
format.json { render json: @resource_picture.errors, status: :unprocessable_entity }
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
5
|
end
|
48
6
|
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
module PettanrPettanPublicV01Licenses
|
2
2
|
class Attribute < ActiveRecord::Base
|
3
3
|
|
4
|
-
validates :license_id, :presence => true, :numericality => true #, :existence => true
|
5
4
|
validates :artist_name, :presence => true
|
6
5
|
# validates :caption, :presence => true
|
7
6
|
# validates :sources, :presence => true
|
@@ -10,51 +9,9 @@ module PettanrPettanPublicV01Licenses
|
|
10
9
|
self.artist_name = operators.artist.name
|
11
10
|
end
|
12
11
|
|
13
|
-
def resource_picture_attributes op, ls
|
14
|
-
{
|
15
|
-
:original_picture_id => op.id,
|
16
|
-
:license_id => ls.id,
|
17
|
-
:artist_name => self.artist_name,
|
18
|
-
:system_picture_id => ls.system_picture_id,
|
19
|
-
:license_group_module_name => ls.license_group_module_name,
|
20
|
-
:license_group_settings => ls.license_group_settings,
|
21
|
-
:credit_picture_settings => ls.credit_picture_settings,
|
22
|
-
:license_settings => {
|
23
|
-
:license_id => ls.id,
|
24
|
-
# :system_picture_id => ls.system_picture_id, # no save
|
25
|
-
:artist_name => self.artist_name,
|
26
|
-
:caption => self.caption,
|
27
|
-
:sources => self.sources
|
28
|
-
}.to_json
|
29
|
-
}
|
30
|
-
end
|
31
|
-
|
32
|
-
def self.remember_params params, operators
|
33
|
-
op = OriginalPicture.show params[:original_picture_id], operators
|
34
|
-
oplg = OriginalPictureLicenseGroup.new(params[:original_picture_license_group])
|
35
|
-
lg = LicenseGroup.show oplg.license_group_id, operators
|
36
|
-
[op, oplg, lg]
|
37
|
-
end
|
38
|
-
|
39
|
-
def engine_name
|
40
|
-
"pettanr_pettan_public_v01_licenses"
|
41
|
-
end
|
42
|
-
|
43
|
-
def form_name
|
44
|
-
self.engine_name + '/attributes'
|
45
|
-
end
|
46
|
-
|
47
12
|
def label_name field_name = nil
|
48
13
|
self.class.to_s + (field_name ? '.' + field_name : '')
|
49
14
|
end
|
50
15
|
|
51
|
-
def trans_name field_name = nil
|
52
|
-
self.engine_name + '.' + field_name
|
53
|
-
end
|
54
|
-
|
55
|
-
def tag_name field_name
|
56
|
-
'attributes[' + field_name + ']'
|
57
|
-
end
|
58
|
-
|
59
16
|
end
|
60
17
|
end
|
@@ -1,16 +1,16 @@
|
|
1
1
|
module PettanrPettanPublicV01Licenses
|
2
2
|
class License < ActiveRecord::Base
|
3
|
-
validates :open, :presence => true, :numericality => true
|
4
|
-
validates :commercial, :presence => true, :numericality => true
|
5
|
-
validates :official, :presence => true, :numericality => true
|
6
|
-
validates :attribution, :presence => true, :numericality => true
|
7
|
-
validates :derive, :presence => true, :numericality => true
|
8
|
-
validates :thumbnail, :presence => true, :numericality => true
|
9
|
-
validates :gif_convert, :presence => true, :numericality => true
|
10
|
-
validates :reverse, :presence => true, :numericality => true
|
11
|
-
validates :sync_vh, :presence => true, :numericality => true
|
12
|
-
validates :overlap, :presence => true, :numericality => true
|
13
|
-
validates :trackback, :presence => true, :numericality => true
|
3
|
+
validates :open, :presence => true, :numericality => true
|
4
|
+
validates :commercial, :presence => true, :numericality => true
|
5
|
+
validates :official, :presence => true, :numericality => true
|
6
|
+
validates :attribution, :presence => true, :numericality => true
|
7
|
+
validates :derive, :presence => true, :numericality => true
|
8
|
+
validates :thumbnail, :presence => true, :numericality => true
|
9
|
+
validates :gif_convert, :presence => true, :numericality => true
|
10
|
+
validates :reverse, :presence => true, :numericality => true
|
11
|
+
validates :sync_vh, :presence => true, :numericality => true
|
12
|
+
validates :overlap, :presence => true, :numericality => true
|
13
|
+
validates :trackback, :presence => true, :numericality => true
|
14
14
|
|
15
15
|
def supply_default
|
16
16
|
end
|
@@ -11,7 +11,7 @@
|
|
11
11
|
<td>
|
12
12
|
<% picture.boosts 'post' %>
|
13
13
|
<div class="md5">
|
14
|
-
<%= h(truncate(picture.artist_name, :length => 12)) %>
|
14
|
+
<%= h(truncate(picture.attribute_extend.artist_name, :length => 12)) %>
|
15
15
|
</div>
|
16
16
|
<div class="md5">
|
17
17
|
<%= h(truncate(picture.attribute_extend.caption, :length => 12)) %>
|
@@ -2,7 +2,7 @@
|
|
2
2
|
<tr>
|
3
3
|
<td colspan="2">
|
4
4
|
<%= link_to(
|
5
|
-
tag(:img, :src => picture.
|
5
|
+
tag(:img, :src => picture.system_picture.url,
|
6
6
|
:alt => h(picture.alt_name),
|
7
7
|
:width => picture.system_picture.width, :height => picture.system_picture.height),
|
8
8
|
picture.license.url )
|
@@ -15,16 +15,16 @@
|
|
15
15
|
</td>
|
16
16
|
</tr>
|
17
17
|
<tr>
|
18
|
-
<td><%= t_m
|
18
|
+
<td><%= t_m 'LicenseGroup' -%></td>
|
19
19
|
<td><%= link_to(h(picture.license.license_group.caption), picture.license.license_group.url) -%></td>
|
20
20
|
</tr>
|
21
21
|
<tr>
|
22
|
-
<td><%= t_m
|
22
|
+
<td><%= t_m 'License' -%></td>
|
23
23
|
<td><%= link_to(h(picture.license.caption), picture.license.url) -%></td>
|
24
24
|
</tr>
|
25
25
|
<tr>
|
26
26
|
<td><%= t_m picture.attribute_extend.label_name('artist_name') -%></td>
|
27
|
-
<td><%= h(picture.artist_name) -%></td>
|
27
|
+
<td><%= h(picture.attribute_extend.artist_name) -%></td>
|
28
28
|
</tr>
|
29
29
|
<tr>
|
30
30
|
<td><%= t_m picture.attribute_extend.label_name('caption') -%></td>
|
@@ -1,7 +1,6 @@
|
|
1
1
|
class CreatePettanrPettanPublicV01LicensesAttributes < ActiveRecord::Migration
|
2
2
|
def change
|
3
3
|
create_table :pettanr_pettan_public_v01_licenses_attributes do |t|
|
4
|
-
t.column :license_id, :integer, :null => false, :default => 0
|
5
4
|
t.column :artist_name, :text, :null => false, :default => 'unknown'
|
6
5
|
t.column :caption, :text
|
7
6
|
t.column :sources, :text
|
metadata
CHANGED
@@ -1,32 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pettanr_pettan_public_v01_licenses
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
5
|
-
prerelease:
|
4
|
+
version: 0.1.11
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- yasushiito
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2014-06-
|
13
|
-
dependencies:
|
14
|
-
- !ruby/object:Gem::Dependency
|
15
|
-
name: sqlite3
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
|
-
requirements:
|
19
|
-
- - ! '>='
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: '0'
|
22
|
-
type: :development
|
23
|
-
prerelease: false
|
24
|
-
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
|
-
requirements:
|
27
|
-
- - ! '>='
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '0'
|
11
|
+
date: 2014-06-20 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
30
13
|
description: This software is a license plugin for PettanR
|
31
14
|
email:
|
32
15
|
- yasusiito@gmail.com
|
@@ -34,6 +17,9 @@ executables: []
|
|
34
17
|
extensions: []
|
35
18
|
extra_rdoc_files: []
|
36
19
|
files:
|
20
|
+
- MIT-LICENSE
|
21
|
+
- README.rdoc
|
22
|
+
- Rakefile
|
37
23
|
- app/assets/javascripts/pettanr_pettan_public_v01_licenses/application.js
|
38
24
|
- app/assets/javascripts/pettanr_pettan_public_v01_licenses/attributes.js
|
39
25
|
- app/assets/stylesheets/pettanr_pettan_public_v01_licenses/application.css
|
@@ -45,55 +31,47 @@ files:
|
|
45
31
|
- app/models/pettanr_pettan_public_v01_licenses/attribute.rb
|
46
32
|
- app/models/pettanr_pettan_public_v01_licenses/credit_picture.rb
|
47
33
|
- app/models/pettanr_pettan_public_v01_licenses/license.rb
|
48
|
-
- app/views/pettanr_pettan_public_v01_licenses/attributes/new.html.erb
|
49
|
-
- app/views/pettanr_pettan_public_v01_licenses/attributes/_confirm.html.erb
|
50
34
|
- app/views/pettanr_pettan_public_v01_licenses/attributes/_credit.html.erb
|
51
|
-
- app/views/pettanr_pettan_public_v01_licenses/attributes/_form.html.erb
|
52
35
|
- app/views/pettanr_pettan_public_v01_licenses/attributes/_full_credit.html.erb
|
53
|
-
- app/views/pettanr_pettan_public_v01_licenses/attributes/_note.html.erb
|
54
36
|
- config/locales/pettanr_pettan_public_v01_licenses.ja.yml
|
55
37
|
- config/routes.rb
|
56
|
-
- db/b1.png
|
57
|
-
- db/migrate/20121008012741_create_pettanr_pettan_public_v01_licenses_attributes.rb
|
58
|
-
- db/migrate/20140408085215_create_pettanr_pettan_public_v01_licenses_licenses.rb
|
59
|
-
- db/migrate/20140408085232_create_pettanr_pettan_public_v01_licenses_credit_pictures.rb
|
60
|
-
- db/migrate/20140414094239_fix_pettanr_pettan_public_v01_licenses_attributes_system_picture_id.rb
|
61
38
|
- db/PetaPublic_BY.png
|
62
39
|
- db/PetaPublic_BY_SA.png
|
63
40
|
- db/PetaPublic_BY_SA_TB.png
|
64
41
|
- db/PetaPublic_BY_TB.png
|
42
|
+
- db/b1.png
|
43
|
+
- db/migrate/20121008012741_create_pettanr_pettan_public_v01_licenses_attributes.rb
|
44
|
+
- db/migrate/20140408085215_create_pettanr_pettan_public_v01_licenses_licenses.rb
|
45
|
+
- db/migrate/20140408085232_create_pettanr_pettan_public_v01_licenses_credit_pictures.rb
|
65
46
|
- db/pettanr_pettan_public_v01_license.json
|
66
47
|
- db/pettanr_pettan_public_v01_license.yml
|
48
|
+
- lib/pettanr_pettan_public_v01_licenses.rb
|
67
49
|
- lib/pettanr_pettan_public_v01_licenses/engine.rb
|
68
50
|
- lib/pettanr_pettan_public_v01_licenses/version.rb
|
69
|
-
- lib/pettanr_pettan_public_v01_licenses.rb
|
70
51
|
- lib/tasks/pettanr_pettan_public_v01_licenses.rake
|
71
52
|
- lib/tasks/pettanr_pettan_public_v01_licenses_tasks.rake
|
72
|
-
- MIT-LICENSE
|
73
|
-
- Rakefile
|
74
|
-
- README.rdoc
|
75
53
|
homepage: https://github.com/yasushiito/pettanr_ppub_v01_licenses/wiki
|
76
|
-
licenses:
|
54
|
+
licenses:
|
55
|
+
- MIT
|
56
|
+
metadata: {}
|
77
57
|
post_install_message:
|
78
58
|
rdoc_options: []
|
79
59
|
require_paths:
|
80
60
|
- lib
|
81
61
|
required_ruby_version: !ruby/object:Gem::Requirement
|
82
|
-
none: false
|
83
62
|
requirements:
|
84
63
|
- - ! '>='
|
85
64
|
- !ruby/object:Gem::Version
|
86
65
|
version: '0'
|
87
66
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
88
|
-
none: false
|
89
67
|
requirements:
|
90
68
|
- - ! '>='
|
91
69
|
- !ruby/object:Gem::Version
|
92
70
|
version: '0'
|
93
71
|
requirements: []
|
94
72
|
rubyforge_project:
|
95
|
-
rubygems_version:
|
73
|
+
rubygems_version: 2.3.0
|
96
74
|
signing_key:
|
97
|
-
specification_version:
|
75
|
+
specification_version: 4
|
98
76
|
summary: Pettan Public License for PettanR
|
99
77
|
test_files: []
|
@@ -1,8 +0,0 @@
|
|
1
|
-
<div>
|
2
|
-
<h2><%= t('pettanr_pettan_public_v01_licenses.digest_credit') -%></h2>
|
3
|
-
<%= render @resource_picture.credit_template, :picture => @resource_picture %>
|
4
|
-
</div>
|
5
|
-
<div>
|
6
|
-
<h2><%= t('pettanr_pettan_public_v01_licenses.full_credit') -%></h2>
|
7
|
-
<%= render @resource_picture.full_credit_template, :picture => @resource_picture %>
|
8
|
-
</div>
|
@@ -1,39 +0,0 @@
|
|
1
|
-
<%= form_tag(@attr.form_name) do %>
|
2
|
-
<%= render 'system/error_explanation', :obj => @attr %>
|
3
|
-
|
4
|
-
<table class="no-border">
|
5
|
-
<tr>
|
6
|
-
<td><%= t_m 'LicenseGroup' -%></td>
|
7
|
-
<td><%= t_m @attr.label_name -%></td>
|
8
|
-
<td><%= t(@attr.trans_name('selected')) -%></td>
|
9
|
-
</tr>
|
10
|
-
<tr>
|
11
|
-
<td><%= t_m @attr.label_name('license_id') -%></td>
|
12
|
-
<td><%= collection_select :attributes, :license_id, @license_group.licenses.map {|l| [l.caption, l.id] }, :last, :first -%></td>
|
13
|
-
<td><%= t(@attr.trans_name('no_blank')) -%></td>
|
14
|
-
</tr>
|
15
|
-
<tr>
|
16
|
-
<td><%= t_m @attr.label_name('artist_name') -%></td>
|
17
|
-
<td><%= text_field_tag @attr.tag_name('artist_name'), @attr.artist_name -%></td>
|
18
|
-
<td><%= t(@attr.trans_name('no_blank')) -%></td>
|
19
|
-
</tr>
|
20
|
-
<tr>
|
21
|
-
<td><%= t_m @attr.label_name('caption') -%></td>
|
22
|
-
<td><%= text_field_tag @attr.tag_name('caption'), @attr.caption -%></td>
|
23
|
-
<td></td>
|
24
|
-
</tr>
|
25
|
-
<tr>
|
26
|
-
<td><%= t_m @attr.label_name('sources') -%></td>
|
27
|
-
<td><%= text_area_tag @attr.tag_name('sources'), @attr.sources -%></td>
|
28
|
-
<td></td>
|
29
|
-
</tr>
|
30
|
-
</table>
|
31
|
-
|
32
|
-
<%= hidden_field_tag :original_picture_id, @original_picture.id %>
|
33
|
-
<%= hidden_field_tag 'original_picture_license_group[original_picture_id]', @original_picture_license_group.original_picture_id %>
|
34
|
-
<%= hidden_field_tag 'original_picture_license_group[license_group_id]', @original_picture_license_group.license_group_id %>
|
35
|
-
|
36
|
-
<div class="actions">
|
37
|
-
<%= submit_tag t(@attr.trans_name('next')) %>
|
38
|
-
</div>
|
39
|
-
<% end %>
|
@@ -1 +0,0 @@
|
|
1
|
-
<%= tag(:img, @original_picture.opt_img_tag) -%>
|