From 139feed586937f59ecd420f54005ba6a7b779b3a Mon Sep 17 00:00:00 2001 From: Kevin Kondratuk Date: Fri, 26 Jul 2019 18:48:53 -0500 Subject: [PATCH] init --- .gitignore | 5 + README.md | 43 +++ fill_template.sh | 46 +++ lubuntu_style.css | 41 +++ .../lubuntu-council-list-info.html | 173 ++++++++++ .../lubuntu-council-options.html | 99 ++++++ .../lubuntu-council-subscribe.html | 23 ++ .../lubuntu-council-list-info-template.html | 141 ++++++++ .../lubuntu-council-options-template.html | 317 ++++++++++++++++++ .../lubuntu-council-subscribe-template.html | 9 + templates/translations | 25 ++ 11 files changed, 922 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100755 fill_template.sh create mode 100644 lubuntu_style.css create mode 100644 original_html_examples/lubuntu-council-list-info.html create mode 100644 original_html_examples/lubuntu-council-options.html create mode 100644 original_html_examples/lubuntu-council-subscribe.html create mode 100644 templates/lubuntu-council-list-info-template.html create mode 100644 templates/lubuntu-council-options-template.html create mode 100644 templates/lubuntu-council-subscribe-template.html create mode 100644 templates/translations diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b62594e --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +list-info-out.html +list-options.html +list-subscribe.html +palette +node_modules \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..d87cf5c --- /dev/null +++ b/README.md @@ -0,0 +1,43 @@ +# lubuntu-mailman-style + +## Overview +This project is for the maintainence of stylesheets and templates for the Lubuntu mailing list pages located on the [Ubuntu Mailing Lists](https://lists.ubuntu.com) page. HTML templates are located in the "templates" folder and are used to generate HTML similar to what Mailman generates, by replacing template tags with placeholder HTML taken from the actual site. These translations are located in "templates/translations". + +## Requirements +* Node 12.16.0 or newer ([NVM](https://github.com/nvm-sh/nvm) suggested) +* a web browser + +## Setup +This is how you can use this repository to make updates to the styles or templates: + + ### Checkout + Clone the git repo: +```bash +git clone +``` + + ### Install Dependencies + Install the serve npm module to statically serve your local working directory: + ```bash + npm i -g serve + ``` + + ### Run + Execute the script to generate HTML from the mailman templates: + ```bash +./fill_template.sh + ``` + Start serving the current directory (execute inside lubuntu-mailman-style project): + ```bash + serve . + ``` + Now, navigate to [localhost](http://localhost:5000) and open one of the html files to preview it--any changes to the underlying files will update without having to restart "serve". + + ## Updating the Templates and Translations + To update templates used by this repository, simply navigate to the following URLs, view page source, and save the page source to the templates folder. Be sure to check for new, unmapped tags and add them to "templates/translations". + + To update translations, simply add or edit translation lines. They are in "templates/translations" in the following format: + ```text + ////Lubuntu-users + ``` +As you can see, the first part of the line is the placeholder tag that will be replaced, then there is a separator "////", followed by the text to replace the tag with. If newline characters are required in the replacement text, please use the "\n" escape sequence, making sure to put the entire replacement on the same line. diff --git a/fill_template.sh b/fill_template.sh new file mode 100755 index 0000000..4b06b46 --- /dev/null +++ b/fill_template.sh @@ -0,0 +1,46 @@ +#! /usr/bin/env node + +var fs = require('fs'); +var readline = require('readline'); + +var translationLines = []; + +var readInterface = readline.createInterface({ + input: fs.createReadStream('./templates/translations'), + output: process.stdout, + console: false +}); + +readInterface.on('line', function(line) { + translationLines.push(line); +}); + +readInterface.on('close', () => { + replaceFile("templates/lubuntu-council-list-info-template.html", "list-info-out.html"); + replaceFile("templates/lubuntu-council-options-template.html", "list-options.html"); + replaceFile("templates/lubuntu-council-subscribe-template.html", "list-subscribe.html"); +}); + +function replaceFile (infile, outfile) { + + fs.readFile(infile, 'utf8', function (err, data) { + if (err) { + return console.log(err); + } + + //# var result = data.replace(//g, '$1'); + + for(i in translationLines) { + var toFrom = translationLines[i].split('////'); + var to = toFrom[0]; + var from = toFrom[1]; + + var pattern = new RegExp(to, 'gi'); + data = data.replace(pattern, from).replace(/\\n/g, "\n"); + } + + fs.writeFile(outfile, data, 'utf8', function (err) { + if (err) return console.log(err); + }); +}); +} \ No newline at end of file diff --git a/lubuntu_style.css b/lubuntu_style.css new file mode 100644 index 0000000..1882169 --- /dev/null +++ b/lubuntu_style.css @@ -0,0 +1,41 @@ +body { + font-size: 14px; + font-family: Ubuntu, sans-serif; + color: #555555; + margin: 0; +} + +h1 { + font-size: 26px; +} + +tr td[bgcolor] { + background-color: #0074B9; + margin: 0; +} + +font[color] { + color: #FFFFFF; + font-size: 26px; +} + +td[bgcolor] { + color: #FFFFFF; +} + +table { + border-spacing: 0; +} + +p { + font-size: 14px; +} + +b { + font-weight: 300; +} + +a { + color: #1E73BE; + font-size: 13px; +} \ No newline at end of file diff --git a/original_html_examples/lubuntu-council-list-info.html b/original_html_examples/lubuntu-council-list-info.html new file mode 100644 index 0000000..a95c174 --- /dev/null +++ b/original_html_examples/lubuntu-council-list-info.html @@ -0,0 +1,173 @@ + + + + + + Lubuntu-users Info Page + + + + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Lubuntu-users -- + Lubuntu Help and User Discussions +
+ About Lubuntu-users + +
+ +
+
+

This mailing list serves the Lubuntu community for the purposes of support and general discussion. +
+
Web: http://lubuntu.me +
Wiki: https://wiki.ubuntu.com/Lubuntu +
IRC: irc://chat.freenode.org/lubuntu +
Telegram: t.me/lubuntudevel +

+

To see the collection of prior postings to the list, + visit the Lubuntu-users + Archives. + +

+
+ Using Lubuntu-users +
+ To post a message to all the list members, send email to + lubuntu-users@lists.ubuntu.com. + +

You can subscribe to the list, or change your existing + subscription, in the sections below. +

+ Subscribing to Lubuntu-users +
+

+ Subscribe to Lubuntu-users by filling out the following + form. + You will be sent email requesting confirmation, to + prevent others from gratuitously subscribing you. This is a hidden list, which means that the + list of members is available only to the list administrator. +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Your email address: +  
    Your name (optional): 
    You may enter a + privacy password below. This provides only mild security, + but should prevent others from messing with your + subscription. Do not use a valuable password as + it will occasionally be emailed back to you in cleartext. + +

    If you choose not to enter a password, one will be + automatically generated for you, and it will be sent to + you once you've confirmed your subscription. You can + always request a mail-back of your password when you edit + your personal options. + +
    +
    Pick a password: 
    Reenter password to confirm: 
    Which language do you prefer to display your messages? + 
    Would you like to receive list mail batched in a daily + digest? + No + Yes +
    +
    +
    +
    +
+
+ + Lubuntu-users Subscribers +
+
+ (The subscribers list is only available to the list + administrator.)

Enter your admin address and password to visit the subscribers list:

Admin address: Password:   
+
+

+

+ To unsubscribe from Lubuntu-users, get a password reminder, + or change your subscription options enter your subscription + email address: +

If you leave the field blank, you will be prompted for + your email address +
+
+


Lubuntu-users list run by wxl at ubuntu.com, tsimonq2 at lubuntu.me
Lubuntu-users administrative interface (requires authorization)
Overview of all lists.ubuntu.com mailing lists

+ + + + + + + +
Delivered by Mailman
version 2.1.20
Python PoweredGNU's Not UnixDebian Powered
+

+ + + diff --git a/original_html_examples/lubuntu-council-options.html b/original_html_examples/lubuntu-council-options.html new file mode 100644 index 0000000..e3684fe --- /dev/null +++ b/original_html_examples/lubuntu-council-options.html @@ -0,0 +1,99 @@ + + + + + + Lubuntu-users list: member options for user paintface07@gmail.com + + + + + + + + + + + +

Lubuntu-users list: member options for user paintface07@gmail.com

+
+ + +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
In order to change your membership option, you must + first log in by giving your membership password in the section + below. If you don't remember your membership password, you can have it + emailed to you by clicking on the button below. If you just want to + unsubscribe from this list, click on the Unsubscribe button and a + confirmation message will be sent to you. + +

Important: From this point on, you must have + cookies enabled in your browser, otherwise none of your changes will take + effect. +

+ + + + + + + + + + + +
Password:
+

Unsubscribe

By clicking on the Unsubscribe button, a + confirmation message will be emailed to you. This message will have a + link that you should click on to complete the removal process (you can + also confirm by email; see the instructions in the confirmation + message).

Password reminder

By clicking on the Remind button, your + password will be emailed to you.
+ +
+
Lubuntu-users list run by wxl at ubuntu.com, tsimonq2 at lubuntu.me
Lubuntu-users administrative interface (requires authorization)
Overview of all lists.ubuntu.com mailing lists

+ + + + + + + +
Delivered by Mailman
version 2.1.20
Python PoweredGNU's Not UnixDebian Powered
+

+ + + \ No newline at end of file diff --git a/original_html_examples/lubuntu-council-subscribe.html b/original_html_examples/lubuntu-council-subscribe.html new file mode 100644 index 0000000..dc05b8c --- /dev/null +++ b/original_html_examples/lubuntu-council-subscribe.html @@ -0,0 +1,23 @@ + + +Lubuntu-users Subscription results + +

Lubuntu-users Subscription results

+Your subscription request has been received, and will soon be acted upon. +Depending on the configuration of this mailing list, your subscription request +may have to be first confirmed by you via email, or approved by the list +moderator. If confirmation is required, you will soon get a confirmation +email which contains further instructions. +
Lubuntu-users list run by wxl at ubuntu.com, tsimonq2 at lubuntu.me
Lubuntu-users administrative interface (requires authorization)
Overview of all lists.ubuntu.com mailing lists

+ + + + + + + +
Delivered by Mailman
version 2.1.20
Python PoweredGNU's Not UnixDebian Powered
+

+ + + diff --git a/templates/lubuntu-council-list-info-template.html b/templates/lubuntu-council-list-info-template.html new file mode 100644 index 0000000..d25365e --- /dev/null +++ b/templates/lubuntu-council-list-info-template.html @@ -0,0 +1,141 @@ + + + + + <MM-List-Name> Info Page + + + + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ -- + +
+ About + + + +
+

+

To see the collection of prior postings to the list, + visit the + Archives. + +

+
+ Using +
+ To post a message to all the list members, send email to + . + +

You can subscribe to the list, or change your existing + subscription, in the sections below. +

+ Subscribing to +
+

+ Subscribe to by filling out the following + form. + +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Your email address: +
    Your name (optional):
    You may enter a + privacy password below. This provides only mild security, + but should prevent others from messing with your + subscription. Do not use a valuable password as + it will occasionally be emailed back to you in cleartext. + +

    If you choose not to enter a password, one will be + automatically generated for you, and it will be sent to + you once you've confirmed your subscription. You can + always request a mail-back of your password when you edit + your personal options. + +
    +
    Pick a password:
    Reenter password to confirm:
    Which language do you prefer to display your messages?
    Would you like to receive list mail batched in a daily + digest? + No + Yes +
    +
    +
    + +
+
+ + Subscribers +
+ + + +

+ + + +

+ + + \ No newline at end of file diff --git a/templates/lubuntu-council-options-template.html b/templates/lubuntu-council-options-template.html new file mode 100644 index 0000000..86939a3 --- /dev/null +++ b/templates/lubuntu-council-options-template.html @@ -0,0 +1,317 @@ + + + + <MM-Presentable-User> membership configuration for <MM-List-Name> + + + + + + +
+ + mailing list membership configuration for + +
+

+ + + + + +
+ 's subscription status, + password, and options for the mailing list. +
+ + + + +

+

+ + +

+ + + + + + + + +
+ + Changing your membership information +
You can change the address that you are subscribed + to the mailing list with by entering the new address in the + fields below. Note that a confirmation email will be sent to + the new address, and the change must be confirmed before it is + processed. + +

Confirmations time out after about . + +

You can also optionally set or change your real name + (i.e. John Smith). + +

If you want to make the membership changes for all the + lists that you are subscribed to at , turn on the + Change globally check box. + +

+ + + + + + + +
New address:
Again to + confirm:
+
+ + + + +
Your name + (optional):
+
+

Change globally

+ +

+ + + + + + + +
+ Unsubscribing from + Your other subscriptions +
+ Turn on the confirmation checkbox and hit this button to + unsubscribe from this mailing list. Warning: + This action will be taken immediately! +

+

+ You can view a list of all the other mailing lists at + for which you are a member. Use this if you want to + make the same membership option changes to this other + subscriptions. + +

+

+
+ + + + + + +
+ Your Password +
+ +
+

Forgotten Your Password?

+
+ Click this button to have your password emailed to your + membership address. +

+

+ +
+
+ +
+

Change Your Password

+ + + + + + + + +
New + password:
Again to + confirm:
+ + +

Change globally. +
+
+ +

+ + +
+ Your Subscription Options +
+ +

+Current values are checked. + +

Note that some of the options have a Set globally +checkbox. Checking this field will cause the changes to be made to +every mailing list that you are a member of on . Click on +List my other subscriptions above to see which other mailing +lists you are subscribed to. +

+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Mail delivery

+ Set this option to Enabled to receive messages posted + to this mailing list. Set it to Disabled if you want + to stay subscribed, but don't want mail delivered to you for a + while (e.g. you're going on vacation). If you disable mail + delivery, don't forget to re-enable it when you come back; it + will not be automatically re-enabled. +

