Add Brewfather links to yeast pages if available.

This commit is contained in:
Chris GIACOFEI 2024-06-03 15:39:54 -04:00
parent 17d8eab873
commit f293e4ec7b
3 changed files with 24 additions and 15 deletions

View File

@ -110,7 +110,7 @@
<footer class="bg-body-tertiary text-center fixed-bottom"> <footer class="bg-body-tertiary text-center fixed-bottom">
<!-- Copyright --> <!-- Copyright -->
<div class="text-center p-1" style="background-color: rgba(0, 0, 0, 0.1);"> <div class="text-center p-1" style="background-color: rgba(0, 0, 0, 0.1);">
&copy; Damn yankee Brewing 2010-{% now "Y" %} &copy; Damn Yankee Brewing 2010-{% now "Y" %}
</div> </div>
<!-- Copyright --> <!-- Copyright -->
</footer> </footer>

View File

@ -9,7 +9,11 @@
<div class="container"> <div class="container">
<h1>{{ batch.strain.name }}</h1> <h1>{{ batch.strain.name }}</h1>
<b>Source: {{ batch.get_source_display }}</b> <b>Source: {{ batch.get_source_display }}
{% if batch.source_batch %}
from <a href="{{ batch.beer_url }}" target="_blank" rel="noopener noreferrer">#{{ batch.beer_num }}: {{ batch.beer_name }}</a>
{% endif %}
</b>
<p><p> <p><p>
</div> <!-- /container --> </div> <!-- /container -->
@ -40,7 +44,7 @@
</fieldset> </fieldset>
</div> </div>
<div class="col-md-6 form-group"> <div class="col-md-6 form-group">
<legend>Print Labels for this Batch</legend> <legend>Print Selected Labels for this Batch</legend>
<p><p> <p><p>
<label for="skip_count">Number of labels already removed from the sheet: </label> <label for="skip_count">Number of labels already removed from the sheet: </label>
<input id="skip_count" type="number" name="skip_count" value=0 size="4"> <input id="skip_count" type="number" name="skip_count" value=0 size="4">

View File

@ -3,27 +3,32 @@
{% block title %}Yeast Samples{% endblock %} {% block title %}Yeast Samples{% endblock %}
{% block jumbotron %}Yeast Sample:{% endblock %} {% block jumbotron %}Yeast Sample:{% endblock %}
{% block jumbotronsub %}{{ sample.id }}{% endblock %} {% block jumbotronsub %}<a href="{% url 'admin:yeast_yeast_change' sample.id %}">{{ sample.id }}</a>{% endblock %}
{% block content %} {% block content %}
<div class="container"> <div class="container">
<h3>{{ batch.strain.name }}</h3> <h3>{{ batch.strain.name }}</h3>
Batch Source: {{ batch.get_source_display }}<br> <b>Batch Source:</b> {{ batch.get_source_display }}
Production Date: {{ sample.batch.production_date }}<br> {% if batch.source_batch %}
<a href="{% url 'admin:yeast_yeast_change' sample.id %}">Admin Page</a> from <a href="{{ batch.beer_url }}" target="_blank" rel="noopener noreferrer">#{{ batch.beer_num }}: {{ batch.beer_name }}</a>
{% endif %}<br>
<b>Production Date:</b> {{ sample.batch.production_date }}<br>
<p><p> <p><p>
{% for sample in batch.remaining_samples %} {% if batch.remaining_samples %}<h4>Batch Samples Remaining</h4>
<ul> <ul>
{% for sample in batch.remaining_samples %}
<li><a href="{% url 'yeast:yeast' sample.id %}">{{ sample.id }}</a> - Storage method: {{ sample.storage.name }} for {{ sample.age }} days, Viability: {{ sample.viability|mul:100|floatformat:1 }}%</li> <li><a href="{% url 'yeast:yeast' sample.id %}">{{ sample.id }}</a> - Storage method: {{ sample.storage.name }} for {{ sample.age }} days, Viability: {{ sample.viability|mul:100|floatformat:1 }}%</li>
</ul>
{% endfor %} {% endfor %}
</ul>
{% endif %}
{% for sample in batch.used_samples %} {% if batch.used_samples %}<h4>Batch Samples Used</h4>
<ul> <ul>
{% for sample in batch.used_samples %}
<li><a href="{% url 'yeast:yeast' sample.id %}">{{ sample.id }}</a></li> <li><a href="{% url 'yeast:yeast' sample.id %}">{{ sample.id }}</a></li>
</ul>
{% endfor %} {% endfor %}
</ul>
{% endif %}
</div> <!-- /container --> </div> <!-- /container -->
{% endblock %} {% endblock %}