From a7c22f1a8d74758a2ef09acba895a89001f548ba Mon Sep 17 00:00:00 2001 From: Metin Yazici Date: Sun, 30 Apr 2023 22:38:32 +0200 Subject: [PATCH] Make sukela nice mode consistent We know about nice mode and clicking it again exits the nice mode - that's consistent with the original. --- ozgursozluk/api.py | 2 ++ ozgursozluk/templates/topic.html | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ozgursozluk/api.py b/ozgursozluk/api.py index 58ce358..3f88dd9 100644 --- a/ozgursozluk/api.py +++ b/ozgursozluk/api.py @@ -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: diff --git a/ozgursozluk/templates/topic.html b/ozgursozluk/templates/topic.html index 8e9623b..29aeb5e 100644 --- a/ozgursozluk/templates/topic.html +++ b/ozgursozluk/templates/topic.html @@ -6,8 +6,14 @@

- {{ topic.title }} - şükela: + {{ topic.title }} - şükela: + {% if topic.nice %} + + nice + + {% else %} nice + {% endif %}