forked from biswaz/rescuekerala
-
Notifications
You must be signed in to change notification settings - Fork 573
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
Fix #1030. Display volunteer count on home page #1036
Open
jerinisready
wants to merge
7
commits into
raksha-life:master
Choose a base branch
from
jerinisready:2019/jerinisready/issue_fix
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Fix #1030. Display volunteer count on home page #1036
jerinisready
wants to merge
7
commits into
raksha-life:master
from
jerinisready:2019/jerinisready/issue_fix
Conversation
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
COMMIT ensures there is no breaking in design or working of the application. CHANGES ======= Added badges to cards which shows count of active items in that section. Date: Sat Aug 10 12:47:58 2019 +0530 On branch 2019/jerinisready/issue_fix Changes to be committed: modified: mainapp/models.py modified: mainapp/views.py modified: static/css/style.css modified: templates/base.html modified: templates/home.html
dauntlessnomad
requested review from
biswaz and
vigneshhari
and removed request for
biswaz
August 10, 2019 10:35
jojurajan
reviewed
Aug 10, 2019
jerinisready
force-pushed
the
2019/jerinisready/issue_fix
branch
from
August 10, 2019 13:13
6651659
to
bdf525b
Compare
jojurajan
reviewed
Aug 10, 2019
biswaz
changed the title
2019/jerinisready/issue fix
Fix #1030. Display volunteer count on home page
Aug 15, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
COMMIT ensures there is no breaking in design or working of the application.
CHANGES
Date: Sat Aug 10 12:47:58 2019 +0530
On branch 2019/jerinisready/issue_fix
Changes to be committed:
mainapp/models.py
mainapp/views.py
static/css/style.css
templates/base.html
templates/home.html
templates/ngo_volunteer.html
Issue Reference
This PR addresses the Issue: Fixes #1030
Summarize
Added badges to cards which shows count of active items in that section.
Updations
mainapp/models.py
- added classmethods for models to get count with neet filtering where required.mainapp/views.py
- caching and passing required counts as contextstatic/css/style.css
- reformated style as per standards with auto intent in Pycharm;- added styles for badge in card
- added a fair border for from.
templates/home.html
- added{% block title %}
to provide title inherritancetemplates/home.html
- added badges for each card.templates/ngo_volunteer.html
- added badges for each card showing volunteer intivudial count and ngo count.OPTIMIZATIONS.
After caching on first hit, it take none until cache expiry.
* Ease Disconnection of changes in this commit from settings.
CONFIGURATIONS.
while coding reviews
settings.HOME_PAGE_ANALYTICS['DISPLAY'] = True
will enable the changes which makes the changes shown as in the images. Turning it off will make everything working normal.settings.HOME_PAGE_ANALYTICS['INVALIDATION_LOGIC'] = 'TIMEOUT'
will invalidate cache insettings.HOME_PAGE_ANALYTICS['TIMEOUT']
seconds which is default to 40 minutes.settings.HOME_PAGE_ANALYTICS['INVALIDATION_LOGIC'] = 'ON_CREATE'
will be eager mode which invalidates cache to get most up to date result, which invalidates cache on every creation in specific tables.settings.HOME_PAGE_ANALYTICS['HOME_PAGE_CACHE_KEY'] = 'home_page_data_statics'
makes redis key to store values for home page counts .settings.HOME_PAGE_ANALYTICS['VOLUNTEER_CACHE_KEY'] = 'ngo_data_statics'
makes redis key to store values for volunteer data counts .