add display of issue title in lists
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import uuid
|
import uuid
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from typing import Dict, List, Optional, Any
|
from typing import AnyStr, Dict, List, Optional, Any
|
||||||
from natsort import natsorted
|
from natsort import natsorted
|
||||||
from sqlalchemy import Column, ForeignKey, Integer, String, Boolean, func
|
from sqlalchemy import Column, ForeignKey, Integer, String, Boolean, func
|
||||||
from sqlalchemy.orm import relationship, Mapped, mapped_column
|
from sqlalchemy.orm import relationship, Mapped, mapped_column
|
||||||
@@ -107,6 +107,12 @@ class Issue(Base, BaseMixin):
|
|||||||
story_arc = relationship("StoryArc", back_populates="issues")
|
story_arc = relationship("StoryArc", back_populates="issues")
|
||||||
issue_works = relationship("IssueWork")
|
issue_works = relationship("IssueWork")
|
||||||
|
|
||||||
|
def get_full_title(self) -> AnyStr:
|
||||||
|
full_title: AnyStr = self.issue_number
|
||||||
|
if self.title:
|
||||||
|
full_title += ": " + self.title
|
||||||
|
return full_title
|
||||||
|
|
||||||
def get_artists(self) -> Dict[Any, List[Any]]:
|
def get_artists(self) -> Dict[Any, List[Any]]:
|
||||||
works: Dict[Any, List[Any]] = {}
|
works: Dict[Any, List[Any]] = {}
|
||||||
for work in self.issue_works:
|
for work in self.issue_works:
|
||||||
|
|||||||
@@ -31,6 +31,7 @@
|
|||||||
<th scope="row">Link</th>
|
<th scope="row">Link</th>
|
||||||
<td colspan="2">{{comic.weblink}}</td>
|
<td colspan="2">{{comic.weblink}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
{% if comic.get_artists()|length > 0 %}
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">Works</th>
|
<th scope="row">Works</th>
|
||||||
<td colspan="2">
|
<td colspan="2">
|
||||||
@@ -46,6 +47,7 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
{% endif %}
|
||||||
{% if comic.volumes|length > 0 %}
|
{% if comic.volumes|length > 0 %}
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">Volumes</th>
|
<th scope="row">Volumes</th>
|
||||||
@@ -63,7 +65,7 @@
|
|||||||
<td colspan="2">
|
<td colspan="2">
|
||||||
<ul>
|
<ul>
|
||||||
{% for issue in comic.sorted_issues() %}
|
{% for issue in comic.sorted_issues() %}
|
||||||
<li><a href="/comic/issues/{{issue.id}}">{{issue.issue_number}}</a></li>
|
<li><a href="/comic/issues/{{issue.id}}">{{issue.get_full_title()}}</a></li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
Reference in New Issue
Block a user