Forráskód Böngészése

config file works

bscheibel 4 éve
szülő
commit
4776ae179e
4 módosított fájl, 139 hozzáadás és 16 törlés
  1. 107 0
      app/config.json
  2. 12 11
      app/templates/index.html
  3. 7 4
      app/templates/show_pdf.html
  4. 13 1
      app/views.py

+ 107 - 0
app/config.json

@@ -0,0 +1,107 @@
+{
+   "Ra":{
+      "ISO4287":[
+         "Symbole",
+         "Tabelle",
+         "Definition"
+      ]
+   },
+   "Rpk":{
+      "ISO4287":[
+         "Symbole",
+         "Tabelle",
+         "Definition"
+      ]
+   },
+  "Rz":{
+    "ISO14405-1" : [
+      "Symbole",
+      "Tabelle",
+      "Definition"]
+  },
+    "CT":{
+    "ISO14405-1" : [
+      "Symbole",
+      "Tabelle",
+      "Definition"]
+  },
+    "GX":{
+    "ISO14405-1" : [
+      "Symbole",
+      "Tabelle",
+      "Definition"]
+  },
+    "GG":{
+    "ISO14405-1" : [
+      "Symbole",
+      "Tabelle",
+      "Definition"]
+  },
+    "H\\d{1,2}":{
+    "ISO286-1" : [
+      "Symbole",
+      "Tabelle",
+      "Definition"]
+  },
+    "h\\d{1,2}":{
+    "ISO286-1" : [
+      "Symbole",
+      "Tabelle",
+      "Definition"]
+  },
+    "M\\d{1,2}":{
+    "ISO6410" : [
+      "Symbole",
+      "Tabelle",
+      "Definition"]
+  },
+    "\u27C2":{
+    "ISO1101" : [
+      "Symbole",
+      "Tabelle",
+      "Definition"]
+  },
+    "\u25CE":{
+    "ISO1101" : [
+      "Symbole",
+      "Tabelle",
+      "Definition"]
+  },
+    "\u232D":{
+    "ISO1101" : [
+      "Symbole",
+      "Tabelle",
+      "Definition"]
+  },
+    "\u2225":{
+    "ISO1101" : [
+      "Symbole",
+      "Tabelle",
+      "Definition"]
+  },
+    "\u232F":{
+    "ISO1101" : [
+      "Symbole",
+      "Tabelle",
+      "Definition"]
+  },
+    "\u2316":{
+    "ISO1101" : [
+      "Symbole",
+      "Tabelle",
+      "Definition"]
+  },
+    "\u2313":{
+    "ISO1101" : [
+      "Symbole",
+      "Tabelle",
+      "Definition"]
+  },
+  "\u23E5":{
+    "ISO1101" : [
+      "Symbole",
+      "Tabelle",
+      "Definition"]
+  }
+}
+

+ 12 - 11
app/templates/index.html

@@ -74,22 +74,23 @@
 
         <ui-resizehandle data-label="drag to resize"></ui-resizehandle>
         <ui-area id="detailcolumn1" data-minsize="20em">
-          <h3 style="text-align:left"> Regulatory Documents</h3>
-            <div id="dat_details" class='x-ui-layout column-one'>
-                <tr>
+            <h3 style="text-align:center"> General Information</h3>
+            <div id="dat_details" class='x-ui-layout'>
+
+                <div class="column-one" style="width:50%;float:left">
+
                   {{ html_links | safe }}
-                </tr>
 
                 {% for iso in isos_names %}
-                <tr>
-                    <td style='text-align:left'> {{ iso }} (Document not available)</td><br>
-                </tr>
+                    {{ iso }} (Document not available)<br>
                 {% endfor %}
-            </div>
-            <div class="x-ui-layout column-two">
-                testtestetse
-            </div>
 
+                </div>
+                <div class="column-two" style="width:50%;float:right">
+
+                {{ html_general | safe }}
+                </div>
+            </div>
           <div id="measurements">
                 <font >
                 <form>

+ 7 - 4
app/templates/show_pdf.html

@@ -5,13 +5,15 @@
 <script src="//mozilla.github.io/pdf.js/build/pdf.js"></script>
  -->
 
-<!--<script type="javascript" src="//cdnjs.cloudflare.com/ajax/libs/pdf.js/2.3.200/pdf.js"></script>
- das funktioniert!!!!!
+<script type="javascript" src="//cdnjs.cloudflare.com/ajax/libs/pdf.js/2.3.200/pdf.js"></script>
+<!-- das funktioniert!!!!!
 <script type="javascript" src="https://unpkg.com/pdfjs-dist@latest/build/pdf.js" ></script>
-<script type="javascript" src="{{ url_for('static', filename='js/pdf.js') }}"></script>-->
-
+<script type="javascript" src="{{ url_for('static', filename='js/pdf.js') }}"></script>
 
 <script src="https://mozilla.github.io/pdf.js/build/pdf.js"></script>
+-->
+
+
 <script type="javascript" src="{{ url_for('static', filename='js/text_layer_builder.js') }}"></script>
 <script type="javascript" src="{{ url_for('static', filename='js/ui_utils.js') }}"></script>
 <body>
@@ -20,6 +22,7 @@
 
 
 var url = "{{ url_for('send_file', filename=og_filename) }}";
+console.log(og_filename);
 
 var pdfjsLib = window['pdfjs-dist/build/pdf'];
 

+ 13 - 1
app/views.py

@@ -41,6 +41,16 @@ def get_file_size(file):
     print(w,h)
     return w,h
 
+def check_config_file(d):
+    reg_search = d
+    #print(reg_search)
+
+    for conf in d:
+        print(conf)
+
+    return "blub"
+
+
 def check_links(isos):
     link_names = {}
     for name in isos:
@@ -97,6 +107,7 @@ def uploaded_file(filename, uuid):
         details = json.loads(db.get(str(uuid) + "details"))
         number_blocks = db.get(str(uuid)+"eps")
         html_code = ""
+        html_general = ""
         reg = r"(-?\d{1,}\.?\d*)"
         for dim in dims:
             print(dim)
@@ -137,7 +148,7 @@ def uploaded_file(filename, uuid):
 
                 for x in relevant_isos:
                     #html_code += "<td style='text-align:left'> <a href=" + url_for('static', filename="isos/"+x) + " >"+ x.partition(".")[0]  +"</a>  </td>"
-                    html_code += "<td style='text-align:left'> <a onclick=ui_add_tab_active('#main','" + x.partition(".")[0] + "','" + x.partition(".")[0] +"',true,'isotab')>" + x.partition(".")[0] + "</a>  </td>"
+                    html_code += "<td style='text-align:left' data-terms='" + terms + "'> <a onclick=ui_add_tab_active('#main','" + x.partition(".")[0] + "','" + x.partition(".")[0] +"',true,'isotab')>" + x.partition(".")[0] + "</a>  </td>"
                 #print(html_code)
         return render_template('show_image_old_working.html', filename=file_out, isos=isos, dims=dims, text=html_code, number=number_blocks, og_filename=filename, w=w, h=h, links=links)
 
@@ -194,3 +205,4 @@ def redis_set(key):
 @app.route('/index')
 def test():
     return render_template('index.html')
+