Skip to content

Commit

Permalink
Adding files
Browse files Browse the repository at this point in the history
  • Loading branch information
gm3dmo committed Jan 1, 2024
1 parent 1d76712 commit a5fc831
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
5 changes: 5 additions & 0 deletions cmp/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
from django.conf import settings
from . import views

# ...


urlpatterns = [

path("", views.index, name="index"),
Expand Down Expand Up @@ -40,3 +43,5 @@
#path("soldier-search/<str:surname>" , views.soldier_search , name="soldier-search" ),

]

urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
4 changes: 4 additions & 0 deletions core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,3 +185,7 @@
}

STATIC_ROOT = BASE_DIR / "staticfiles"


MEDIA_ROOT = os.path.join(BASE_DIR, "cmp/media")
MEDIA_URL = "/media/"
9 changes: 8 additions & 1 deletion templates/cmp/soldier.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,14 @@ <h4>Soldier Record</h4>
<tr><td>Company:</td><td>{{ soldier.soldierdeath.company }}</td></tr>
<tr><td>CWGC Link:</td><td><span style="font-size: 1.5em;"><a href="{{ soldier.soldierdeath.cwgc_url }}">{{ soldier.soldierdeath.cwgc_id }}</span></a></td></tr>
<tr><td>Cemetery:</td><td>{{ soldier.soldierdeath.cemetery }}, {{soldier.soldierdeath.cemetery.country }} <span style="font-size: 1.3em;">{{ soldier.soldierdeath.cemetery.country.flag }}</span>
<tr><td colspan="2"> {{ cemetery_map | safe }} </td></tr>
<tr><td colspan="2" style="text-align: center;"><img src="/media/{{ soldier.id}}/memorial/{{ soldier.id }}.jpg"</td></tr>
<tr><td colspan="2" style="text-align: center;">
<div style="width: 60%; height: auto; margin: auto;">
{{ cemetery_map | safe }} </td></tr>
</div>
</td>
</tr>

{% endif %}

</tbody>
Expand Down

0 comments on commit a5fc831

Please sign in to comment.