diff options
Diffstat (limited to 'app')
| -rw-r--r-- | app/controllers/csp_reports_controller.rb | 4 | ||||
| -rw-r--r-- | app/models/concerns/file_attachment.rb | 3 | ||||
| -rw-r--r-- | app/views/assets/show.html.erb | 10 | ||||
| -rw-r--r-- | app/views/layouts/application.html.erb | 2 | ||||
| -rw-r--r-- | app/views/layouts/events.html.erb | 17 | ||||
| -rw-r--r-- | app/views/nodes/new.html.erb | 5 |
6 files changed, 17 insertions, 24 deletions
diff --git a/app/controllers/csp_reports_controller.rb b/app/controllers/csp_reports_controller.rb index a8f8edb..5a3b55e 100644 --- a/app/controllers/csp_reports_controller.rb +++ b/app/controllers/csp_reports_controller.rb | |||
| @@ -12,9 +12,9 @@ class CspReportsController < ApplicationController | |||
| 12 | if report | 12 | if report |
| 13 | directive = report["effective-directive"] || report["violated-directive"] | 13 | directive = report["effective-directive"] || report["violated-directive"] |
| 14 | at = (URI.parse(report["document-uri"]).path rescue "unparsed") | 14 | at = (URI.parse(report["document-uri"]).path rescue "unparsed") |
| 15 | Rails.logger.warn("CSP violation: #{directive} blocked=#{report['blocked-uri']} at=#{at}") | 15 | CSP_LOGGER.warn("CSP violation: #{directive} blocked=#{report['blocked-uri']} at=#{at}") |
| 16 | else | 16 | else |
| 17 | Rails.logger.warn("CSP violation: unparseable report (#{raw.to_s.bytesize} bytes)") | 17 | CSP_LOGGER.warn("CSP violation: unparseable report (#{raw.to_s.bytesize} bytes)") |
| 18 | end | 18 | end |
| 19 | 19 | ||
| 20 | head :no_content | 20 | head :no_content |
diff --git a/app/models/concerns/file_attachment.rb b/app/models/concerns/file_attachment.rb index 613a6f0..3c09456 100644 --- a/app/models/concerns/file_attachment.rb +++ b/app/models/concerns/file_attachment.rb | |||
| @@ -106,7 +106,8 @@ module FileAttachment | |||
| 106 | end | 106 | end |
| 107 | 107 | ||
| 108 | def sanitize_filename(filename) | 108 | def sanitize_filename(filename) |
| 109 | File.basename(filename).gsub(/[^\w\.\-]/, '_') | 109 | name = File.basename(filename).unicode_normalize(:nfc) |
| 110 | name.gsub(/(?u)[^\w\.\-]/, '_') | ||
| 110 | end | 111 | end |
| 111 | 112 | ||
| 112 | # Proxy object returned by asset.upload, providing the Paperclip-compatible | 113 | # Proxy object returned by asset.upload, providing the Paperclip-compatible |
diff --git a/app/views/assets/show.html.erb b/app/views/assets/show.html.erb index 5717dd9..ff00883 100644 --- a/app/views/assets/show.html.erb +++ b/app/views/assets/show.html.erb | |||
| @@ -20,7 +20,15 @@ | |||
| 20 | <div class="node_content"><%= image_tag @asset.upload.url(:medium), style: "max-width: 300px; max-height: 300px;" %></div> | 20 | <div class="node_content"><%= image_tag @asset.upload.url(:medium), style: "max-width: 300px; max-height: 300px;" %></div> |
| 21 | 21 | ||
| 22 | <div class="node_description">Public Path</div> | 22 | <div class="node_description">Public Path</div> |
| 23 | <div class="node_content"><%= @asset.upload.url.sub(/\?\d+$/, "") %></div> | 23 | <div class="node_content"> |
| 24 | <% public_path = @asset.upload.url.sub(/\?\d+$/, "") %> | ||
| 25 | <%= link_to public_path, public_path, target: "_blank", rel: "noopener" %> | ||
| 26 | <button type="button" class="action_button copy_button" | ||
| 27 | data-copy-url="<%= request.base_url + public_path %>"> | ||
| 28 | <%= icon("copy", library: "tabler", "aria-hidden": true) %> | ||
| 29 | <span class="copy_button_label">Copy URL</span> | ||
| 30 | </button> | ||
| 31 | </div> | ||
| 24 | 32 | ||
| 25 | <div class="node_description">Content Type</div> | 33 | <div class="node_description">Content Type</div> |
| 26 | <div class="node_content"><%= @asset.upload.content_type %></div> | 34 | <div class="node_content"><%= @asset.upload.content_type %></div> |
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index ca867ab..f981fc1 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb | |||
| @@ -62,12 +62,10 @@ | |||
| 62 | <div id="center_column"> | 62 | <div id="center_column"> |
| 63 | <%= yield :layout %> | 63 | <%= yield :layout %> |
| 64 | <div id="footer"> | 64 | <div id="footer"> |
| 65 | <br /> | ||
| 66 | <p style="text-align: center"> | 65 | <p style="text-align: center"> |
| 67 | <%= link_to "Impressum", content_path("imprint") %> | 66 | <%= link_to "Impressum", content_path("imprint") %> |
| 68 | <%= link_to "Datenschutz", content_path("datenschutz") %> | 67 | <%= link_to "Datenschutz", content_path("datenschutz") %> |
| 69 | <%= language_selector %> | 68 | <%= language_selector %> |
| 70 | <!-- %= link_to t(:sponsors), content_path("sponsors") % --> | ||
| 71 | </p> | 69 | </p> |
| 72 | </div> | 70 | </div> |
| 73 | </div> | 71 | </div> |
diff --git a/app/views/layouts/events.html.erb b/app/views/layouts/events.html.erb deleted file mode 100644 index 93a6c0c..0000000 --- a/app/views/layouts/events.html.erb +++ /dev/null | |||
| @@ -1,17 +0,0 @@ | |||
| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | ||
| 2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
| 3 | |||
| 4 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | ||
| 5 | <head> | ||
| 6 | <meta http-equiv="content-type" content="text/html;charset=UTF-8" /> | ||
| 7 | <title>Events: <%= controller.action_name %></title> | ||
| 8 | <%= stylesheet_link_tag 'scaffold' %> | ||
| 9 | </head> | ||
| 10 | <body> | ||
| 11 | |||
| 12 | <p style="color: green"><%= flash[:notice] %></p> | ||
| 13 | |||
| 14 | <%= yield %> | ||
| 15 | |||
| 16 | </body> | ||
| 17 | </html> | ||
diff --git a/app/views/nodes/new.html.erb b/app/views/nodes/new.html.erb index 890d46e..805fbc9 100644 --- a/app/views/nodes/new.html.erb +++ b/app/views/nodes/new.html.erb | |||
| @@ -41,7 +41,10 @@ | |||
| 41 | <div class="node_description">Resulting path</div> | 41 | <div class="node_description">Resulting path</div> |
| 42 | <div class="node_content"> | 42 | <div class="node_content"> |
| 43 | <span id="resulting_path">—</span> | 43 | <span id="resulting_path">—</span> |
| 44 | <button type="button" id="copy_resulting_path" class="unselected">copy</button> | 44 | <button type="button" id="copy_resulting_path" class="unselected copy_button" data-copy-target="#resulting_path"> |
| 45 | <span class="copy_button_label">copy</span> | ||
| 46 | </button> | ||
| 47 | |||
| 45 | <span class="field_hint">This preview updates as you type. The final path can still be changed afterward by editing the title (for the last segment) or moving the node to a different parent (for everything before it).</span> | 48 | <span class="field_hint">This preview updates as you type. The final path can still be changed afterward by editing the title (for the last segment) or moving the node to a different parent (for everything before it).</span> |
| 46 | </div> | 49 | </div> |
| 47 | 50 | ||