+ Enabled
+ Disabled

+ Set globally +

+ Set Digest Mode

+ If you turn digest mode on, you'll get posts bundled together + (usually one per day but possibly more on busy lists), instead + of singly when they're sent. If digest mode is changed from + on to off, you may receive one last digest. +

+ Off
+ On +
+ Get MIME or Plain Text Digests?

+ Your mail reader may or may not support MIME digests. In + general MIME digests are preferred, but if you have a problem + reading them, select plain text digests. +

+ MIME
+ Plain Text

+ Set globally +

+ Receive your own posts to the list?

+ Ordinarily, you will get a copy of every message you post to + the list. If you don't want to receive this copy, set this + option to No. +

+ No
+ Yes +
+ Receive acknowledgement mail when you send mail to + the list?

+

+ No
+ Yes +
+ Get password reminder email for this list?

+ Once a month, you will get an email containing a password + reminder for every list at this host to which you are + subscribed. You can turn this off on a per-list basis by + selecting No for this option. If you turn off + password reminders for all the lists you are subscribed to, no + reminder email will be sent to you. +

+ No
+ Yes

+ Set globally +

+ Conceal yourself from subscriber list?

+ When someone views the list membership, your email address is + normally shown (in an obscured fashion to thwart spam + harvesters). If you do not want your email address to show up + on this membership roster at all, select Yes for this option. +

+ No
+ Yes +
+ What language do you prefer?

+

+ +
+ Which topic categories would you like to subscribe + to?

+ By selecting one or more topics, you can filter the + traffic on the mailing list, so as to receive only a + subset of the messages. If a message matches one of + your selected topics, then you will get the message, + otherwise you will not. + +

If a message does not match any topic, the delivery + rule depends on the setting of the option below. If + you do not select any topics of interest, you will get + all the messages sent to the mailing list. +

+ +
+ Do you want to receive messages that do not match any + topic filter?

+ + This option only takes effect if you've subscribed to + at least one topic above. It describes what the + default delivery rule is for messages that don't match + any topic filter. Selecting No says that if + the message does not match any topic filters, then you + won't get the message, while selecting Yes + says to deliver such non-matching messages to you. + +

If no topics of interest are selected above, then + you will receive every message sent to the mailing + list. +

+ No
+ Yes +
+ Avoid duplicate copies of messages?

+ + When you are listed explicitly in the To: or + Cc: headers of a list message, you can opt to + not receive another copy from the mailing list. + Select Yes to avoid receiving copies from the + mailing list; select No to receive copies. + +

If the list has member personalized messages + enabled, and you elect to receive copies, every copy + will have a X-Mailman-Copy: yes header added + to it. + +

+ No
+ Yes

+ Set globally +

+
+
+ +

+ + + + + \ No newline at end of file diff --git a/templates/lubuntu-council-subscribe-template.html b/templates/lubuntu-council-subscribe-template.html new file mode 100644 index 0000000..0ff63b3 --- /dev/null +++ b/templates/lubuntu-council-subscribe-template.html @@ -0,0 +1,9 @@ + + +<MM-List-Name> Subscription results + +

Subscription results

+ + + + \ No newline at end of file diff --git a/templates/translations b/templates/translations new file mode 100644 index 0000000..590cbfb --- /dev/null +++ b/templates/translations @@ -0,0 +1,25 @@ +\n Archives.\n ////Lubuntu-users\n Archives. +////Lubuntu-users +////Lubuntu Help and User Discussions +////
+//// +//// +////This mailing list serves the Lubuntu community for the purposes of support and general discussion.\n
\n
Web: http://lubuntu.me\n
Wiki: https://wiki.ubuntu.com/Lubuntu\n
IRC: irc://chat.freenode.org/lubuntu\n
Telegram: t.me/lubuntudevel\n
+////lubuntu-users@lists.ubuntu.com +////You will be sent email requesting confirmation, to\n prevent others from gratuitously subscribing you. This is a hidden list, which means that the\n list of members is available only to the list administrator. +////
+//// +//// +//// +//// +//// +//// \n +//// +//// +//// +//// +//// +////(The subscribers list is only available to the list\n administrator.)

Enter your admin address and password to visit the subscribers list:

Admin address: Password:   
+//// +////To unsubscribe from Lubuntu-users, get a password reminder,\n or change your subscription options enter your subscription\n email address:\n

If you leave the field blank, you will be prompted for\n your email address +////
Lubuntu-users list run by wxl at ubuntu.com, tsimonq2 at lubuntu.me
Lubuntu-users administrative interface (requires authorization)
Overview of all lists.ubuntu.com mailing lists

\n\n \n \n \n \n \n \n
Delivered by Mailman
version 2.1.20
Python PoweredGNU's Not UnixDebian Powered
\n

\ No newline at end of file