-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
171 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from django.core.management.base import BaseCommand | ||
|
||
from webportal.models import Assembly | ||
|
||
|
||
class Command(BaseCommand): | ||
help = """ | ||
Delete all the assemblies from the database. | ||
To run: 'python manage.py delete_assemblies' | ||
""" | ||
|
||
def handle(self, *args, **kwargs): | ||
num_assemblies = Assembly.objects.count() | ||
Assembly.objects.all().delete() | ||
self.stdout.write( | ||
self.style.SUCCESS(f"{num_assemblies} assemblies deleted successfully.") | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 5.1.3 on 2024-12-11 22:24 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("webportal", "0007_assembly_user_alter_material_unique_id"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="material", | ||
name="unique_id", | ||
field=models.CharField(default="41573d", max_length=6, unique=True), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 5.1.3 on 2024-12-11 22:28 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("webportal", "0008_alter_material_unique_id"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="material", | ||
name="unique_id", | ||
field=models.CharField(default="4e3bd0", max_length=6, unique=True), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 22 additions & 1 deletion
23
webportal/templates/webportal/partials/assemblies/assembly-detail.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,26 @@ | ||
<div id="assembly-detail-view"> | ||
|
||
<h1>assembly-detail-view {{ assembly.name }}</h1> | ||
<div id="assembly-cells"> | ||
{% for row in row_range %} | ||
<div class="row"> | ||
{% for col in col_range %} | ||
<div class="cell"> | ||
<input class="text-black" value="Test" /> | ||
{% comment %} | ||
{% for cell in cells %} | ||
{% if cell.x == col and cell.y == row %} | ||
{% endif %} | ||
{% endfor %} | ||
{% endcomment %} | ||
</div> | ||
{% endfor %} | ||
</div> | ||
{% endfor %} | ||
</div> | ||
|
||
<div id="grid-control-buttons"> | ||
<button class="btn" hx-post="{% url 'add-row' assembly.pk %}" hx-target="#assembly-cells" hx-swap="beforeend">Add Row</button> | ||
<button class="btn" hx-post="{% url 'add-column' assembly.pk %}" hx-target="#assembly-cells">Add Column</button> | ||
</div> | ||
|
||
</div> |
18 changes: 0 additions & 18 deletions
18
webportal/templates/webportal/partials/assemblies/assembly-name.html
This file was deleted.
Oops, something went wrong.
23 changes: 22 additions & 1 deletion
23
webportal/templates/webportal/partials/assemblies/assembly.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,27 @@ | ||
<div id="assembly" class="col-span-4"> | ||
{% if assembly %} | ||
{% include "webportal/partials/assemblies/assembly-name.html" %} | ||
|
||
{% block assembly-name %} | ||
<div id="assembly-name"> | ||
<form | ||
hx-post="{% url 'update-assembly-name' assembly.id %}" | ||
hx-target="#assembly-name" | ||
hx-swap="outerHTML" | ||
> | ||
<input | ||
type="text" | ||
name="name" | ||
class="text-black" | ||
value="{{ assembly.name }}" | ||
hx-trigger="changed delay:500ms" | ||
style="border: 1px solid #939799; padding: 8px; border-radius: 4px; background: transparent; color: white;" | ||
onfocus="this.style.borderColor='#007bff'; this.style.boxShadow='0 0 5px rgba(0, 123, 255, 0.5)'; this.style.outline='none'; this.style.background='white'; this.style.color='black';" | ||
onblur="this.style.borderColor='#ccc'; this.style.boxShadow='none'; this.style.background='transparent'; this.style.color='white';" | ||
/> | ||
</form> | ||
</div> | ||
{% endblock %} | ||
|
||
{% include "webportal/partials/assemblies/assembly-detail.html" %} | ||
{% endif %} | ||
</div> |
3 changes: 0 additions & 3 deletions
3
webportal/templates/webportal/partials/assemblies/column.html
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
{% for cell in cells %} | ||
<div class="cell">{{ cell.value }}</div> | ||
{% endfor %} | ||
<div class="row grid grid-cols-[200px_minmax(900px,_1fr)_100px]"> | ||
{% for cell in cells %} | ||
{% comment %} <div class="cell">{{ cell.value }}</div> {% endcomment %} | ||
<div class="cell"> | ||
<input class="text-black" value="Test" /> | ||
</div> | ||
{% endfor %} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters