Refactor template content_title()
and prev/next buttons feature
those were intertwined but now are a bit more separate, much better
This commit is contained in:
parent
9f743daf07
commit
eafe3737dc
8 changed files with 72 additions and 45 deletions
|
@ -83,7 +83,25 @@
|
|||
</div><!-- global -->
|
||||
|
||||
<div class="page">
|
||||
${self.content_title()}
|
||||
% if capture(self.content_title):
|
||||
|
||||
% if show_prev_next is not Undefined and show_prev_next:
|
||||
<div style="float: right;">
|
||||
% if prev_url:
|
||||
${h.link_to("« Older", prev_url, class_='button autodisable')}
|
||||
% else:
|
||||
${h.link_to("« Older", '#', class_='button', disabled='disabled')}
|
||||
% endif
|
||||
% if next_url:
|
||||
${h.link_to("Newer »", next_url, class_='button autodisable')}
|
||||
% else:
|
||||
${h.link_to("Newer »", '#', class_='button', disabled='disabled')}
|
||||
% endif
|
||||
</div>
|
||||
% endif
|
||||
|
||||
<h1>${self.content_title()}</h1>
|
||||
% endif
|
||||
</div>
|
||||
</header>
|
||||
|
||||
|
@ -136,7 +154,7 @@
|
|||
<%def name="title()"></%def>
|
||||
|
||||
<%def name="content_title()">
|
||||
<h1>${self.title()}</h1>
|
||||
${self.title()}
|
||||
</%def>
|
||||
|
||||
<%def name="header_core()">
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
</%def>
|
||||
|
||||
<%def name="content_title()">
|
||||
<h1>History for ${instance_title}</h1>
|
||||
History for ${instance_title}
|
||||
</%def>
|
||||
|
||||
${grid.render_complete()|n}
|
||||
|
|
|
@ -26,21 +26,7 @@
|
|||
</%def>
|
||||
|
||||
<%def name="content_title()">
|
||||
% if master.supports_prev_next:
|
||||
<div style="float: right;">
|
||||
% if prev_instance:
|
||||
${h.link_to(u"« Older", url('{}.view'.format(route_prefix), uuid=prev_instance.uuid), class_='button autodisable')}
|
||||
% else:
|
||||
${h.link_to(u"« Older", '#', class_='button', disabled='disabled')}
|
||||
% endif
|
||||
% if next_instance:
|
||||
${h.link_to(u"Newer »", url('{}.view'.format(route_prefix), uuid=next_instance.uuid), class_='button autodisable')}
|
||||
% else:
|
||||
${h.link_to(u"Newer »", '#', class_='button', disabled='disabled')}
|
||||
% endif
|
||||
</div>
|
||||
% endif
|
||||
<h1>${instance_title}</h1>
|
||||
${instance_title}
|
||||
</%def>
|
||||
|
||||
<%def name="context_menu_items()">
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<%def name="title()">${model_title}</%def>
|
||||
|
||||
<%def name="content_title()">
|
||||
<h1>${row_title}</h1>
|
||||
${row_title}
|
||||
</%def>
|
||||
|
||||
<%def name="context_menu_items()">
|
||||
|
|
|
@ -5,22 +5,6 @@
|
|||
|
||||
## TODO: this was basically copied from Revel diff template..need to abstract
|
||||
|
||||
<%def name="content_title()">
|
||||
<div style="float: right;">
|
||||
% if previous_transaction:
|
||||
${h.link_to(u"« Older", url('{}.version'.format(route_prefix), uuid=instance.uuid, txnid=previous_transaction.id), class_='button')}
|
||||
% else:
|
||||
${h.link_to(u"« Older", '#', class_='button', disabled='disabled')}
|
||||
% endif
|
||||
% if next_transaction:
|
||||
${h.link_to(u"Newer »", url('{}.version'.format(route_prefix), uuid=instance.uuid, txnid=next_transaction.id), class_='button')}
|
||||
% else:
|
||||
${h.link_to(u"Newer »", '#', class_='button', disabled='disabled')}
|
||||
% endif
|
||||
</div>
|
||||
<h1>${self.title()}</h1>
|
||||
</%def>
|
||||
|
||||
<div class="form-wrapper">
|
||||
|
||||
<div class="form">
|
||||
|
|
|
@ -160,7 +160,25 @@
|
|||
## Page Title
|
||||
<section id="content-title" class="hero is-primary">
|
||||
<div class="container">
|
||||
${self.content_title()}
|
||||
% if capture(self.content_title):
|
||||
|
||||
% if show_prev_next is not Undefined and show_prev_next:
|
||||
<div style="float: right;">
|
||||
% if prev_url:
|
||||
${h.link_to("« Older", prev_url, class_='button autodisable')}
|
||||
% else:
|
||||
${h.link_to("« Older", '#', class_='button', disabled='disabled')}
|
||||
% endif
|
||||
% if next_url:
|
||||
${h.link_to("Newer »", next_url, class_='button autodisable')}
|
||||
% else:
|
||||
${h.link_to("Newer »", '#', class_='button', disabled='disabled')}
|
||||
% endif
|
||||
</div>
|
||||
% endif
|
||||
|
||||
<h1 class="title">${self.content_title()}</h1>
|
||||
% endif
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
@ -208,7 +226,7 @@
|
|||
<%def name="title()"></%def>
|
||||
|
||||
<%def name="content_title()">
|
||||
<h1 class="title">${self.title()}</h1>
|
||||
${self.title()}
|
||||
</%def>
|
||||
|
||||
<%def name="header_core()">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue