pettanr_public_domain_v01_licenses 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,7 +2,7 @@ require_dependency "pettanr_public_domain_v01_licenses/application_controller"
2
2
 
3
3
  module PettanrPublicDomainV01Licenses
4
4
  class AttributesController < ApplicationController
5
- layout 'test' if Pettanr::TestLayout
5
+ layout 'test' if MagicNumber['test_layout']
6
6
  before_filter :authenticate_user!, :only => [:new, :create]
7
7
  before_filter :authenticate_artist, :only => [:new, :create]
8
8
 
@@ -25,6 +25,7 @@ module PettanrPublicDomainV01Licenses
25
25
  @license = License.show @public_domain_license.license_id
26
26
  @resource_picture = @original_picture.resource_picture || ResourcePicture.new
27
27
  @resource_picture.attributes = @public_domain_license.resource_picture_attributes @original_picture
28
+ @resource_picture.overwrite @original_picture
28
29
  respond_to do |format|
29
30
  if @public_domain_license.valid?
30
31
  format.html { render main_app.new_resource_picture_path }
@@ -1,26 +1,25 @@
1
+ <%= render @resource_picture.credit_template, :picture => @resource_picture %>
1
2
  <div>
2
- <% @sp = SystemPicture.find(@resource_picture.credit_data["system_picture_id"]) %>
3
- <%= content_tag(:a,
4
- tag(:img, :src => @sp.url, :alt => h(@license_group.caption.to_s + '[' + @license.caption.to_s + ']')),
5
- :href => @license.url )
6
- %>
7
- </div>
8
- <%= h @resource_picture.credit_data['caption'] %>
9
- by
10
- <%= link_to_unless @resource_picture.credit_data['artist_url'].blank?, h(@resource_picture.artist_name), @resource_picture.credit_data['artist_url'] %>
11
- is licensed under a
12
- <%= link_to h(@license_group.caption), @license_group.url %>
13
- <%= link_to h(@license.caption), @license.url %>
14
- <% unless @resource_picture.credit_data['source_url'].blank? %>
15
- <div>
16
- <%= link_to 'base', @resource_picture.credit_data['source_url'] %>
17
- </div>
18
- <% end %>
19
- <% unless @resource_picture.credit_data['note'].blank? %>
20
- <div>
21
- note:<%= h @resource_picture.credit_data['note'] %>
22
- </div>
23
- <% end %>
24
- <div>
25
- MD5:<%= @resource_picture.original_picture.md5 %>
3
+ <table class="no-border">
4
+ <tr>
5
+ <td>License Group</td>
6
+ <td><%= h @license_group.caption -%></td>
7
+ </tr>
8
+ <tr>
9
+ <td>License</td>
10
+ <td><%= h @license.caption -%></td>
11
+ </tr>
12
+ <tr>
13
+ <td>Artist Name</td>
14
+ <td><%= h @resource_picture.artist_name -%></td>
15
+ </tr>
16
+ <tr>
17
+ <td>source picture's url</td>
18
+ <td><%= h @resource_picture.credit_data['source_url'] -%></td>
19
+ </tr>
20
+ <tr>
21
+ <td>note</td>
22
+ <td><%= h @resource_picture.credit_data['note'] -%></td>
23
+ </tr>
24
+ </table>
26
25
  </div>
@@ -1,25 +1,32 @@
1
- <div>
2
- <%= content_tag(:a,
3
- tag(:img, :src => picture.license.system_picture.url, :alt => h(picture.license.license_group.caption.to_s + '[' + picture.license.caption.to_s + ']')),
4
- :href => picture.license.url )
5
- %>
6
- </div>
7
- <%= h picture.credit_data['caption'] %>
8
- by
9
- <%= link_to_unless picture.credit_data['artist_url'].blank?, h(picture.artist_name), picture.credit_data['artist_url'] %>
10
- is licensed under a
11
- <%= link_to h(picture.license.license_group.caption), picture.license.license_group.url %>
12
- <%= link_to h(picture.license.caption), picture.license.url %>
13
- <% unless picture.credit_data['source_url'].blank? %>
14
- <div>
15
- <%= link_to 'base', picture.credit_data['source_url'] %>
16
- </div>
17
- <% end %>
18
- <% unless picture.credit_data['note'].blank? %>
19
- <div>
20
- note:<%= h picture.credit_data['note'] %>
21
- </div>
22
- <% end %>
23
- <div>
24
- <%= picture.md5 %>
25
- </div>
1
+ <table class="no-border">
2
+ <tr>
3
+ <td width="1px">
4
+ <%= content_tag(:a,
5
+ tag(:img, :src => picture.license.system_picture.url, :alt => h(picture.license.license_group.caption.to_s + '[' + picture.license.caption.to_s + ']'), :width => picture.license.system_picture.width, :height => picture.license.system_picture.height),
6
+ :href => picture.license.url )
7
+ %>
8
+ </td>
9
+ <td>
10
+ <% unless picture.artist_name.blank? %>
11
+ <div class="md5">
12
+ <%= h picture.artist_name %>
13
+ </div>
14
+ <% end %>
15
+ <% unless picture.credit_data['source_url'].blank? %>
16
+ <div class="md5">
17
+ <%= link_to 'Source', picture.credit_data['source_url'] %>
18
+ </div>
19
+ <% end %>
20
+ <% unless picture.credit_data['note'].blank? %>
21
+ <div class="md5">
22
+ <%= h picture.credit_data['note'] %>
23
+ </div>
24
+ <% end %>
25
+ </td>
26
+ </tr>
27
+ <tr>
28
+ <td colspan="2">
29
+ <div class="md5">MD5:<%= picture.md5 %></div>
30
+ </td>
31
+ </tr>
32
+ </table>
@@ -17,19 +17,39 @@
17
17
  </div>
