diff options
author | 2022-08-16 22:08:39 +0400 | |
---|---|---|
committer | 2022-08-16 22:08:39 +0400 | |
commit | 7c240c68e24c0f3bf041522ce21de271cb92c6f3 (patch) | |
tree | 6b714750a6cf71dbb6b68a9c2081367ba7f76431 | |
parent | Add Tag Metadata (diff) |
Better Split Up Tag Commit Messages
Signed-off-by: Hassan Abouelela <[email protected]>
-rw-r--r-- | pydis_site/apps/content/models/tag.py | 5 | ||||
-rw-r--r-- | pydis_site/templates/content/tag.html | 4 |
2 files changed, 8 insertions, 1 deletions
diff --git a/pydis_site/apps/content/models/tag.py b/pydis_site/apps/content/models/tag.py index 3c729768..c504ce21 100644 --- a/pydis_site/apps/content/models/tag.py +++ b/pydis_site/apps/content/models/tag.py @@ -23,6 +23,11 @@ class Commit(models.Model): """The URL to the commit on GitHub.""" return self.URL_BASE + self.sha + def lines(self) -> collections.abc.Iterable[str]: + """Return each line in the commit message.""" + for line in self.message.split("\n"): + yield line + def format_users(self) -> collections.abc.Iterable[str]: """Return a nice representation of the user(s)' name and email.""" for author in json.loads(self.author): diff --git a/pydis_site/templates/content/tag.html b/pydis_site/templates/content/tag.html index 513009da..655dd786 100644 --- a/pydis_site/templates/content/tag.html +++ b/pydis_site/templates/content/tag.html @@ -31,7 +31,9 @@ <div class="dropdown-item">{{ user }}</div> {% endfor %} <div class="dropdown-divider"></div> - <div class="dropdown-item">{{ tag.last_commit.message }}</div> + {% for line in tag.last_commit.lines %} + <div class="dropdown-item">{{ line }}</div> + {% endfor %} </div> </div> </div> |