-
Notifications
You must be signed in to change notification settings - Fork 1
291348 and 291349: Enhance batch administration functionality and templates #303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 16 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
fc01117
Enhance batch administration functionality and templates
addcf78
Enhance BatchAdmin and CountryBatchAdmin with new button functionalities
e1125b7
Refactor BatchAdmin button functionalities for improved navigation
826b82e
add styles for adminextrabuttons select
vitali-yanushchyk-valor 0f32f3d
Add tests for BatchAdmin button behavior with beneficiary groups
588a278
Refactor BatchAdmin and enhance batch reprocessing functionality
8b06971
Merge branch 'develop' into feature/291348
arsen-vs 47bb098
Update tests for batch reprocessing to conditionally assert household…
61a8ccf
Refactor household assertions in batch reprocessing tests
2d3506f
Enhance batch reprocessing logic and add comprehensive tests
5381609
Update reprocess confirmation form and enhance batch reprocessing tests
08564ef
Update assertions in batch reprocessing tests to improve accuracy
66a3e25
Update assertion for skipped households in batch reprocessing tests
f40e19d
Add tests for BatchAdmin functionality related to households
16bc6e1
Refactor BatchAdmin test cases for improved clarity and accuracy
e952708
Refactor beneficiary group checks in BatchAdmin and batch reprocessing
5d6a720
Update test setup for batch reprocessing to include raw data
df15cfa
Enhance batch reprocessing tests to include beneficiary group setup
511b248
Update assertions for skipped individuals in batch reprocessing tests
64d949f
Merge branch 'develop' into feature/291348
domdinicola 1d8fdf9
Merge branch 'develop' into feature/291348
domdinicola 320e6d7
Add comprehensive tests for batch reprocessing mapping functionality
604bae7
Add alien individual fields to program configuration in batch reproce…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -1,11 +1,23 @@ | ||
| from admin_extra_buttons.mixins import ExtraButtonsMixin | ||
| from adminfilters.mixin import AdminAutoCompleteSearchMixin, AdminFiltersMixin | ||
| from django.contrib import admin | ||
| from django import forms | ||
|
|
||
| from adminactions import actions | ||
|
|
||
|
|
||
| class BaseModelAdmin(ExtraButtonsMixin, AdminAutoCompleteSearchMixin, AdminFiltersMixin, admin.ModelAdmin): | ||
| pass | ||
| @property | ||
| def media(self) -> forms.Media: | ||
| base = super().media | ||
| return base + forms.Media( | ||
| js=[], | ||
| css={ | ||
| "screen": [ | ||
| "admin/admin_extra.css", | ||
| ], | ||
| }, | ||
| ) | ||
|
|
||
|
|
||
| actions.add_to_site(admin.site) |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,26 @@ | ||
| .object-tools select.aeb-button { | ||
| margin: 0; | ||
| padding:.2rem .1rem .2rem .3rem; /* top right bottom left */ | ||
| height: 1.6rem; | ||
| line-height: 1.25rem; | ||
|
|
||
| background: var(--object-tools-bg); | ||
| color: var(--object-tools-fg); | ||
|
|
||
| font: 400 .7rem/1.25rem var(--font-family-primary); | ||
| text-transform: uppercase; | ||
|
|
||
| border: 0; | ||
| border-radius: 1rem; | ||
| cursor: pointer; | ||
| vertical-align: middle; | ||
| } | ||
|
|
||
| .object-tools select.aeb-button:hover { | ||
| background: var(--object-tools-hover-bg); | ||
| } | ||
|
|
||
| .object-tools select.aeb-button option { | ||
| background: var(--object-tools-bg); | ||
| color: var(--object-tools-fg); | ||
| } |
118 changes: 118 additions & 0 deletions
118
src/country_workspace/web/templates/admin/country_workspace/batch_beneficiaries.html
This file contains hidden or 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,118 @@ | ||
| {% extends "admin/base_site.html" %} | ||
| {% load i18n admin_urls static %} | ||
| {% block breadcrumbs %} | ||
| <div class="breadcrumbs"> | ||
| <a href="{% url 'admin:index' %}">{% trans 'Home' %}</a> | ||
| › <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{{ opts.app_config.verbose_name }}</a> | ||
| › <a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst }}</a> | ||
| › <a href="{% url opts|admin_urlname:'change' batch.pk %}">{{ batch|truncatewords:"18" }}</a> | ||
| › {% trans 'Beneficiaries' %} | ||
| </div> | ||
| {% endblock %} | ||
| {% block content %} | ||
| <div id="content-main"> | ||
| <h1> | ||
| {% trans 'Beneficiaries for Batch' %}: {{ batch }} | ||
| </h1> | ||
| <div class="module"> | ||
| <h2> | ||
| {% trans 'Households' %} ({{ households.count }}) | ||
| </h2> | ||
| {% if households %} | ||
| <table style="width: 100%;"> | ||
| <thead> | ||
| <tr> | ||
| <th> | ||
| {% trans 'Name' %} | ||
| </th> | ||
| <th> | ||
| {% trans 'ID' %} | ||
| </th> | ||
| <th> | ||
| {% trans 'Status' %} | ||
| </th> | ||
| </tr> | ||
| </thead> | ||
| <tbody> | ||
| {% for hh in households %} | ||
| <tr class="{% cycle 'row1' 'row2' %}"> | ||
| <td> | ||
| <a href="{% url 'admin:country_workspace_household_change' hh.pk %}">{{ hh.name }}</a> | ||
| </td> | ||
| <td> | ||
| {{ hh.pk }} | ||
| </td> | ||
| <td> | ||
| {% if hh.removed %} | ||
| <span style="color: red;">{% trans 'Removed' %}</span> | ||
| {% else %} | ||
| <span style="color: green;">{% trans 'Active' %}</span> | ||
| {% endif %} | ||
| </td> | ||
| </tr> | ||
| {% endfor %} | ||
| </tbody> | ||
| </table> | ||
| {% else %} | ||
| <p> | ||
| {% trans 'No households found.' %} | ||
| </p> | ||
| {% endif %} | ||
| </div> | ||
| <div class="module"> | ||
| <h2> | ||
| {% trans 'Individuals' %} ({{ individuals.count }}) | ||
| </h2> | ||
| {% if individuals %} | ||
| <table style="width: 100%;"> | ||
| <thead> | ||
| <tr> | ||
| <th> | ||
| {% trans 'Name' %} | ||
| </th> | ||
| <th> | ||
| {% trans 'ID' %} | ||
| </th> | ||
| <th> | ||
| {% trans 'Household' %} | ||
| </th> | ||
| <th> | ||
| {% trans 'Status' %} | ||
| </th> | ||
| </tr> | ||
| </thead> | ||
| <tbody> | ||
| {% for ind in individuals %} | ||
| <tr class="{% cycle 'row1' 'row2' %}"> | ||
| <td> | ||
| <a href="{% url 'admin:country_workspace_individual_change' ind.pk %}">{{ ind.name }}</a> | ||
| </td> | ||
| <td> | ||
| {{ ind.pk }} | ||
| </td> | ||
| <td> | ||
| {% if ind.household %} | ||
| <a href="{% url 'admin:country_workspace_household_change' ind.household.pk %}">{{ ind.household.name }}</a> | ||
| {% else %} | ||
| - | ||
| {% endif %} | ||
| </td> | ||
| <td> | ||
| {% if ind.removed %} | ||
| <span style="color: red;">{% trans 'Removed' %}</span> | ||
| {% else %} | ||
| <span style="color: green;">{% trans 'Active' %}</span> | ||
| {% endif %} | ||
| </td> | ||
| </tr> | ||
| {% endfor %} | ||
| </tbody> | ||
| </table> | ||
| {% else %} | ||
| <p> | ||
| {% trans 'No individuals found.' %} | ||
| </p> | ||
| {% endif %} | ||
| </div> | ||
| </div> | ||
| {% endblock %} |
This file contains hidden or 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 hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.