diff --git a/app.py b/app.py index 7f0291f..759a59a 100644 --- a/app.py +++ b/app.py @@ -11,7 +11,11 @@ def home(): for line in u_file: u_list.append(line); - return render_template("index.html", u_list=u_list) + return render_template("index.html", u_list=u_list, page_name="home") + + +def rules(): + return render_template("rules.html") def home2(name): # app.route('/home2/') @@ -41,8 +45,6 @@ def req(): rt = { "username": Widg("username", "input", None), - "displayname": Widg("displayname", "input", None), - "prefer display name?": Widg("default_disp", "check", None), "email for account lockout / registration confirmation (optional)": Widg("email", "input", None), "SSH public key": Widg("pub_key", "textarea", None), "shell of choice": Widg("shell", "choice", [("bash", "/bin/bash"), ("ksh", "/bin/ksh")]), @@ -50,7 +52,17 @@ def req(): }; # uhhh is this how you're supposed to do this? - return render_template("req.html", req_tab = rt, widg_fun = widg_fun) + return render_template("req.html", req_tab = rt, widg_fun = widg_fun, page_name="req") + +def signup(): + username = request.form["username"] + email = request.form["email"] + shell = request.form["shell"] + rule_read = request.form["rule_read"] + + if(rule_read != "on"): + print("some fail condition") + def login(): if request.method == "POST": @@ -61,7 +73,9 @@ def login(): if __name__=="__main__": app.add_url_rule('/home2/', 'home2', home2) + app.add_url_rule('/rules', 'rules', rules) app.add_url_rule('/success/', 'success', success) app.add_url_rule('/login', 'login', login, methods = ['POST', 'GET']) app.add_url_rule('/req', 'req', req, methods = ['POST', 'GET']) + app.add_url_rule('/req/signup', 'req', req, methods = ['POST']) app.run(host="104.248.118.130",debug=True) diff --git a/static/main.css b/static/main.css index 906c256..6589d62 100644 --- a/static/main.css +++ b/static/main.css @@ -2,6 +2,15 @@ html { background: #000; } +h1{ + text-align: center; +} + +footer{ + width: 800px; + margin: 0 auto; +} + body { margin: 0; padding: 0; @@ -28,17 +37,17 @@ header h1.logo { float: left; } -header h1.logo:hover { - color: #fff; - text-decoration: none; -} +/* header h1.logo:hover { */ +/* color: #fff; */ +/* text-decoration: none; */ +/* } */ /* * Center the body content */ .container { - width: 1200px; + width: 800px; margin: 0 auto; } diff --git a/static/main_req.css b/static/main_req.css new file mode 100644 index 0000000..9eea25f --- /dev/null +++ b/static/main_req.css @@ -0,0 +1,71 @@ +html { + background: #000; + background-image: url("req.png"); + background-repeat: no-repeat; +} + +h1{ + text-align: center; +} + +footer{ + width: 800px; + margin: 0 auto; +} + +body { + margin: 0; + padding: 0; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + color: #fff; +} + + /* + * Formatting the header area + */ + +header { + height: 35px; + width: 100%; + opacity: .9; + margin-bottom: 10px; +} + +header h1.logo { + margin: 0; + font-size: 1.7em; + color: #fff; + text-transform: uppercase; + float: left; +} + +/* header h1.logo:hover { */ +/* color: #fff; */ +/* text-decoration: none; */ +/* } */ + + /* + * Center the body content + */ + +.container { + width: 800px; + margin: 0 auto; +} + +h2 { + font-size: 3em; + margin-top: 40px; + text-align: center; + letter-spacing: -2px; +} + +h3 { + font-size: 1.7em; + font-weight: 100; + margin-top: 30px; + text-align: center; + letter-spacing: -1px; + color: #999; +} + diff --git a/static/req.png b/static/req.png new file mode 100644 index 0000000..d92f90b Binary files /dev/null and b/static/req.png differ diff --git a/templates/index.html b/templates/index.html index 1a46c2c..54b93e1 100644 --- a/templates/index.html +++ b/templates/index.html @@ -4,10 +4,10 @@

lingy.in is a public unix / tilde instance for lainons

current thread: https://lainchan.org/tech/res/34563.html

-

sign up

-

rules

-

git

-

users

+

sign up

+

rules

+

git

+

users

    {% for user in u_list %}
  1. {{user}}
  2. diff --git a/templates/layout.html b/templates/layout.html index a72b840..c0f57f4 100644 --- a/templates/layout.html +++ b/templates/layout.html @@ -1,13 +1,15 @@ - userreq + LAINTILDE0 -

    铃音

    +

    lingy.in

    {%block content%} {%endblock%}
    + + diff --git a/templates/main_layout.html b/templates/main_layout.html index dcf28d2..f3dc825 100644 --- a/templates/main_layout.html +++ b/templates/main_layout.html @@ -1,7 +1,7 @@ LAINTILDE0 - +

    lingy.in

    diff --git a/templates/req.html b/templates/req.html index 8783760..df2a6f2 100644 --- a/templates/req.html +++ b/templates/req.html @@ -1,4 +1,4 @@ -{%extends "layout.html"%} +{%extends "main_layout.html"%} {%block content%}

    @@ -26,14 +26,4 @@

    -

    -A requested feature is to have to allow users to have a unicode username since unicode allows for more interesting aesthics -
    -If you enter a unicode display name, the system will try to display your unicode name when possbile. It will also be your default in terminal prompt, chat and your tilde path -
    -the linux os only sees your true ascii username. so your ssh login, file permissions etc will user your true username -
    -feedback on this feature welcome -

    - {%endblock%} diff --git a/templates/rules.html b/templates/rules.html new file mode 100644 index 0000000..1ecadf5 --- /dev/null +++ b/templates/rules.html @@ -0,0 +1,23 @@ +{%extends "layout.html"%} + +{%block content%} +

    +

    Rules

    +
      +
    1. you must 18 or older to use lingy.in
    2. +
    3. since this is multiuser system, show good judgement with the server resources (ie dont start mining crypto)
    4. +
    5. don't damage/delete others work
    6. +
    7. don't upload child pornography to lingy.in
    8. +
    9. don't use lingy.in to distribute malware
    10. +
    11. be smart with your data (fwiw, when i use a shared system like this i assume all data i have on the box is effecitvely comprimised)
    12. +
    +
    +

    some things to consider:

    +
      +
    1. relax and try not to take the things others say too seriously.
    2. +
    3. no implementation is perfect. so i encourage you to make your own tilde with different rules and designs
    4. +
    5. On your first login throw something fun in your index.html even if its just placeholder.
    6. +
    +

    + +{%endblock%}