Fix HostingPlatform

Users can add projects and associated hosting platforms and respective URLs at the same time.
This commit is contained in:
Kristofers Solo
2023-06-25 13:46:46 +00:00
parent 12b93544f9
commit bfc25c582f
9 changed files with 116 additions and 143 deletions

View File

@@ -5,18 +5,7 @@
{% block content %}
<form method="post">
{% csrf_token %}
{{ project_form.as_p }}
<table>
{{ language_formset.management_form }}
{% for form in language_formset %}
<tr>
<td>{{ form.language.label_tag }}</td>
<td>{{ form.language }}</td>
<td>{{ form.percentage }}</td>
</tr>
{% endfor %}
</table>
{{ host_formset.as_p }}
{{ form.as_p }}
<button type="submit">Post</button>
</form>
{% endblock %}

View File

@@ -11,26 +11,12 @@
</button>
<br>
{% for project in projects %}
<b>@{{ project.author.username }}</b>
<b>@{{ project.owner }}</b>
<h4>{{ project.name }}</h4>
<p>{{ project.description }}</p>
<ul>
{% for license in project.licenses.all %}
<li>
<a href="{{ license.url }}">{{ license.short_name }}</a>
</li>
{% empty %}
<p>No license</p>
{% endfor %}
</ul>
<ul>
{% for language in project.projectprogramminglanguage_set.all %}
<li>{{ language.language }} | {{ language.percentage }}&#37;</li>
{% empty %}
<p>No language</p>
{% endfor %}
</ul>
<br>
<a href="{{ project.get_absolute_url }}">
<button>Read more</button>
</a>
<p>{{ project.date_created }}</p>
{% empty %}
<p>No projects yet (</p>