Skip to content

Commit 68fb521

Browse files
authored
Merge pull request #6740 from LMFDB/main
main -> dev
2 parents 0e3c9c2 + 472b969 commit 68fb521

File tree

9 files changed

+180
-101
lines changed

9 files changed

+180
-101
lines changed

lmfdb/app.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,17 @@ def top_rcs():
366366
bread = [(t, " ")]
367367
return render_template("single.html", kid="rcs", title=t, bread=bread)
368368

369+
@app.route("/announcements")
370+
def announcements():
371+
t = "Announcements"
372+
bread = [(t, " ")]
373+
return render_template("single.html", kid="content.announcements", title=t, bread=bread)
374+
375+
@app.route("/ongoing")
376+
def ongoing():
377+
t = "Ongoing projects"
378+
bread = [(t, " ")]
379+
return render_template("single.html", kid="content.ongoing", title=t, bread=bread)
369380

370381
@app.route("/health")
371382
@app.route("/alive")

lmfdb/belyi/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ def download_galmap_magma(self, label, lang="magma"):
490490
s += "// Magma code for Belyi map with label %s\n\n" % label
491491
s += "\n// Group theoretic data\n\n"
492492
s += "d := %s;\n" % rec["deg"]
493-
s += "i := %s;\n" % int(label.split("T")[1][0])
493+
s += "i := %s;\n" % int(label.split("T")[1].split("-")[0])
494494
s += "G := TransitiveGroup(d,i);\n"
495495
s += "sigmas := %s;\n" % self.perm_maker(rec, lang)
496496
s += "embeddings := %s;\n" % self.embedding_maker(rec, lang)

lmfdb/characters/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ def render_DirichletNavigation():
327327
info['rows'] = list(range(modulus_start, modulus_end + 1))
328328
info['cols'] = sorted({r[1] for r in entries})
329329
return render_template("ModulusList.html", **info)
330-
except ValueError as err:
330+
except (ValueError, IndexError) as err:
331331
flash_error("Error raised in parsing: %s", err)
332332

333333
if request.args:

lmfdb/homepage/boxes.py

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,31 @@
55

66

77
class Box():
8-
def __init__(self, title):
9-
self.title = title
10-
self.content = None
11-
self.links = []
12-
self.target = url_for('index')
13-
self.img = None
14-
15-
def add_link(self, title, href):
16-
self.links.append((title, href))
8+
def __init__(self, data):
9+
self.title = data["title"]
10+
self.img = url_for('static', filename=f'images/{data["image"]}.png')
11+
if self.title == "Announcements":
12+
# Dynamic content generated from knowl
13+
from lmfdb.knowledge.knowl import knowldb
14+
from lmfdb.knowledge.main import md
15+
max_entries = 3
16+
content = [line.strip() for line in
17+
knowldb.get_knowl("content.announcements", ["content"])["content"].split("\n")]
18+
# Only keep lines that are part of an unordered list
19+
content = [line for line in content if line.startswith("* ") or line.startswith("- ") or line.startswith("+ ")]
20+
overflow = len(content) > max_entries
21+
content = content[:max_entries]
22+
content = "\n".join(content)
23+
if overflow:
24+
content += "\n* [More...](/announcements)    (and [ongoing projects](/ongoing))"
25+
else:
26+
content += "\n* See also [ongoing projects](/ongoing)"
27+
self.content = md.convert(content)
28+
else:
29+
self.content = data["content"]
1730

1831
@cached_function
1932
def load_boxes():
20-
boxes = []
2133
_curdir = os.path.dirname(os.path.abspath(__file__))
2234
with open(os.path.join(_curdir, "index_boxes.yaml")) as boxfile:
23-
listboxes = yaml.load_all(boxfile, Loader=yaml.FullLoader)
24-
for b in listboxes:
25-
B = Box(b['title'])
26-
B.content = b['content']
27-
if 'image' in b:
28-
B.img = url_for('static', filename='images/'+b['image']+'.png')
29-
for title, url in b['links']:
30-
B.add_link(title, url)
31-
boxes.append(B)
32-
return boxes
35+
return [Box(b) for b in yaml.load_all(boxfile, Loader=yaml.FullLoader)]

lmfdb/homepage/index_boxes.yaml

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,21 @@ title: A database
33
image: families
44
content: <p>The LMFDB is a database of mathematical objects arising in number theory and arithmetic geometry that illustrates some of the mathematical connections predicted by the Langlands program.</p>
55
<p>Click a heading on the left to browse, or <a href="/random">go to a random page</a>.</p>
6-
control: 1
7-
links:
8-
- [ 0,0 ]
96
---
107
title: Announcements
11-
content: <p>Check out the recently updated <a href="/Groups/Abstract/">abstract groups</a> database.</p>
12-
<p>Check out the new <a href="/ModularCurve/Q/">modular curves</a> database [beta].</p>
138
image: announcements
14-
control: 0
15-
links:
16-
- [ 0,0 ]
179
---
1810
title: Learn more
1911
image: smalluniverse
2012
content: <p>Information is available regarding the <a href="/rcs">source, reliability, and completeness</a> of the database.</p>
2113
<p><a href="/knowledge/show/doc.knowl">Knowls</a> provide explanations when you need them.</p><p><a href="/intro">Overview</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="/universe">LMFDB universe</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="/knowledge/">Knowledge</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="/api/">Data</a></p>
22-
control: 0
23-
links:
24-
- [ 0,0 ]
2514
---
2615
title: Citations and acknowledgments
2716
image: citations
2817
content: <ul>
2918
<li><a href="/citation">How to cite the LMFDB</a></li>
30-
<li><a href="https://github.com/LMFDB/lmfdb">Source code repository</li>
31-
<li><a href="/management">Editorial board</li>
32-
<li><a href="/acknowledgment">Acknowledgments</li>
33-
<li><a href="/acknowledgment/activities">Activities</li>
19+
<li><a href="https://github.com/LMFDB/lmfdb">Source code repository</a></li>
20+
<li><a href="/management">Editorial board</a></li>
21+
<li><a href="/acknowledgment">Acknowledgments</a> and <a href="/acknowledgment/activities">activities</a></li>
3422
</ul>
35-
control: 0
36-
links:
37-
- [ 0,0 ]
3823
...

lmfdb/knowledge/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,7 @@ def render_knowl(ID, footer=None, kwargs=None,
755755
# the idea is to pass the keyword arguments of the knowl further along the chain
756756
# of links, in this case the title and the permalink!
757757
# so, this kw_params should be plain python, e.g. "a=1, b='xyz'"
758-
kw_params = ', '.join(('%s="%s"' % (k, v) for k, v in kwargs.items()))
758+
kw_params = ', '.join(('%s="%s"' % (key, val) for key, val in kwargs.items()))
759759
logger.debug("kw_params: %s" % kw_params)
760760

761761
# this is a very simple template based on no other template to render one single Knowl

lmfdb/lmfdb_database.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class LMFDBStatsTable(PostgresStatsTable):
2727

2828

2929
# These are the operations where we don't insert records into the ongoing_operations table since they don't take noticeable space.
30-
_nolog_changetypes = ["delete", "resort", "add_column", "drop_column", "create_extra_table", "move_column"]
30+
_nolog_changetypes = ["delete", "resort", "add_column", "drop_column", "create_table", "create_extra_table", "move_column"]
3131

3232

3333
class LMFDBSearchTable(PostgresSearchTable):

0 commit comments

Comments
 (0)