Merge pull request #3 from strboul/nice-mode

Make sukela nice mode consistent
pull/4/head
beucismis 1 year ago committed by GitHub
commit 8b60525aae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      ozgursozluk/api.py
  2. 6
      ozgursozluk/templates/topic.html

@ -66,6 +66,7 @@ class Topic:
pagecount: int
permalink: str
entrys: Iterator[Entry]
nice: bool | None = None
def title_id(self) -> str:
return _unicode_tr(f"{self.title}--{self.id}")
@ -129,6 +130,7 @@ class Eksi:
int(pager.attrs["data-pagecount"]) if pager is not None else 0,
self.base_url + h1.find("a", href=True)["href"],
self._get_entrys(soup),
a == "nice",
)
def get_entry(self, id: str) -> Topic:

@ -7,7 +7,13 @@
<div>
<p>
{{ topic.title }} - şükela:
{% if topic.nice %}
<a href="{{ url_for('topic', title=topic.title_id()) }}">
<b>nice</b>
</a>
{% else %}
<a href="{{ url_for('topic', title=topic.title_id(), p=p, a='nice') }}">nice</a>
{% endif %}
</p>
</div>
<div>

Loading…
Cancel
Save