Explorar el Código

크롭 개선, 버그 수정

Surplus_Up (2DU) hace 7 años
padre
commit
ac8b4f6f67
Se han modificado 4 ficheros con 10 adiciones y 3 borrados
  1. 1 0
      app.py
  2. 3 3
      route/setting.py
  3. 3 0
      route/tool/func.py
  4. 3 0
      views/neo_yousoro/index.html

+ 1 - 0
app.py

@@ -70,6 +70,7 @@ class EverythingConverter(werkzeug.routing.PathConverter):
 
 app.jinja_env.filters['md5_replace'] = md5_replace
 app.jinja_env.filters['load_lang'] = load_lang
+app.jinja_env.filters['cut_100'] = cut_100
 
 app.url_map.converters['everything'] = EverythingConverter
 

+ 3 - 3
route/setting.py

@@ -259,10 +259,10 @@ def setting_2(conn, num):
                 
             curs.execute("select name from other where name = ? and coverage = ?", [info_d, coverage])
             if curs.fetchall():
-                curs.execute("update other set data = ?, coverage = ? where name = ?", [
+                curs.execute("update other set data = ? where name = ? and coverage = ?", [
                     flask.request.form.get('content', ''),
-                    coverage,
-                    info_d
+                    info_d,
+                    coverage
                 ])
             else:
                 curs.execute("insert into other (name, data, coverage) values (?, ?, ?)", [info_d, flask.request.form.get('content', ''), coverage])

+ 3 - 0
route/tool/func.py

@@ -435,6 +435,9 @@ def other2(data):
 
     return data
 
+def cut_100(data):
+    return re.sub('<(((?!>).)*)>', '', data)[0:100] + '...'
+
 def wiki_set(num = 1):
     if num == 1:
         data_list = []

+ 3 - 0
views/neo_yousoro/index.html

@@ -14,6 +14,9 @@
         <link rel="shortcut icon" href="/views/main_css/file/favicon.ico">
         {{imp[1][5]|safe}}
         {{imp[2][3]|safe}}
+        <meta name="title" content="{{imp[0]}} - {{imp[1][0]}}">
+        <meta name="keywords" content="{{imp[1][0]}}">
+        <meta name="description" content="{{data|cut_100}}">
         <meta name="viewport" content="width=device-width, initial-scale=1">
     </head>
     <body>