Skip to content

Commit

Permalink
Address feedback #5886
Browse files Browse the repository at this point in the history
  • Loading branch information
boryanagoncharenko committed Oct 28, 2024
1 parent f1b744d commit e39f5f4
Show file tree
Hide file tree
Showing 65 changed files with 491 additions and 101 deletions.
8 changes: 7 additions & 1 deletion messages.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2024-06-26 16:04+0200\n"
"POT-Creation-Date: 2024-10-28 19:29+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down Expand Up @@ -1265,6 +1265,9 @@ msgstr ""
msgid "print_accounts"
msgstr ""

msgid "print_accounts_title"
msgstr ""

msgid "print_logo"
msgstr ""

Expand Down Expand Up @@ -1910,6 +1913,9 @@ msgstr ""
msgid "walker_variable_role"
msgstr ""

msgid "website"
msgstr ""

msgid "what_is_your_role"
msgstr ""

Expand Down
45 changes: 30 additions & 15 deletions static/js/appbundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -119488,26 +119488,40 @@ def note_with_error(value, err):
$("#passwords_desc").show();
}
}
function printAccounts() {
function printAccounts(title) {
var table = document.getElementById("accounts_table");
let newWindow = window.open("");
const css2 = `
<style>
@media print {
#accounts_table {
margin-top: 50px;
border-collapse: collapse;
}
#accounts_table td, th {
padding-left: 10px;
padding-right: 10px;
padding-top: 5px;
padding-bottom: 5px;
font-size: 24px;
border: 1px solid gray;
}
h1 {
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", "Courier New", monospace;
font-size: x-large;
margin-left: 20px;
color: rgb(44 82 130);
}

#accounts_table {
border-collapse: collapse;
}

#accounts_table td, th {
padding-left: 10px;
padding-right: 10px;
padding-top: 5px;
padding-bottom: 5px;
font-size: 24px;
border: 1px solid gray;
color: rgb(44 82 130);
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", "Courier New", monospace;
text-align: center;
}
</style>`;
newWindow.document.write(`
<div style="display: flex; margin-bottom: 20px;">
<img src="/images/hero-graphic/hero-graphic-empty.png" height="100">
<h1>${title}</h1>
</div>
`);
newWindow.document.write((table == null ? void 0 : table.outerHTML) + css2);
newWindow.print();
newWindow.close();
Expand Down Expand Up @@ -119569,7 +119583,8 @@ def note_with_error(value, err):
let result = "";
for (let [index3, account] of accounts.entries()) {
result += `
<tr class="${index3 % 2 ? "bg-white" : "bg-gray-200"}">
<tr class="${index3 % 2 ? "bg-white" : "bg-gray-200"} font-mono">
<td class="text-center px-4 py-2">hedy.org</td>
<td class="text-center px-4 py-2">${account["username"]}</td>
<td class="text-center px-4 py-2">${account["password"]}</td>
</tr>`;
Expand Down
4 changes: 2 additions & 2 deletions static/js/appbundle.js.map

Large diffs are not rendered by default.

45 changes: 30 additions & 15 deletions static/js/teachers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -566,26 +566,40 @@ export function toggleAutoGeneratePasswords() {
}
}

export function printAccounts() {
export function printAccounts(title: string) {
var table = document.getElementById("accounts_table");
let newWindow = window.open("")!;
const css = `
<style>
@media print {
#accounts_table {
margin-top: 50px;
border-collapse: collapse;
}
#accounts_table td, th {
padding-left: 10px;
padding-right: 10px;
padding-top: 5px;
padding-bottom: 5px;
font-size: 24px;
border: 1px solid gray;
}
h1 {
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", "Courier New", monospace;
font-size: x-large;
margin-left: 20px;
color: rgb(44 82 130);
}
#accounts_table {
border-collapse: collapse;
}
#accounts_table td, th {
padding-left: 10px;
padding-right: 10px;
padding-top: 5px;
padding-bottom: 5px;
font-size: 24px;
border: 1px solid gray;
color: rgb(44 82 130);
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", "Courier New", monospace;
text-align: center;
}
</style>`;
newWindow.document.write(`
<div style="display: flex; margin-bottom: 20px;">
<img src="/images/hero-graphic/hero-graphic-empty.png" height="100">
<h1>${title}</h1>
</div>
`);
newWindow.document.write(table?.outerHTML + css);
newWindow.print();
newWindow.close();
Expand Down Expand Up @@ -661,7 +675,8 @@ function createHtmlForAccountsTable(accounts: Array<any>) {
let result = ""
for (let [index, account] of accounts.entries()) {
result += `
<tr class="${ index%2 ? 'bg-white' : 'bg-gray-200'}">
<tr class="${ index%2 ? 'bg-white' : 'bg-gray-200'} font-mono">
<td class="text-center px-4 py-2">hedy.org</td>
<td class="text-center px-4 py-2">${account['username']}</td>
<td class="text-center px-4 py-2">${account['password']}</td>
</tr>`;
Expand Down
20 changes: 10 additions & 10 deletions templates/create-accounts.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,23 +52,23 @@ <h3 class="w-full my-0 py-0">
</div>
</form>

<div id="accounts_results" class="w-1/2 gap-4 mt-4 items-center hidden">
<div id="accounts_results" class="gap-4 mt-4 items-center hidden">
<div class="flex flex-row gap-4">
<button id="copy_accounts" class="blue-btn px-4 mb-3" onclick="hedyApp.copyAccountsToClipboard('{{_('copy_clipboard')}}')">
{{_('copy_accounts_to_clipboard')}}
</button>
<button id="print_accounts" class="blue-btn px-4 mb-3" onclick="hedyApp.printAccounts()">
<button id="print_accounts" class="blue-btn px-4 mb-3"
onclick="hedyApp.printAccounts('{{_('print_accounts_title')}}')">
{{_('print_accounts')}}
</button>
</div>
<div class="overflow-x-auto rounded-lg shadow-lg">
<table id="accounts_table" data-cy="create_accounts_output" class="w-full border border-gray-400">
<tr class="bg-blue-300 text-blue-900">
<th class="px-10 py-2 text-center">{{_('username')}}</th>
<th class="px-10 py-2 text-center">{{_('password')}}</th>
</tr>
</table>
</div>
<table id="accounts_table" data-cy="create_accounts_output" class="border border-gray-400">
<tr class="bg-blue-300 text-blue-900">
<th class="px-10 py-2 text-center">{{_('website')}}</th>
<th class="px-10 py-2 text-center">{{_('username')}}</th>
<th class="px-10 py-2 text-center">{{_('password')}}</th>
</tr>
</table>
</div>
</div>
</div>
Expand Down
8 changes: 7 additions & 1 deletion translations/ar/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1496,6 +1496,9 @@ msgstr "Previous page"
msgid "print_accounts"
msgstr "Print"

msgid "print_accounts_title"
msgstr ""

msgid "print_logo"
msgstr "قول"

Expand Down Expand Up @@ -2194,7 +2197,7 @@ msgstr "اسم المستخدم"

#, fuzzy
msgid "username_contains_invalid_symbol"
msgstr "Usernames cannot contain the symbol ':' or '@'. Remove these symbols from following rows: {usernames}"
msgstr "Usernames cannot contain the symbol ':' or '@'. Remove these symbols from following usernames: {usernames}"

#, fuzzy
msgid "username_contains_separator"
Expand Down Expand Up @@ -2247,6 +2250,9 @@ msgstr "Waiting for submit"
msgid "walker_variable_role"
msgstr "walker"

msgid "website"
msgstr ""

#, fuzzy
msgid "what_is_your_role"
msgstr "What is your role?"
Expand Down
8 changes: 7 additions & 1 deletion translations/bg/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1645,6 +1645,9 @@ msgstr "Previous page"
msgid "print_accounts"
msgstr "Print"

msgid "print_accounts_title"
msgstr ""

msgid "print_logo"
msgstr "принтирай"

Expand Down Expand Up @@ -2421,7 +2424,7 @@ msgstr "Потребителско име"

#, fuzzy
msgid "username_contains_invalid_symbol"
msgstr "Usernames cannot contain the symbol ':' or '@'. Remove these symbols from following rows: {usernames}"
msgstr "Usernames cannot contain the symbol ':' or '@'. Remove these symbols from following usernames: {usernames}"

#, fuzzy
msgid "username_contains_separator"
Expand Down Expand Up @@ -2476,6 +2479,9 @@ msgstr "Waiting for submit"
msgid "walker_variable_role"
msgstr "walker"

msgid "website"
msgstr ""

#, fuzzy
msgid "what_is_your_role"
msgstr "What is your role?"
Expand Down
8 changes: 7 additions & 1 deletion translations/bn/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1693,6 +1693,9 @@ msgstr "Previous page"
msgid "print_accounts"
msgstr "Print"

msgid "print_accounts_title"
msgstr ""

#, fuzzy
msgid "print_logo"
msgstr "print"
Expand Down Expand Up @@ -2500,7 +2503,7 @@ msgstr "Username"

#, fuzzy
msgid "username_contains_invalid_symbol"
msgstr "Usernames cannot contain the symbol ':' or '@'. Remove these symbols from following rows: {usernames}"
msgstr "Usernames cannot contain the symbol ':' or '@'. Remove these symbols from following usernames: {usernames}"

#, fuzzy
msgid "username_contains_separator"
Expand Down Expand Up @@ -2558,6 +2561,9 @@ msgstr "Waiting for submit"
msgid "walker_variable_role"
msgstr "walker"

msgid "website"
msgstr ""

#, fuzzy
msgid "what_is_your_role"
msgstr "What is your role?"
Expand Down
8 changes: 7 additions & 1 deletion translations/ca/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1515,6 +1515,9 @@ msgstr "Previous page"
msgid "print_accounts"
msgstr "Print"

msgid "print_accounts_title"
msgstr ""

msgid "print_logo"
msgstr "imprimir"

Expand Down Expand Up @@ -2225,7 +2228,7 @@ msgstr "Nom d'usuari"

#, fuzzy
msgid "username_contains_invalid_symbol"
msgstr "Usernames cannot contain the symbol ':' or '@'. Remove these symbols from following rows: {usernames}"
msgstr "Usernames cannot contain the symbol ':' or '@'. Remove these symbols from following usernames: {usernames}"

#, fuzzy
msgid "username_contains_separator"
Expand Down Expand Up @@ -2277,6 +2280,9 @@ msgstr "Waiting for submit"
msgid "walker_variable_role"
msgstr "walker"

msgid "website"
msgstr ""

msgid "what_is_your_role"
msgstr "Quin és el teu paper?"

Expand Down
8 changes: 7 additions & 1 deletion translations/cs/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1631,6 +1631,9 @@ msgstr "Previous page"
msgid "print_accounts"
msgstr "Print"

msgid "print_accounts_title"
msgstr ""

#, fuzzy
msgid "print_logo"
msgstr "print"
Expand Down Expand Up @@ -2401,7 +2404,7 @@ msgstr "Uživatelské jméno"

#, fuzzy
msgid "username_contains_invalid_symbol"
msgstr "Usernames cannot contain the symbol ':' or '@'. Remove these symbols from following rows: {usernames}"
msgstr "Usernames cannot contain the symbol ':' or '@'. Remove these symbols from following usernames: {usernames}"

#, fuzzy
msgid "username_contains_separator"
Expand Down Expand Up @@ -2457,6 +2460,9 @@ msgstr "Waiting for submit"
msgid "walker_variable_role"
msgstr "walker"

msgid "website"
msgstr ""

#, fuzzy
msgid "what_is_your_role"
msgstr "What is your role?"
Expand Down
8 changes: 7 additions & 1 deletion translations/cy/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1706,6 +1706,9 @@ msgstr "Previous page"
msgid "print_accounts"
msgstr "Print"

msgid "print_accounts_title"
msgstr ""

msgid "print_logo"
msgstr "argraffu"

Expand Down Expand Up @@ -2512,7 +2515,7 @@ msgstr "Username"

#, fuzzy
msgid "username_contains_invalid_symbol"
msgstr "Usernames cannot contain the symbol ':' or '@'. Remove these symbols from following rows: {usernames}"
msgstr "Usernames cannot contain the symbol ':' or '@'. Remove these symbols from following usernames: {usernames}"

#, fuzzy
msgid "username_contains_separator"
Expand Down Expand Up @@ -2570,6 +2573,9 @@ msgstr "Waiting for submit"
msgid "walker_variable_role"
msgstr "walker"

msgid "website"
msgstr ""

#, fuzzy
msgid "what_is_your_role"
msgstr "What is your role?"
Expand Down
8 changes: 7 additions & 1 deletion translations/da/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1710,6 +1710,9 @@ msgstr "Previous page"
msgid "print_accounts"
msgstr "Print"

msgid "print_accounts_title"
msgstr ""

#, fuzzy
msgid "print_logo"
msgstr "print"
Expand Down Expand Up @@ -2522,7 +2525,7 @@ msgstr "Username"

#, fuzzy
msgid "username_contains_invalid_symbol"
msgstr "Usernames cannot contain the symbol ':' or '@'. Remove these symbols from following rows: {usernames}"
msgstr "Usernames cannot contain the symbol ':' or '@'. Remove these symbols from following usernames: {usernames}"

#, fuzzy
msgid "username_contains_separator"
Expand Down Expand Up @@ -2580,6 +2583,9 @@ msgstr "Waiting for submit"
msgid "walker_variable_role"
msgstr "walker"

msgid "website"
msgstr ""

#, fuzzy
msgid "what_is_your_role"
msgstr "What is your role?"
Expand Down
Loading

0 comments on commit e39f5f4

Please sign in to comment.