Răsfoiți Sursa

Merge pull request #1273 from openNAMU/dev

Dev
잉여개발기 (SPDV) 4 ani în urmă
părinte
comite
3f5140bf01

Fișier diff suprimat deoarece este prea mare
+ 378 - 299
app.py


+ 13 - 13
lang/en-US.json

@@ -384,7 +384,7 @@
             "close_vote" : "Close vote",
             "re_open_vote" : "Reopen vote",
     "_comment_3_" : "Long",
-        "application_submitted": "Applicatied successfully for registration",
+        "application_submitted": "Registration application successful",
         "waiting_for_approval": "Application for registration has been made successfully. Please wait for approval by administrators.",
         "ie_no_data_required" : "Operation cannot continue because all required data has not been collected.",
         "user_reset_sign" : "Your account information has changed like this.",
@@ -401,16 +401,16 @@
             "update_error" : "Auto update is not supported.",
             "inter_error" : "Internal error.",
             "authority_error" : "Insufficient privileges.",
-            "no_login_error" : "Non-login status.",
+            "no_login_error" : "You are not logged in.",
             "no_exist_user_error" : "The account does not exist.",
             "no_admin_block_error" : "You cannot block or check administrators.",
-            "skin_error" : "This skin is not support settings.",
-            "same_id_exist_error" : "There are users with the same username.",
+            "skin_error" : "The skin you are using does not support individual settings.",
+            "same_id_exist_error" : "There are users using the same username.",
             "long_id_error" : "Username must be shorter than 20 characters.",
-            "id_char_error" : "Only Korean letters, alphabets are allowed for Username.",
+            "id_char_error" : "Only Korean letters and alphabets are allowed for Username.",
             "file_exist_error" : "The file does not exist.",
-            "password_error" : "The password is different.",
-            "recaptcha_error" : "Go through the reCAPTCHA.",
+            "password_error" : "Password does not match.",
+            "recaptcha_error" : "Pass the reCAPTCHA.",
             "file_extension_error" : "Only files with the specified extension can be uploaded.",
             "edit_record_error" : "Edit reason can not be more than 500 characters.",
             "same_file_error" : "A file with the same name exists.",
@@ -428,15 +428,15 @@
             "application_not_found" : "Application not found",
             "invalid_password_error" : "The Password or ID is invalid.",
             "watchlist_overflow_error": "You cannot add more than ten documents.",
-            "copyright_disagreed" : "You have to agree copyright noticement to contribute",
+            "copyright_disagreed" : "You have to agree to the copyright noticement to contribute.",
             "email_send_error" : "Email transfer failed.",
-            "restart_fail_error" : "Restart failed. Please use manual restart.",
+            "restart_fail_error" : "Restart failed. Please try restarting manually.",
             "same_email_error" : "There are users using the same email.",
             "input_email_error" : "There is a problem with the input value.",
         "_comment_3.2_" : "Warning",
-            "http_warning" : "Warning: If you are not on HTTPS connection, Your information can be leaked. We won't response to that.",
+            "http_warning" : "Warning: If you are not on HTTPS connection, your information can be leaked. The users themselves have responsibility to any problems that happen because of this.",
             "user_head_warning" : "User data will be deleted if you close the browser or when you sign in.",
-            "no_login_warning" : "You are not logged in. The IP address will be logged when editing or discussing with non-login.",
-            "update_warning" : "Manual updates are recommended if your version is 0.2 or lower than the latest version. For Windows, the contents of the route folder disappear.",
-            "history_delete_warning" : "If you erase history, it's hard to restore it, so make a careful decision."
+            "no_login_warning" : "You are not logged in. Your current IP address will be logged within editing or discussing until you log in.",
+            "update_warning" : "Manual updates are recommended if your version is 0.2 or lower than the latest version. For Windows, the contents of the route folder will be deleted.",
+            "history_delete_warning" : "If you erase history, it's hard to restore it, so please be careful."
 }

+ 4 - 0
route/edit_delete.py

@@ -47,6 +47,7 @@ def edit_delete_2(conn, name):
 
         file_check = re.search(r'^file:(.+)\.(.+)$', name)
         if file_check:
