Skip to content

Commit

Permalink
Merge pull request #848 from ValdikSS/add-model-filter
Browse files Browse the repository at this point in the history
Web Ui: add filter by printer model in PPD driver list
  • Loading branch information
michaelrsweet authored Dec 26, 2023
2 parents c0f5e9d + 75eb1ec commit e0fd976
Show file tree
Hide file tree
Showing 9 changed files with 189 additions and 0 deletions.
21 changes: 21 additions & 0 deletions templates/choose-model.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
<H2 CLASS="title">{op=modify-printer?Modify {printer_name}:Add Printer}</H2>

<SCRIPT TYPE="text/javascript"><!--
function filterItems(el) {
var value = el.value.toLowerCase();
var form = el.form;
var sel = form.PPD_NAME;
var opt = sel.options;

for (var i=0; i<opt.length; i++) {
if (value && opt[i].text.toLowerCase().indexOf(value) == -1) {
opt[i].hidden = true;
} else {
opt[i].hidden = false;
}
}
}
--></SCRIPT>

<FORM METHOD="POST" ACTION="/admin" ENCTYPE="multipart/form-data">
<INPUT TYPE="HIDDEN" NAME="org.cups.sid" VALUE="{$org.cups.sid}">
<INPUT TYPE="HIDDEN" NAME="OP" VALUE="{op}">
Expand Down Expand Up @@ -35,6 +52,10 @@
<TD>{PPD_MAKE} <INPUT TYPE="SUBMIT" NAME="SELECT_MAKE" VALUE="Select Another Make/Manufacturer"></TD>
</TR>
<TR>
<TH CLASS="label">Filter by Model:</TH>
<TD><INPUT TYPE="TEXT" NAME="PPD_FILTER" PLACEHOLDER="🔍" ONKEYUP="filterItems(this);"></TD>
</TR>
<TR>
<TH CLASS="label">Model:</TH>
<TD>
<SELECT NAME="PPD_NAME" SIZE="10">
Expand Down
21 changes: 21 additions & 0 deletions templates/da/choose-model.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
<H2 CLASS="title">{op=modify-printer?Rediger {printer_name}:Tilføj printer}</H2>

<SCRIPT TYPE="text/javascript"><!--
function filterItems(el) {
var value = el.value.toLowerCase();
var form = el.form;
var sel = form.PPD_NAME;
var opt = sel.options;

for (var i=0; i<opt.length; i++) {
if (value && opt[i].text.toLowerCase().indexOf(value) == -1) {
opt[i].hidden = true;
} else {
opt[i].hidden = false;
}
}
}
--></SCRIPT>

<FORM METHOD="POST" ACTION="/admin" ENCTYPE="multipart/form-data">
<INPUT TYPE="HIDDEN" NAME="org.cups.sid" VALUE="{$org.cups.sid}">
<INPUT TYPE="HIDDEN" NAME="OP" VALUE="{op}">
Expand Down Expand Up @@ -35,6 +52,10 @@ Del {?printer_is_shared=?ikke:{?printer_is_shared=0?ikke:}} printeren</TD>
<TD>{PPD_MAKE} <INPUT TYPE="SUBMIT" NAME="SELECT_MAKE" VALUE="Vælg en anden producent"></TD>
</TR>
<TR>
<TH CLASS="label">Filtrer efter model:</TH>
<TD><INPUT TYPE="TEXT" NAME="PPD_FILTER" PLACEHOLDER="🔍" ONKEYUP="filterItems(this);"></TD>
</TR>
<TR>
<TH CLASS="label">Model:</TH>
<TD>
<SELECT NAME="PPD_NAME" SIZE="10">
Expand Down
21 changes: 21 additions & 0 deletions templates/de/choose-model.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
<H2 CLASS="title">{op=modify-printer?{printer_name} ändern:Drucker hinzufügen (Schritt 5/5)}</H2>

<SCRIPT TYPE="text/javascript"><!--
function filterItems(el) {
var value = el.value.toLowerCase();
var form = el.form;
var sel = form.PPD_NAME;
var opt = sel.options;

for (var i=0; i<opt.length; i++) {
if (value && opt[i].text.toLowerCase().indexOf(value) == -1) {
opt[i].hidden = true;
} else {
opt[i].hidden = false;
}
}
}
--></SCRIPT>

<FORM METHOD="POST" ACTION="/admin" ENCTYPE="multipart/form-data">
<INPUT TYPE="HIDDEN" NAME="org.cups.sid" VALUE="{$org.cups.sid}">
<INPUT TYPE="HIDDEN" NAME="OP" VALUE="{op}">
Expand Down Expand Up @@ -35,6 +52,10 @@ Drucker {?printer_is_shared=?nicht:{?printer_is_shared=0?nicht:}} im Netzwerk fr
<TD>{PPD_MAKE} <INPUT TYPE="SUBMIT" NAME="SELECT_MAKE" VALUE="Anderen Hersteller/Marke wählen"></TD>
</TR>
<TR>
<TH CLASS="label">Nach Modell filtern:</TH>
<TD><INPUT TYPE="TEXT" NAME="PPD_FILTER" PLACEHOLDER="🔍" ONKEYUP="filterItems(this);"></TD>
</TR>
<TR>
<TH CLASS="label">Modell:</TH>
<TD>
<SELECT NAME="PPD_NAME" SIZE="10">
Expand Down
21 changes: 21 additions & 0 deletions templates/es/choose-model.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
<H2 CLASS="title">{op=modify-printer?Modificar {printer_name}:A&ntilde;adir impresora}</H2>

