Skip to content

Commit

Permalink
WIP implementation for issue demozoo#15
Browse files Browse the repository at this point in the history
  • Loading branch information
jensadne committed Jul 20, 2018
1 parent 5da3dee commit a3bb7aa
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
6 changes: 4 additions & 2 deletions productions/forms.py
Expand Up @@ -296,7 +296,8 @@ def save(self, commit=True):

class Meta:
model = ProductionLink
exclude = ['parameter', 'link_class', 'production', 'is_download_link', 'description', 'demozoo0_id', 'file_for_screenshot', 'is_unresolved_for_screenshotting']
exclude = ['parameter', 'link_class', 'production', 'is_download_link', 'demozoo0_id', 'file_for_screenshot', 'is_unresolved_for_screenshotting']
widgets = {'description': forms.TextInput(attrs={'placeholder': 'Optional description, like "party version"'})}

ProductionDownloadLinkFormSet = inlineformset_factory(Production, ProductionLink,
form=ProductionDownloadLinkForm, formset=BaseExternalLinkFormSet, extra=2)
Expand All @@ -318,7 +319,8 @@ def save(self, commit=True):

class Meta:
model = ProductionLink
exclude = ['parameter', 'link_class', 'production', 'is_download_link', 'description', 'demozoo0_id', 'file_for_screenshot', 'is_unresolved_for_screenshotting']
exclude = ['parameter', 'link_class', 'production', 'is_download_link', 'demozoo0_id', 'file_for_screenshot', 'is_unresolved_for_screenshotting']
widgets = {'description': forms.TextInput(attrs={'placeholder': 'Optional description, like "party version"'})}

ProductionExternalLinkFormSet = inlineformset_factory(Production, ProductionLink,
form=ProductionExternalLinkForm, formset=BaseExternalLinkFormSet)
Expand Down
2 changes: 1 addition & 1 deletion productions/templates/productions/_downloads.html
Expand Up @@ -12,7 +12,7 @@ <h3 class="panel__title">Downloads</h3>
<ul class="download_links">
{% for link in download_links %}
<li class="download_link {{ link.html_link_class }}">
{{ link.as_download_link|safe }}
{{ link.as_download_link|safe }}{%if link.description %} ({{ link.description }}){% endif %}
</li>
{% endfor %}
</ul>
Expand Down
2 changes: 1 addition & 1 deletion productions/templates/productions/_external_links.html
Expand Up @@ -11,7 +11,7 @@ <h3 class="panel__title">External links</h3>
{% endif %}
<ul class="external_links">
{% for link in external_links %}
<li>{{ link.html_link|safe }}</li>
<li>{{ link.html_link|safe }}{%if link.description %} ({{ link.description }}){% endif %}</li>
{% endfor %}
</ul>
</div>
3 changes: 2 additions & 1 deletion productions/templates/productions/edit_links.html
Expand Up @@ -24,7 +24,8 @@ <h2>Editing {{ external_or_download }} links for {{ production.title }}:</h2>
<div class="field_input">
{% spawningformset formset %}
{% spawningform as form %}
{{ form.url }}
{{ form.url }}<br>
{{ form.description }}
{% for hidden in form.hidden_fields %}
{{ hidden }}
{% endfor %}
Expand Down

0 comments on commit a3bb7aa

Please sign in to comment.