+            '''
             file_check = file_check.groups()
             file_directory = os.path.join(
                 load_image_url(), 
@@ -54,6 +55,9 @@ def edit_delete_2(conn, name):
             )
             if os.path.exists(file_directory):
                 os.remove(file_directory)
+            '''
+            
+            pass
         else:
             curs.execute(db_change('select data from other where name = "count_all_title"'))
             curs.execute(db_change("update other set data = ? where name = 'count_all_title'"), [str(int(curs.fetchall()[0][0]) - 1)])

+ 43 - 0
route/edit_delete_file.py

@@ -0,0 +1,43 @@
+from .tool.func import *
+
+def edit_delete_file_2(conn, name):
+    curs = conn.cursor()
+
+    ip = ip_check()
+    if admin_check() == 0:
+        return re_error('/ban')
+
+    mime_type = re.search(r'([^.]+)$', name)
+    if mime_type:
+        mime_type = mime_type.group(1).lower()
+    else:
+        mime_type = 'jpg'
+
+    file_name = re.sub(r'\.([^.]+)$', '', name)
+    file_name = re.sub(r'^file:', '', file_name)
+    
+    file_all_name = sha224_replace(file_name) + '.' + mime_type
+    file_directory = os.path.join(load_image_url(), file_all_name)
+    
+    if not os.path.exists(file_directory):
+        return redirect('/w/' + url_pas(name))
+
+    if flask.request.method == 'POST':
+        admin_check(None, 'file del (' + name + ')')
+        os.remove(file_directory)
+
+        return redirect('/w/' + url_pas(name))
+    else:
+        return easy_minify(flask.render_template(skin_check(),
+            imp = [name, wiki_set(), wiki_custom(), wiki_css(['(' + load_lang('file_delete') + ')', 0])],
+            data = '''
+                <form method="post">
+                    <img src="/image/''' + url_pas(file_all_name) + '''">
+                    <hr class="main_hr">
+                    <a href="/image/''' + url_pas(file_all_name) + '''">/image/''' + url_pas(file_all_name) + '''</a>
+                    <hr class="main_hr">
+                    <button type="submit">''' + load_lang('file_delete') + '''</button>
+                </form>
+            ''',
+            menu = [['w/' + url_pas(name), load_lang('return')]]
+        ))

+ 1 - 1
route/edit_delete_many.py → route/edit_delete_mutiple.py

@@ -1,7 +1,7 @@
 from .tool.func import *
 from . import edit_delete
 
-def edit_delete_many_2(conn):
+def edit_delete_mutiple_2(conn):
     curs = conn.cursor()
 
     ip = ip_check()

+ 2 - 1
route/main_manager.py

@@ -38,7 +38,7 @@ def main_manager_2(conn, num):
                     <h2>2. ''' + load_lang('owner') + '''</h2>
                     <ul class="inside_ul">
                         <li><a href="/admin_group">''' + load_lang('admin_group_list') + '''</a></li>
-                        <li><a href="/many_delete">''' + load_lang('many_delete') + '''</a></li>
+                        <li><a href="/delete/doc_mutiple">''' + load_lang('many_delete') + '''</a></li>
                         <li><a href="/app_submit">''' + load_lang('application_list') + '''</a></li>
                         <li><a href="/api/sitemap.xml">''' + load_lang('get_sitemap') + '''</a></li>
                         <li><a href="/register">''' + load_lang('add_user') + '''</a></li>
@@ -54,6 +54,7 @@ def main_manager_2(conn, num):
                         <li><a href="/name_filter">''' + load_lang('id_filter_list') + '''</a></li>
                         <li><a href="/file_filter">''' + load_lang('file_filter_list') + '''</a></li>
                         <li><a href="/extension_filter">''' + load_lang('extension_filter_list') + '''</a></li>
+                        <li><a href="/doc_filter">''' + load_lang('doc_filter_list') + '''</a></li>
                     </ul>
                     <h3>2.2. ''' + load_lang('server') + '''</h2>
                     <ul class="inside_ul">