<SCRIPT TYPE="text/javascript"><!--
function filterItems(el) {
var value = el.value.toLowerCase();
var form = el.form;
var sel = form.PPD_NAME;
var opt = sel.options;

for (var i=0; i<opt.length; i++) {
if (value && opt[i].text.toLowerCase().indexOf(value) == -1) {
opt[i].hidden = true;
} else {
opt[i].hidden = false;
}
}
}
--></SCRIPT>

<FORM METHOD="POST" ACTION="/admin" ENCTYPE="multipart/form-data">
<INPUT TYPE="HIDDEN" NAME="org.cups.sid" VALUE="{$org.cups.sid}">
<INPUT TYPE="HIDDEN" NAME="OP" VALUE="{op}">
Expand Down Expand Up @@ -35,6 +52,10 @@
<TD>{PPD_MAKE} <INPUT TYPE="SUBMIT" NAME="SELECT_MAKE" VALUE="Seleccione otra marca/fabricante"></TD>
</TR>
<TR>
<TH CLASS="label">Filtrar por modelo:</TH>
<TD><INPUT TYPE="TEXT" NAME="PPD_FILTER" PLACEHOLDER="🔍" ONKEYUP="filterItems(this);"></TD>
</TR>
<TR>
<TH CLASS="label">Modelo:</TH>
<TD>
<SELECT NAME="PPD_NAME" SIZE="10">
Expand Down
21 changes: 21 additions & 0 deletions templates/fr/choose-model.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
<H2 CLASS="title">{op=modify-printer?Modifier {printer_name}:Ajouter une imprimante}</H2>

<SCRIPT TYPE="text/javascript"><!--
function filterItems(el) {
var value = el.value.toLowerCase();
var form = el.form;
var sel = form.PPD_NAME;
var opt = sel.options;

for (var i=0; i<opt.length; i++) {
if (value && opt[i].text.toLowerCase().indexOf(value) == -1) {
opt[i].hidden = true;
} else {
opt[i].hidden = false;
}
}
}
--></SCRIPT>

<FORM METHOD="POST" ACTION="/admin" ENCTYPE="multipart/form-data">
<INPUT TYPE="HIDDEN" NAME="org.cups.sid" VALUE="{$org.cups.sid}">
<INPUT TYPE="HIDDEN" NAME="OP" VALUE="{op}">
Expand Down Expand Up @@ -35,6 +52,10 @@
<TD>{PPD_MAKE} <INPUT TYPE="SUBMIT" NAME="SELECT_MAKE" VALUE="Choisir un autre fabricant"></TD>
</TR>
<TR>
<TH CLASS="label">Filtrer par modèle :</TH>
<TD><INPUT TYPE="TEXT" NAME="PPD_FILTER" PLACEHOLDER="🔍" ONKEYUP="filterItems(this);"></TD>
</TR>
<TR>
<TH CLASS="label">Modèle :</TH>
<TD>
<SELECT NAME="PPD_NAME" SIZE="10">
Expand Down
21 changes: 21 additions & 0 deletions templates/ja/choose-model.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
<H2 CLASS="title">{op=modify-printer?{printer_name}の変更:プリンターの追加}</H2>

<SCRIPT TYPE="text/javascript"><!--
function filterItems(el) {
var value = el.value.toLowerCase();
var form = el.form;
var sel = form.PPD_NAME;
var opt = sel.options;

for (var i=0; i<opt.length; i++) {
if (value && opt[i].text.toLowerCase().indexOf(value) == -1) {
opt[i].hidden = true;
} else {
opt[i].hidden = false;
}
}
}
--></SCRIPT>

<FORM METHOD="POST" ACTION="/admin" ENCTYPE="multipart/form-data">
<INPUT TYPE="HIDDEN" NAME="org.cups.sid" VALUE="{$org.cups.sid}">
<INPUT TYPE="HIDDEN" NAME="OP" VALUE="{op}">
Expand Down Expand Up @@ -35,6 +52,10 @@
<TD>{PPD_MAKE} <INPUT TYPE="SUBMIT" NAME="SELECT_MAKE" VALUE="他のメーカー/製造元を選択"></TD>
</TR>
<TR>
<TH CLASS="label">モデルフィルター:</TH>
<TD><INPUT TYPE="TEXT" NAME="PPD_FILTER" PLACEHOLDER="🔍" ONKEYUP="filterItems(this);"></TD>
</TR>
<TR>
<TH CLASS="label">モデル:</TH>
<TD>
<SELECT NAME="PPD_NAME" SIZE="10">
Expand Down
21 changes: 21 additions & 0 deletions templates/pl/choose-model.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
<H2 CLASS="title">{op=modify-printer?Modyfikowanie {printer_name}:Dodawanie drukarki}</H2>

