Browse Source

cleanup of old files, added meta documentation

b_overhaul
crunch 2 weeks ago
parent
commit
0df73178c5
9 changed files with 0 additions and 145 deletions
  1. +0
    -17
      .drone.yml
  2. BIN
      Misc/Consulta Presentation.pptx
  3. BIN
      Misc/SchriftlicheAusarbeitung.pdf
  4. BIN
      Misc/docker-compose.png
  5. BIN
      Misc/models.png
  6. +0
    -2
      README.md
  7. +0
    -11
      utils/permission-checking.py
  8. +0
    -40
      utils/script.js
  9. +0
    -75
      utils/test.html

+ 0
- 17
.drone.yml View File

@@ -1,17 +0,0 @@
---
kind: pipeline
type: docker
name: default

steps:
- name: test
image: python:3.8
commands:
- pip install -r utils/requirements.txt
- cd Consulta_project
- if ! [ -d static ]; then mkdir static; fi
- export DJANGO_SETTINGS_MODULE=Consulta_project.dev_settings
- python manage.py makemigrations
- python manage.py migrate --run-syncdb
- python manage.py collectstatic --noinput
- python manage.py test

BIN
Misc/Consulta Presentation.pptx View File


BIN
Misc/SchriftlicheAusarbeitung.pdf View File


BIN
Misc/docker-compose.png View File

Before After
Width: 509  |  Height: 556  |  Size: 26KB

BIN
Misc/models.png View File

Before After
Width: 251  |  Height: 525  |  Size: 34KB

+ 0
- 2
README.md View File

@@ -1,7 +1,5 @@
# Consulta

[![Build Status](https://drone.reinkober-it.de/api/badges/crunch/Consulta/status.svg)](https://drone.reinkober-it.de/crunch/Consulta)

### Preface
*Consulta* is a project in the context of a bachelor's assignment at the University of Duisburg-Essen. The objective of this project is to create a basic implementation of a polling tool for use in lectures or presentations.



+ 0
- 11
utils/permission-checking.py View File

@@ -1,11 +0,0 @@
from django.contrib.auth.models import User, Group
from polls.models import Poll
from guardian.shortcuts import get_objects_for_user, get_objects_for_group
alice = User.objects.get(username='alice')
bob = User.objects.get(username='bob')
pollcreator = Group.objects.get(name='Poll Creator')
oa = get_objects_for_user(alice, ('view_poll', 'add_poll', 'change_poll', 'delete_poll'), Poll)
ob = get_objects_for_user(bob, ('view_poll', 'add_poll', 'change_poll', 'delete_poll'), Poll)
op = get_objects_for_group(pollcreator, ('view_poll', 'add_poll', 'change_poll', 'delete_poll'), Poll)
bob.has_perm(Poll.objects.get(slug='bobs-poll'), 'polls.view_poll')
bob.has_perm(Poll.objects.get(slug='alices-poll'), 'polls.view_poll')

+ 0
- 40
utils/script.js View File

@@ -1,40 +0,0 @@
id = document.getElementById("id").innerText
url = 'http://127.0.0.1:8000/api/polls/' + id + '/?format=json'


fetch(url).then((response) => {
return response.json();
})
.then((data) => {
fetch('http://127.0.0.1:8000/api/questions/' + data.questions[0]).then((response) => {
return response.json();
}).then((data) => {
fetch('http://127.0.0.1:8000/api/answers' + data.answers[0]).then((response) => {
return response.json();
}).then(data) => {
createChart(data.answers, data.answers)
}
});
});

createChart(data.answers, data.answers)
/* data.questions.forEach(element => {
fetch('http://127.0.0.1:8000/api/questions/' + element).then((response) => {
return response.json();
}).then((data) => {
createChart(data.answers)
console.log(data.answers)
});
}); */

function createChart(series, labels) {
new Chartist.Pie('.ct-chart', {
series: series,
labels: labels,
}, {
donut: true,
donutWidth: 60,
startAngle: 270,
showLabel: true
});
}

+ 0
- 75
utils/test.html View File

@@ -1,75 +0,0 @@
<!DOCTYPE html>
<html lang="en">

<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="/static/css/landing.css" />

<link rel="stylesheet" href="https://cdn.jsdelivr.net/chartist.js/latest/chartist.min.css">
<script src="https://cdn.jsdelivr.net/chartist.js/latest/chartist.min.js"></script>

<title>Consulta - polling made easy.</title>
</head>

<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<a class="navbar-brand" href="/">Consulta</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarText"
aria-controls="navbarText" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarText">
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="/polls/">Polls</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="/editor">Poll Editor</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#">Legal</a>
</li>
<li class="nav-item">
<a class='nav-link' href="/accounts/register/">Register</a>
</li>
</ul>
</div>
</nav>

<div class="container" style="text-align: center; margin-top: 6em;">
<h2>Poll: Root&#39;s Poll</h2>
<p id="id" style="display: none;">5</p>
<hr>
<h3>Question: What is Love?</h3>
<small>Answer: Baby don&#39;t hurt me - 0</small><br>
<small>Answer: Don&#39;t hurt me - 0</small><br>
<br>
<h3>Question: Second Question</h3>
<p>There are no answers to this question.</p>
<br>
</div>

<div class="ct-chart"></div>


<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"
integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1"
crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"
integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM"
crossorigin="anonymous"></script>
<script src="script.js"></script>
</body>

</html>

Loading…
Cancel
Save