+ 3 - 0
route/main_test_func.py

@@ -2,6 +2,9 @@ import time
 from .tool.func import *
 
 def main_test_func_2(conn):
+    if admin_check() != 1:
+        return re_error('/error/3')
+    
     test_start = time.time()
 
     for _ in range(0, 10000):

+ 1 - 10
route/main_upload.py

@@ -61,8 +61,7 @@ def main_upload_2(conn):
 
             data_url_image = load_image_url()
             if os.path.exists(os.path.join(data_url_image, e_data)):
-                os.remove(os.path.join(data_url_image, e_data))
-                data.save(os.path.join(data_url_image, e_data))
+                return re_error('/error/16')
             else:
                 data.save(os.path.join(data_url_image, e_data))
 
@@ -75,21 +74,13 @@ def main_upload_2(conn):
             db_data = curs.fetchall()
             if db_data and db_data[0][0] == 'namumark':
                 file_d = '' + \
-                    '[[file:' + name + ']]\n' + \
-                    '{{{[[file:' + name + ']]}}}\n\n' + \
                     flask.request.form.get('f_lice_sel', 'direct_input') + '\n' + \
-                    (ip if ip_or_user(ip) != 0 else '[[user:' + ip + ']]') + '\n' + \
-                    file_size + 'KB\n' + \
                     '[[category:' + re.sub(r'\]', '_', flask.request.form.get('f_lice_sel', '')) + ']]\n' + \
                     (g_lice if g_lice != '' else '') + \
                 ''
             else:
                 file_d = '' + \
-                    'file:' + name + '\n' + \
-                    '/image/' + e_data + '\n\n' + \
                     flask.request.form.get('f_lice_sel', 'direct_input') + '\n' + \
-                    ip + \
-                    file_size + 'KB\n\n' + \
                     (g_lice if g_lice != '' else '') + \
                 ''
 

+ 36 - 32
route/tool/func.py

@@ -84,7 +84,7 @@ global_wiki_set = {}
 
 global_db_set = ''
 
-data_css_ver = '116'
+data_css_ver = '117'
 data_css = ''
 
 conn = ''
@@ -102,39 +102,43 @@ def load_conn(data):
     load_conn2(data)
     
 # Func-init
-def get_conn(db_set = ''):
-    global global_db_set
-    if db_set != '':
-        global_db_set = db_set
-    else:
-        db_set = global_db_set
-    
-    if db_set['type'] == 'sqlite':
-        conn = sqlite3.connect(db_set['name'] + '.db')
-        curs = conn.cursor()
-    else:
-        conn = pymysql.connect(
-            host = db_set['mysql_host'],
-            user = db_set['mysql_user'],
-            password = db_set['mysql_pw'],
-            charset = 'utf8mb4',
-            port = int(db_set['mysql_port'])
-        )
-        curs = conn.cursor()
-    
-        try:
-            curs.execute(db_change(
-                'create database ' + db_set['name'] + ' ' + \
-                'default character set utf8mb4;'
-            ))
-        except:
-            pass
+class get_db_connect:
+    def __init__(self, db_set):
+        self.db_set = db_set
+        self.conn = ''
         
-        conn.select_db(db_set['name'])
+    def __call__(self):
+        return self.conn
         
-    load_conn(conn)
+    def __enter__(self):
+        if self.db_set['type'] == 'sqlite':
+            self.conn = sqlite3.connect(self.db_set['name'] + '.db')
+        else:
+            self.conn = pymysql.connect(
+                host = self.db_set['mysql_host'],
+                user = self.db_set['mysql_user'],
+                password = self.db_set['mysql_pw'],
+                charset = 'utf8mb4',
+                port = int(self.db_set['mysql_port'])
+            )
+            curs = self.conn.cursor()
+
+            try:
+                curs.execute(db_change(
+                    'create database ' + self.db_set['name'] + ' ' + \
+                    'default character set utf8mb4;'
+                ))
+            except:
+                pass
+
+            self.conn.select_db(self.db_set['name'])
+
+        load_conn(self.conn)
+
+        return self.conn
         
