-
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
1 parent
3df59dc
commit c5abd47
Showing
9 changed files
with
135 additions
and
22 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from django.apps import AppConfig | ||
|
||
|
||
class DosportalConfig(AppConfig): | ||
name = 'DOSPORTAL' | ||
|
||
def ready(self): | ||
import DOSPORTAL.signals |
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,37 @@ | ||
from django.db.models.signals import post_save | ||
from django.contrib.auth.models import User | ||
from django.dispatch import receiver | ||
from .models import Profile, record | ||
|
||
|
||
@receiver(post_save, sender=User) | ||
def create_profile(sender, instance, created, **kwargs): | ||
if created: | ||
Profile.objects.create(user=instance) | ||
|
||
|
||
@receiver(post_save, sender=User) | ||
def save_profile(sender, instance, **kwargs): | ||
instance.profile.save() | ||
|
||
|
||
|
||
@receiver(post_save, sender=record) | ||
def save_record(sender, instance, **kwargs): | ||
print("AFTER SAVE.... ") | ||
print(sender) | ||
print(instance) | ||
print(kwargs) | ||
|
||
filepath = 'data/media/'+instance.log_file | ||
print(filepath) | ||
|
||
metadata = instance.metadata | ||
|
||
if 'device_info' not in metadata: | ||
metadata['device_info'] = {} | ||
|
||
with open(filepath, 'r') as file: | ||
for line in file: | ||
print(line) | ||
|
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,24 @@ | ||
|
||
|
||
{% extends "base.html" %} | ||
{% load crispy_forms_tags %} | ||
|
||
{% block content %} | ||
|
||
<div class="d-flex justify-content-between"><div class="h1">Edit detector</div> | ||
|
||
<div class="container"> | ||
<div class="row"> | ||
<div class="col-md-12"> | ||
<form action="" method="post"> | ||
{% csrf_token %} | ||
{{ detectorEditForm | crispy }} | ||
<button class="btn btn-success is-success is-fullwidth is-medium mt-5" type="submit"> Submit </button> | ||
</form> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
|
||
{% endblock %} |
46 changes: 46 additions & 0 deletions
46
DOSPORTAL/templates/organizations/organization_profile.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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
|
||
{% extends "base.html" %} | ||
{% load martortags %} | ||
|
||
{% block content %} | ||
|
||
Organizace <a href="{%url 'organization-detail' slug=organization.slug %}"><b> {{ organization.name }} {% if user.is_authenticated %} <a href="{{organization.get_admin_url}}"><i class="bi bi-pencil"></i></a>{%endif%}</b> | ||
|
||
<br> | ||
|
||
<div class="d-flex flex-wrap align-items-center text-decoration-none"> | ||
{% for a in organization.user_organizations.all %} | ||
<a href="{%url 'user_profile' username=a.user.username %}" class="text-decoration-none"> | ||
<div class="d-flex align-items-center m-2"> | ||
<img src="{{a.user.profile.image.url}}" class="rounded-circle" alt="{{a.user.full_name }}" style="width: 40px; height: 40px; object-fit: cover;"> | ||
<small class="ml-2 py-2 pr-3">{{a.user}}</small> | ||
</div> | ||
</a> | ||
{% endfor %} | ||
</div> | ||
|
||
|
||
|
||
</div> | ||
|
||
<hr> | ||
|
||
<h2>Detectors</h2> | ||
{% for detector in organization.detectors.all %} | ||
|
||
|
||
<a href="{% url 'detector-view' pk=detector.pk %}"> {{detector}}</a> <br> | ||
{% endfor %} | ||
<hr> | ||
<h2>Maintainer of detectors:</h2> | ||
|
||
TODO: | ||
|
||
<h2>Author of measurements</h2> | ||
|
||
TODO: | ||
|
||
|
||
|
||
|
||
{% endblock %} |
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
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