https://github.com/acdh-oeaw/apis-ampel

https://github.com/acdh-oeaw/apis-ampel

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    1 of 1 committers (100.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.3%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

Basic Info
  • Host: GitHub
  • Owner: acdh-oeaw
  • Language: HTML
  • Default Branch: main
  • Size: 84 KB
Statistics
  • Stars: 0
  • Watchers: 4
  • Forks: 0
  • Open Issues: 3
  • Releases: 0
Created over 3 years ago · Last pushed over 3 years ago
Metadata Files
Readme

README.md

Apis-Ampel

Django-App for the APIS plattform. Adds status indicators to all entities that are displayed as 'traffic lights' in list, detail and edit views.

Basics

This module consists of two parts. A settings model, which allows to turn the display of the Ampel on or off on a per module basis, i.e. Relations (PersonInstitution, PersonPlace, etc.) or Entities (Person, Event, etc.).The second part is a model that stores for each instance of a given Entity or Relation a status indicator (red, yellow or green).When the Ampel is active for a given model, the indicator will be displayed in all listviews, detail views and edit views. There is also a special note field attached to each Ampel instance, allowing for writing and retrieving a note on the given Ampel instance.

Usage

In detail and edit views, the Ampel indicator can be toggled, if a user is logged in. Otherwise, the indicator will be displayed, but can't be changed. The note for a given Ampel instance can be accessed via a button; the button is blue if a note exists, otherwise it is gray.

  • toggling the Ampel indicator is auto-saved in a callback – so what you see is what you get
  • instances where the Ampel has not been toggled yet, will show up as red in all views
  • you can filter for those instances in the listview by selecting 'default' in the dropdown
  • only instances where the Ampel has been set to red will show up listed under the 'red' option
  • you can also search for text segments within a given note in the listview filters
  • turning the display of an existing Ampel on or off for a given model only changes the visibility, it does not change the already stored data

Implementation

Two django-models are used: AmpelSettings – which links to the content_type of a given model, and a Ampel model. The Ampel model links to TempEntityClass via a one-to-one-field; this field is also used as the models primary key. Note that all Relations and Entities inherit from TempEntityClass in Apis – which means the primary key of a Entity or Relation instance is ident to the primary key of its TempEntityClass and also with the primary key of the Ampel instance it is linked to. As all Entities and Relations inherit their primary key field from TempEntityClass, all ids are unique, even across different Entities and Relations. Therefore you can programmatically access a given Ampel instance by looking up the primary key of an Entity or Relation instance in the Ampel model. The Ampel setup is lazy: you don't have to give initial values; a helper function was implemented that checks if an Ampel instance exists for a given Entity or Relation, and if not, it will be created. So when you first try to access an Ampel instance by toggling the indicator, the actual instance will be created automatically. That's the reason why a default display of 'red' was enabled in all views for nstances of Relations or Entities for which the Ampel has not been set yet. You can filter for those in the listview by selecting the 'default' option in the Ampel dropdown.

Dependencies

This module depends on apis_core version 18.3 or higher.

Installation

1. Install the package

via pip:

bash pip install apis-ampel

via poetry:

sh poetry add apis-ampel

2. Update your settings.py file

Add "apisampel" to your INSTALLEDAPPS settings variable.

3. Update your urls.py file

Add this block:

python if "apis_ampel" in settings.INSTALLED_APPS: urlpatterns.append( url( r"^apis_ampel/", include("apis_ampel.urls", namespace="apis_ampel"), ) )

4. Update webpage/templates/base.html

Add this block within the ul-tag of your navbar element:

html {% if user.is_authenticated and "apis_ampel" in APPS %} <li class="nav-item dropdown"> <a class="nav-link"href="{% url'apis_ampel:ampel_settings' %}">Ampel`</a>` </li> {% endif %}

Owner

  • Name: Austrian Centre for Digital Humanities & Cultural Heritage
  • Login: acdh-oeaw
  • Kind: organization
  • Email: acdh@oeaw.ac.at
  • Location: Vienna, Austria

GitHub Events

Total
Last Year

Committers

Last synced: about 1 year ago

All Time
  • Total Commits: 2
  • Total Committers: 1
  • Avg Commits per committer: 2.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Gregor Pirgie g****e@o****t 2
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: about 1 year ago

All Time
  • Total issues: 3
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 1
  • Total pull request authors: 0
  • Average comments per issue: 0.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • gregorpirgie (3)
Pull Request Authors
Top Labels
Issue Labels
enhancement (3) documentation (1)
Pull Request Labels

Dependencies

poetry.lock pypi
  • 188 dependencies