-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Made a start on implementing the frontend via django not react. * Updated a lot of components to work with django * Made some minor tweaks * added missing dependency * Added more functionality * Merged develop * updated the installed files * fixed spacing problem when no sidebar is filled * Fixed a description and some styling issues
- Loading branch information
Showing
41 changed files
with
823 additions
and
116 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,7 @@ | ||
frontend/ | ||
static/ | ||
src/open_inwoner/static/ | ||
media/ | ||
docs/ | ||
bin/ | ||
deployment/ |
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 @@ | ||
{} |
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
14 changes: 14 additions & 0 deletions
14
src/open_inwoner/components/templates/components/File/File.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,14 @@ | ||
{% load i18n link_tags utils %} | ||
|
||
<aside class="file"> | ||
{% if file.file.file_type == 'Image' %} | ||
<span class="material-icons-outlined">image</span> | ||
{% else %} | ||
<span class="material-icons-outlined">description</span> | ||
{% endif %} | ||
<p class="p"> | ||
{% firstof file.file.name file.file.label|cut:file.file.extension|cut:"." %} ({{file.file.extension}}, {{file.file.file.size|readable_size}}) | ||
</p> | ||
{% trans "Download" as download %} | ||
{% link href=file.file.file.url text=download secondary=True download=True icon="file_download" %} | ||
</aside> |
17 changes: 17 additions & 0 deletions
17
src/open_inwoner/components/templates/components/File/FileList.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,17 @@ | ||
{% load i18n file_tags %} | ||
|
||
<nav class="file-list"> | ||
{% trans "Bestanden" as base_title %} | ||
{% if h1 %} | ||
<h1 class="h1" id="files">{% firstof title base_title %}</h1> | ||
{% else %} | ||
<h4 class="h4" id="files">{% firstof title base_title %}</h4> | ||
{% endif %} | ||
<ul class="file-list__list"> | ||
{% for file in files %} | ||
<li class="file-list__list-item"> | ||
{% file file=file %} | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
</nav> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from django import template | ||
|
||
register = template.Library() | ||
|
||
|
||
@register.inclusion_tag("components/File/FileList.html") | ||
def file_list(**kwargs): | ||
""" | ||
files: array | this is the list of file that need to be rendered. (Optional) | ||
h1: bool | render the title in a h1 instead of a h4 (Optional) | ||
title: string | the title that should be used (Optional) | ||
""" | ||
return {**kwargs} | ||
|
||
|
||
@register.inclusion_tag("components/File/File.html") | ||
def file(file, **kwargs): | ||
""" | ||
file: this is the file that needs to be rendered. | ||
""" | ||
return {**kwargs, "file": file} |
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
25 changes: 25 additions & 0 deletions
25
src/open_inwoner/js/components/accessibility/change_font.js
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,25 @@ | ||
const printButtons = document.querySelectorAll(".accessibility--change-font") | ||
|
||
class Print { | ||
constructor(node) { | ||
this.node = node; | ||
this.text = node.querySelector(".link__text"); | ||
this.node.addEventListener('click', this.change.bind(this)) | ||
} | ||
|
||
change(event) { | ||
event.preventDefault(); | ||
let root = document.documentElement; | ||
const varName = '--font-family-body'; | ||
|
||
if (root.style.getPropertyValue(varName) == "Open Dyslexic") { | ||
root.style.setProperty(varName, "TheSans C5"); | ||
this.text.innerText = this.node.dataset.text; | ||
} else { | ||
root.style.setProperty(varName, "Open Dyslexic"); | ||
this.text.innerText = this.node.dataset.altText; | ||
} | ||
} | ||
} | ||
|
||
[...printButtons].forEach((printButton) => new Print(printButton)) |
30 changes: 30 additions & 0 deletions
30
src/open_inwoner/js/components/accessibility/enlarge_font.js
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,30 @@ | ||
const enlargeButtons = document.querySelectorAll(".accessibility--enlarge-font") | ||
|
||
class EnlageFont { | ||
constructor(node) { | ||
this.node = node; | ||
this.text = node.querySelector(".link__text"); | ||
this.icon = node.querySelector(".material-icons"); | ||
this.node.addEventListener('click', this.enlarge.bind(this)) | ||
} | ||
|
||
enlarge(event) { | ||
event.preventDefault(); | ||
let root = document.documentElement; | ||
const varName = '--font-size-body'; | ||
const baseSize = '16px' | ||
const enlargeSize = "20px" | ||
|
||
if (root.style.getPropertyValue(varName) == enlargeSize) { | ||
root.style.setProperty(varName, baseSize); | ||
this.text.innerText = this.node.dataset.text; | ||
this.icon.innerText = this.node.dataset.icon; | ||
} else { | ||
root.style.setProperty(varName, enlargeSize); | ||
this.text.innerText = this.node.dataset.altText; | ||
this.icon.innerText = this.node.dataset.altIcon; | ||
} | ||
} | ||
} | ||
|
||
[...enlargeButtons].forEach((enlargeButton) => new EnlageFont(enlargeButton)) |
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,4 @@ | ||
import './change_font'; | ||
import './print'; | ||
import './read'; | ||
import './enlarge_font'; |
Oops, something went wrong.