18
18
  <% end %>
19
19
 
20
- <div class="field">
21
- <%= collection_select :public_domain_license, :license_id, @license_group.licenses.map {|l| [l.caption, l.id] }, :last, :first %>
22
- <%= text_field_tag 'public_domain_license[artist_name]', @public_domain_license.artist_name %>
23
- <p>source picture's url</p>
24
- <%= text_field_tag 'public_domain_license[source_url]', @public_domain_license.source_url %>
25
- <p>note</p>
26
- <%= text_field_tag 'public_domain_license[note]', @public_domain_license.note %>
27
- </div>
20
+ <table class="no-border">
21
+ <tr>
22
+ <td>License Group</td>
23
+ <td><%= h @license_group.caption -%></td>
24
+ <td>selected</td>
25
+ </tr>
26
+ <tr>
27
+ <td>License</td>
28
+ <td><%= collection_select :public_domain_license, :license_id, @license_group.licenses.map {|l| [l.caption, l.id] }, :last, :first -%></td>
29
+ <td>+</td>
30
+ </tr>
31
+ <tr>
32
+ <td>Artist Name</td>
33
+ <td><%= text_field_tag 'public_domain_license[artist_name]', @public_domain_license.artist_name -%></td>
34
+ <td>+</td>
35
+ </tr>
36
+ <tr>
37
+ <td>source picture's url</td>
38
+ <td><%= text_field_tag 'public_domain_license[source_url]', @public_domain_license.source_url -%></td>
39
+ <td></td>
40
+ </tr>
41
+ <tr>
42
+ <td>note</td>
43
+ <td><%= text_field_tag 'public_domain_license[note]', @public_domain_license.note -%></td>
44
+ <td></td>
45
+ </tr>
46
+ </table>
47
+
28
48
  <%= hidden_field_tag :original_picture_id, @original_picture.id %>
29
49
  <%= hidden_field_tag 'original_picture_license_group[original_picture_id]', @original_picture_license_group.original_picture_id %>
30
50
  <%= hidden_field_tag 'original_picture_license_group[license_group_id]', @original_picture_license_group.license_group_id %>
31
51
 
32
52
  <div class="actions">
33
- <%= submit_tag %>
53
+ <%= submit_tag 'Next' %>
34
54
  </div>
35
55
  <% end %>
@@ -0,0 +1,2 @@
1
+ <h1>Select license (and more info)</h1>
2
+ <img src="<%= @original_picture.url -%>">
@@ -1 +1,2 @@
1
+ <%= render 'pettanr_public_domain_v01_licenses/attributes/note' %>
1
2
  <%= render 'pettanr_public_domain_v01_licenses/attributes/form' %>
@@ -1,3 +1,3 @@
1
1
  module PettanrPublicDomainV01Licenses
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pettanr_public_domain_v01_licenses
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-08 00:00:00.000000000 Z
12
+ date: 2012-10-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
- requirement: &19999992 !ruby/object:Gem::Requirement
16
+ requirement: &21159408 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 3.1.1
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *19999992
24
+ version_requirements: *21159408
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: sqlite3
27
- requirement: &19997712 !ruby/object:Gem::Requirement
27
+ requirement: &21158976 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *19997712
35
+ version_requirements: *21158976
36
36
  description: This software is a license plugin for PettanR
37
37
  email:
38
38
  - yasusiito@gmail.com
@@ -55,6 +55,7 @@ files:
55
55
  - app/views/pettanr_public_domain_v01_licenses/attributes/_confirm.html.erb
56
56
  - app/views/pettanr_public_domain_v01_licenses/attributes/_credit.html.erb
57
57
  - app/views/pettanr_public_domain_v01_licenses/attributes/_form.html.erb
58
+ - app/views/pettanr_public_domain_v01_licenses/attributes/_note.html.erb
58
59
  - config/routes.rb
59
60
  - db/Copyleft.png
60
61
  - db/migrate/20121008000901_create_pettanr_public_domain_v01_licenses_attributes.rb