OSDN Git Service

t#29924:fix;license browser
authoryasushiito <yas@pen-chan.jp>
Tue, 23 Oct 2012 08:30:07 +0000 (17:30 +0900)
committeryasushiito <yas@pen-chan.jp>
Tue, 23 Oct 2012 08:30:07 +0000 (17:30 +0900)
Gemfile.lock
app/views/licenses/browse.html.erb
app/views/licenses/list.html.erb
script/ls_helper.rb

index b7a1755..0e4fe12 100644 (file)
@@ -39,7 +39,7 @@ GEM
       mime-types
       xml-simple
     bcrypt-ruby (3.0.1-x86-mingw32)
-    builder (3.0.3)
+    builder (3.0.4)
     capybara (1.1.2)
       mime-types (>= 1.16)
       nokogiri (>= 1.3.3)
@@ -47,7 +47,7 @@ GEM
       rack-test (>= 0.5.4)
       selenium-webdriver (~> 2.0)
       xpath (~> 0.1.4)
-    childprocess (0.3.5)
+    childprocess (0.3.6)
       ffi (~> 1.0, >= 1.0.6)
     choice (0.1.6)
     coffee-rails (3.1.1)
@@ -66,7 +66,7 @@ GEM
       capybara (>= 1.1.2)
       cucumber (>= 1.1.8)
       nokogiri (>= 1.5.0)
-    database_cleaner (0.8.0)
+    database_cleaner (0.9.1)
     devise (1.5.2)
       bcrypt-ruby (~> 3.0)
       orm_adapter (~> 0.0.3)
@@ -78,7 +78,7 @@ GEM
     factory_girl (4.1.0)
       activesupport (>= 3.0.0)
     ffi (1.1.5-x86-mingw32)
-    gherkin (2.11.4-x86-mingw32)
+    gherkin (2.11.5-x86-mingw32)
       json (>= 1.4.6)
     hike (1.2.1)
     i18n (0.6.1)
@@ -97,17 +97,17 @@ GEM
     multi_json (1.3.6)
     nokogiri (1.5.5-x86-mingw32)
     orm_adapter (0.0.7)
-    pettanr_creative_commons_v30_licenses (0.0.2)
+    pettanr_creative_commons_v30_licenses (0.0.3)
       rails (~> 3.1.1)
-    pettanr_pettan_commons_v01_licenses (0.0.3)
+    pettanr_pettan_commons_v01_licenses (0.0.4)
       rails (~> 3.1.1)
-    pettanr_pettan_protected_v01_licenses (0.0.3)
+    pettanr_pettan_protected_v01_licenses (0.0.4)
       rails (~> 3.1.1)
-    pettanr_pettan_public_v01_licenses (0.0.3)
+    pettanr_pettan_public_v01_licenses (0.0.4)
       rails (~> 3.1.1)
-    pettanr_public_domain_v01_licenses (0.0.2)
+    pettanr_public_domain_v01_licenses (0.0.3)
       rails (~> 3.1.1)
-    pettanr_unknown_v01_licenses (0.0.3)
+    pettanr_unknown_v01_licenses (0.0.4)
       rails (~> 3.1.1)
     pg (0.14.1-x86-mingw32)
     polyglot (0.3.3)
@@ -152,7 +152,7 @@ GEM
     rspec-expectations (2.11.3)
       diff-lcs (~> 1.1.3)
     rspec-mocks (2.11.3)
-    rspec-rails (2.11.0)
+    rspec-rails (2.11.4)
       actionpack (>= 3.0)
       activesupport (>= 3.0)
       railties (>= 3.0)
@@ -194,7 +194,7 @@ GEM
       nokogiri (>= 1.2.0)
       rack (>= 1.0)
       rack-test (>= 0.5.3)
-    xml-simple (1.1.1)
+    xml-simple (1.1.2)
     xpath (0.1.4)
       nokogiri (~> 1.3)
 
index 97a995d..6c7a5f8 100644 (file)
@@ -1,9 +1,3 @@
-    <th>license_group_id</th>
-    <th>name</th>
-    <th>caption</th>
-    <th>url</th>
-    <th>system_picture_id</th>
-    <th>settings</th>
 <div>
 <p>
 <div>id</div>
 <div>url</div>
 <%= h @license.url %>
 </p>
+<p>
 <div>system_picture_id</div>
 <%= @license.system_picture_id %>
 </p>
+<p>
+<div>credit_pictures</div>
+<%= @license.credit_pictures %>
+</p>
 <div>settings</div>
 <%= h @license.settings %>
 </p>
index 77ae8b5..bc4c659 100644 (file)
@@ -3,12 +3,10 @@
 <table>
   <tr>
     <th>id</th>
-    <th>license_group_id</th>
+    <th>lg_id</th>
     <th>name</th>
     <th>caption</th>
     <th>url</th>
-    <th>system_picture_id</th>
-    <th>settings</th>
     <th>created_at</th>
     <th>updated_at</th>
   </tr>
     <td><%= h license.name %></td>
     <td><%= h license.caption %></td>
     <td><%= h license.url %></td>
-    <td><%= link_to license.system_picture_id, :controller => 'system_pictures', :action => :browse, :id => license.system_picture_id %></td>
-    <td><%= h license.settings %></td>
     <td><%= license.created_at %></td>
     <td><%= license.updated_at %></td>
   </tr>
 <% end -%>
 </table>
-<%= link_to 'new original license', new_original_license_path %>
index 4ea1a66..bc504ac 100644 (file)
@@ -29,9 +29,20 @@ lg.each do |k, g|
       puts 'open system picture file ' + fn\r
       d = File.open(fn, 'rb').read\r
       b = Base64.encode64(d).gsub(/\r/, '').gsub(/\n/, '')\r
-      l['system_picture'] = b\r
+      l['system_picture_id'] = {"text" => b}\r
       l.delete 'system_picture_file'\r
     end\r
+    if l['credit_pictures']\r
+      credit_pictures = {}\r
+      l['credit_pictures'].each do |n, v|\r
+        fn = File.expand_path(wd + '/' + v)\r
+        puts 'open system picture file ' + fn\r
+        d = File.open(fn, 'rb').read\r
+        b = Base64.encode64(d).gsub(/\r/, '').gsub(/\n/, '')\r
+        credit_pictures[n] = {"text" => b}\r
+      end\r
+      l['credit_pictures'] = credit_pictures\r
+    end\r
   end\r
 end\r
 puts "generating " + o\r