Skip to content

Commit 606ff10

Browse files
authored
Files: Improved Anonymous Page with Info (#588)
* Improve the Files anon page * Latest language strings * Fix tests
1 parent 46bcb9a commit 606ff10

File tree

43 files changed

+1216
-460
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1216
-460
lines changed

Diff for: app/controllers/file_pushes_controller.rb

+1-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ class FilePushesController < ApplicationController
44
helper FilePushesHelper
55

66
# Authentication always except for :show
7-
acts_as_token_authentication_handler_for User, except: [:show]
7+
acts_as_token_authentication_handler_for User, except: [:show, :new]
88

99
resource_description do
1010
name 'File Pushes'
@@ -70,10 +70,6 @@ def show
7070

7171
# GET /file_pushes/new
7272
def new
73-
# Require authentication if allow_anonymous is false
74-
# See config/settings.yml
75-
authenticate_user! if Settings.enable_logins && !Settings.allow_anonymous
76-
7773
if user_signed_in?
7874
@push = FilePush.new
7975

@@ -85,7 +81,6 @@ def new
8581
format.html { render template: 'file_pushes/new_anonymous' }
8682
end
8783
end
88-
8984
end
9085

9186
api :POST, '/f.json', 'Create a new file push.'

Diff for: app/views/file_pushes/new_anonymous.html.erb

+27-4
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,32 @@
22

33
<div class='container'>
44
<%= render partial: "shared/topnav" %>
5-
<div class="d-flex flex-column mh-100 justify-content-center align-items-center" style="height: 300px;">
6-
<p class="lead text-center">
7-
<%= _('Please log in to use this feature.') %>
8-
</p>
5+
<div class="card text-center w-50 my-5 mx-auto">
6+
<div class="card-header">
7+
<em class="bi bi-info-circle"></em>
8+
<%= _('This Feature is In BETA') %>
9+
</div>
10+
<div class="card-body">
11+
<h5 class="card-title">
12+
<%= _('Securely Send Files That Delete Automatically') %>
13+
</h5>
14+
<p class="card-text">
15+
<%= _('Until stable, this feature is in beta and requires a log in.') %>
16+
</p>
17+
<% if ENV.key?('PWPUSH_COM') %>
18+
<p class="card-text">
19+
<%= _('I would appreciate any feedback you have in the') %>
20+
<%= link_to _("feedback form"), new_feedback_path %>
21+
<%= _('or') %>
22+
<%= link_to _("in this Github Discussion"), "https://github.com/pglombardo/PasswordPusher/discussions/568" %>.
23+
</p>
24+
<p class="card-text">
25+
<%= _('See this') %>
26+
<%= link_to _("Twitter thread"), "https://twitter.com/pwpush/status/1608047208686821377" %>
27+
<%= _('for more information and screenshots.') %>
28+
</p>
29+
<% end %>
30+
<a href="<%= new_user_session_path %>" class="btn btn-primary">Log In</a>
31+
</div>
932
</div>
1033
</div>

Diff for: app/views/layouts/login.html.erb

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
<div class='my-3'>
5555
<em>
5656
<%= _("Some domains may inadvertently block emails. If you are having trouble receiving emails, ") %>
57-
<%= link_to "send a message", new_feedback_path %>
57+
<%= link_to _("send a message"), new_feedback_path %>
5858
<%= _('and we can help out.') %>
5959
</em>
6060
</div>

Diff for: app/views/shared/_topnav.html.erb

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<% if Settings.enable_logins %>
22
<ul class="nav nav-tabs mb-3">
33
<li class="nav-item">
4-
<a class="nav-link <%= current_controller?("passwords") ? 'active' : '' %>" aria-current="page" href="/">Passwords</a>
4+
<a class="nav-link <%= current_controller?("passwords") ? 'active' : '' %>" aria-current="page" href="/"><%= _('Passwords') %></a>
55
</li>
66
<% if Settings.enable_file_pushes %>
77
<li class="nav-item">
8-
<a class="nav-link <%= current_controller?("file_pushes") ? 'active' : '' %>" href="<%= new_file_push_path %>">Files (beta)</a>
8+
<a class="nav-link <%= current_controller?("file_pushes") ? 'active' : '' %>" href="<%= new_file_push_path %>"><%= _('Files') %></a>
99
</li>
1010
<% end %>
1111
</ul>

Diff for: config/locales/.translation_io

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
# ignore the conflicts and "sync" again, it will fix this file for you.
66

77
---
8-
timestamp: 1672183796
8+
timestamp: 1672223760

Diff for: config/locales/gettext/app.pot

+60-21
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: pwpush 1.0\n"
1010
"Report-Msgid-Bugs-To: [email protected]\n"
11-
"POT-Creation-Date: 2022-12-28 00:29+0100\n"
12-
"PO-Revision-Date: 2022-12-28 00:29+0100\n"
11+
"POT-Creation-Date: 2022-12-28 11:36+0100\n"
12+
"PO-Revision-Date: 2022-12-28 11:36+0100\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language-Team: LANGUAGE <[email protected]>\n"
1515
"Language: \n"
@@ -38,30 +38,30 @@ msgid ""
3838
"gain?"
3939
msgstr ""
4040

41-
#: ../../../app/controllers/file_pushes_controller.rb:133
41+
#: ../../../app/controllers/file_pushes_controller.rb:128
4242
msgid ""
4343
"Only 10 active pushes allowed while in Beta and until things are stable. If it"
4444
"'s an option, you can manually expire existing pushes before creating new ones"
4545
"."
4646
msgstr ""
4747

48-
#: ../../../app/controllers/file_pushes_controller.rb:225
48+
#: ../../../app/controllers/file_pushes_controller.rb:220
4949
#: ../../../app/controllers/passwords_controller.rb:202
5050
msgid "That push doesn't belong to you."
5151
msgstr ""
5252

53-
#: ../../../app/controllers/file_pushes_controller.rb:253
53+
#: ../../../app/controllers/file_pushes_controller.rb:248
5454
#: ../../../app/controllers/passwords_controller.rb:230
5555
msgid "That push does not belong to you."
5656
msgstr ""
5757

58-
#: ../../../app/controllers/file_pushes_controller.rb:258
58+
#: ../../../app/controllers/file_pushes_controller.rb:253
5959
#: ../../../app/controllers/passwords_controller.rb:235
6060
msgid "That push is not deletable by viewers."
6161
msgstr ""
6262

63-
#: ../../../app/controllers/file_pushes_controller.rb:275
64-
#: ../../../app/controllers/file_pushes_controller.rb:278
63+
#: ../../../app/controllers/file_pushes_controller.rb:270
64+
#: ../../../app/controllers/file_pushes_controller.rb:273
6565
#: ../../../app/controllers/passwords_controller.rb:259
6666
#: ../../../app/controllers/passwords_controller.rb:262
6767
#: ../../../app/views/file_pushes/audit.html.erb:106
@@ -897,8 +897,52 @@ msgstr ""
897897
msgid "Pushing..."
898898
msgstr ""
899899

900-
#: ../../../app/views/file_pushes/new_anonymous.html.erb:7
901-
msgid "Please log in to use this feature."
900+
#: ../../../app/views/file_pushes/new_anonymous.html.erb:8
901+
msgid "This Feature is In BETA"
902+
msgstr ""
903+
904+
#: ../../../app/views/file_pushes/new_anonymous.html.erb:12
905+
msgid "Securely Send Files That Delete Automatically"
906+
msgstr ""
907+
908+
#: ../../../app/views/file_pushes/new_anonymous.html.erb:15
909+
msgid "Until stable, this feature is in beta and requires a log in."
910+
msgstr ""
911+
912+
#: ../../../app/views/file_pushes/new_anonymous.html.erb:19
913+
msgid "I would appreciate any feedback you have in the"
914+
msgstr ""
915+
916+
#: ../../../app/views/file_pushes/new_anonymous.html.erb:20
917+
msgid "feedback form"
918+
msgstr ""
919+
920+
#: ../../../app/views/file_pushes/new_anonymous.html.erb:21
921+
#: ../../../app/views/file_pushes/preview.html.erb:36
922+
#: ../../../app/views/file_pushes/show.html.erb:47
923+
#: ../../../app/views/file_pushes/show.html.erb:50
924+
#: ../../../app/views/pages/about.html.erb:28
925+
#: ../../../app/views/pages/about.html.erb:34
926+
#: ../../../app/views/passwords/preview.html.erb:36
927+
#: ../../../app/views/passwords/show.html.erb:31
928+
#: ../../../app/views/passwords/show.html.erb:34
929+
msgid "or"
930+
msgstr ""
931+
932+
#: ../../../app/views/file_pushes/new_anonymous.html.erb:22
933+
msgid "in this Github Discussion"
934+
msgstr ""
935+
936+
#: ../../../app/views/file_pushes/new_anonymous.html.erb:25
937+
msgid "See this"
938+
msgstr ""
939+
940+
#: ../../../app/views/file_pushes/new_anonymous.html.erb:26
941+
msgid "Twitter thread"
942+
msgstr ""
943+
944+
#: ../../../app/views/file_pushes/new_anonymous.html.erb:27
945+
msgid "for more information and screenshots."
902946
msgstr ""
903947

904948
#: ../../../app/views/file_pushes/preliminary.html.erb:3
@@ -937,17 +981,6 @@ msgid_plural "days"
937981
msgstr[0] ""
938982
msgstr[1] ""
939983

940-
#: ../../../app/views/file_pushes/preview.html.erb:36
941-
#: ../../../app/views/file_pushes/show.html.erb:47
942-
#: ../../../app/views/file_pushes/show.html.erb:50
943-
#: ../../../app/views/pages/about.html.erb:28
944-
#: ../../../app/views/pages/about.html.erb:34
945-
#: ../../../app/views/passwords/preview.html.erb:36
946-
#: ../../../app/views/passwords/show.html.erb:31
947-
#: ../../../app/views/passwords/show.html.erb:34
948-
msgid "or"
949-
msgstr ""
950-
951984
#: ../../../app/views/file_pushes/preview.html.erb:37
952985
#: ../../../app/views/passwords/preview.html.erb:37
953986
msgid "view"
@@ -1130,6 +1163,10 @@ msgid ""
11301163
"ing emails, "
11311164
msgstr ""
11321165

1166+
#: ../../../app/views/layouts/login.html.erb:57
1167+
msgid "send a message"
1168+
msgstr ""
1169+
11331170
#: ../../../app/views/layouts/login.html.erb:58
11341171
msgid "and we can help out."
11351172
msgstr ""
@@ -2047,10 +2084,12 @@ msgid "Your password is blurred out. Click below to reveal it."
20472084
msgstr ""
20482085

20492086
#: ../../../app/views/shared/_dashboard_header.html.erb:10
2087+
#: ../../../app/views/shared/_topnav.html.erb:4
20502088
msgid "Passwords"
20512089
msgstr ""
20522090

20532091
#: ../../../app/views/shared/_dashboard_header.html.erb:14
2092+
#: ../../../app/views/shared/_topnav.html.erb:8
20542093
msgid "Files"
20552094
msgstr ""
20562095

Diff for: config/locales/gettext/ca/LC_MESSAGES/app.mo

0 Bytes
Binary file not shown.

Diff for: config/locales/gettext/ca/app.po

+60-21
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ msgid ""
77
msgstr ""
88
"Project-Id-Version: pwpush 1.0\n"
99
"Report-Msgid-Bugs-To: [email protected]\n"
10-
"POT-Creation-Date: 2022-12-28 00:29+0100\n"
11-
"PO-Revision-Date: 2022-12-28 00:29+0100\n"
10+
"POT-Creation-Date: 2022-12-28 11:36+0100\n"
11+
"PO-Revision-Date: 2022-12-28 11:36+0100\n"
1212
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1313
"Language-Team: Catalan\n"
1414
"Language: ca\n"
@@ -42,30 +42,30 @@ msgstr ""
4242
"No s'han pogut enviar comentaris. Vas aprovar el Test d'Humanitat? Correu elec"
4343
"trònic vàlid? Torna-ho a provar?"
4444

45-
#: ../../../app/controllers/file_pushes_controller.rb:133
45+
#: ../../../app/controllers/file_pushes_controller.rb:128
4646
msgid ""
4747
"Only 10 active pushes allowed while in Beta and until things are stable. If it"
4848
"'s an option, you can manually expire existing pushes before creating new ones"
4949
"."
5050
msgstr ""
5151

52-
#: ../../../app/controllers/file_pushes_controller.rb:225
52+
#: ../../../app/controllers/file_pushes_controller.rb:220
5353
#: ../../../app/controllers/passwords_controller.rb:202
5454
msgid "That push doesn't belong to you."
5555
msgstr "Aquesta pujada no et pertany."
5656

57-
#: ../../../app/controllers/file_pushes_controller.rb:253
57+
#: ../../../app/controllers/file_pushes_controller.rb:248
5858
#: ../../../app/controllers/passwords_controller.rb:230
5959
msgid "That push does not belong to you."
6060
msgstr "Aquesta pujada no et pertany."
6161

62-
#: ../../../app/controllers/file_pushes_controller.rb:258
62+
#: ../../../app/controllers/file_pushes_controller.rb:253
6363
#: ../../../app/controllers/passwords_controller.rb:235
6464
msgid "That push is not deletable by viewers."
6565
msgstr "Aquesta pujada no es pot ser esborrada."
6666

67-
#: ../../../app/controllers/file_pushes_controller.rb:275
68-
#: ../../../app/controllers/file_pushes_controller.rb:278
67+
#: ../../../app/controllers/file_pushes_controller.rb:270
68+
#: ../../../app/controllers/file_pushes_controller.rb:273
6969
#: ../../../app/controllers/passwords_controller.rb:259
7070
#: ../../../app/controllers/passwords_controller.rb:262
7171
#: ../../../app/views/file_pushes/audit.html.erb:106
@@ -931,8 +931,52 @@ msgstr "Puja-la!"
931931
msgid "Pushing..."
932932
msgstr "S'està pujant..."
933933

934-
#: ../../../app/views/file_pushes/new_anonymous.html.erb:7
935-
msgid "Please log in to use this feature."
934+
#: ../../../app/views/file_pushes/new_anonymous.html.erb:8
935+
msgid "This Feature is In BETA"
936+
msgstr ""
937+
938+
#: ../../../app/views/file_pushes/new_anonymous.html.erb:12
939+
msgid "Securely Send Files That Delete Automatically"
940+
msgstr ""
941+
942+
#: ../../../app/views/file_pushes/new_anonymous.html.erb:15
943+
msgid "Until stable, this feature is in beta and requires a log in."
944+
msgstr ""
945+
946+
#: ../../../app/views/file_pushes/new_anonymous.html.erb:19
947+
msgid "I would appreciate any feedback you have in the"
948+
msgstr ""
949+
950+
#: ../../../app/views/file_pushes/new_anonymous.html.erb:20
951+
msgid "feedback form"
952+
msgstr ""
953+
954+
#: ../../../app/views/file_pushes/new_anonymous.html.erb:21
955+
#: ../../../app/views/file_pushes/preview.html.erb:36
956+
#: ../../../app/views/file_pushes/show.html.erb:47
957+
#: ../../../app/views/file_pushes/show.html.erb:50
958+
#: ../../../app/views/pages/about.html.erb:28
959+
#: ../../../app/views/pages/about.html.erb:34
960+
#: ../../../app/views/passwords/preview.html.erb:36
961+
#: ../../../app/views/passwords/show.html.erb:31
962+
#: ../../../app/views/passwords/show.html.erb:34
963+
msgid "or"
964+
msgstr "o"
965+
966+
#: ../../../app/views/file_pushes/new_anonymous.html.erb:22
967+
msgid "in this Github Discussion"
968+
msgstr ""
969+
970+
#: ../../../app/views/file_pushes/new_anonymous.html.erb:25
971+
msgid "See this"
972+
msgstr ""
973+
974+
#: ../../../app/views/file_pushes/new_anonymous.html.erb:26
975+
msgid "Twitter thread"
976+
msgstr ""
977+
978+
#: ../../../app/views/file_pushes/new_anonymous.html.erb:27
979+
msgid "for more information and screenshots."
936980
msgstr ""
937981

938982
#: ../../../app/views/file_pushes/preliminary.html.erb:3
@@ -971,17 +1015,6 @@ msgid_plural "days"
9711015
msgstr[0] "dia"
9721016
msgstr[1] "dies"
9731017

974-
#: ../../../app/views/file_pushes/preview.html.erb:36
975-
#: ../../../app/views/file_pushes/show.html.erb:47
976-
#: ../../../app/views/file_pushes/show.html.erb:50
977-
#: ../../../app/views/pages/about.html.erb:28
978-
#: ../../../app/views/pages/about.html.erb:34
979-
#: ../../../app/views/passwords/preview.html.erb:36
980-
#: ../../../app/views/passwords/show.html.erb:31
981-
#: ../../../app/views/passwords/show.html.erb:34
982-
msgid "or"
983-
msgstr "o"
984-
9851018
#: ../../../app/views/file_pushes/preview.html.erb:37
9861019
#: ../../../app/views/passwords/preview.html.erb:37
9871020
msgid "view"
@@ -1171,6 +1204,10 @@ msgid ""
11711204
"ing emails, "
11721205
msgstr ""
11731206

1207+
#: ../../../app/views/layouts/login.html.erb:57
1208+
msgid "send a message"
1209+
msgstr ""
1210+
11741211
#: ../../../app/views/layouts/login.html.erb:58
11751212
msgid "and we can help out."
11761213
msgstr "i podem ajudar."
@@ -2250,10 +2287,12 @@ msgid "Your password is blurred out. Click below to reveal it."
22502287
msgstr "La teva contrasenya està borrosa. Feu clic a continuació per revelar-lo."
22512288

22522289
#: ../../../app/views/shared/_dashboard_header.html.erb:10
2290+
#: ../../../app/views/shared/_topnav.html.erb:4
22532291
msgid "Passwords"
22542292
msgstr ""
22552293

22562294
#: ../../../app/views/shared/_dashboard_header.html.erb:14
2295+
#: ../../../app/views/shared/_topnav.html.erb:8
22572296
msgid "Files"
22582297
msgstr ""
22592298

Diff for: config/locales/gettext/cs/LC_MESSAGES/app.mo

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)