pettanr_creative_commons_v30_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_creative_commons_v30_licenses/attributes_controller.rb +0 -32
- data/app/models/pettanr_creative_commons_v30_licenses/attribute.rb +0 -33
- data/app/models/pettanr_creative_commons_v30_licenses/license.rb +10 -10
- data/app/views/pettanr_creative_commons_v30_licenses/attributes/_credit.html.erb +1 -1
- data/app/views/pettanr_creative_commons_v30_licenses/attributes/_full_credit.html.erb +2 -2
- data/db/migrate/20121008044128_create_pettanr_creative_commons_v30_licenses_attributes.rb +0 -1
- data/lib/pettanr_creative_commons_v30_licenses/version.rb +1 -1
- metadata +12 -33
- data/app/views/pettanr_creative_commons_v30_licenses/attributes/_confirm.html.erb +0 -8
- data/app/views/pettanr_creative_commons_v30_licenses/attributes/_form.html.erb +0 -49
- data/app/views/pettanr_creative_commons_v30_licenses/attributes/_note.html.erb +0 -2
- data/app/views/pettanr_creative_commons_v30_licenses/attributes/new.html.erb +0 -4
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
ZmNiYzEwYzBlM2M4YWQ3MTc4ZjUwMjVjNzI5OTAxZjRhMTRlYmZhNQ==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
YjZjODUxMmU4YmI5N2JhMTUxOTIzMGE3ZWQ0ZjA3MmUwYTgxMGIyNA==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
MzlmOWEzODFjZTNjYTMzNGQ0NzU0OTg2ZDkyOGNhM2VjNDAyM2U5YTI4YzFi
|
10
|
+
OGRhMzZiZDYzMDk5NGIxNDAzZDY4ZWJlZGNjMjljYjJiOWY1YjUyYTYzMzkx
|
11
|
+
OTQzMjU4YzkyYWNjYTM2YTgxNzU2ZjlhZGYxYzFlMjRjZjEwZjM=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
YTk1YTEzYjVjZjM0M2IxYTEwZjQyY2FkYTQ5NDBiNjhlYzYyY2MwMTY2MTE1
|
14
|
+
ZjZjNWJkMjY4MmE5NWE3ODhlOTQ1YmU3ZDY1ZDMxM2MyYTA2OGM2ODYyYmYz
|
15
|
+
NmUwZWYwMDdjY2UyYmU0NjhiY2E4ZTAwNGY4ZWFlODc3YzFkODg=
|
@@ -2,37 +2,5 @@ require_dependency "pettanr_creative_commons_v30_licenses/application_controller
|
|
2
2
|
|
3
3
|
module PettanrCreativeCommonsV30Licenses
|
4
4
|
class AttributesController < ApplicationController
|
5
|
-
before_filter :authenticate_user, :only => [:new, :create]
|
6
|
-
before_filter :authenticate_artist, :only => [:new, :create]
|
7
|
-
|
8
|
-
def new
|
9
|
-
@original_picture, @original_picture_license_group, @license_group =
|
10
|
-
PettanrCreativeCommonsV30Licenses::Attribute.remember_params params, @operators
|
11
|
-
@attr = @license_group.my_engine.new_attribute {}
|
12
|
-
@attr.supply_default @operators
|
13
|
-
|
14
|
-
respond_to do |format|
|
15
|
-
format.html
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
def create
|
20
|
-
@original_picture, @original_picture_license_group, @license_group =
|
21
|
-
PettanrCreativeCommonsV30Licenses::Attribute.remember_params params, @operators
|
22
|
-
@attr = PettanrCreativeCommonsV30Licenses.new_attribute params[:creative_commons_license]
|
23
|
-
@license = ::License.show @attr.license_id, @operators
|
24
|
-
@resource_picture = @original_picture.resource_picture || ResourcePicture.new
|
25
|
-
@resource_picture.attributes = @attr.resource_picture_attributes @original_picture, @license
|
26
|
-
@resource_picture.overwrite @original_picture
|
27
|
-
respond_to do |format|
|
28
|
-
if @attr.valid?
|
29
|
-
format.html { render main_app.new_resource_picture_path }
|
30
|
-
format.json { render json: @resource_picture.to_json(ResourcePicture.show_json_opt), status: :created }
|
31
|
-
else
|
32
|
-
format.html { render action: "new" }
|
33
|
-
format.json { render json: @resource_picture.errors, status: :unprocessable_entity }
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
5
|
end
|
38
6
|
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
module PettanrCreativeCommonsV30Licenses
|
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 :artist_url, :url => {:allow_blank => true}
|
7
6
|
validates :source_url, :url => {:allow_blank => true}
|
@@ -11,41 +10,9 @@ module PettanrCreativeCommonsV30Licenses
|
|
11
10
|
self.artist_name = operators.artist.name
|
12
11
|
end
|
13
12
|
|
14
|
-
def resource_picture_attributes op, ls
|
15
|
-
{
|
16
|
-
:original_picture_id => op.id,
|
17
|
-
:license_id => ls.id,
|
18
|
-
:artist_name => self.artist_name,
|
19
|
-
:system_picture_id => ls.system_picture_id,
|
20
|
-
:license_group_module_name => ls.license_group_module_name,
|
21
|
-
:license_group_settings => ls.license_group_settings,
|
22
|
-
:credit_picture_settings => ls.credit_picture_settings,
|
23
|
-
:license_settings => {
|
24
|
-
:license_id => ls.id,
|
25
|
-
# :system_picture_id => ls.system_picture_id, # no save
|
26
|
-
:artist_name => self.artist_name,
|
27
|
-
:caption => self.caption,
|
28
|
-
:artist_url => self.artist_url,
|
29
|
-
:source_url => self.source_url,
|
30
|
-
:more_permission_url => self.more_permission_url
|
31
|
-
}.to_json
|
32
|
-
}
|
33
|
-
end
|
34
|
-
|
35
|
-
def self.remember_params params, operators
|
36
|
-
op = OriginalPicture.show params[:original_picture_id], operators
|
37
|
-
oplg = OriginalPictureLicenseGroup.new(params[:original_picture_license_group])
|
38
|
-
lg = LicenseGroup.show oplg.license_group_id, operators
|
39
|
-
[op, oplg, lg]
|
40
|
-
end
|
41
|
-
|
42
13
|
def label_name field_name = nil
|
43
14
|
self.class.to_s + (field_name ? '.' + field_name : '')
|
44
15
|
end
|
45
16
|
|
46
|
-
def tag_name field_name
|
47
|
-
'creative_commons_license[' + field_name + ']'
|
48
|
-
end
|
49
|
-
|
50
17
|
end
|
51
18
|
end
|
@@ -1,15 +1,15 @@
|
|
1
1
|
module PettanrCreativeCommonsV30Licenses
|
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 )
|
@@ -16,7 +16,7 @@
|
|
16
16
|
</tr>
|
17
17
|
<tr>
|
18
18
|
<td><%= t_m 'PettanrCreativeCommonsV30Licenses::Attribute.artist_name' -%></td>
|
19
|
-
<td><%= link_to_if picture.attribute_extend.artist_url, h(picture.artist_name), picture.attribute_extend.artist_url -%></td>
|
19
|
+
<td><%= link_to_if picture.attribute_extend.artist_url, h(picture.attribute_extend.artist_name), picture.attribute_extend.artist_url -%></td>
|
20
20
|
</tr>
|
21
21
|
<tr>
|
22
22
|
<td><%= t_m 'LicenseGroup' -%></td>
|
@@ -1,7 +1,6 @@
|
|
1
1
|
class CreatePettanrCreativeCommonsV30LicensesAttributes < ActiveRecord::Migration
|
2
2
|
def change
|
3
3
|
create_table :pettanr_creative_commons_v30_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 :artist_url, :text
|
metadata
CHANGED
@@ -1,32 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pettanr_creative_commons_v30_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_creative_commons_v30_licenses/application.js
|
38
24
|
- app/assets/javascripts/pettanr_creative_commons_v30_licenses/attributes.js
|
39
25
|
- app/assets/stylesheets/pettanr_creative_commons_v30_licenses/application.css
|
@@ -45,12 +31,8 @@ files:
|
|
45
31
|
- app/models/pettanr_creative_commons_v30_licenses/attribute.rb
|
46
32
|
- app/models/pettanr_creative_commons_v30_licenses/credit_picture.rb
|
47
33
|
- app/models/pettanr_creative_commons_v30_licenses/license.rb
|
48
|
-
- app/views/pettanr_creative_commons_v30_licenses/attributes/new.html.erb
|
49
|
-
- app/views/pettanr_creative_commons_v30_licenses/attributes/_confirm.html.erb
|
50
34
|
- app/views/pettanr_creative_commons_v30_licenses/attributes/_credit.html.erb
|
51
|
-
- app/views/pettanr_creative_commons_v30_licenses/attributes/_form.html.erb
|
52
35
|
- app/views/pettanr_creative_commons_v30_licenses/attributes/_full_credit.html.erb
|
53
|
-
- app/views/pettanr_creative_commons_v30_licenses/attributes/_note.html.erb
|
54
36
|
- config/locales/pettanr_creative_commons_v30_licenses.ja.yml
|
55
37
|
- config/routes.rb
|
56
38
|
- db/b1.png
|
@@ -66,36 +48,33 @@ files:
|
|
66
48
|
- db/migrate/20140408085049_create_pettanr_creative_commons_v30_licenses_credit_pictures.rb
|
67
49
|
- db/pettanr_creative_commons_v30_license.json
|
68
50
|
- db/pettanr_creative_commons_v30_license.yml
|
51
|
+
- lib/pettanr_creative_commons_v30_licenses.rb
|
69
52
|
- lib/pettanr_creative_commons_v30_licenses/engine.rb
|
70
53
|
- lib/pettanr_creative_commons_v30_licenses/version.rb
|
71
|
-
- lib/pettanr_creative_commons_v30_licenses.rb
|
72
54
|
- lib/tasks/pettanr_creative_commons_v30_licenses.rake
|
73
55
|
- lib/tasks/pettanr_creative_commons_v30_licenses_tasks.rake
|
74
|
-
- MIT-LICENSE
|
75
|
-
- Rakefile
|
76
|
-
- README.rdoc
|
77
56
|
homepage: https://github.com/yasushiito/pettanr_cc_v30_licenses/wiki
|
78
|
-
licenses:
|
57
|
+
licenses:
|
58
|
+
- MIT
|
59
|
+
metadata: {}
|
79
60
|
post_install_message:
|
80
61
|
rdoc_options: []
|
81
62
|
require_paths:
|
82
63
|
- lib
|
83
64
|
required_ruby_version: !ruby/object:Gem::Requirement
|
84
|
-
none: false
|
85
65
|
requirements:
|
86
66
|
- - ! '>='
|
87
67
|
- !ruby/object:Gem::Version
|
88
68
|
version: '0'
|
89
69
|
required_rubygems_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
|
requirements: []
|
96
75
|
rubyforge_project:
|
97
|
-
rubygems_version:
|
76
|
+
rubygems_version: 2.3.0
|
98
77
|
signing_key:
|
99
|
-
specification_version:
|
78
|
+
specification_version: 4
|
100
79
|
summary: Creative Commons License for PettanR
|
101
80
|
test_files: []
|
@@ -1,8 +0,0 @@
|
|
1
|
-
<div>
|
2
|
-
<h2><%= t('pettanr_creative_commons_v30_licenses.digest_credit') -%></h2>
|
3
|
-
<%= render @resource_picture.credit_template, :picture => @resource_picture %>
|
4
|
-
</div>
|
5
|
-
<div>
|
6
|
-
<h2><%= t('pettanr_creative_commons_v30_licenses.full_credit') -%></h2>
|
7
|
-
<%= render @resource_picture.full_credit_template, :picture => @resource_picture %>
|
8
|
-
</div>
|
@@ -1,49 +0,0 @@
|
|
1
|
-
<%= form_tag('/pettanr_creative_commons_v30_licenses/attributes') 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('pettanr_creative_commons_v30_licenses.selected') -%></td>
|
9
|
-
</tr>
|
10
|
-
<tr>
|
11
|
-
<td><%= t_m @attr.label_name('license_id') -%></td>
|
12
|
-
<td><%= collection_select :creative_commons_license, :license_id, @license_group.licenses.map {|l| [l.caption, l.id] }, :last, :first -%></td>
|
13
|
-
<td><%= t('pettanr_creative_commons_v30_licenses.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('pettanr_creative_commons_v30_licenses.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('artist_url') -%></td>
|
27
|
-
<td><%= text_field_tag @attr.tag_name('artist_url'), @attr.artist_url -%></td>
|
28
|
-
<td></td>
|
29
|
-
</tr>
|
30
|
-
<tr>
|
31
|
-
<td><%= t_m @attr.label_name('source_url') -%></td>
|
32
|
-
<td><%= text_field_tag @attr.tag_name('source_url'), @attr.source_url -%></td>
|
33
|
-
<td></td>
|
34
|
-
</tr>
|
35
|
-
<tr>
|
36
|
-
<td><%= t_m @attr.label_name('more_permission_url') -%></td>
|
37
|
-
<td><%= text_field_tag @attr.tag_name('more_permission_url'), @attr.more_permission_url -%></td>
|
38
|
-
<td></td>
|
39
|
-
</tr>
|
40
|
-
</table>
|
41
|
-
|
42
|
-
<%= hidden_field_tag :original_picture_id, @original_picture.id %>
|
43
|
-
<%= hidden_field_tag 'original_picture_license_group[original_picture_id]', @original_picture_license_group.original_picture_id %>
|
44
|
-
<%= hidden_field_tag 'original_picture_license_group[license_group_id]', @original_picture_license_group.license_group_id %>
|
45
|
-
|
46
|
-
<div class="actions">
|
47
|
-
<%= submit_tag t('pettanr_creative_commons_v30_licenses.next') %>
|
48
|
-
</div>
|
49
|
-
<% end %>
|
@@ -1,4 +0,0 @@
|
|
1
|
-
<h1><%= t('pettanr_creative_commons_v30_licenses.title') %></h1>
|
2
|
-
<%= @page_title = t('pettanr_creative_commons_v30_licenses.title') %>
|
3
|
-
<%= render 'pettanr_creative_commons_v30_licenses/attributes/note' %>
|
4
|
-
<%= render 'pettanr_creative_commons_v30_licenses/attributes/form' %>
|