diff options
author | junk | 2021-03-31 06:07:15 -0300 |
---|---|---|
committer | junk | 2021-04-08 14:14:40 -0400 |
commit | e9a0a02f9e17a7a03e39d066c8157285e774a376 (patch) | |
tree | f2792c6390d5560e66f85e9053968d7f27695c9a /cgi | |
parent | f7baf0c69606d49c6be86d3f27bc88d9d58cd4ba (diff) | |
download | weabot-e9a0a02f9e17a7a03e39d066c8157285e774a376.tar.gz weabot-e9a0a02f9e17a7a03e39d066c8157285e774a376.tar.xz weabot-e9a0a02f9e17a7a03e39d066c8157285e774a376.zip |
Nuevos estilos
Diffstat (limited to 'cgi')
-rw-r--r-- | cgi/templates/catalog.html | 1 | ||||
-rw-r--r-- | cgi/templates/stats.html | 61 | ||||
-rw-r--r-- | cgi/templates/txt_archive.html | 2 | ||||
-rw-r--r-- | cgi/templates/txt_thread.en.html | 2 | ||||
-rw-r--r-- | cgi/templates/txt_thread.html | 2 | ||||
-rwxr-xr-x | cgi/weabot.py | 33 |
6 files changed, 42 insertions, 59 deletions
diff --git a/cgi/templates/catalog.html b/cgi/templates/catalog.html index 8c0d80e..d4822ae 100644 --- a/cgi/templates/catalog.html +++ b/cgi/templates/catalog.html @@ -29,4 +29,5 @@ </div> <?py #endfor ?> </div> +<hr /> <?py include('templates/base_bottom.html') ?>
\ No newline at end of file diff --git a/cgi/templates/stats.html b/cgi/templates/stats.html index 6cfe4f1..b284d7a 100644 --- a/cgi/templates/stats.html +++ b/cgi/templates/stats.html @@ -5,7 +5,7 @@ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <style> -body{font-family:arial,sans-serif;background:#090909;color:#fdfdfd;margin:0;text-align:center} +body{font-family:arial,sans-serif;background:#090909 url('/bg3.png');color:#fff;margin:0;text-align:center;text-shadow:1px 1px #000} a,a:visited{color:#fdfdfd;text-decoration:none} a:hover{text-decoration:underline} hr{margin:1em 0} @@ -24,38 +24,40 @@ td a{display:block;padding:10px} .r{text-align:right} .l{text-align:left} .pos{line-height:0em;text-align:center} -.uno{font-size:2em;color:red} -.dos{font-size:1.6em;color:orange} -.tres{font-size:1.3em;color:yellow} +.b1{font-size:2em;color:red} +.b2{font-size:1.6em;color:orange} +.b3{font-size:1.3em;color:yellow} .etc{color:grey} #foot{margin:1em;font-size:.9em} #foot a{color:#999} -@media (max-width:600px){ -.t1{font-size:1.6em} -.t2{font-size:.9em} -h2{font-size:1.2em} -table{font-size:1.1em} -table.desc{font-size:.9em} -th,td{padding:5px} -td a{display:block;padding:5px} -.uno{font-size:1.6em} -.dos{font-size:1.4em} -.tres{font-size:1.2em} -#boards th{font-size:.8em} -.long{word-break:break-all} -#foot{font-size:12px} +@media (max-width:600px){c + .t1{font-size:1.6em} + .t2{font-size:.9em} + h2{font-size:1.2em} + table{font-size:1.1em} + table.desc{font-size:.9em} + th,td{padding:5px} + td a{display:block;padding:5px} + .b1{font-size:1.6em} + .b2{font-size:1.4em} + .b3{font-size:1.2em} + #boards th{font-size:.8em} + .long{word-break:break-all} + #foot{font-size:12px} } </style> </head> <body> <div id="title"> - <div class="t1"><a href="/" style="font-weight:900">Bienvenido a Internet</a> Estadísticas</div> - <div class="t2"> - <span>Última actualización:</span> <span>${timestamp} GMT${tz}</span> - <?py if not regenerated: ?> - <span>(en caché)</span> - <?py #endif ?> - </div> + <div class="t1"> + <a href="/" style="font-weight:900">Bienvenido a Internet</a> Estadísticas + </div> + <div class="t2"> + <span>Última actualización:</span> <span>${timestamp} GMT${tz}</span> + <?py if not regenerated: ?> + <span>(en caché)</span> + <?py #endif ?> + </div> </div> <hr /> @@ -100,12 +102,7 @@ td a{display:block;padding:5px} <?py iter = 1 ?> <?py for dir, board, percent, num in boards_percent: ?> <tr> - <td class="pos"> - <?py if iter == 1: ?><span class="uno">${iter}</span> - <?py elif iter == 2: ?><span class="dos">${iter}</span> - <?py elif iter == 3: ?><span class="tres">${iter}</span> - <?py else: ?>${iter}<?py #endif ?> - </td> + <td class="pos b${iter}">${iter}</td> <td class="l boards"><a href="/${dir}/" target="_blank">${board}</a></td> <td class="r">${num}</td> <td class="r">${percent}%</td> @@ -158,6 +155,6 @@ td a{display:block;padding:5px} <hr /> -<div id="foot">B.a.I. - 2010-2019 · Contacto: <a href="mailto:burocracia@bienvenidoainternet.org">burocracia@bienvenidoainternet.org</a></div> +<div id="foot">B.a.I. - 2010-2021 · Contacto: <a href="mailto:burocracia@bienvenidoainternet.org">burocracia@bienvenidoainternet.org</a></div> </body> </html>
\ No newline at end of file diff --git a/cgi/templates/txt_archive.html b/cgi/templates/txt_archive.html index 2b5caa3..88b3196 100644 --- a/cgi/templates/txt_archive.html +++ b/cgi/templates/txt_archive.html @@ -68,7 +68,7 @@ <?py #endif ?> <?py #endfor ?> <?py if 'size' in thread: ?> - <div class="size">#{thread['size']}</div> + <div id="size">#{thread['size']}</div> <?py #endif ?> </div> <hr /><div class="stop red">■ Este hilo se encuentra guardado en el archivo</div><hr /> diff --git a/cgi/templates/txt_thread.en.html b/cgi/templates/txt_thread.en.html index 45f8f8e..4b16fca 100644 --- a/cgi/templates/txt_thread.en.html +++ b/cgi/templates/txt_thread.en.html @@ -20,6 +20,8 @@ <hr /> <?py if thread['length'] > 1000: ?> <div class="stop red">The thread got over 1000 posts and has been closed.</div> +<?py elif thread['length'] > 950: ?> + <div class="warn yellow">The thread has reached 950 posts. When it reaches 1000 posts it will be closed.</div> <?py elif thread['length'] > 900: ?> <div class="warn yellow">The thread has reached 900 posts. When it reaches 1000 posts it will be closed.</div> <?py #endif ?> diff --git a/cgi/templates/txt_thread.html b/cgi/templates/txt_thread.html index 18293c1..c8d70d1 100644 --- a/cgi/templates/txt_thread.html +++ b/cgi/templates/txt_thread.html @@ -20,6 +20,8 @@ <hr /> <?py if thread['length'] > 1000: ?> <div class="stop red">El hilo superó los 1000 mensajes y ha sido cerrado. Ya no se puede postear en él.</div> +<?py elif thread['length'] > 950: ?> + <div class="warn red">El hilo ha recibido más de 950 mensajes. Cuando llegue a 1000 será cerrado.</div> <?py elif thread['length'] > 900: ?> <div class="warn yellow">El hilo ha recibido más de 900 mensajes. Cuando llegue a 1000 será cerrado.</div> <?py #endif ?> diff --git a/cgi/weabot.py b/cgi/weabot.py index 7e27ca7..eba4c72 100755 --- a/cgi/weabot.py +++ b/cgi/weabot.py @@ -192,8 +192,9 @@ class weabot(object): elif path_split[1] == "api": import api caught = True - self.headers = [("Content-Type", "application/json"), ("Access-Control-Allow-Origin", "*"), ("Access-Control-Allow-Methods", - "PUT, GET, POST, DELETE, OPTIONS"), ("Access-Control-Allow-Headers", "Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With")] + self.headers = [("Content-Type", "application/json"), ("Access-Control-Allow-Origin", "*"), + ("Access-Control-Allow-Methods", "PUT, GET, POST, DELETE, OPTIONS"), + ("Access-Control-Allow-Headers", "Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With")] OpenDb() api.api(self, path_split) elif path_split[1] == "threadlist": @@ -492,7 +493,7 @@ class weabot(object): message = message.replace("\r", "") # check ! functions before - extend = extend_str = dice = ball = None + extend = extend_str = None if not post["parentid"] and board["dir"] not in ['bai', 'world']: # creating thread @@ -504,20 +505,6 @@ class weabot(object): extend_str = res.group(0) message = message[res.end(0):] - if board["dir"] in ['juegos', '0', 'polka']: - __dice = re.compile(r"^!dado(:\w+)(:\w+)?\n") - res = __dice.match(message) - if res: - dice = res.groups() - message = message[res.end(0):] - - if board["dir"] in ['zonavip', '0', 'polka']: - __ball = re.compile(r"^!bola8\n") - res = __ball.match(message) - if res: - ball = True - message = message[res.end(0):] - # use and format message if message.strip(): post["message"] = format_post( @@ -527,10 +514,6 @@ class weabot(object): if extend_str: extend_str = extend_str.replace('!extend', 'EXTEND') post["message"] += '<hr />' + extend_str + ' configurado.' - if dice: - post["message"] += '<hr />' + throw_dice(dice) - if ball: - post["message"] += '<hr />' + magic_ball() if not post["parentid"] and post["email"].lower() == 'sage': post["email"] = "" @@ -1016,12 +999,11 @@ class weabot(object): # 1 week = 604800 query_day = FetchAll("SELECT DATE_FORMAT(FROM_UNIXTIME(FLOOR((timestamp-10800)/86400)*86400+86400), \"%Y-%m-%d\"), COUNT(1), COUNT(IF(parentid=0, 1, NULL)) " "FROM posts " - "WHERE (timestamp-10800) > (UNIX_TIMESTAMP()-604800) AND (IS_DELETED = 0 OR IS_DELETED = 3) " + "WHERE (timestamp-10800) > (UNIX_TIMESTAMP()-604800) AND (IS_DELETED = 0) " "GROUP BY FLOOR((timestamp-10800)/86400) " "ORDER BY FLOOR((timestamp-10800)/86400)", 0) - query_count = FetchOne( - "SELECT COUNT(1), COUNT(NULLIF(file, '')), VERSION() FROM posts", 0) + query_count = FetchOne("SELECT COUNT(1), COUNT(NULLIF(file, '')), VERSION() FROM posts", 0) total = int(query_count[0]) total_files = int(query_count[1]) mysql_ver = query_count[2] @@ -1033,8 +1015,7 @@ class weabot(object): for date, count, threads in query_day[1:]: days.append((date, count, threads)) - query_b = FetchAll( - "SELECT id, dir, name FROM boards WHERE boards.secret = 0", 0) + query_b = FetchAll("SELECT id, dir, name FROM boards WHERE boards.secret = 0", 0) boards = [] totalp = 0 |