pettanr_pettan_commons_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_commons_v01_licenses/attributes_controller.rb +0 -42
- data/app/models/pettanr_pettan_commons_v01_licenses/attribute.rb +0 -47
- data/app/models/pettanr_pettan_commons_v01_licenses/license.rb +10 -10
- data/app/views/pettanr_pettan_commons_v01_licenses/attributes/_credit.html.erb +1 -1
- data/app/views/pettanr_pettan_commons_v01_licenses/attributes/_full_credit.html.erb +3 -3
- data/db/migrate/20121008030508_create_pettanr_pettan_commons_v01_licenses_attributes.rb +0 -1
- data/lib/pettanr_pettan_commons_v01_licenses/version.rb +1 -1
- metadata +17 -39
- data/app/views/pettanr_pettan_commons_v01_licenses/attributes/_confirm.html.erb +0 -8
- data/app/views/pettanr_pettan_commons_v01_licenses/attributes/_form.html.erb +0 -39
- data/app/views/pettanr_pettan_commons_v01_licenses/attributes/_note.html.erb +0 -1
- data/app/views/pettanr_pettan_commons_v01_licenses/attributes/new.html.erb +0 -4
- data/db/migrate/20140414094025_fix_pettanr_pettan_commons_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
|
+
N2QxODI2ZTdiMGFiMTRkNTNmMDQ1OTVjZTU1ZTRjZTkzZmYzMzljMg==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
MGU4ZjJjM2Y1NjJmYjI4MzRhNTJkMjNhNWFkZTM2N2RhN2Y2MTc2OQ==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
YWM2ZmVlM2NlZWVkNDljZjhjOWNkMWIxYTViYjYxMDY5Mzg4ZTI5MzQwYjc3
|
10
|
+
NWU0YjM1MDYwNzFiZjA4NjU3OWYxOTMxMWNjYTNiMGQ3OWY5MDZkZDc5MmQ0
|
11
|
+
MzE3MzZiNjY5ZDYwMGMyMDBmZGU4Mjk1NzA0YTVhNDU2Zjk1YTU=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
OGM3ODRmMDliZmRiMTRmNGMwMWFkYTJjZWM2NzljODNiMzNhNmNlM2VkOGIx
|
14
|
+
MjVlNjY2NTk2YTBmZTY0MTc1Y2Q5YTczZjA3NGNhMTQyMDdjNzBjZDYzMzYw
|
15
|
+
NjA0M2RlZTk1NWM1NzQ4ZTYyMGFkMDI1ZDI4YTliNTU1MDQwNTY=
|
@@ -2,47 +2,5 @@ require_dependency "pettanr_pettan_commons_v01_licenses/application_controller"
|
|
2
2
|
|
3
3
|
module PettanrPettanCommonsV01Licenses
|
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
|
-
PettanrPettanCommonsV01Licenses
|
10
|
-
end
|
11
|
-
|
12
|
-
def self.my_model
|
13
|
-
PettanrPettanCommonsV01Licenses::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 PettanrPettanCommonsV01Licenses
|
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,5 @@ module PettanrPettanCommonsV01Licenses
|
|
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_commons_v01_licenses"
|
41
|
-
end
|
42
|
-
|
43
|
-
def form_name
|
44
|
-
self.engine_name + '/attributes'
|
45
|
-
end
|
46
|
-
|
47
|
-
def label_name field_name = nil
|
48
|
-
self.class.to_s + (field_name ? '.' + field_name : '')
|
49
|
-
end
|
50
|
-
|
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
12
|
end
|
60
13
|
end
|
@@ -1,15 +1,15 @@
|
|
1
1
|
module PettanrPettanCommonsV01Licenses
|
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
|
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
13
|
|
14
14
|
def supply_default
|
15
15
|
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 )
|
@@ -19,12 +19,12 @@
|
|
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 picture.
|
22
|
+
<td><%= t_m picture.label_name('license_id') -%></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 CreatePettanrPettanCommonsV01LicensesAttributes < ActiveRecord::Migration
|
2
2
|
def change
|
3
3
|
create_table :pettanr_pettan_commons_v01_licenses_attributes do |t|
|
4
|
-
t.column :license_id, :integer, :null => false, :default => 0
|
5
4
|
t.column :artist_name, :string, :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_commons_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_commons_v01_licenses/application.js
|
38
24
|
- app/assets/javascripts/pettanr_pettan_commons_v01_licenses/attributes.js
|
39
25
|
- app/assets/stylesheets/pettanr_pettan_commons_v01_licenses/application.css
|
@@ -45,20 +31,10 @@ files:
|
|
45
31
|
- app/models/pettanr_pettan_commons_v01_licenses/attribute.rb
|
46
32
|
- app/models/pettanr_pettan_commons_v01_licenses/credit_picture.rb
|
47
33
|
- app/models/pettanr_pettan_commons_v01_licenses/license.rb
|
48
|
-
- app/views/pettanr_pettan_commons_v01_licenses/attributes/new.html.erb
|
49
|
-
- app/views/pettanr_pettan_commons_v01_licenses/attributes/_confirm.html.erb
|
50
34
|
- app/views/pettanr_pettan_commons_v01_licenses/attributes/_credit.html.erb
|
51
|
-
- app/views/pettanr_pettan_commons_v01_licenses/attributes/_form.html.erb
|
52
35
|
- app/views/pettanr_pettan_commons_v01_licenses/attributes/_full_credit.html.erb
|
53
|
-
- app/views/pettanr_pettan_commons_v01_licenses/attributes/_note.html.erb
|
54
36
|
- config/locales/pettanr_pettan_commons_v01_licenses.ja.yml
|
55
37
|
- config/routes.rb
|
56
|
-
- db/b1.png
|
57
|
-
- db/b2.png
|
58
|
-
- db/migrate/20121008030508_create_pettanr_pettan_commons_v01_licenses_attributes.rb
|
59
|
-
- db/migrate/20140401102950_create_pettanr_pettan_commons_v01_licenses_licenses.rb
|
60
|
-
- db/migrate/20140401234553_create_pettanr_pettan_commons_v01_licenses_credit_pictures.rb
|
61
|
-
- db/migrate/20140414094025_fix_pettanr_pettan_commons_v01_licenses_attributes_system_picture_id.rb
|
62
38
|
- db/PetaCommon_BY.png
|
63
39
|
- db/PetaCommon_BY_NC.png
|
64
40
|
- db/PetaCommon_BY_NC_ND.png
|
@@ -70,38 +46,40 @@ files:
|
|
70
46
|
- db/PetaCommon_NC_SA_NR.png
|
71
47
|
- db/PetaCommon_SA_KA.png
|
72
48
|
- db/PetaCommon_SA_NR.png
|
49
|
+
- db/b1.png
|
50
|
+
- db/b2.png
|
51
|
+
- db/migrate/20121008030508_create_pettanr_pettan_commons_v01_licenses_attributes.rb
|
52
|
+
- db/migrate/20140401102950_create_pettanr_pettan_commons_v01_licenses_licenses.rb
|
53
|
+
- db/migrate/20140401234553_create_pettanr_pettan_commons_v01_licenses_credit_pictures.rb
|
73
54
|
- db/pettanr_pettan_commons_v01_license.json
|
74
55
|
- db/pettanr_pettan_commons_v01_license.yml
|
56
|
+
- lib/pettanr_pettan_commons_v01_licenses.rb
|
75
57
|
- lib/pettanr_pettan_commons_v01_licenses/engine.rb
|
76
58
|
- lib/pettanr_pettan_commons_v01_licenses/version.rb
|
77
|
-
- lib/pettanr_pettan_commons_v01_licenses.rb
|
78
59
|
- lib/tasks/pettanr_pettan_commons_v01_licenses.rake
|
79
60
|
- lib/tasks/pettanr_pettan_commons_v01_licenses_tasks.rake
|
80
|
-
- MIT-LICENSE
|
81
|
-
- Rakefile
|
82
|
-
- README.rdoc
|
83
61
|
homepage: https://github.com/yasushiito/pettanr_pcom_v01_licenses/wiki
|
84
|
-
licenses:
|
62
|
+
licenses:
|
63
|
+
- MIT
|
64
|
+
metadata: {}
|
85
65
|
post_install_message:
|
86
66
|
rdoc_options: []
|
87
67
|
require_paths:
|
88
68
|
- lib
|
89
69
|
required_ruby_version: !ruby/object:Gem::Requirement
|
90
|
-
none: false
|
91
70
|
requirements:
|
92
71
|
- - ! '>='
|
93
72
|
- !ruby/object:Gem::Version
|
94
73
|
version: '0'
|
95
74
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
96
|
-
none: false
|
97
75
|
requirements:
|
98
76
|
- - ! '>='
|
99
77
|
- !ruby/object:Gem::Version
|
100
78
|
version: '0'
|
101
79
|
requirements: []
|
102
80
|
rubyforge_project:
|
103
|
-
rubygems_version:
|
81
|
+
rubygems_version: 2.3.0
|
104
82
|
signing_key:
|
105
|
-
specification_version:
|
83
|
+
specification_version: 4
|
106
84
|
summary: Pettan Commons License for PettanR
|
107
85
|
test_files: []
|
@@ -1,8 +0,0 @@
|
|
1
|
-
<div>
|
2
|
-
<h2><%= t('pettanr_pettan_commons_v01_licenses.digest_credit') -%></h2>
|
3
|
-
<%= render @resource_picture.credit_template, :picture => @resource_picture %>
|
4
|
-
</div>
|
5
|
-
<div>
|
6
|
-
<h2><%= t('pettanr_pettan_commons_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) -%>
|