mirror of
https://github.com/daniviga/django-ram.git
synced 2025-08-08 15:17:49 +02:00
Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
575c938205
|
|||
2af772a722
|
|||
f580bcffc5
|
|||
6accb66006
|
|||
f56accb4ff
|
|||
5a7b7fd79e | |||
dcdad71b1b | |||
321ae1065e | |||
e8efa5d87a |
24
README.md
24
README.md
@@ -2,8 +2,7 @@
|
|||||||
|
|
||||||
[](https://github.com/daniviga/django-rma/actions/workflows/django.yml)
|
[](https://github.com/daniviga/django-rma/actions/workflows/django.yml)
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
A `jff` (just for fun) project that aims to create a
|
A `jff` (just for fun) project that aims to create a
|
||||||
model railroad assets manager that allows to:
|
model railroad assets manager that allows to:
|
||||||
@@ -26,6 +25,8 @@ This project probably doesn't match you needs nor expectations. Be aware.
|
|||||||
|
|
||||||
Your model train may also catch fire while using this software.
|
Your model train may also catch fire while using this software.
|
||||||
|
|
||||||
|
Check out [my own instance](https://daniele.mynarrowgauge.org).
|
||||||
|
|
||||||
## Components
|
## Components
|
||||||
|
|
||||||
Project is based on the following technologies and components:
|
Project is based on the following technologies and components:
|
||||||
@@ -138,14 +139,18 @@ To be continued ...
|
|||||||
## Screenshots
|
## Screenshots
|
||||||
|
|
||||||
### Frontend
|
### Frontend
|
||||||
|

|
||||||
|
---
|
||||||
|

|
||||||
|
---
|
||||||
|

|
||||||
|
|
||||||
|
#### Dark mode
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||

|
|
||||||
---
|
---
|
||||||

|
|
||||||
---
|
|
||||||

|
|
||||||
---
|
|
||||||

|
|
||||||
|
|
||||||
|
|
||||||
### Backoffice
|
### Backoffice
|
||||||
@@ -158,8 +163,7 @@ To be continued ...
|
|||||||
|
|
||||||
### Rest API
|
### Rest API
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -8,7 +8,17 @@
|
|||||||
{% for c in consist %}
|
{% for c in consist %}
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<div class="card shadow-sm">
|
<div class="card shadow-sm">
|
||||||
{% if c.image %}<a href="{{ c.get_absolute_url }}"><img src="{{ c.image.url }}" alt="Card image cap"></a>{% endif %}
|
<a href="{{ c.get_absolute_url }}">
|
||||||
|
{% if c.image %}
|
||||||
|
<img src="{{ c.image.url }}" alt="Card image cap">
|
||||||
|
{% else %}
|
||||||
|
{% with c.consist_item.first.rolling_stock as r %}
|
||||||
|
{% for i in r.image.all %}
|
||||||
|
{% if i.is_thumbnail %}<img src="{{ i.image.url }}" alt="Card image cap">{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
{% endwith %}
|
||||||
|
{% endif %}
|
||||||
|
</a>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<p class="card-text" style="position: relative;">
|
<p class="card-text" style="position: relative;">
|
||||||
<strong>{{ c }}</strong>
|
<strong>{{ c }}</strong>
|
||||||
|
@@ -61,6 +61,7 @@ class GetHomeFiltered(View):
|
|||||||
| Q(rolling_class__description__icontains=s)
|
| Q(rolling_class__description__icontains=s)
|
||||||
| Q(rolling_class__type__type__icontains=s)
|
| Q(rolling_class__type__type__icontains=s)
|
||||||
| Q(road_number__icontains=s)
|
| Q(road_number__icontains=s)
|
||||||
|
| Q(sku=s)
|
||||||
| Q(rolling_class__company__name__icontains=s)
|
| Q(rolling_class__company__name__icontains=s)
|
||||||
| Q(rolling_class__company__country__icontains=s)
|
| Q(rolling_class__company__country__icontains=s)
|
||||||
| Q(manufacturer__name__icontains=s)
|
| Q(manufacturer__name__icontains=s)
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
from ram.utils import git_suffix
|
from ram.utils import git_suffix
|
||||||
|
|
||||||
__version__ = "0.0.12"
|
__version__ = "0.0.14"
|
||||||
__version__ += git_suffix(__file__)
|
__version__ += git_suffix(__file__)
|
||||||
|
@@ -46,6 +46,22 @@ class RollingStockPropertyInline(admin.TabularInline):
|
|||||||
extra = 0
|
extra = 0
|
||||||
|
|
||||||
|
|
||||||
|
@admin.register(RollingStockDocument)
|
||||||
|
class RollingStockDocumentAdmin(admin.ModelAdmin):
|
||||||
|
list_display = (
|
||||||
|
"__str__",
|
||||||
|
"rolling_stock",
|
||||||
|
"description",
|
||||||
|
"download",
|
||||||
|
)
|
||||||
|
search_fields = (
|
||||||
|
"rolling_stock__rolling_class__identifier",
|
||||||
|
"rolling_stock__sku",
|
||||||
|
"description",
|
||||||
|
"file",
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@admin.register(RollingStock)
|
@admin.register(RollingStock)
|
||||||
class RollingStockAdmin(admin.ModelAdmin):
|
class RollingStockAdmin(admin.ModelAdmin):
|
||||||
inlines = (
|
inlines = (
|
||||||
|
@@ -4,6 +4,7 @@ from uuid import uuid4
|
|||||||
from django.db import models
|
from django.db import models
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
from django.dispatch import receiver
|
from django.dispatch import receiver
|
||||||
|
from django.utils.safestring import mark_safe
|
||||||
|
|
||||||
# from django.core.files.storage import FileSystemStorage
|
# from django.core.files.storage import FileSystemStorage
|
||||||
|
|
||||||
@@ -141,7 +142,12 @@ class RollingStockDocument(models.Model):
|
|||||||
return "{0}".format(os.path.basename(self.file.name))
|
return "{0}".format(os.path.basename(self.file.name))
|
||||||
|
|
||||||
def filename(self):
|
def filename(self):
|
||||||
return os.path.basename(self.file.name)
|
return self.__str__()
|
||||||
|
|
||||||
|
def download(self):
|
||||||
|
return mark_safe(
|
||||||
|
'<a href="{0}" target="_blank">Link</a>'.format(self.file.url)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class RollingStockImage(models.Model):
|
class RollingStockImage(models.Model):
|
||||||
|
Reference in New Issue
Block a user