Skip to content

Commit

Permalink
Improved labels in split mode
Browse files Browse the repository at this point in the history
  • Loading branch information
thvitt committed Oct 8, 2019
1 parent cb6bf28 commit 848d2a9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/macrogen/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,13 +406,13 @@ def reference(self, ref: Reference, index: Optional[int] = None, write_subpage:
getattr(wit, 'min_verse', ''), len(assertions), len(conflicts)),
id=f'idx{index}', class_=type(wit).__name__)
if write_subpage:
self._last_ref_subpage(DAY, ref)
self._last_ref_subpage(ref)
else:
wit = ref.reference if isinstance(ref, SplitReference) else ref
self.row((index, 0, format(wit), wit, '', '', getattr(wit, 'min_verse', ''), ''),
class_='pure-fade-40', title='Keine Macrogenesedaten', id=f'idx{index}')

def _last_ref_subpage(self, DAY, ref):
def _last_ref_subpage(self, ref):
"""Writes a subpage for ref, but only if it’s the last witness we just wrote"""
target = config.path.report_dir
if isinstance(ref, SplitReference):
Expand Down Expand Up @@ -477,7 +477,7 @@ def _last_ref_subpage(self, DAY, ref):
class_='delete' if delete_ else str(attr['kind']))
write_html(basename.with_suffix('.php'), report + assertionTable.format_table(),
breadcrumbs=[dict(caption='Referenzen', link='refs')],
head=str(ref), graph_id='refgraph')
head=ref.label, graph_id='refgraph')


class AssertionTable(HtmlTable):
Expand Down
3 changes: 3 additions & 0 deletions src/macrogen/splitgraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ def label(self) -> str:
def __str__(self):
return f"{self.reference} ({self.side.label})"

def __repr__(self):
return f"{self.__class__.__name__}({self.reference!r}, {self.side!s})"

@classmethod
def both(cls, reference):
start = cls(reference, Side.START)
Expand Down

0 comments on commit 848d2a9

Please sign in to comment.