Parcourir la source

feat: 优化手机端体验

SongZihuan il y a 3 ans
Parent
commit
9a9d3fb00d
3 fichiers modifiés avec 16 ajouts et 13 suppressions
  1. 1 1
      app/test.py
  2. 1 1
      templates/base.html
  3. 14 11
      templates/test.html

+ 1 - 1
app/test.py

@@ -30,7 +30,7 @@ class ResetDeleteForm(FlaskForm):
 
 
 class UploadFile(FlaskForm):
-    file = FileField()
+    file = FileField("File")
     submit = SubmitField("Upload")
 
 

+ 1 - 1
templates/base.html

@@ -25,7 +25,7 @@
 </head>
 <body>
 
-<h1 class="text-center mt-2"> Welcome to {{ title }} ! </h1>
+<h1 class="text-center m-1"> Welcome to {{ title }} ! </h1>
 <p class="col-8 offset-2 text-center" > <a href="{{ url_for("test.introduce") }}"> {{ about }} </a> </p>
 
 <section class="container mt-2 mb-2">

+ 14 - 11
templates/test.html

@@ -146,9 +146,10 @@
                     </form>
 
                     <div class="col-12 col-lg-6 offset-lg-3 text-left">
-                        <p class="h4 mb-2"> User: {{ current_user.user }} </p>
-                        <p> You have {{ box_sum }} word(s) in database. </p>
-                        <div class="col-12 justify-content-around text-center mb-2">
+                        <p class="h4 mb-2 col-12"> User: {{ current_user.user }} </p>
+                        <p class="col-12"> You have {{ box_sum }} word(s) in database. </p>
+
+                        <div class="col-12 text-center mb-2">
                             <a class="btn btn-light mr-2 mb-2" href="{{ url_for("word_list.show_box_word", box=1) }}" >
                                 <span class="small"> Box1: {{ box[0] }} </span> </a>
                             <a class="btn btn-light mr-2 mb-2" href="{{ url_for("word_list.show_box_word", box=2) }}">
@@ -161,14 +162,16 @@
                                 <span class="small"> Box5: {{ box[4] }} </span> </a>
                         </div>
 
-                        <a class="col-12 btn btn-primary mr-2 mb-2" href="{{ url_for("word_list.show_all_word") }}"> Word List </a>
-                        <div class="btn-group mb-2 col-12">
-                            <a class="btn btn-dark" href="{{ url_for("test.download_table", file_type="csv") }}"> csv </a>
-                            <a class="btn btn-secondary" href="{{ url_for("test.download_table", file_type="xlsx") }}"> xlsx </a>
-                            <a class="btn btn-success" href="{{ url_for("test.download_table", file_type="json") }}"> json </a>
-                            <a class="btn btn-danger" href="{{ url_for("test.download_table", file_type="markdown") }}"> md </a>
-                            <a class="btn btn-warning" href="{{ url_for("test.download_table", file_type="latex") }}"> latex </a>
-                            <a class="btn btn-light" href="{{ url_for("test.download_table", file_type="html") }}"> html </a>
+                        <a class="col-12 btn btn-primary mb-2" href="{{ url_for("word_list.show_all_word") }}"> Word List </a>
+                        <div class="text-center">
+                            <div class="btn-group mb-2" role="group">
+                                <a class="btn btn-dark" href="{{ url_for("test.download_table", file_type="csv") }}"> csv </a>
+                                <a class="btn btn-secondary" href="{{ url_for("test.download_table", file_type="xlsx") }}"> xlsx </a>
+                                <a class="btn btn-success" href="{{ url_for("test.download_table", file_type="json") }}"> json </a>
+                                <a class="btn btn-danger" href="{{ url_for("test.download_table", file_type="markdown") }}"> md </a>
+                                <a class="btn btn-warning" href="{{ url_for("test.download_table", file_type="latex") }}"> latex </a>
+                                <a class="btn btn-light" href="{{ url_for("test.download_table", file_type="html") }}"> html </a>
+                            </div>
                         </div>
 
                         <form method="post" action="{{ url_for("test.search") }}" class="mb-2">