sphinx
sphinxcontrib-plantuml
+sphinxcontrib-mermaid
-r requirements.txt
"sphinx.ext.duration",
"sphinx.ext.napoleon",
"sphinxcontrib.plantuml",
+ "sphinxcontrib.mermaid",
"sphinx.ext.mathjax",
"myst_parser",
"sphinx.ext.todo",
--- /dev/null
+Views
+=====
+..
+ In django views, respond to the http request and create the response.
+
+.. automodule:: georeport.views
+ :members:
:caption: Contents:
georeport/models
-
+ georeport/views
+
+
+ info/model-info
.. todolist::
--- /dev/null
+Model-Info
+==========
+
+Models describe the data-structure of the database.
+
+In this project, there are two main models, which are called **Category** and **Report**.
+
+The report-model contains request, provided by an user.
+
+The reports are grouped by categories.
+Furthermore the category also handles access to the reports. This is done by checking if a
+user corresponds with a category and only if this is the case,the user gets access to the category and the
+reports.
+
+The structure of the database is shown in the following diagram.
+
+
+.. mermaid::
+
+ erDiagram
+ Report{
+ string title
+ string description
+ datetime creation_time
+ dateimte updated_at
+ boolean published
+ int state
+ email email
+ }
+ Category{
+ string name
+ }
+ Location{
+ float Latitude
+ float Longitude
+ }
+ Image
+ User
+ Group
+ Report }o--|| Category : "belongs to"
+ Report }| -- || Location: "is at"
+ Report || -- o{ Image: "has"
+ Category |o--o{Category: "Parent of"
+ User }o--o{ Group : "is in"
+ User }o--o{ Category: "owns"
+ Group }o--o{ Category: "owns"
+
+
--- /dev/null
+/*
+ * Copyright: (c) 2025, Jörn Menne <jmenne@posteo.de>
+ * GNU General Public License v3.0 (see LICSENE or https://www.gnu.org/license/gpl-3.0.md)
+*/
+// Center the map-view on Paderborn and use openstreetmap as a mapservice
+var map = L.map("map").setView([51.7173, 8.753557], 15);
+L.tileLayer("https://tile.openstreetmap.org/{z}/{x}/{y}.png", {
+ maxZoom: 19,
+ attribution: "© <a href='https://www.openstreetmap.org/copyright'>OpenStreetMap</a>"
+}).addTo(map);
--- /dev/null
+#map {
+ height: 500px;
+}
--- /dev/null
+
+<!--
+Copyright: (c) 2025, Jörn Menne <jmenne@posteo.de>
+GNU General Public License v3.0 (see LICSENE or https://www.gnu.org/license/gpl-3.0.md)
+-->
+<!DOCTYPE html>
+{% load static %}
+<html>
+ <head>
+ <title>Pinpoint-Report</title>
+ <link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"
+ integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY="
+ crossorigin=""/>
+
+ <!-- Make sure you put this AFTER Leaflet's CSS -->
+ <script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"
+ integrity="sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo="
+ crossorigin="">
+ </script>
+ <link rel="stylesheet" href="{% static 'georeport/style.css' %}"/>
+ </head>
+ <body>
+ <h1>Pinpoint-Report</h1>
+ <div id="map"></div>
+ <script src="{% static 'georeport/mapsetup.js' %}"> </script>
+ </body>
+</html>
+
-# Create your views here.
+# Copyright: (c) 2025, Jörn Menne <jmenne@posteo.de>
+# GNU General Public License v3.0 (see LICSENE or https://www.gnu.org/license/gpl-3.0.md)
+
+"""
+Module containing the django-views.
+Each view is associated with a url in urls.py.
+A view takes a request and creates a respond for the request.
+"""
+
+from django.shortcuts import render
+from django.views.decorators.http import require_safe
+
+
+@require_safe
+def index(request):
+ """
+ Function which handles request going to "/georeport".
+ """
+ return render(request, "georeport/index.html")
+
-# TODO: Index-Views
# TODO: Category-List
-# TODO: Report-List
-# TODO: Create-Report
-# TODO: DetailView
# TODO: Category-Detail
-# TODO: Supcategories
-
+# TODO: Subcategories
-from django.http import HttpResponse
+# TODO: Report-List
+# TODO: Create-Report
+# TODO: Detailview Report
-def index(request):
- return HttpResponse(b"Pinpoint-Report")
+# TODO: Finish Link