minor changes & api change

master
Your Name 5 years ago
parent 2f38f54f0d
commit fb56053a4b

@ -13,3 +13,23 @@ img{
padding-bottom: 10px;
max-width: 50%;
}
.content{
padding-left: 50px;
display: none;
}
@media print {
.content{
display:block;
}
}
@media only screen and (max-width: 600px) {
#main{font-family: monospace;
max-width: 100%;
}
}

@ -37,7 +37,7 @@ ______ ______ ______ ______ __ ______
<label><input type="checkbox" name="links" value="links">Links</label>
</div-->
<div id="main">
<p class="mono">
<span class="mono">
POETIC SOFTWARE <br>
--------------- <br>
<br>
@ -58,6 +58,8 @@ POETIC SOFTWARE <br>
#+# #+# #+# #+# #+# #+# #+#+# #+#+# #+# #+# #+# #+# #+#
######## ######## ### ### ### ### ### ### ### ### ##########
</pre>
<label><input type="checkbox" id="showall" name="showall" value="showall">show all</label><br>
<br>
INTRODUCTION
{% for post in posts %}
@ -75,7 +77,9 @@ INTRODUCTION
{% for post in posts %}
{% if "thesis"|string() == post.category|string() %}
<div class="post">
<a href="min/{{ post.pid }}"><p>{{count|length}}. {{ post.title|safe }}<p></a></div>
<a href="min/{{ post.pid }}"><p>{{count|length}}. {{ post.title|safe }}<p></a>
<div class="content">{{ post.writingfield|safe }}</div></div>
{% set __ = count.append(1) %}
{% endif %}
{% else %}
@ -88,7 +92,9 @@ INTRODUCTION
{% for post in posts %}
{% if "exercise"|string() == post.category|string() %}
<div class="post">
<a href="min/{{ post.pid }}"><p>{{count|length}}. {{ post.title|safe }}<p></a></div>
<a href="min/{{ post.pid }}"><p>{{count|length}}. {{ post.title|safe }}<p></a>
<div class="content">{{ post.writingfield|safe }}</div>
</div>
{% set __ = count.append(1) %}
{% endif %}
{% else %}
@ -101,7 +107,9 @@ INTRODUCTION
{% for post in posts %}
{% if "concept"|string() == post.category|string() %}
<div class="post">
<a href="min/{{ post.pid }}"><p>{{ post.title|safe }}<p></a></div>
<a href="min/{{ post.pid }}"><p>{{ post.title|safe }}<p></a>
<div class="content">{{ post.writingfield|safe }}</div>
</div>
{% endif %}
{% else %}
<em>The Software is lacking a introduction, ask your system administrator about it.</em>
@ -109,9 +117,22 @@ INTRODUCTION
</p>
</span>
</div>
<script>
const checkbox = document.getElementById('showall')
checkbox.addEventListener('change', (event) => {
if (event.target.checked) {
$(".content").css({"display":"block"})
} else {
$(".content").css({"display":"none"})
}
})
</script>
</body>
</html>

@ -170,7 +170,7 @@ def get_words(query):
#text = cleanhtml(text)
regex = re.compile('[%s]' % re.escape(string.punctuation))
#text = regex.sub('', text)
soup = BeautifulSoup(text,"lxml")
soup = BeautifulSoup(text)
for id, word in enumerate(soup.prettify().split()):
if "<" not in word or ">" not in word or "=" not in word:
word = regex.sub('', word)
@ -199,7 +199,7 @@ def get_words(query):
#text = cleanhtml(text)
#regex = re.compile('[%s]' % re.escape(string.punctuation))
#text = regex.sub('', text)
soup = BeautifulSoup(text,"lxml")
soup = BeautifulSoup(text)
for id, word in enumerate(soup.prettify().split()):
if word.startswith(query) and ("<" not in word or ">" not in word or "=" not in word):
a = {}
@ -225,7 +225,7 @@ def replace_with(link, n, pid):
post = Posts.query.filter_by(pid=pid).first()
frompost = Posts.query.filter_by(pid=link).first()
html = post.writingfield
soup = BeautifulSoup(html,"lxml")
soup = BeautifulSoup(html)
words = soup.prettify().split()
words[n] = words[n]+" <a class='linkTo' href='"+str(link)+"'>→ "+frompost.title+"</a>"
print(words)

Loading…
Cancel
Save