Skip to content

Commit 86d7481

Browse files
committed
Add optional credentials to print host form
1 parent cbbfc5a commit 86d7481

14 files changed

Lines changed: 46 additions & 3 deletions

File tree

app/controllers/print_hosts_controller.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ def print_host_params
7070
params.require(:print_host).permit( # rubocop:todo Rails/StrongParametersExpect
7171
:name, # i18n-tasks-use t("activerecord.attributes.print_host.name")
7272
:endpoint, # i18n-tasks-use t("activerecord.attributes.print_host.endpoint")
73-
:protocol # i18n-tasks-use t("activerecord.attributes.print_host.protocol")
73+
:protocol, # i18n-tasks-use t("activerecord.attributes.print_host.protocol")
74+
:credentials # i18n-tasks-use t("activerecord.attributes.print_host.credentials")
7475
)
7576
end
7677

app/views/print_hosts/_form.html.erb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<%= TextInputRow(form: form, attribute: :endpoint, label: PrintHost.human_attribute_name(:endpoint), help: t(".endpoint.help")) %>
55
<%= SelectInputRow form: form, attribute: :protocol, label: PrintHost.human_attribute_name(:protocol), help: t(".protocol.help"),
66
select_options: Naturally.sort(PrintHost::PROTOCOLS.keys).map { [translate("print_hosts.protocols.%{protocol}" % {protocol: it}), it] } %>
7+
<%= PasswordInputRow(form: form, attribute: :credentials, label: PrintHost.human_attribute_name(:credentials), help: t(".credentials.help")) %>
78
<hr>
89
<div>
910
<%= form.submit class: "btn btn-primary" %>

config/locales/cs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ cs:
128128
size: Velikost souboru
129129
y_up: Y nahoru
130130
print_host:
131+
credentials:
131132
endpoint:
132133
name:
133134
protocol:
@@ -988,6 +989,8 @@ cs:
988989
destroy:
989990
success:
990991
form:
992+
credentials:
993+
help:
991994
endpoint:
992995
help:
993996
name:

config/locales/de.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ de:
128128
size: Dateigröße
129129
y_up: Y Aufwärts
130130
print_host:
131+
credentials:
131132
endpoint:
132133
name:
133134
protocol:
@@ -992,6 +993,8 @@ de:
992993
destroy:
993994
success:
994995
form:
996+
credentials:
997+
help:
995998
endpoint:
996999
help:
9971000
name:

config/locales/en.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ en:
128128
size: File Size
129129
y_up: Y Up
130130
print_host:
131+
credentials: Credentials
131132
endpoint: Endpoint
132133
name: Name
133134
protocol: Protocol
@@ -988,6 +989,8 @@ en:
988989
destroy:
989990
success: Printer removed
990991
form:
992+
credentials:
993+
help: API key or password, if required
991994
endpoint:
992995
help: The URL of your printer's API (e.g. http://printer.local)
993996
name:

config/locales/es.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ es:
128128
size: Tamaño del archivo
129129
y_up: Eje Y Arriba
130130
print_host:
131+
credentials:
131132
endpoint:
132133
name:
133134
protocol:
@@ -988,6 +989,8 @@ es:
988989
destroy:
989990
success:
990991
form:
992+
credentials:
993+
help:
991994
endpoint:
992995
help:
993996
name:

config/locales/fr.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ fr:
130130
size: Taille du fichier
131131
y_up: Y Up
132132
print_host:
133+
credentials:
133134
endpoint:
134135
name:
135136
protocol:
@@ -990,6 +991,8 @@ fr:
990991
destroy:
991992
success:
992993
form:
994+
credentials:
995+
help:
993996
endpoint:
994997
help:
995998
name:

config/locales/ja.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ ja:
128128
size: ファイルサイズ
129129
y_up: Y上
130130
print_host:
131+
credentials:
131132
endpoint:
132133
name:
133134
protocol:
@@ -988,6 +989,8 @@ ja:
988989
destroy:
989990
success:
990991
form:
992+
credentials:
993+
help:
991994
endpoint:
992995
help:
993996
name:

config/locales/nl.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ nl:
128128
size: Bestandsgrootte
129129
y_up: Y Omhoog
130130
print_host:
131+
credentials:
131132
endpoint:
132133
name:
133134
protocol:
@@ -988,6 +989,8 @@ nl:
988989
destroy:
989990
success:
990991
form:
992+
credentials:
993+
help:
991994
endpoint:
992995
help:
993996
name:

config/locales/pl.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ pl:
128128
size: Rozmiar pliku
129129
y_up:
130130
print_host:
131+
credentials:
131132
endpoint:
132133
name:
133134
protocol:
@@ -988,6 +989,8 @@ pl:
988989
destroy:
989990
success:
990991
form:
992+
credentials:
993+
help:
991994
endpoint:
992995
help:
993996
name:

0 commit comments

Comments
 (0)