<SCRIPT TYPE="text/javascript"><!--
function filterItems(el) {
var value = el.value.toLowerCase();
var form = el.form;
var sel = form.PPD_NAME;
var opt = sel.options;

for (var i=0; i<opt.length; i++) {
if (value && opt[i].text.toLowerCase().indexOf(value) == -1) {
opt[i].hidden = true;
} else {
opt[i].hidden = false;
}
}
}
--></SCRIPT>

<FORM METHOD="POST" ACTION="/admin" ENCTYPE="multipart/form-data">
<INPUT TYPE="HIDDEN" NAME="org.cups.sid" VALUE="{$org.cups.sid}">
<INPUT TYPE="HIDDEN" NAME="OP" VALUE="{op}">
Expand Down Expand Up @@ -35,6 +52,10 @@
<TD>{PPD_MAKE} <INPUT TYPE="SUBMIT" NAME="SELECT_MAKE" VALUE="Wybierz innego producenta"></TD>
</TR>
<TR>
<TH CLASS="label">Filtruj według modelu:</TH>
<TD><INPUT TYPE="TEXT" NAME="PPD_FILTER" PLACEHOLDER="🔍" ONKEYUP="filterItems(this);"></TD>
</TR>
<TR>
<TH CLASS="label">Model:</TH>
<TD>
<SELECT NAME="PPD_NAME" SIZE="10">
Expand Down
21 changes: 21 additions & 0 deletions templates/pt_BR/choose-model.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
<H2 CLASS="title">{op=modify-printer?Modificar {printer_name}:Adicionar impressora}</H2>

<SCRIPT TYPE="text/javascript"><!--
function filterItems(el) {
var value = el.value.toLowerCase();
var form = el.form;
var sel = form.PPD_NAME;
var opt = sel.options;

for (var i=0; i<opt.length; i++) {
if (value && opt[i].text.toLowerCase().indexOf(value) == -1) {
opt[i].hidden = true;
} else {
opt[i].hidden = false;
}
}
}
--></SCRIPT>

<FORM METHOD="POST" ACTION="/admin" ENCTYPE="multipart/form-data">
<INPUT TYPE="HIDDEN" NAME="org.cups.sid" VALUE="{$org.cups.sid}">
<INPUT TYPE="HIDDEN" NAME="OP" VALUE="{op}">
Expand Down Expand Up @@ -35,6 +52,10 @@
<TD>{PPD_MAKE} <INPUT TYPE="SUBMIT" NAME="SELECT_MAKE" VALUE="Selecione outro fabricante"></TD>
</TR>
<TR>
<TH CLASS="label">Filtrar por modelo:</TH>
<TD><INPUT TYPE="TEXT" NAME="PPD_FILTER" PLACEHOLDER="🔍" ONKEYUP="filterItems(this);"></TD>
</TR>
<TR>
<TH CLASS="label">Modelo:</TH>
<TD>
<SELECT NAME="PPD_NAME" SIZE="10">
Expand Down
21 changes: 21 additions & 0 deletions templates/ru/choose-model.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
<H2 CLASS="title">{op=modify-printer?Изменение {printer_name}:Добавление принтера}</H2>

<SCRIPT TYPE="text/javascript"><!--
function filterItems(el) {
var value = el.value.toLowerCase();
var form = el.form;
var sel = form.PPD_NAME;
var opt = sel.options;

for (var i=0; i<opt.length; i++) {
if (value && opt[i].text.toLowerCase().indexOf(value) == -1) {
opt[i].hidden = true;
} else {
opt[i].hidden = false;
}
}
}
--></SCRIPT>

<FORM METHOD="POST" ACTION="/admin" ENCTYPE="multipart/form-data">
<INPUT TYPE="HIDDEN" NAME="org.cups.sid" VALUE="{$org.cups.sid}">
<INPUT TYPE="HIDDEN" NAME="OP" VALUE="{op}">
Expand Down Expand Up @@ -35,6 +52,10 @@
<TD>{PPD_MAKE} <INPUT TYPE="SUBMIT" NAME="SELECT_MAKE" VALUE="Выбрать другого производителя"></TD>
</TR>
<TR>
<TH CLASS="label">Фильтр по модели:</TH>
<TD><INPUT TYPE="TEXT" NAME="PPD_FILTER" PLACEHOLDER="🔍" ONKEYUP="filterItems(this);"></TD>
</TR>
<TR>
<TH CLASS="label">Модель:</TH>
<TD>
<SELECT NAME="PPD_NAME" SIZE="10">
Expand Down

0 comments on commit e0fd976

Please sign in to comment.