-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for multiple vehicles (#425)
* add two new field to agreement These fileds indicate whether an user has an agreement of a particular type. This change is done to support the upcoming agreement change which allow for a user to either use bocken, the electric bike *hornet* or both. * add validation logic to journalentry A user which has an agreement type which does not match that of bocken cannot create a journal entry, if not checked a person with only a agreement that applies to hornet could add entries which would be incorrect. * translations * wip: add new model+admin made migration to initiliaze data and such but no real work in replacing the logic in journal entries and such * wip: "works" need to test and further fix the front-end so that the automatically filled trips are fixed * wip: update template Added code for fetching the latest status of all of the vehicles dynamically so that it mimics previous behaviour with only a single vehicle * wip: add main group and vehicle to report form Show the main group and the vehicle driven for the reports so that it is "easier" to collect statistics. * wip: remove debug print * wip: docs and add todos :shrug: * wip: added validation logic to form and add tests Updated tests for journalentryform to use vehicle, also added tests which check if the user can or can not drive a particular vehicle etc. * wip: missed a file :) * wip: typo * wip: translations * wip: translations * changed form autofill logic for vehicles Now fetches the attribute based on the vehicle id which is stored in the DOM, technically has support for unlimited vehicles but might not as fool proof. * add base to parseInt + docs * fix: init meter with no entries If there were no entries the code didn't fetch the meter stats from the vehicle objects, now it does :) * fix: add listener for meter start on dom load * fix: lint :smile_cat:
- Loading branch information
Showing
18 changed files
with
648 additions
and
188 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
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,15 @@ | ||
|
||
from django.contrib.admin import ModelAdmin | ||
|
||
|
||
class VehicleAdmin(ModelAdmin): | ||
"""Custom class for the admin pages for Vehicle.""" | ||
|
||
list_display = ( | ||
"vehicle_name", | ||
"car", | ||
"bike", | ||
"vehicle_meter_start", | ||
"vehicle_meter_stop" | ||
) | ||
list_filter = ['vehicle_name'] |
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
Oops, something went wrong.