redmine_apijs 6.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +2 -0
- data/LICENSE +339 -0
- data/README +74 -0
- data/app/controllers/apijs_controller.rb +326 -0
- data/app/views/application/_browser.html.erb +45 -0
- data/app/views/attachments/_links.html.erb +146 -0
- data/app/views/settings/_apijs.html.erb +256 -0
- data/assets/fonts/apijs/config.json +130 -0
- data/assets/fonts/apijs/fontello.woff +0 -0
- data/assets/fonts/apijs/fontello.woff2 +0 -0
- data/assets/images/apijs/player-black-200.png +0 -0
- data/assets/images/apijs/player-black-400.png +0 -0
- data/assets/images/apijs/player-white-200.png +0 -0
- data/assets/images/apijs/player-white-400.png +0 -0
- data/assets/images/apijs/tv.gif +0 -0
- data/assets/javascripts/apijs-redmine.min.js +7 -0
- data/assets/javascripts/apijs.min.js +7 -0
- data/assets/javascripts/app.js +224 -0
- data/assets/stylesheets/apijs-print.min.css +8 -0
- data/assets/stylesheets/apijs-redmine-rtl.min.css +8 -0
- data/assets/stylesheets/apijs-redmine.min.css +8 -0
- data/assets/stylesheets/apijs-screen-rtl.min.css +8 -0
- data/assets/stylesheets/apijs-screen.min.css +8 -0
- data/assets/stylesheets/styles.css +73 -0
- data/config/locales/cs.yml +30 -0
- data/config/locales/de.yml +30 -0
- data/config/locales/en.yml +30 -0
- data/config/locales/es.yml +30 -0
- data/config/locales/fr.yml +30 -0
- data/config/locales/it.yml +30 -0
- data/config/locales/ja.yml +30 -0
- data/config/locales/nl.yml +30 -0
- data/config/locales/pl.yml +30 -0
- data/config/locales/pt-BR.yml +30 -0
- data/config/locales/pt.yml +30 -0
- data/config/locales/ru.yml +30 -0
- data/config/locales/sk.yml +30 -0
- data/config/locales/tr.yml +30 -0
- data/config/locales/zh.yml +30 -0
- data/config/routes.rb +86 -0
- data/init.rb +69 -0
- data/lib/apijs_attachment.rb +252 -0
- data/lib/apijs_const.rb +35 -0
- data/lib/apijs_files.rb +55 -0
- data/lib/image.py +201 -0
- data/lib/redmine_apijs.rb +46 -0
- data/lib/useragentparser.rb +175 -0
- data/lib/video.py +78 -0
- data/redmine_apijs.gemspec +69 -0
- metadata +94 -0
@@ -0,0 +1,45 @@
|
|
1
|
+
<%
|
2
|
+
# Created S/17/08/2019
|
3
|
+
# Updated L/25/05/2020
|
4
|
+
#
|
5
|
+
# Copyright 2008-2020 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
|
6
|
+
# https://www.luigifab.fr/redmine/apijs
|
7
|
+
#
|
8
|
+
# This program is free software, you can redistribute it or modify
|
9
|
+
# it under the terms of the GNU General Public License (GPL) as published
|
10
|
+
# by the free software foundation, either version 2 of the license, or
|
11
|
+
# (at your option) any later version.
|
12
|
+
#
|
13
|
+
# This program is distributed in the hope that it will be useful,
|
14
|
+
# but without any warranty, without even the implied warranty of
|
15
|
+
# merchantability or fitness for a particular purpose. See the
|
16
|
+
# GNU General Public License (GPL) for more details.
|
17
|
+
|
18
|
+
text = ''
|
19
|
+
data = (Useragentparser.new).parse
|
20
|
+
|
21
|
+
if data['browser'] && data['version']
|
22
|
+
data['version'] = Thread.current[:request].query_parameters[:browser] ? 1 : data['version'].to_f
|
23
|
+
if (data['browser'] == 'MSIE') && (data['version'] < 15)
|
24
|
+
text = raw l(:apijs_browser_warning, { n: 'Internet Explorer', v: data['version'], l: 'href="https://www.microsoft.com/windows/microsoft-edge"' })
|
25
|
+
elsif (data['browser'] == 'Edge') && (data['version'] < 16)
|
26
|
+
text = raw l(:apijs_browser_warning, { n: 'Edge', v: data['version'], l: 'href="https://www.microsoft.com/windows/microsoft-edge"' })
|
27
|
+
elsif (data['browser'] == 'Firefox') && (data['version'] < 36)
|
28
|
+
text = raw l(:apijs_browser_warning, { n: 'Firefox', v: data['version'], l: 'href="https://www.mozilla.org/firefox"' })
|
29
|
+
elsif (data['browser'] == 'Chrome') && (data['version'] < 31)
|
30
|
+
text = raw l(:apijs_browser_warning, { n: 'Chrome', v: data['version'], l: 'href="https://www.google.com/chrome"' })
|
31
|
+
elsif (data['browser'] == 'Opera') && (data['version'] < 19)
|
32
|
+
text = raw l(:apijs_browser_warning, { n: 'Opera', v: data['version'], l: 'href="https://www.opera.com/"' })
|
33
|
+
elsif (data['browser'] == 'Safari') && (data['version'] < 9)
|
34
|
+
text = raw l(:apijs_browser_warning, { n: 'Safari', v: data['version'], l: 'href="https://www.apple.com/safari/"' })
|
35
|
+
end
|
36
|
+
end
|
37
|
+
%>
|
38
|
+
<% if text.length > 0 %>
|
39
|
+
<% if pos == "bottom" %>
|
40
|
+
<div class="flash error apijs" id="oldBrowser" style="position:absolute; top:25px; left:33%; width:31%; z-index:9000;"><%= text %></div>
|
41
|
+
<script>var e = document.getElementById('oldBrowser'); document.querySelector('body').insertBefore(e, document.getElementById('wrapper')); e.removeAttribute('style');</script>
|
42
|
+
<% else %>
|
43
|
+
<div class="flash error apijs" id="oldBrowser"><%= text %></div>
|
44
|
+
<% end %>
|
45
|
+
<% end %>
|
@@ -0,0 +1,146 @@
|
|
1
|
+
<%
|
2
|
+
# Created L/21/05/2012
|
3
|
+
# Updated D/26/07/2020
|
4
|
+
#
|
5
|
+
# Copyright 2008-2020 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
|
6
|
+
# https://www.luigifab.fr/redmine/apijs
|
7
|
+
#
|
8
|
+
# This program is free software, you can redistribute it or modify
|
9
|
+
# it under the terms of the GNU General Public License (GPL) as published
|
10
|
+
# by the free software foundation, either version 2 of the license, or
|
11
|
+
# (at your option) any later version.
|
12
|
+
#
|
13
|
+
# This program is distributed in the hope that it will be useful,
|
14
|
+
# but without any warranty, without even the implied warranty of
|
15
|
+
# merchantability or fitness for a particular purpose. See the
|
16
|
+
# GNU General Public License (GPL) for more details.
|
17
|
+
|
18
|
+
if Setting.plugin_redmine_apijs['sort_attachments'] == '1'
|
19
|
+
attachments = attachments.to_a.sort! { |a,b| a.filename.downcase <=> b.filename.downcase }
|
20
|
+
end
|
21
|
+
|
22
|
+
setting_enabled = Setting.plugin_redmine_apijs['enabled'] == '1'
|
23
|
+
setting_show_album = Setting.plugin_redmine_apijs['show_album'] == '1'
|
24
|
+
setting_show_album_infos = Setting.plugin_redmine_apijs['show_album_infos'] == '1'
|
25
|
+
setting_show_filename = Setting.plugin_redmine_apijs['show_filename'] == '1'
|
26
|
+
setting_show_exifdate = Setting.plugin_redmine_apijs['show_exifdate'] == '1'
|
27
|
+
permission_delete = User.current.allowed_to?(:delete_attachments, @project)
|
28
|
+
permission_edit = User.current.allowed_to?(:edit_attachments, @project)
|
29
|
+
|
30
|
+
@slideshowi = 0 unless defined? @slideshowi
|
31
|
+
show_album = show_list = false
|
32
|
+
|
33
|
+
if setting_show_album
|
34
|
+
attachments.each { |attachment|
|
35
|
+
if (attachment.isPhoto? || attachment.isVideo?) && !attachment.isExcluded?
|
36
|
+
show_album = true
|
37
|
+
else
|
38
|
+
show_list = true
|
39
|
+
end
|
40
|
+
}
|
41
|
+
else
|
42
|
+
show_list = true
|
43
|
+
end
|
44
|
+
%>
|
45
|
+
|
46
|
+
<% if setting_enabled %>
|
47
|
+
<% if show_album %>
|
48
|
+
<p class="apijs section"><strong><%= l(:apijs_title_album) %></strong></p>
|
49
|
+
<div class="attachments album" id="slideshow.<%= @slideshowi %>">
|
50
|
+
<% slideshowj = 0 %>
|
51
|
+
<% attachments.each { |attachment| %>
|
52
|
+
<% if (attachment.isPhoto? || attachment.isVideo?) && !attachment.isExcluded? %>
|
53
|
+
<% description = (attachment.description.blank?) ? ' ' : attachment.description.gsub(/["\\\x0]/, ' ') %>
|
54
|
+
<dl id="attachmentId<%= attachment.id %>">
|
55
|
+
<dt>
|
56
|
+
<a href="<%= (attachment.isVideo?) ? attachment.getDownloadUrl + '?stream=1' : attachment.getShowUrl %>" type="<%= attachment.content_type %>" onclick="return false" id="slideshow.<%= @slideshowi %>.<%= slideshowj %>">
|
57
|
+
<img src="<%= attachment.getThumbUrl %>" srcset="<%= attachment.getSrcsetUrl %> 2x" width="200" height="150" alt="<%= h(description).strip! %>"/>
|
58
|
+
<input type="hidden" value="<%= (setting_show_filename) ? attachment.filename : 'false' %>|<%= (setting_show_exifdate) ? format_time(attachment.created_on) : 'false' %>|<%= h(description) %>"/>
|
59
|
+
</a>
|
60
|
+
</dt>
|
61
|
+
<dd class="<%= (setting_show_album_infos) ? 'big' : 'one' %>">
|
62
|
+
<div class="action">
|
63
|
+
<% if attachment.readable? %>
|
64
|
+
<button type="button" class="attachment download" title="<%= l(:apijs_title_download, v: number_to_human_size(attachment.filesize)) %>" onclick="<%= raw attachment.getDownloadButton %>"></button>
|
65
|
+
<% end %>
|
66
|
+
<% if permission_edit %>
|
67
|
+
<button type="button" class="attachment edit" title="<%= l(:button_edit) %>" onclick="<%= raw attachment.getEditButton(form_authenticity_token) %>"></button>
|
68
|
+
<% end %>
|
69
|
+
<% if permission_delete %>
|
70
|
+
<button type="button" class="attachment delete" title="<%= l(:button_delete) %>" onclick="<%= raw attachment.getDeleteButton(form_authenticity_token) %>"></button>
|
71
|
+
<% end %>
|
72
|
+
</div>
|
73
|
+
<% if setting_show_album_infos %>
|
74
|
+
<span class="filename"><%= h(attachment.filename) %></span>
|
75
|
+
<span class="author date"><%= h(attachment.author) %> (<%= format_time(attachment.created_on) %>)</span>
|
76
|
+
<span class="description"><%= h(description) %></span>
|
77
|
+
<% else %>
|
78
|
+
<span class="description"><%= h(description) %></span>
|
79
|
+
<% end %>
|
80
|
+
</dd>
|
81
|
+
</dl>
|
82
|
+
<% slideshowj += 1 %>
|
83
|
+
<% end %>
|
84
|
+
<% } %>
|
85
|
+
<% @slideshowi += 1 if slideshowj > 0 %>
|
86
|
+
</div>
|
87
|
+
<% end %>
|
88
|
+
<% if show_list %>
|
89
|
+
<p class="apijs section"><strong><%= l(:apijs_title_files) %></strong></p>
|
90
|
+
<ul class="attachments" id="slideshow.<%= @slideshowi %>">
|
91
|
+
<% slideshowj = 0 %>
|
92
|
+
<% attachments.each { |attachment| %>
|
93
|
+
<% if !setting_show_album || (!attachment.isPhoto? && !attachment.isVideo?) || attachment.isExcluded? %>
|
94
|
+
<% description = (attachment.description.blank?) ? ' ' : attachment.description.gsub(/["\\\x0]/, ' ') %>
|
95
|
+
<li id="attachmentId<%= attachment.id %>">
|
96
|
+
<% if permission_delete %>
|
97
|
+
<button type="button" class="attachment delete" title="<%= l(:button_delete) %>" onclick="<%= raw attachment.getDeleteButton(form_authenticity_token) %>"></button>
|
98
|
+
<% end %>
|
99
|
+
<% if permission_edit %>
|
100
|
+
<button type="button" class="attachment edit" title="<%= l(:button_edit) %>" onclick="<%= raw attachment.getEditButton(form_authenticity_token) %>"></button>
|
101
|
+
<% end %>
|
102
|
+
<% if attachment.readable? %>
|
103
|
+
<button type="button" class="attachment download" title="<%= l(:button_download) %>" onclick="<%= raw attachment.getDownloadButton %>"></button>
|
104
|
+
<% end %>
|
105
|
+
<% if attachment.is_text? || attachment.isImage? || attachment.isVideo? %>
|
106
|
+
<% if attachment.isImage? || attachment.isVideo? %>
|
107
|
+
<a href="<%= attachment.getDownloadUrl.gsub('download', 'show') %>" type="<%= attachment.content_type %>" onclick="return false" id="slideshow.<%= @slideshowi %>.<%= slideshowj %>">
|
108
|
+
<input type="hidden" value="<%= (setting_show_filename) ? attachment.filename : 'false' %>|<%= (setting_show_exifdate) ? format_time(attachment.created_on) : 'false' %>|<%= h(description) %>" />
|
109
|
+
</a>
|
110
|
+
<% slideshowj += 1 %>
|
111
|
+
<% else %>
|
112
|
+
<button type="button" class="attachment show" title="<%= l(:button_show) %>" onclick="<%= raw attachment.getShowButton(setting_show_filename, setting_show_exifdate, description) %>"></button>
|
113
|
+
<% end %>
|
114
|
+
<% end %>
|
115
|
+
<strong><%= attachment.filename %></strong>
|
116
|
+
<span class="description"><%= h(description) %></span>
|
117
|
+
<span class="size">(<%= number_to_human_size(attachment.filesize) %>)</span>
|
118
|
+
<span class="author"><%= h(attachment.author) %></span>
|
119
|
+
<span class="date">(<%= format_time(attachment.created_on) %>)</span>
|
120
|
+
</li>
|
121
|
+
<% end %>
|
122
|
+
<% } %>
|
123
|
+
<% @slideshowi += 1 if slideshowj > 0 %>
|
124
|
+
</ul>
|
125
|
+
<% end %>
|
126
|
+
<% else %>
|
127
|
+
<ul class="attachments">
|
128
|
+
<% attachments.each { |attachment| %>
|
129
|
+
<li id="attachmentId<%= attachment.id %>">
|
130
|
+
<% if options[:deletable] %>
|
131
|
+
<%= link_to(image_tag('delete.png'), attachment_path(attachment), confirm: l(:text_are_you_sure), method: :delete, title: l(:button_delete)) %>
|
132
|
+
<% end %>
|
133
|
+
<% if attachment.is_text? %>
|
134
|
+
<%= link_to(image_tag('magnifier.png'), controller: 'attachments', action: 'show', id: attachment, filename: attachment.filename) %>
|
135
|
+
<% end %>
|
136
|
+
<%= link_to_attachment(attachment, class: 'icon icon-attachment', download: true) %>
|
137
|
+
<% unless attachment.description.blank? %>
|
138
|
+
<span class="description"><%= h(attachment.description) %></span>
|
139
|
+
<% end %>
|
140
|
+
<span class="size">(<%= number_to_human_size(attachment.filesize) %>)</span>
|
141
|
+
<span class="author"><%= h(attachment.author) %></span>
|
142
|
+
<span class="date">(<%= format_time(attachment.created_on) %>)</span>
|
143
|
+
</li>
|
144
|
+
<% } %>
|
145
|
+
</ul>
|
146
|
+
<% end %>
|
@@ -0,0 +1,256 @@
|
|
1
|
+
<%
|
2
|
+
# Created J/12/12/2013
|
3
|
+
# Updated D/26/07/2020
|
4
|
+
#
|
5
|
+
# Copyright 2008-2020 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
|
6
|
+
# https://www.luigifab.fr/redmine/apijs
|
7
|
+
#
|
8
|
+
# This program is free software, you can redistribute it or modify
|
9
|
+
# it under the terms of the GNU General Public License (GPL) as published
|
10
|
+
# by the free software foundation, either version 2 of the license, or
|
11
|
+
# (at your option) any later version.
|
12
|
+
#
|
13
|
+
# This program is distributed in the hope that it will be useful,
|
14
|
+
# but without any warranty, without even the implied warranty of
|
15
|
+
# merchantability or fitness for a particular purpose. See the
|
16
|
+
# GNU General Public License (GPL) for more details.
|
17
|
+
|
18
|
+
html_title "Redmine Apijs plugin - " + l(:label_administration)
|
19
|
+
checked = 'checked="checked"'
|
20
|
+
size_files = 0
|
21
|
+
size_thumb = 0
|
22
|
+
size_srcset = 0
|
23
|
+
size_show = 0
|
24
|
+
|
25
|
+
if File.directory?(ALL_FILES)
|
26
|
+
size_files = `du -hs #{ALL_FILES} | cut -f1`.strip!
|
27
|
+
size = size_files.to_f
|
28
|
+
size_files = number_to_human_size(size * 1024 * 1024 * 1024) if size_files =~ /G/
|
29
|
+
size_files = number_to_human_size(size * 1024 * 1024) if size_files =~ /M/
|
30
|
+
size_files = number_to_human_size(size * 1024) if size_files =~ /K/
|
31
|
+
end
|
32
|
+
|
33
|
+
if File.directory?(File.join(APIJS_ROOT, 'thumb'))
|
34
|
+
size_thumb = `du -hs #{APIJS_ROOT}/thumb/ | cut -f1`.strip!
|
35
|
+
size = size_thumb.to_f
|
36
|
+
size_thumb = number_to_human_size(size * 1024 * 1024 * 1024) if size_thumb =~ /G/i
|
37
|
+
size_thumb = number_to_human_size(size * 1024 * 1024) if size_thumb =~ /M/i
|
38
|
+
size_thumb = number_to_human_size(size * 1024) if size_thumb =~ /K/i
|
39
|
+
end
|
40
|
+
|
41
|
+
if File.directory?(File.join(APIJS_ROOT, 'srcset'))
|
42
|
+
size_srcset = `du -hs #{APIJS_ROOT}/srcset/ | cut -f1`.strip!
|
43
|
+
size = size_srcset.to_f
|
44
|
+
size_srcset = number_to_human_size(size * 1024 * 1024 * 1024) if size_srcset =~ /G/i
|
45
|
+
size_srcset = number_to_human_size(size * 1024 * 1024) if size_srcset =~ /M/i
|
46
|
+
size_srcset = number_to_human_size(size * 1024) if size_srcset =~ /K/i
|
47
|
+
end
|
48
|
+
|
49
|
+
if File.directory?(File.join(APIJS_ROOT, 'show'))
|
50
|
+
size_show = `du -hs #{APIJS_ROOT}/show/ | cut -f1`.strip!
|
51
|
+
size = size_show.to_f
|
52
|
+
size_show = number_to_human_size(size * 1024 * 1024 * 1024) if size_show =~ /G/i
|
53
|
+
size_show = number_to_human_size(size * 1024 * 1024) if size_show =~ /M/i
|
54
|
+
size_show = number_to_human_size(size * 1024) if size_show =~ /K/i
|
55
|
+
end
|
56
|
+
|
57
|
+
|
58
|
+
if Redmine::Platform.mswin?
|
59
|
+
cmd = 'python.exe'
|
60
|
+
else
|
61
|
+
cmd = `command -v python3 || command -v python || command -v python2`.to_s.strip!
|
62
|
+
end
|
63
|
+
|
64
|
+
if cmd.length == 0
|
65
|
+
pyt = 'not found'
|
66
|
+
pil = pyt
|
67
|
+
sco = pyt
|
68
|
+
else
|
69
|
+
pyt = `#{cmd} --version 2>&1`.gsub('Python ', '').strip!
|
70
|
+
|
71
|
+
pil = `#{cmd} -c "from PIL import Image; print(Image.__version__)" 2>&1`.strip!
|
72
|
+
if pil.include? "o module named"
|
73
|
+
pil = 'not available'
|
74
|
+
elsif pil.include? "__version__"
|
75
|
+
pil = 'available'
|
76
|
+
end
|
77
|
+
|
78
|
+
sco = `#{cmd} -c "import scour; print(scour.__version__)" 2>&1`.strip!
|
79
|
+
if sco.include? "o module named"
|
80
|
+
sco = 'not available'
|
81
|
+
elsif sco.include? "__version__"
|
82
|
+
sco = 'available'
|
83
|
+
end
|
84
|
+
end
|
85
|
+
%>
|
86
|
+
|
87
|
+
<p style="margin:0.5em 1em; padding:0.5em;">
|
88
|
+
Luigifab/Apijs <%= Redmine::Plugin.find(:redmine_apijs).version %>
|
89
|
+
<span style="float:<%= l(:direction) == 'rtl' ? 'left' : 'right' %>; font-size:11px;"><a href="https://www.redmine.org/plugins/apijs">redmine.org/plugins/apijs</a> | <a href="https://www.luigifab.fr/redmine/apijs">luigifab.fr/redmine/apijs</a> | <a href="https://www.luigifab.fr/apijs">luigifab.fr/apijs</a> | ⚠ IPv6</span>
|
90
|
+
</p>
|
91
|
+
|
92
|
+
<fieldset class="box apijs tabular settings">
|
93
|
+
<legend><%= raw l(:apijs_config_apijs) %></legend>
|
94
|
+
<p>
|
95
|
+
<label for="apijsEnabled"><%= raw l(:apijs_config_enable) %></label>
|
96
|
+
<select name="settings[enabled]" id="apijsEnabled">
|
97
|
+
<option value="0" <%= raw 'selected="selected"' if settings['enabled'] != '1' %>><%= raw l(:general_text_No) %></option>
|
98
|
+
<option value="1" <%= raw 'selected="selected"' if settings['enabled'] == '1' %>><%= raw l(:general_text_Yes) %></option>
|
99
|
+
</select>
|
100
|
+
<% if settings['enabled'] == '1' %>
|
101
|
+
/ <button type="button" style="vertical-align:middle;" onclick="apijs.dialog.dialogInformation('<%= raw l(:apijs_example1_title) %>','<%= raw l(:apijs_example1_text).gsub(/['"\\\x0]/,'\\\\\0') %>');"><%= l(:apijs_example, v: 1) %></button>
|
102
|
+
<button type="button" style="vertical-align:middle;" onclick="apijs.dialog.dialogInformation('<%= raw l(:apijs_example2_title) %>','[p]<%= raw l(:apijs_example2_text).gsub(/['"\\\x0]/,'\\\\\0') %>[/p][p]<%= raw l(:apijs_example2_link, v: '[a href=\'https://www.luigifab.fr/\' class=\'popup\']www.luigifab.fr[/a]').gsub(/['"\\\x0]/,'\\\\\0') %>[/p]');"><%= l(:apijs_example, v: 2) %></button>
|
103
|
+
<% end %>
|
104
|
+
</p>
|
105
|
+
<p>
|
106
|
+
<label for="apijsSort"><%= raw l(:apijs_config_sort_order) %></label>
|
107
|
+
<select name="settings[sort_attachments]" id="apijsSort">
|
108
|
+
<option value="0" <%= raw 'selected="selected"' if settings['sort_attachments'] != '1' %>><%= raw l(:general_text_No) %></option>
|
109
|
+
<option value="1" <%= raw 'selected="selected"' if settings['sort_attachments'] == '1' %>><%= raw l(:general_text_Yes) %></option>
|
110
|
+
</select>
|
111
|
+
</p>
|
112
|
+
<p>
|
113
|
+
<label for="apijsBrowser"><%= raw l(:apijs_config_browser) %></label>
|
114
|
+
<select name="settings[browser]" id="apijsBrowser">
|
115
|
+
<option value="0" <%= raw 'selected="selected"' if settings['browser'] != '1' %>><%= raw l(:general_text_No) %></option>
|
116
|
+
<option value="1" <%= raw 'selected="selected"' if settings['browser'] == '1' %>><%= raw l(:general_text_Yes) %></option>
|
117
|
+
</select>
|
118
|
+
<em class="info"><%= raw l(:apijs_config_browser_help) %></em>
|
119
|
+
</p>
|
120
|
+
<p>
|
121
|
+
<label><%= raw l(:label_role_and_permissions) %></label>
|
122
|
+
<a href="<%= url_for({controller: 'roles', action: 'permissions'}) %>"><%= raw l(:label_role_and_permissions) %></a>
|
123
|
+
<em class="info"><%= raw l(:permission_edit_attachments) %><br /><%= raw l(:permission_delete_attachments) %></em>
|
124
|
+
</p>
|
125
|
+
<p>
|
126
|
+
<label><%= raw l(:apijs_config_directories) %></label>
|
127
|
+
<%= ALL_FILES %>/ <b><%= size_files %></b>
|
128
|
+
<br /><%= APIJS_ROOT %>/thumb/ <b><%= size_thumb %></b> (200x150)
|
129
|
+
<br /><%= APIJS_ROOT %>/srcset/ <b><%= size_srcset %></b> (400x300)
|
130
|
+
<br /><%= APIJS_ROOT %>/show/ <b><%= size_show %></b> (1200x900)
|
131
|
+
</p>
|
132
|
+
</fieldset>
|
133
|
+
|
134
|
+
<fieldset class="box apijs tabular settings">
|
135
|
+
<legend><%= raw l(:apijs_config_album) %></legend>
|
136
|
+
<p>
|
137
|
+
<label for="apijsShowAlbum"><%= raw l(:apijs_config_show_album) %></label>
|
138
|
+
<select name="settings[show_album]" id="apijsShowAlbum">
|
139
|
+
<option value="0" <%= raw 'selected="selected"' if settings['show_album'] != '1' %>><%= raw l(:general_text_No) %></option>
|
140
|
+
<option value="1" <%= raw 'selected="selected"' if settings['show_album'] == '1' %>><%= raw l(:general_text_Yes) %></option>
|
141
|
+
</select>
|
142
|
+
</p>
|
143
|
+
<p>
|
144
|
+
<label for="apijsShowAlbumInformations"><%= raw l(:apijs_config_show_album_infos) %></label>
|
145
|
+
<select name="settings[show_album_infos]" id="apijsShowAlbumInformations">
|
146
|
+
<option value="0" <%= raw 'selected="selected"' if settings['show_album_infos'] != '1' %>><%= raw l(:general_text_No) %></option>
|
147
|
+
<option value="1" <%= raw 'selected="selected"' if settings['show_album_infos'] == '1' %>><%= raw l(:general_text_Yes) %></option>
|
148
|
+
</select>
|
149
|
+
</p>
|
150
|
+
<p>
|
151
|
+
<label for="apijsShowFilename"><%= raw l(:apijs_config_show_filename) %></label>
|
152
|
+
<select name="settings[show_filename]" id="apijsShowFilename">
|
153
|
+
<option value="0" <%= raw 'selected="selected"' if settings['show_filename'] != '1' %>><%= raw l(:general_text_No) %></option>
|
154
|
+
<option value="1" <%= raw 'selected="selected"' if settings['show_filename'] == '1' %>><%= raw l(:general_text_Yes) %></option>
|
155
|
+
</select>
|
156
|
+
</p>
|
157
|
+
<p>
|
158
|
+
<label for="apijsShowExifdate"><%= raw l(:apijs_config_show_exifdate) %></label>
|
159
|
+
<select name="settings[show_exifdate]" id="apijsShowExifdate">
|
160
|
+
<option value="0" <%= raw 'selected="selected"' if settings['show_exifdate'] != '1' %>><%= raw l(:general_text_No) %></option>
|
161
|
+
<option value="1" <%= raw 'selected="selected"' if settings['show_exifdate'] == '1' %>><%= raw l(:general_text_Yes) %></option>
|
162
|
+
</select>
|
163
|
+
</p>
|
164
|
+
<p>
|
165
|
+
<label><%= raw l(:apijs_config_mimetypes) %></label>
|
166
|
+
<span style="display:block; line-height:200%;">
|
167
|
+
<label class="bis">
|
168
|
+
<input type="checkbox" name="settings[album_mimetype_jpg]" value="1" <%= raw checked if settings['album_mimetype_jpg'] == '1' %> /> jpg
|
169
|
+
</label>
|
170
|
+
<label class="bis">
|
171
|
+
<input type="checkbox" name="settings[album_mimetype_jpeg]" value="1" <%= raw checked if settings['album_mimetype_jpeg'] == '1' %> /> jpeg
|
172
|
+
</label>
|
173
|
+
<label class="bis">
|
174
|
+
<input type="checkbox" name="settings[album_mimetype_gif]" value="1" <%= raw checked if settings['album_mimetype_gif'] == '1' %> /> gif
|
175
|
+
</label>
|
176
|
+
<label class="bis">
|
177
|
+
<input type="checkbox" name="settings[album_mimetype_png]" value="1" <%= raw checked if settings['album_mimetype_png'] == '1' %> /> png
|
178
|
+
</label>
|
179
|
+
<label class="bis">
|
180
|
+
<input type="checkbox" name="settings[album_mimetype_tif]" value="1" <%= raw checked if settings['album_mimetype_tif'] == '1' %> /> tif
|
181
|
+
</label>
|
182
|
+
<label class="bis">
|
183
|
+
<input type="checkbox" name="settings[album_mimetype_tiff]" value="1" <%= raw checked if settings['album_mimetype_tiff'] == '1' %> /> tiff
|
184
|
+
</label>
|
185
|
+
<label class="bis">
|
186
|
+
<input type="checkbox" name="settings[album_mimetype_webp]" value="1" <%= raw checked if settings['album_mimetype_webp'] == '1' %> /> webp
|
187
|
+
</label>
|
188
|
+
<label class="bis">
|
189
|
+
<input type="checkbox" name="settings[album_mimetype_bmp]" value="1" <%= raw checked if settings['album_mimetype_bmp'] == '1' %> /> bmp
|
190
|
+
</label>
|
191
|
+
<label class="bis">
|
192
|
+
<input type="checkbox" name="settings[album_mimetype_eps]" value="1" <%= raw checked if settings['album_mimetype_eps'] == '1' %> /> eps
|
193
|
+
</label>
|
194
|
+
<label class="bis">
|
195
|
+
<input type="checkbox" name="settings[album_mimetype_psd]" value="1" <%= raw checked if settings['album_mimetype_psd'] == '1' %> /> psd
|
196
|
+
</label>
|
197
|
+
<label class="bis">
|
198
|
+
<input type="checkbox" name="settings[album_mimetype_svg]" value="1" <%= raw checked if settings['album_mimetype_svg'] == '1' %> /> <u>svg</u>
|
199
|
+
</label>
|
200
|
+
<label class="bis">
|
201
|
+
<input type="checkbox" name="settings[album_mimetype_ogv]" value="1" <%= raw checked if settings['album_mimetype_ogv'] == '1' %> /> ogv
|
202
|
+
</label>
|
203
|
+
<label class="bis">
|
204
|
+
<input type="checkbox" name="settings[album_mimetype_webm]" value="1" <%= raw checked if settings['album_mimetype_webm'] == '1' %> /> webm
|
205
|
+
</label>
|
206
|
+
<label class="bis">
|
207
|
+
<input type="checkbox" name="settings[album_mimetype_mp4]" value="1" <%= raw checked if settings['album_mimetype_mp4'] == '1' %> /> mp4
|
208
|
+
</label>
|
209
|
+
</span>
|
210
|
+
</p>
|
211
|
+
<p>
|
212
|
+
<label for="apijsAlbumExcludeName"><%= raw l(:apijs_config_album_exclude_name) %></label>
|
213
|
+
<input type="text" name="settings[album_exclude_name]" value="<%= settings['album_exclude_name'] %>" size="40" id="apijsAlbumExcludeName" />
|
214
|
+
<em class="info"><%= raw l(:text_comma_separated) %></em>
|
215
|
+
</p>
|
216
|
+
<p>
|
217
|
+
<label for="apijsAlbumExcludeDesc"><%= raw l(:apijs_config_album_exclude_desc) %></label>
|
218
|
+
<input type="text" name="settings[album_exclude_desc]" value="<%= settings['album_exclude_desc'] %>" size="40" id="apijsAlbumExcludeDesc" />
|
219
|
+
<em class="info"><%= raw l(:text_comma_separated) %></em>
|
220
|
+
</p>
|
221
|
+
<p>
|
222
|
+
<label for="apijsCreateAll"><%= raw l(:apijs_config_create_all) %></label>
|
223
|
+
<select name="settings[create_all]" id="apijsCreateAll">
|
224
|
+
<option value="0" <%= raw 'selected="selected"' if settings['create_all'] == '0' %>>
|
225
|
+
<%= raw l(:general_text_No) %>
|
226
|
+
</option>
|
227
|
+
<option value="1" <%= raw 'selected="selected"' if settings['create_all'] == '1' %>>
|
228
|
+
<%= raw l(:general_text_Yes) %> - single thread
|
229
|
+
</option>
|
230
|
+
<option value="2" <%= raw 'selected="selected"' if settings['create_all'] == '2' %>>
|
231
|
+
<%= raw l(:general_text_Yes) %> - multi thread (<%= `nproc 2>&1`.strip!.to_i %> cpu)
|
232
|
+
</option>
|
233
|
+
</select>
|
234
|
+
<em class="info"><%= raw l(:apijs_config_create_all_info) %></em>
|
235
|
+
</p>
|
236
|
+
</fieldset>
|
237
|
+
|
238
|
+
<fieldset class="box apijs tabular settings">
|
239
|
+
<legend><%= raw l(:apijs_config_programs) %></legend>
|
240
|
+
<p dir="ltr">
|
241
|
+
<label>python / python-pil / python-scour</label>
|
242
|
+
<span class="cmd"><%= pyt %> / <%= pil %> (<a href="https://pillow.readthedocs.io/en/latest/">docs</a>) / <%= sco %> (svg, <a href="https://github.com/scour-project/scour/wiki/Documentation">docs</a>)</span>
|
243
|
+
<em class="info">python .../redmine_apijs/lib/image.py .../xyz.jpg .../xyz.jpg 200 150 90 2>&1</em>
|
244
|
+
<em class="info">python .../redmine_apijs/lib/video.py .../xyz.ogv .../xyz.jpg 200 150 90 2>&1</em>
|
245
|
+
</p>
|
246
|
+
<p dir="ltr">
|
247
|
+
<label>libimage-exiftool-perl</label>
|
248
|
+
<span class="cmd"><%= `exiftool -ver 2>&1`.strip! %></span>
|
249
|
+
<em class="info">exiftool -FastScan -IgnoreMinorErrors -DateTimeOriginal -S3 .../xyz.jpg 2>&1</em>
|
250
|
+
</p>
|
251
|
+
<p dir="ltr">
|
252
|
+
<label>ffmpegthumbnailer</label>
|
253
|
+
<span class="cmd"><%= `ffmpegthumbnailer -v 2>&1`.gsub('ffmpegthumbnailer version:', '').strip! %></span>
|
254
|
+
<em class="info">ffmpegthumbnailer -i .../xyz.webm -o .../xyz.jpg -q 10 -s 200</em>
|
255
|
+
</p>
|
256
|
+
</fieldset>
|
@@ -0,0 +1,130 @@
|
|
1
|
+
{
|
2
|
+
"name": "",
|
3
|
+
"css_prefix_text": "icon-",
|
4
|
+
"css_use_suffix": false,
|
5
|
+
"hinting": true,
|
6
|
+
"units_per_em": 1000,
|
7
|
+
"ascent": 850,
|
8
|
+
"glyphs": [
|
9
|
+
{
|
10
|
+
"uid": "12f4ece88e46abd864e40b35e05b11cd",
|
11
|
+
"css": "ok",
|
12
|
+
"code": 59392,
|
13
|
+
"src": "fontawesome"
|
14
|
+
},
|
15
|
+
{
|
16
|
+
"uid": "5211af474d3a9848f67f945e2ccaf143",
|
17
|
+
"css": "cancel",
|
18
|
+
"code": 59393,
|
19
|
+
"src": "fontawesome"
|
20
|
+
},
|
21
|
+
{
|
22
|
+
"uid": "eeec3208c90b7b48e804919d0d2d4a41",
|
23
|
+
"css": "upload",
|
24
|
+
"code": 59394,
|
25
|
+
"src": "fontawesome"
|
26
|
+
},
|
27
|
+
{
|
28
|
+
"uid": "9a76bc135eac17d2c8b8ad4a5774fc87",
|
29
|
+
"css": "download",
|
30
|
+
"code": 59395,
|
31
|
+
"src": "fontawesome"
|
32
|
+
},
|
33
|
+
{
|
34
|
+
"uid": "1c4068ed75209e21af36017df8871802",
|
35
|
+
"css": "down-big",
|
36
|
+
"code": 59396,
|
37
|
+
"src": "fontawesome"
|
38
|
+
},
|
39
|
+
{
|
40
|
+
"uid": "555ef8c86832e686fef85f7af2eb7cde",
|
41
|
+
"css": "left-big",
|
42
|
+
"code": 59397,
|
43
|
+
"src": "fontawesome"
|
44
|
+
},
|
45
|
+
{
|
46
|
+
"uid": "ad6b3fbb5324abe71a9c0b6609cbb9f1",
|
47
|
+
"css": "right-big",
|
48
|
+
"code": 59398,
|
49
|
+
"src": "fontawesome"
|
50
|
+
},
|
51
|
+
{
|
52
|
+
"uid": "95376bf082bfec6ce06ea1cda7bd7ead",
|
53
|
+
"css": "up-big",
|
54
|
+
"code": 59399,
|
55
|
+
"src": "fontawesome"
|
56
|
+
},
|
57
|
+
{
|
58
|
+
"uid": "861ab06e455e2de3232ebef67d60d708",
|
59
|
+
"css": "minus",
|
60
|
+
"code": 59400,
|
61
|
+
"src": "fontawesome"
|
62
|
+
},
|
63
|
+
{
|
64
|
+
"uid": "44e04715aecbca7f266a17d5a7863c68",
|
65
|
+
"css": "plus",
|
66
|
+
"code": 59401,
|
67
|
+
"src": "fontawesome"
|
68
|
+
},
|
69
|
+
{
|
70
|
+
"uid": "c76b7947c957c9b78b11741173c8349b",
|
71
|
+
"css": "attention",
|
72
|
+
"code": 59402,
|
73
|
+
"src": "fontawesome"
|
74
|
+
},
|
75
|
+
{
|
76
|
+
"uid": "e82cedfa1d5f15b00c5a81c9bd731ea2",
|
77
|
+
"css": "info-circled",
|
78
|
+
"code": 59403,
|
79
|
+
"src": "fontawesome"
|
80
|
+
},
|
81
|
+
{
|
82
|
+
"uid": "17ebadd1e3f274ff0205601eef7b9cc4",
|
83
|
+
"css": "help-circled",
|
84
|
+
"code": 59404,
|
85
|
+
"src": "fontawesome"
|
86
|
+
},
|
87
|
+
{
|
88
|
+
"uid": "178053298e3e5b03551d754d4b9acd8b",
|
89
|
+
"css": "doc-inv",
|
90
|
+
"code": 61787,
|
91
|
+
"src": "fontawesome"
|
92
|
+
},
|
93
|
+
{
|
94
|
+
"uid": "7277ded7695b2a307a5f9d50097bb64c",
|
95
|
+
"css": "print",
|
96
|
+
"code": 59405,
|
97
|
+
"src": "fontawesome"
|
98
|
+
},
|
99
|
+
{
|
100
|
+
"uid": "e99461abfef3923546da8d745372c995",
|
101
|
+
"css": "cog",
|
102
|
+
"code": 59406,
|
103
|
+
"src": "fontawesome"
|
104
|
+
},
|
105
|
+
{
|
106
|
+
"uid": "38575a803c4da31ce20d77e1e1236bcb",
|
107
|
+
"css": "paper-plane",
|
108
|
+
"code": 61912,
|
109
|
+
"src": "fontawesome"
|
110
|
+
},
|
111
|
+
{
|
112
|
+
"uid": "4815ddddea76d90e367a9694a93b7e24",
|
113
|
+
"css": "resize-full",
|
114
|
+
"code": 59407,
|
115
|
+
"src": "iconic"
|
116
|
+
},
|
117
|
+
{
|
118
|
+
"uid": "ce06b5805120d0c2f8d60cd3f1a4fdb5",
|
119
|
+
"css": "play",
|
120
|
+
"code": 59408,
|
121
|
+
"src": "fontawesome"
|
122
|
+
},
|
123
|
+
{
|
124
|
+
"uid": "0b28050bac9d3facf2f0226db643ece0",
|
125
|
+
"css": "pause",
|
126
|
+
"code": 59409,
|
127
|
+
"src": "fontawesome"
|
128
|
+
}
|
129
|
+
]
|
130
|
+
}
|