Make sukela nice mode consistent

We know about nice mode and clicking it again exits the nice mode -
that's consistent with the original.
pull/3/head
Metin Yazici 1 year ago
parent 1e987af840
commit a7c22f1a8d
  1. 2
      ozgursozluk/api.py
  2. 8
      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:

@ -6,8 +6,14 @@
<div class="info">
<div>
<p>
{{ topic.title }} - şükela:
{{ 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