Skip to content
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

Offline enhancement #1767

Open
wants to merge 105 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
555d117
Update SITE_VERSION to 2.13.6
shubhamgoel02 Jan 17, 2025
1d26047
code reverted
arushsinghh Jan 20, 2025
6d3a804
1392 changes reverted
arushsinghh Jan 20, 2025
e2c6966
Update production.py
shubhamgoel02 Jan 21, 2025
2a70b4d
user authentication url
vimugdhabatra Jan 21, 2025
c83735a
Github 1392 changes
arushsinghh Jan 27, 2025
080bbf9
Invite admin user button commented
arushsinghh Jan 29, 2025
05e5ea7
Deleted unwanted file
vimugdhabatra Jan 29, 2025
1d00e85
user authentication commented
vimugdhabatra Jan 29, 2025
60851b4
Invite admin user button commented (#1730)
vimugdhabatra Jan 29, 2025
ac91204
2.13.8
shubhamgoel-tomhorn Jan 29, 2025
f6fb0eb
user authentication: restricting uninvited users to login
vimugdhabatra Jan 30, 2025
e54721d
index.html file change
vimugdhabatra Jan 30, 2025
15b7735
first name updated by admin user is finalised
vimugdhabatra Jan 30, 2025
1e9479c
chat experience auto refresh: by Ajay
vimugdhabatra Jan 31, 2025
fde9a1b
user authentication fix and epic2 matomo changes
vimugdhabatra Feb 5, 2025
a30bfc9
conflict of main and user authencation
vimugdhabatra Feb 5, 2025
29e8193
epic2 matomo and user auth full functionality (#1739)
vimugdhabatra Feb 5, 2025
f535688
2.13.9-rc.3
shubhamgoel02 Feb 5, 2025
c8ce100
conflict resolved
vimugdhabatra Feb 5, 2025
0c62ef6
conflict resolved (#1740)
vimugdhabatra Feb 5, 2025
ab4cc91
2.13.9-rc.5
shubhamgoel02 Feb 5, 2025
4db72c3
invite admin css fix
vimugdhabatra Feb 6, 2025
a0f0f1e
invite admin css fix (#1741)
vimugdhabatra Feb 6, 2025
080ab9c
discription added for image title as alt text (#1742)
kushvah-ajaysingh-nagarro Feb 11, 2025
15c516b
2.13.9
shubhamgoel02 Feb 11, 2025
14f82d9
reply url: removed locale for user authentication
vimugdhabatra Feb 13, 2025
25f548b
reply url: removed locale for user authentication (#1743)
vimugdhabatra Feb 13, 2025
f38eb31
share feature
Feb 19, 2025
d312fb3
2.13.10-rc.3
shubhamgoel02 Feb 21, 2025
f3f3e0b
user authentication redirect url reverse, matomo email masking
vimugdhabatra Feb 21, 2025
14672cd
user authentication redirect url reverse, matomo email masking (#1746)
vimugdhabatra Feb 21, 2025
04c4ac3
Update production.py
shubhamgoel02 Feb 26, 2025
cc8456b
rating and feedback
kushvah-ajaysingh-nagarro Feb 27, 2025
247363d
rating and feedback (#1747)
kushvah-ajaysingh-nagarro Feb 27, 2025
5d9243d
rating setting
kushvah-ajaysingh-nagarro Feb 27, 2025
f0560cb
rating setting (#1748)
kushvah-ajaysingh-nagarro Feb 27, 2025
58a30bd
2.13.10-rc.8
shubhamgoel02 Feb 27, 2025
1b9b585
list reviews
kushvah-ajaysingh-nagarro Feb 27, 2025
59414d9
list reviews (#1749)
kushvah-ajaysingh-nagarro Feb 27, 2025
a8b6504
2.13.10-rc.9
shubhamgoel02 Feb 27, 2025
69d7221
Merge branch 'development' into share_article
kushvah-ajaysingh-nagarro Feb 27, 2025
bc5aea0
merge development
kushvah-ajaysingh-nagarro Feb 27, 2025
2994088
share feature (#1744)
kushvah-ajaysingh-nagarro Feb 27, 2025
e8cad26
move share button above feedback
kushvah-ajaysingh-nagarro Feb 27, 2025
e392780
move share button above feedback (#1750)
kushvah-ajaysingh-nagarro Feb 27, 2025
9c1c26c
secure and httponly issue fix
kushvah-ajaysingh-nagarro Feb 28, 2025
932bca8
secure and httponly issue fix (#1751)
kushvah-ajaysingh-nagarro Feb 28, 2025
37ca5ac
2.13.10-rc.10
shubhamgoel02 Feb 28, 2025
b574133
commented proxy
kushvah-ajaysingh-nagarro Feb 28, 2025
9313464
commented proxy (#1752)
kushvah-ajaysingh-nagarro Feb 28, 2025
cfd0beb
2.13.10-rc.11
shubhamgoel02 Feb 28, 2025
29a63cd
commented enforce https
kushvah-ajaysingh-nagarro Feb 28, 2025
7ea2fbf
commented enforce https (#1753)
kushvah-ajaysingh-nagarro Feb 28, 2025
753cbb0
2.13.10-rc.12
shubhamgoel02 Feb 28, 2025
c6c5e26
Vulnerability issue secure httponly (#1754)
kushvah-ajaysingh-nagarro Feb 28, 2025
180576f
superset iogt widget complete code
vimugdhabatra Mar 2, 2025
31a9571
superset iogt widget complete code (#1755)
vimugdhabatra Mar 2, 2025
28ff52a
Merge branch 'epic2_user_auth' into main
vimugdhabatra Mar 2, 2025
cbb3165
merged main into epic2_user_auth
vimugdhabatra Mar 2, 2025
962d509
2.13.11-rc.1
shubhamgoel02 Mar 3, 2025
a491308
questionnarie changes
vimugdhabatra Mar 3, 2025
6e88565
questionnarie changes (#1757)
vimugdhabatra Mar 3, 2025
9d11844
2.13.11-rc.2
shubhamgoel02 Mar 3, 2025
b115629
Merge branch 'main' into development
kushvah-ajaysingh-nagarro Mar 4, 2025
15d3a41
Merge branch 'development_2' into epic2_user_auth
Mar 4, 2025
c6fa3f1
Development (#1758)
vimugdhabatra Mar 4, 2025
db0de88
2.13.11-rc.3
shubhamgoel02 Mar 4, 2025
da625c9
feedback enhancements
kushvah-ajaysingh-nagarro Mar 7, 2025
eb5be90
Merge branch 'epic2_user_auth' into development_2
Mar 10, 2025
92f2c6f
Merge branch 'epic2_user_auth' into development_2
Mar 10, 2025
8242532
Development 2 (#1760)
kushvah-ajaysingh-nagarro Mar 10, 2025
9fb90c4
2.13.11-rc.5
shubhamgoel02 Mar 10, 2025
b61d52b
Share and rating feedback (#1761)
kushvah-ajaysingh-nagarro Mar 11, 2025
e31d64f
2.13.11
shubhamgoel02 Mar 11, 2025
54efe59
Update base.py
vimugdhabatra Mar 12, 2025
525beba
Update urls.py for production user auth
vimugdhabatra Mar 12, 2025
308a31f
2.13.12-rc.2
shubhamgoel02 Mar 12, 2025
03fe738
Update urls.py
vimugdhabatra Mar 13, 2025
890e9b0
Update base.py
vimugdhabatra Mar 13, 2025
5434cdc
2.13.12-rc.3
shubhamgoel02 Mar 13, 2025
ebf7c57
print statement added for debugging of env variables
vimugdhabatra Mar 13, 2025
2f5d9cb
print statement added for debugging of env variables (#1762)
vimugdhabatra Mar 13, 2025
e8db61a
2.13.12-rc.4
shubhamgoel02 Mar 13, 2025
06e3c21
merged main
shubhamgoel02 Mar 13, 2025
f179022
2.13.12-rc.5
shubhamgoel02 Mar 13, 2025
a439530
Bugfix/login profile button (#1764)
shubhamgoel02 Mar 13, 2025
1016f57
Merge pull request #1 from unicef/epic2_user_auth
vimugdhabatra Mar 13, 2025
f74c93c
redirect uri change for production
vimugdhabatra Mar 13, 2025
e157a10
merged main
shubhamgoel02 Mar 13, 2025
ee5ef04
2.13.13-rc.1
shubhamgoel02 Mar 13, 2025
32223f5
Merge pull request #1 from unicef/epic2_user_auth (#1765)
shubhamgoel02 Mar 17, 2025
a7130eb
Update base.py
shubhamgoel02 Mar 17, 2025
a9bea00
Update urls.py
shubhamgoel02 Mar 17, 2025
e1177ce
2.13.13-rc.2
shubhamgoel02 Mar 17, 2025
6304bd0
offline functionality
vimugdhabatra Mar 19, 2025
37669fb
offline functionality
vimugdhabatra Mar 19, 2025
1757434
Merge branch 'epic2_user_auth' of https://github.com/vimugdhabatra/io…
vimugdhabatra Mar 19, 2025
6830f80
Update urls.py
vimugdhabatra Mar 19, 2025
10bcfcd
Update base.py
vimugdhabatra Mar 19, 2025
c78d8a5
Epic2 user auth (#1766)
vimugdhabatra Mar 19, 2025
73093f2
Update production.py
shubhamgoel02 Mar 19, 2025
6a9378b
questionnarie change
vimugdhabatra Mar 20, 2025
890dae1
questionnarie change (#1768)
vimugdhabatra Mar 20, 2025
f8d097d
2.13.13-rc.5
shubhamgoel02 Mar 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
index.html file change
vimugdhabatra committed Jan 30, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit e54721d0505c252f7bd480ef4804ef33f5535e51
314 changes: 314 additions & 0 deletions iogt_users/templates/wagtailusers/users/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,314 @@
{% extends "wagtailusers/users/index.html" %}
{% load wagtailadmin_tags i18n %}

{% block content %}
{% trans "Users" as users_str %}

{% include "wagtailadmin/shared/header.html" with subtitle=group.name title=users_str action_url=add_link action_text=add_a_user_str icon="user" search_url="wagtailusers_users:index" %}
<div class="right">
<div class="actionbutton action-buttons">
<button id="invite-admin-button" class="button button&#45;&#45;icon" style="margin-left: 10px;">
{% icon name="plus" wrapped=1 %} Invite Admin User
</button>
</div>
</div>
<div class="nice-padding">
<div id="user-results" class="users">
{% include "wagtailusers/users/results.html" %}
</div>
{% trans "Select all users in listing" as select_all_text %}
{% include 'wagtailadmin/bulk_actions/footer.html' with select_all_obj_text=select_all_text app_label=app_label model_name=model_name objects=users %}
</div>

<!-- <header class=" hasform">-->
<!-- <div class="row">-->
<!-- <div class="left">-->
<!-- <div class="col">-->
<!-- <h1><svg class="icon icon-user icon" aria-hidden="true"><use href="#icon-user"></use></svg>-->
<!-- Users-->
<!-- </h1>-->
<!-- </div>-->
<!-- <form class="col search-form" action="/admin/users/" method="get" novalidate="" role="search">-->
<!-- <ul class="fields">-->
<!-- <li class="required">-->
<!-- <div class="field char_field text_input field-small iconfield" data-contentpath="q">-->
<!-- <label for="id_q">Search term:</label>-->
<!-- <div class="field-content">-->
<!-- <div class="input">-->
<!-- <svg class="icon icon-search icon" aria-hidden="true"><use href="#icon-search"></use></svg>-->
<!-- <input type="text" name="q" placeholder="Search users" required="" id="id_q">-->
<!-- <span></span>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </li>-->
<!-- <li class="visuallyhidden"><input disabled="" type="submit" aria-hidden="true"></li>-->
<!-- <li class="submit visuallyhidden"><input type="submit" value="Search" class="button"></li>-->
<!-- </ul>-->
<!-- </form>-->
<!-- </div>-->
<!-- <div class="right">-->
<!-- <div class="actionbutton action-buttons">-->
<!-- <button id="invite-admin-button" class="button button&#45;&#45;icon" style="margin-left: 10px;">-->
<!-- {% icon name="plus" wrapped=1 %} Invite Admin User-->
<!-- </button>-->
<!-- <a href="/admin/users/add/" class="button bicolor button&#45;&#45;icon">-->
<!-- <span class="icon-wrapper"><svg class="icon icon-plus icon" aria-hidden="true"><use href="#icon-plus"></use></svg></span>-->
<!-- Add a user-->
<!-- </a>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </header>-->

<div id="invite-admin-modal" class="modal">
<div class="modal-content">
<div>
<span class="close-button" id="close-modal">&times;</span>
<h2>Invite Admin User</h2>
</div>
<hr>
<form id="invite-admin-form">
<div class="input-group">
<div class="input-field">
<input type="text" id="first_name" name="first_name" placeholder="First Name">
<span class="error-message" id="first_name_error" style="color: red; display: none;"></span>
</div>

<div class="input-field">
<input type="text" id="last_name" name="last_name" placeholder="Last Name">
<span class="error-message" id="last_name_error" style="color: red; display: none;"></span>
</div>

</div>
<div class="input-field">
<input type="text" id="email" name="email" placeholder="Email Address" title="Please enter a valid email address">
<span class="error-message" id="email_error" style="color: red; display: none;"></span>
</div>

<div class="form-actions">
<button type="submit" class="button button--icon" style="border-radius: 5px;">Send Invite</button>
</div>
</form>
</div>
</div>

<style>
.modal {
display: none;
position: fixed;
z-index: 1000;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: auto;
background-color: rgba(0, 0, 0, 0.4);
}
.modal-content {
background-color: #fefefe;
margin: 15% 36%;
padding: 20px;
border: 1px solid #888;
width: 25%;
border-radius: 10px;
}
.close-button {
color: black;
float: right;
font-size: 28px;
font-weight: bold;
}
.close-button:hover,
.close-button:focus {
color: black;
text-decoration: none;
cursor: pointer;
}
.error-message {
display: block;
color: red;
}
hr{
border-color: black;
}
.input-group {
display: flex;
gap: 10px;
margin-bottom: 15px;
}
.input-field {
flex: 1;
}
.input-field input {
border: 1px solid #888;
width: 100%;
padding: 10px;
font-weight: 400;
border-radius: 5px;
}
input.invalid {
border: 1px solid red;
}

.form-actions {
display: flex;
justify-content: flex-end;
margin-top: 25px;
}

</style>

{% endblock %}

{% block extra_js %}
{{ block.super }}
<script>
window.headerSearch = {
{% if group %}
url: "{% url 'wagtailusers_groups:users' group.id %}",
{% else %}
url: "{% url 'wagtailusers_users:index' %}",
{% endif %}
termInput: "#id_q",
targetOutput: "#user-results"
}
</script>
<script>
window.wagtailConfig.BULK_ACTION_ITEM_TYPE = 'USER';
</script>
<script defer src="{% versioned_static 'wagtailadmin/js/bulk-actions.js' %}"></script>

<script>
document.addEventListener('DOMContentLoaded', function() {
const inviteAdminButton = document.getElementById('invite-admin-button');
const modal = document.getElementById('invite-admin-modal');
const closeButton = document.getElementById('close-modal');
const form = document.getElementById('invite-admin-form');
const inputs = form.querySelectorAll('input');
const body = document.querySelector('body');

inviteAdminButton.onclick = function() {
modal.style.display = 'block';
form.reset();
resetErrorMessages();
};

closeButton.onclick = function() {
modal.style.display = 'none';
};

form.onsubmit = function(event) {
event.preventDefault();
resetErrorMessages();

const firstName = document.getElementById('first_name').value;
const lastName = document.getElementById('last_name').value;
const email = document.getElementById('email').value;

let isValid = true;

if (firstName.trim() === "") {
showError('first_name', "First Name is required.");
isValid = false;
}
if (lastName.trim() === "") {
showError('last_name', "Last Name is required.");
isValid = false;
}
if (!validateEmail(email)) {
showError('email', "Please enter a valid email address.");
isValid = false;
}

if (isValid) {
const formData = new FormData(form);

fetch("{% url 'invite_admin_user' %}", {
method: 'POST',
body: formData,
headers: {
'X-Requested-With': 'XMLHttpRequest'
}
})
.then(response => response.json())
.then(data => {
if (data.success) {
modal.style.display = 'none';
form.reset();
displaySuccessMessage("Invite sent successfully!");

setTimeout(() => {
modal.style.display = 'none';
}, 1000);
} else {
for (const [key, value] of Object.entries(data.errors)) {
showError(key, value);
}
}
})
.catch(error => console.error('Error:', error));
}
};

function validateEmail(email) {
const re = /^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}$/;
return re.test(String(email).toLowerCase());
}

function resetErrorMessages() {
const errorMessages = document.querySelectorAll('.error-message');
errorMessages.forEach(function(errorMessage) {
errorMessage.textContent = '';
errorMessage.style.display = 'none';
});

const invalidInputs = document.querySelectorAll('input.invalid');
invalidInputs.forEach(function(input) {
input.classList.remove('invalid');
});
}

function showError(inputId, message) {
const errorElement = document.getElementById(inputId + '_error');
errorElement.textContent = message;
errorElement.style.display = 'block';
document.getElementById(inputId).classList.add('invalid');
}

function displaySuccessMessage(message){
const successMessage = document.createElement('div');
successMessage.textContent = message;
successMessage.style.cssText = `
position: fixed;
bottom: 10px;
right: 10px;
background-color: #134f5c;
color: white;
padding: 15px 20px;
border-radius: 5px;
z-index: 1001;
font-size: 14px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
font-weight: bold;
`;

body.appendChild(successMessage);

setTimeout(() => {
successMessage.remove();
}, 1000);
}

inputs.forEach(input => {
input.addEventListener('input', function() {
const errorMessage = document.getElementById(input.id + '_error');
if (errorMessage) {
errorMessage.style.display = 'none';
}
input.classList.remove('invalid');
});
});
});
</script>
{% endblock %}