-    return conn
+    def __exit__(self, exc_type, exc_value, traceback):
+        self.conn.close()
 
 def update(ver_num, set_data):
     print('----')
@@ -411,7 +415,7 @@ def get_default_admin_group():
 def load_image_url():
     curs.execute(db_change('select data from other where name = "image_where"'))
     image_where = curs.fetchall()
-    image_where = image_where[0][0] if image_where else 'data/images'
+    image_where = image_where[0][0] if image_where else os.path.join('data', 'images')
     
     return image_where
 

+ 16 - 0
route/tool/func_mark.py

@@ -134,6 +134,22 @@ def render_do(doc_name, doc_data, data_type, data_in):
                 ''',
                 []
             ]
+        elif rep_data == 'markdown':
+            data_in = (data_in + '_') if data_in else ''
+            data_end = [
+                '<pre style="display: none;" id="' + data_in + 'render_content_set">' + html.escape(wiki_set_data) + '</pre>' + \
+                '<pre style="display: none;" id="' + data_in + 'render_content_load">' + html.escape(doc_data) + '</pre>' + \
+                '<div class="render_content" id="' + data_in + 'render_content"></div>', 
+                '''
+                    do_onmark_render(
+                        test_mode = "normal", 
+                        name_id = "''' + data_in + '''render_content",
+                        name_include = "''' + data_in + '''",
+                        name_doc = "''' + doc_name.replace('"', '//"') + '''"
+                    );
+                ''',
+                []
+            ]
         else:
             data_end = [
                 doc_data, 

+ 48 - 18
route/view_read.py

@@ -4,8 +4,14 @@ def view_read_2(conn, name, doc_rev, doc_from):
     curs = conn.cursor()
 
     sub = ''
-    div = ''
+    menu = []
+    
+    user_doc = ''
+    category_doc = ''
+    file_data = ''
+    
     ip = ip_check()
+    
     name_doc_pass = doc_from
     uppage = re.sub(r"/([^/]+)$", '', name)
     num = str(doc_rev)        
@@ -33,9 +39,44 @@ def view_read_2(conn, name, doc_rev, doc_from):
 
         if category_sub != '':
             category_doc += '<h2 id="cate_under">' + load_lang('under_category') + '</h2><ul class="inside_ul">' + category_sub + '</ul>'
+    elif re.search(r"^user:([^/]*)", name):
+        match = re.search(r"^user:([^/]*)", name)
+        user_name = html.escape(match.group(1))
+        user_doc = '''
+            <div id="get_user_info"></div>
+            <script>load_user_info("''' + user_name + '''");</script>
+            <hr class="main_hr">
+        '''
+        if name == 'user:' + user_name:
+            menu += [['w/' + url_pas(name) + '/' + url_pas(get_time().split()[0]), load_lang('today_doc')]]
+    elif re.search(r"^file:", name):
+        mime_type = re.search(r'([^.]+)$', name)
+        if mime_type:
+            mime_type = mime_type.group(1).lower()
+        else:
+            mime_type = 'jpg'
+            
+        file_name = re.sub(r'\.([^.]+)$', '', name)
+        file_name = re.sub(r'^file:', '', file_name)
+        
+        file_all_name = sha224_replace(file_name) + '.' + mime_type
+        file_path_name = os.path.join(load_image_url(), file_all_name)
+        if os.path.exists(file_path_name):
+            file_size = str(round(os.path.getsize(file_path_name) / 1000, 1))
+            file_data = '''
+                <img src="/image/''' + url_pas(file_all_name) + '''">
+                <h2>DATA</h2>
+                <table>
+                    <tr><td>URL</td><td><a href="/image/''' + url_pas(file_all_name) + '''">LINK</a></td></tr>
+                    <tr><td>VOLUME</td><td>''' + file_size + '''KB</td></tr>
+                </table>
+                <h2>CONTENT</h2>
+            '''
+
+            menu += [['delete/doc_file/' + url_pas(name), load_lang('file_delete')]]
+        else:
+            file_data = ''
             
-        div += category_doc
-
     if num != '0':
         curs.execute(db_change("select title from history where title = ? and id = ? and hide = 'O'"), [name, num])
         if curs.fetchall() and admin_check(6) != 1:
@@ -92,7 +133,7 @@ def view_read_2(conn, name, doc_rev, doc_from):
         response_data = 200
 
     if num != '0':
-        menu = [['history/' + url_pas(name), load_lang('history')]]
+        menu += [['history/' + url_pas(name), load_lang('history')]]
         sub = ' (r' + str(num) + ')'
         acl = 0
         r_date = 0
@@ -101,9 +142,9 @@ def view_read_2(conn, name, doc_rev, doc_from):
         acl = 1 if curs.fetchall() else 0
         menu_acl = 1 if acl_check(name) == 1 else 0
         if response_data == 404:
-            menu = [['edit/' + url_pas(name), load_lang('create'), menu_acl]] 
+            menu += [['edit/' + url_pas(name), load_lang('create'), menu_acl]] 
         else:
-            menu = [['edit/' + url_pas(name), load_lang('edit'), menu_acl]]
+            menu += [['edit/' + url_pas(name), load_lang('edit'), menu_acl]]
             
         menu += [
             ['topic/' + url_pas(name), load_lang('discussion'), topic], 
@@ -131,18 +172,7 @@ def view_read_2(conn, name, doc_rev, doc_from):
         r_date = curs.fetchall()
         r_date = r_date[0][0] if r_date else 0
 
-    div = end_data + div
-
-    match = re.search(r"^user:([^/]*)", name)
-    if match:
-        user_name = html.escape(match.group(1))
-        div = '''
-            <div id="get_user_info"></div>
-            <script>load_user_info("''' + user_name + '''");</script>
-            <hr class="main_hr">
-        ''' + div
-        if name == 'user:' + user_name:
-            menu += [['w/' + url_pas(name) + '/' + url_pas(get_time().split()[0]), load_lang('today_doc')]]
+    div = file_data + user_doc + end_data + category_doc
 
     curs.execute(db_change("select data from other where name = 'body'"))
     body = curs.fetchall()

+ 9 - 6
route/view_xref.py

@@ -1,6 +1,6 @@
 from .tool.func import *
 
-def view_xref_2(conn, name):
+def view_xref_2(conn, name, xref_type = '1'):
     curs = conn.cursor()
 
     if acl_check(name, 'render') == 1:
@@ -9,18 +9,21 @@ def view_xref_2(conn, name):
     num = int(number_check(flask.request.args.get('num', '1')))
     sql_num = (num * 50 - 50) if num * 50 > 0 else 0
     
-    xref_type = flask.request.args.get('change', '1')
     if xref_type == '1':
-        div = '<a href="?change=2">(' + load_lang('link_in_this') + ')</a><hr class="main_hr">'
+        div = '<a href="/xref/this/' + url_pas(name) + '">(' + load_lang('link_in_this') + ')</a><hr class="main_hr">'
+        
+        data_sub = '(' + load_lang('backlink') + ')'
     else:
-        div = '<a href="?change=1">(' + load_lang('normal') + ')</a><hr class="main_hr">'
+        div = '<a href="/xref/' + url_pas(name) + '">(' + load_lang('normal') + ')</a><hr class="main_hr">'
+        
+        data_sub = '(' + load_lang('link_in_this') + ')'
 
     div += '<ul class="inside_ul">'
 
     sql_insert = ['link', 'title'] if xref_type == '1' else ['title', 'link']
     curs.execute(db_change("" + \
         "select distinct " + sql_insert[0] + ", type from back " + \
-        "where " + sql_insert[1] + " = ? and not type = 'cat' and not type = 'no' and not type = 'nothing'" + \
+        "where " + sql_insert[1] + " = ? and not type = 'no' and not type = 'nothing'" + \
         "order by type asc, title asc limit ?, 50" + \
     ""), [
         name,
@@ -44,7 +47,7 @@ def view_xref_2(conn, name):
     div += '</ul>' + next_fix('/xref/' + url_pas(name) + '?change=' + xref_type + '&num=', num, data_list)
 
     return easy_minify(flask.render_template(skin_check(),
-        imp = [name, wiki_set(), wiki_custom(), wiki_css(['(' + load_lang('backlink') + ')', 0])],
+        imp = [name, wiki_set(), wiki_custom(), wiki_css([data_sub, 0])],
         data = div,
         menu = [['w/' + url_pas(name), load_lang('return')], ['backlink_reset/' + url_pas(name), load_lang('reset_backlink')]]
     ))

+ 2 - 2
version.json

@@ -1,7 +1,7 @@
 {
     "beta" : {
-        "r_ver" : "v3.4.1-stable (stable1) (beta6) (dev8)",
+        "r_ver" : "v3.5.0-dev (stable1) (beta10) (dev12)",
         "c_ver" : "3500101",
-        "s_ver" : "3500101"
+        "s_ver" : "3500110"
     }
 }

+ 2 - 2
views/main_css/js/load_skin_set.js

@@ -153,8 +153,8 @@ function main_css_skin_load() {
     }
     
     if(
-        document.cookie.match(regex_data('main_css_darkmode')) &&
-        document.cookie.match(regex_data('main_css_darkmode'))[1] === '1'
+        document.cookie.match(main_css_regex_data('main_css_darkmode')) &&
+        document.cookie.match(main_css_regex_data('main_css_darkmode'))[1] === '1'
     ) {
         head_data.innerHTML += '' +
             '<link rel="stylesheet" href="/views/main_css/css/sub/dark.css?ver=5">' +

+ 186 - 0
views/ringo/css/main.css

@@ -0,0 +1,186 @@
+body {
+    margin: 0;
+}
+
+html {
+    background: #eee;
+}
+
+header#main {
+    border-bottom: 0;
+    
+    line-height: 50px;
+    
+    padding-left: 20px;
+    padding-right: 20px;
+    
+    background-color: #99ddff;
+}
+
+header#main a {
+    color: black;
+}
+
+header#main span#right {
+    float: right;
+}
+
+header#main form.not_mobile input.search {
+    display: inline-block;
+    
+    width: 200px;
+}
+
+header#main form.not_mobile {
+    display: inline-block;
+}
+
+input.search {
+    height: 35px;
+    
+    vertical-align: middle;
+    
+    margin-top: -5px;
+    
+    border: 0;
+    
+    padding: 10px;
+}
+
+input.only_mobile.search {
+    width: calc(100% - 70px);
+    
+    display: inline-block;
+}
+
+input.search:focus-visible {
+    outline: none;
+}
+
+button.search_button {
+    width: 35px;
+    height: 35px;
+    
+    vertical-align: middle;
+    
+    margin-top: -5px;
+    margin-left: -5px;
+    
+    border: 0;
+    
+    font-size: 20px;
+    
+    line-height: 0px;
+}
+
+button.search_button#goto {
+    background-color: #ccffbb;
+}
+
+button.search_button#search {
+    background-color: #ffeecc;
+}
+
+aside {
+    width: 250px;
+    
+    float: left;
+    
+    display: inline-block;
+    
+    padding-top: 10px;
+    padding-left: 20px;
+    padding-right: 20px;
+    
+    background-color: #ffeaee;
+    
+    height: calc(100vh - (50px + 20px));
+}
+
+aside button {
+    width: 25%;
+}
+
+section {
+    width: calc(100% - (250px + 40px));
+    
+    display: inline-block;
+    
+    border-left: 0px solid;
+    
+    background-color: white;
+}
+
+header#section {
+    padding-top: 11px;
+    padding-bottom: 11px;
+    
+    border-bottom: 0px solid;
+    
+    background-color: #cceeff;
+}
+
+article.main {
+    max-width: 1000px;
+    
+    padding-left: 20px;
+    padding-right: 20px;
+    
+    margin: auto;
+}
+
+article.main#content {
+    padding-top: 20px;
+    
+    min-height: 400px;
+}
+
+article.main#title h1 {
+    margin: 0;
+}
+
+.only_mobile, header#main form.only_mobile {
+    display: none;
+}
+
+@media screen and (max-width: 1000px) {    
+    aside {        
+        float: none;
+        
+        border-top: 0px solid;
+        
+        width: calc(100vw - 40px);
+        height: 100%;
+        
+        padding: 20px;
+    }
+    
+    section {
+        width: 100vw;
+        
+        padding-bottom: 20px;
+        
+        border-left: 0;
+    }
+    
+    .not_mobile, header#main form.not_mobile {
+        display: none;
+    }
+    
+    .only_mobile, header#main form.only_mobile {
+        display: block;
+    }
+}
+
+footer {
+    border-top: 0px solid;
+    
+    margin-top: 20px;
+    background: #eee;
+    
+    padding: 20px;
+}
+
+footer.only_mobile {
+    margin-top: 0px;
+}

+ 107 - 0
views/ringo/index.html

@@ -0,0 +1,107 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <meta charset="utf-8">
+        {% if imp[3][0] != 0 %}
+            <title>{{imp[0]}} {{imp[3][0]}} - {{imp[1][0]}}</title>
+        {% else %}
+            <title>{{imp[0]}} - {{imp[1][0]}}</title>
+        {% endif %}
+        {{imp[3][3]|safe}}
+        <script src="https://code.iconify.design/1/1.0.3/iconify.min.js"></script>
+        <link rel="stylesheet" href="/views/ringo/css/main.css?ver=1">
+        <link rel="shortcut icon" href="/views/main_css/file/favicon.ico?ver=1">
+        {{imp[1][5]|safe}}
+        {{imp[2][3]|safe}}
+        {% if imp[3][0] != 0 %}
+            <meta name="title" content="{{imp[0]}}{{imp[3][0]}} - {{imp[1][0]}}">
+        {% else %}
+            <meta name="title" content="{{imp[0]}} - {{imp[1][0]}}">
+        {% endif %}
+        <meta name="keywords" content="{{imp[0]}}">
+        {% if imp[2][12] != 0 and imp[2][12] == 'w' %}
+            <meta name="description" content="{{data|cut_100}}">
+        {% endif %}
+        <meta name="viewport" content="width=device-width, initial-scale=1">
+    </head>
+    <body>
+        <header id="main">
+            <span id="left">
+                <span id="logo"><a href="/">{{imp[1][4]|safe}}</a></span>
+            </span>
+            <span id="right">
+                <span class="top_cel" id="">
+                    <span class="iconify" data-icon="ic:baseline-access-time" data-inline="true"></span>
+                    <span class="not_mobile">{{'list'|load_lang}}</span>
+                    <span class="iconify" data-icon="ic:baseline-arrow-drop-down" data-inline="true"></span>
+                </span>
+                <span class="top_cel" id="">
+                    <span class="iconify" data-icon="ic:baseline-archive" data-inline="true"></span>
+                    <span class="not_mobile">{{'tool'|load_lang}}</span>
+                    <span class="iconify" data-icon="ic:baseline-arrow-drop-down" data-inline="true"></span>
+                </span>
+                <span class="top_cel" id="">
+                    {% if imp[2][2] == 1 %}
+                        {% if imp[2][8] != '0' %}
+                            <span class="iconify" data-icon="ic:baseline-add-alert" data-inline="true"></span>
+                        {% else %}
+                            <span class="iconify" data-icon="ic:baseline-person-add" data-inline="true"></span>
+                        {% endif %}
+                    {% else %}
+                        <span class="iconify" data-icon="ic:baseline-person" data-inline="true"></span>
+                    {% endif %}
+                    <span class="not_mobile">{{'tool'|load_lang}}</span>
+                    <span class="iconify" data-icon="ic:baseline-arrow-drop-down" data-inline="true"></span>
+                </span>
+                <form class="not_mobile" method="post" action="/search" role="search">
+                    <input class="not_mobile search" name="search" placeholder="{{'search'|load_lang}}" autocomplete="off" type="search">
+                    <button type="submit" id="goto" formaction="/goto" class="search_button">
+                        <span class="iconify" data-icon="ic:round-find-in-page" data-inline="true"></span>
+                    </button>
+                    <button type="submit" id="search" formaction="/search" class="search_button">
+                        <span class="iconify" data-icon="ic:baseline-search" data-inline="true"></span>
+                    </button>
+                </form>
+            </span>
+            <form class="only_mobile" method="post" action="/search" role="search">
+                <input class="only_mobile search" name="search" placeholder="{{'search'|load_lang}}" autocomplete="off" type="search">
+                <button type="submit" id="goto" formaction="/goto" class="search_button">
+                    <span class="iconify" data-icon="ic:round-find-in-page" data-inline="true"></span>
+                </button>
+                <button type="submit" id="search" formaction="/search" class="search_button">
+                    <span class="iconify" data-icon="ic:baseline-search" data-inline="true"></span>
+                </button>
+            </form>
+        </header>
+        <section>
+            <header id="section">
+                <article class="main" id="title">
+                    <h1><span class="change_space">{{imp[0]}}</span></h1>
+                </article>
+            </header>
+            <article class="main" id="content">
+                {{data|safe}}
+            </article>
+            <footer class="not_mobile">
+                <article class="main" id="footer">
+                    {{imp[1][1]|safe}}
+                    <br>
+                    <br>
+                    <a href="https://github.com/openNAMU/openNAMU"><img id="b_logo" src="/views/main_css/file/s_logo.png"></a>
+                </article>
+            </footer>
+        </section>
+        <aside>
+            <button class="side_button selected">A</button><!--
+         --><button class="side_button">B</button><!--
+         --><button class="side_button">C</button><!--
+         --><button class="side_button">D</button>
+        </aside>
+        <footer class="only_mobile">
+            {{imp[1][1]|safe}}
+            <br>
+            <br>
+            <a href="https://github.com/openNAMU/openNAMU"><img id="b_logo" src="/views/main_css/file/s_logo.png"></a>
+        </footer>
+    </body>
+</html>

+ 26 - 11
views/tenshi/index.html

@@ -131,18 +131,33 @@
                 <div id="main_top">
                     {% if menu != 0 %}
                         <div id="tool" class="not_mobile">
-                            {% for sub_d in menu %}
-                                <div id="tool_cel">
-                                    {% if sub_d|length > 2 and sub_d[2] == 1 %}
-                                        <a class="menu-item" href="/{{sub_d[0]}}" id="topic_color">{{sub_d[1]}}</a>
-                                    {% else %}
-                                        <a class="menu-item" href="/{{sub_d[0]}}">{{sub_d[1]}}</a>
+                            {% if menu[0] == 1 %}
+                                {% for sub_d in menu %}
+                                    <div id="tool_cel">
+                                        {% if sub_d|length > 2 and sub_d[2] == 1 %}
+                                            <a class="menu-item" href="{{sub_d[0]}}" id="topic_color">{{sub_d[1]}}</a>
+                                        {% else %}
+                                            <a class="menu-item" href="{{sub_d[0]}}">{{sub_d[1]}}</a>
+                                        {% endif %}
+                                    </div>
+                                    {% if menu[loop.index] %}
+                                        |
                                     {% endif %}
-                                </div>
-                                {% if menu[loop.index] %}
-                                    |
-                                {% endif %}
-                            {% endfor %}
+                                {% endfor %}
+                            {% else %}
+                                {% for sub_d in menu %}
+                                    <div id="tool_cel">
+                                        {% if sub_d|length > 2 and sub_d[2] == 1 %}
+                                            <a class="menu-item" href="/{{sub_d[0]}}" id="topic_color">{{sub_d[1]}}</a>
+                                        {% else %}
+                                            <a class="menu-item" href="/{{sub_d[0]}}">{{sub_d[1]}}</a>
+                                        {% endif %}
+                                    </div>
+                                    {% if menu[loop.index] %}
+                                        |
+                                    {% endif %}
+                                {% endfor %}
+                            {% endif %}
                         </div>
                     {% endif %}
                     <h1 id="title">

Unele fișiere nu au fost afișate deoarece prea multe fișiere au fost modificate în acest diff