papermill 0.13.1 → 0.13.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/app/views/papermill/_form.html.erb +13 -0
- data/app/views/papermill/_thumbnail_asset.html.erb +1 -1
- data/app/views/papermill/edit.html.erb +22 -28
- data/config/locales/papermill.yml +24 -28
- data/lib/papermill/papermill_asset.rb +6 -2
- data/public/papermill/papermill.css +15 -14
- data/public/papermill/papermill.js +3 -3
- metadata +2 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.13.
|
1
|
+
0.13.2
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<p>
|
2
|
+
<%= form.label :title, I18n.t("title", :scope => 'papermill') %><br />
|
3
|
+
<%= form.text_field :title, :class => "text_field" %>
|
4
|
+
</p>
|
5
|
+
<p>
|
6
|
+
<%= form.label :copyright, I18n.t("copyright", :scope => 'papermill') %><br />
|
7
|
+
<%= form.text_field :copyright, :class => "text_field" %>
|
8
|
+
</p>
|
9
|
+
<p>
|
10
|
+
<%= form.label :description, I18n.t("description", :scope => 'papermill') %><br />
|
11
|
+
<%= form.text_area :description %>
|
12
|
+
</p>
|
13
|
+
<%= submit_tag I18n.t('save', :scope => 'papermill') %>
|
@@ -2,5 +2,5 @@
|
|
2
2
|
<span class="image"><%= image_tag(thumbnail_asset.url(thumbnail_style)) %></span>
|
3
3
|
<% else %>
|
4
4
|
<span class="name" title="<%= thumbnail_asset.name %>"><%= truncate(thumbnail_asset.name, :length => 15) %></span>
|
5
|
-
<span class="infos"><%= thumbnail_asset.content_type
|
5
|
+
<span class="infos"><%= thumbnail_asset.content_type %></span>
|
6
6
|
<% end %>
|
@@ -1,39 +1,33 @@
|
|
1
|
-
<link href="/papermill/papermill.css" media="screen" rel="stylesheet" type="text/css" />
|
2
1
|
<div id="papermill-box">
|
3
2
|
<div id="left">
|
4
|
-
<%= link_to(@asset.image? ? image_tag(@asset.url("400x#{Papermill::PAPERMILL_DEFAULTS[:max_height]}>")) : I18n.t("file_type", :type => @asset.content_type
|
3
|
+
<%= link_to(@asset.image? ? image_tag(@asset.url("400x#{Papermill::PAPERMILL_DEFAULTS[:max_height]}>")) : I18n.t("file_type", :type => @asset.content_type, :scope => 'papermill'), @asset.url, :popup => true) %>
|
5
4
|
</div>
|
6
5
|
<div id="right">
|
7
6
|
<div id="read-only">
|
8
|
-
<
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
<
|
14
|
-
<
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
<% if assetable = @asset.assetable %>
|
20
|
-
<p onclick="jQuery('#parent-box').toggle(); jQuery('#parent-box-more').toggle(); return false;"><%= I18n.t("parent", :scope => 'papermill') %><span id="parent-box-more">...</span></p>
|
21
|
-
<span style="display:none;" id="parent-box"><%= debug assetable.to_yaml %></span>
|
22
|
-
<% end %>
|
7
|
+
<table border="0">
|
8
|
+
<tr><td class="left-cell"><%= I18n.t("name", :scope => 'papermill') %> </td><td><%= @asset.name %></td></tr>
|
9
|
+
<tr><td class="left-cell"><%= I18n.t("content_type", :scope => 'papermill') %></td><td><%= @asset.content_type %></td></tr>
|
10
|
+
<tr><td class="left-cell"><%= I18n.t("size", :scope => 'papermill') %> </td><td><%= number_to_human_size(@asset.size.to_i) %></td></tr>
|
11
|
+
<% if @asset.image? %>
|
12
|
+
<tr><td class="left-cell"><%= I18n.t("width", :scope => 'papermill') %> </td><td><%= @asset.width.to_i %>px</td></tr>
|
13
|
+
<tr><td class="left-cell"><%= I18n.t("height", :scope => 'papermill') %> </td><td><%= @asset.height.to_i %>px</td></tr>
|
14
|
+
<% end %>
|
15
|
+
<tr><td class="left-cell"><%= I18n.t("created_at", :scope => 'papermill') %> </td><td><%= I18n.l(@asset.created_at) %></td></tr>
|
16
|
+
<tr><td class="left-cell"><%= I18n.t("updated_at", :scope => 'papermill') %> </td><td><%= I18n.l(@asset.updated_at) %></td></tr>
|
17
|
+
</table>
|
23
18
|
</div>
|
24
19
|
<div id="read-write">
|
25
|
-
<
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
<%= f.label :description, I18n.t("description", :scope => 'papermill') %>
|
32
|
-
<%= f.text_area :description %>
|
33
|
-
<div><%= submit_tag I18n.t('save', :scope => 'papermill') %></div>
|
34
|
-
<% end %>
|
20
|
+
<form onsubmit="jQuery.ajax({data:jQuery.param(jQuery(this).serializeArray()), dataType:'script', type:'post', url:'/papermill/<%= @asset.id %>'}); return false;" method="post" action="/papermill/76">
|
21
|
+
<input type="hidden" value="put" name="_method"/>
|
22
|
+
<% fields_for :papermill_asset, @asset do |form| %>
|
23
|
+
<%= render :partial => 'form', :object => form %>
|
24
|
+
<% end %>
|
25
|
+
</form>
|
35
26
|
</div>
|
36
27
|
</div>
|
37
28
|
<div style="clear:both;"></div>
|
38
|
-
<p id="footer"
|
29
|
+
<p id="footer">
|
30
|
+
<%= I18n.t("location", :scope => 'papermill') + @asset.file.path %><br />
|
31
|
+
<%= I18n.t("url", :scope => 'papermill') + @asset.url %>
|
32
|
+
</p>
|
39
33
|
</div>
|
@@ -13,22 +13,20 @@ en:
|
|
13
13
|
SWFUPLOAD_LOADING: "Loading..."
|
14
14
|
SWFUPLOAD_ERROR: "Something happened while loading" # + " <file_name> (<swfupload error message> [<error code>])"
|
15
15
|
file_type: "{{type.capitalize}} file"
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
created_at: "Created at: "
|
23
|
-
updated_at: "Updated at: "
|
16
|
+
name: "Name"
|
17
|
+
content_type: "Content-type"
|
18
|
+
size: "File size"
|
19
|
+
class_name: "Asset type"
|
20
|
+
created_at: "Created at"
|
21
|
+
updated_at: "Updated at"
|
24
22
|
title: "Title"
|
25
|
-
copyright: "Copyright
|
26
|
-
description: "Description
|
23
|
+
copyright: "Copyright"
|
24
|
+
description: "Description"
|
25
|
+
width: "Width"
|
26
|
+
height: "Height"
|
27
27
|
save: "Send to server"
|
28
|
-
location: "File
|
29
|
-
|
30
|
-
width: "Width: "
|
31
|
-
height: "Height: "
|
28
|
+
location: "File : "
|
29
|
+
url: "URL : "
|
32
30
|
fr:
|
33
31
|
papermill:
|
34
32
|
not-processed: "Erreur/ressource non trouvée"
|
@@ -44,19 +42,17 @@ fr:
|
|
44
42
|
SWFUPLOAD_LOADING: "Chargement..."
|
45
43
|
SWFUPLOAD_ERROR: "Une erreur est survenue pendant le chargement de"
|
46
44
|
file_type: "Fichier {{type}}"
|
47
|
-
read-only: "Informations en lecture seule : "
|
48
|
-
modifiable_fields: "Informations modifiables : "
|
49
45
|
name: "Nom : "
|
50
|
-
content_type: "Content-type
|
51
|
-
size: "Taille du fichier
|
52
|
-
class_name: "Type d'asset
|
53
|
-
created_at: "Création
|
54
|
-
updated_at: "Mise à jour
|
55
|
-
title: "Titre
|
56
|
-
copyright: "Copyright
|
57
|
-
description: "Description
|
46
|
+
content_type: "Content-type"
|
47
|
+
size: "Taille du fichier"
|
48
|
+
class_name: "Type d'asset"
|
49
|
+
created_at: "Création"
|
50
|
+
updated_at: "Mise à jour"
|
51
|
+
title: "Titre"
|
52
|
+
copyright: "Copyright"
|
53
|
+
description: "Description"
|
54
|
+
width: "Largeur"
|
55
|
+
height: "Hauteur"
|
58
56
|
save: "Envoyer"
|
59
|
-
location: "
|
60
|
-
|
61
|
-
width: "Largeur : "
|
62
|
-
height: "Hauteur : "
|
57
|
+
location: "Fichier : "
|
58
|
+
url: "Lien : "
|
@@ -42,12 +42,16 @@ class PapermillAsset < ActiveRecord::Base
|
|
42
42
|
file.url(style && CGI::escape(style.to_s))
|
43
43
|
end
|
44
44
|
|
45
|
+
def path(style = nil)
|
46
|
+
file.path(style)
|
47
|
+
end
|
48
|
+
|
45
49
|
def content_type
|
46
|
-
file_content_type
|
50
|
+
file_content_type
|
47
51
|
end
|
48
52
|
|
49
53
|
def image?
|
50
|
-
content_type && content_type.
|
54
|
+
content_type && content_type.split("/")[0] == "image" && (content_type.split("/")[1] || "unknown")
|
51
55
|
end
|
52
56
|
|
53
57
|
def destroy_files
|
@@ -1,16 +1,16 @@
|
|
1
|
-
#papermill-box{width:
|
2
|
-
#papermill-box #left {float:left; width:400px; padding-bottom:10px;}
|
3
|
-
#papermill-box #right {float:right; width:
|
4
|
-
#papermill-box
|
5
|
-
#papermill-box
|
6
|
-
#papermill-box
|
7
|
-
#papermill-box p
|
8
|
-
|
9
|
-
#papermill-box
|
10
|
-
#papermill-box
|
11
|
-
|
12
|
-
#papermill-box
|
13
|
-
#papermill-box
|
1
|
+
#papermill-box { width:862px; margin-bottom:10px; }
|
2
|
+
#papermill-box #left { float:left; width:400px; padding-bottom:10px; }
|
3
|
+
#papermill-box #right { float:right; width:420px; margin-left:20px; border-left:2px solid GREY; padding-left:20px; padding-bottom:10px; }
|
4
|
+
#papermill-box input.text_field { width:400px; margin:5px 0; }
|
5
|
+
#papermill-box textarea { width:403px; height:100px; margin:5px 0; }
|
6
|
+
#papermill-box label { }
|
7
|
+
#papermill-box p { padding: 3px 0; margin:0;}
|
8
|
+
|
9
|
+
#papermill-box #footer { text-align:center; font-size:10px; padding:5px }
|
10
|
+
#papermill-box #read-write { margin:10px 0 0 5px; }
|
11
|
+
|
12
|
+
#papermill-box .right-cell {}
|
13
|
+
#papermill-box .left-cell {font-weight:bold; padding-right:10px; text-align:right;}
|
14
14
|
|
15
15
|
.papermill a:hover { background:none; color:inherit; }
|
16
16
|
.papermill a img { border:0px; }
|
@@ -44,4 +44,5 @@
|
|
44
44
|
/* Need some backgrounds?
|
45
45
|
.papermill li { background:transparent url(images/background.png) repeat top left; }
|
46
46
|
.papermill-thumb-container { background:transparent url(images/container-background.jpg) repeat top left; }
|
47
|
-
*/
|
47
|
+
*/
|
48
|
+
|
@@ -1,5 +1,5 @@
|
|
1
1
|
popup = function(title1, title) {
|
2
|
-
window.open (title1, title, config='height=
|
2
|
+
window.open (title1, title, config='height=580, width=870, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no')
|
3
3
|
}
|
4
4
|
|
5
5
|
|
@@ -24,8 +24,8 @@ popup = function(url) {
|
|
24
24
|
Shadowbox.open({
|
25
25
|
content: url,
|
26
26
|
player: "iframe",
|
27
|
-
width:
|
28
|
-
height:
|
27
|
+
width: 870,
|
28
|
+
height: 580
|
29
29
|
});
|
30
30
|
}
|
31
31
|
return false;
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: papermill
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.13.
|
4
|
+
version: 0.13.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- "Benoit B\xC3\xA9n\xC3\xA9zech"
|
@@ -39,6 +39,7 @@ files:
|
|
39
39
|
- VERSION
|
40
40
|
- app/controllers/papermill_controller.rb
|
41
41
|
- app/views/papermill/_asset.html.erb
|
42
|
+
- app/views/papermill/_form.html.erb
|
42
43
|
- app/views/papermill/_raw_asset.html.erb
|
43
44
|
- app/views/papermill/_thumbnail_asset.html.erb
|
44
45
|
- app/views/papermill/edit.html.erb
|