mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Add survery to admin first log
This commit is contained in:
parent
9ba7dac723
commit
474597d16c
@ -61,6 +61,7 @@ class Controller:
|
|||||||
self.support_scheduler: BackgroundScheduler = BackgroundScheduler(
|
self.support_scheduler: BackgroundScheduler = BackgroundScheduler(
|
||||||
timezone=str(tz)
|
timezone=str(tz)
|
||||||
)
|
)
|
||||||
|
self.first_login = False
|
||||||
self.support_scheduler.start()
|
self.support_scheduler.start()
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
@ -398,6 +398,9 @@ class PanelHandler(BaseHandler):
|
|||||||
template = "panel/contribute.html"
|
template = "panel/contribute.html"
|
||||||
|
|
||||||
elif page == "dashboard":
|
elif page == "dashboard":
|
||||||
|
page_data['first_log'] = self.controller.first_login
|
||||||
|
if self.controller.first_login and exec_user['username'] == 'admin':
|
||||||
|
self.controller.first_login = False
|
||||||
if superuser: # TODO: Figure out a better solution
|
if superuser: # TODO: Figure out a better solution
|
||||||
try:
|
try:
|
||||||
page_data[
|
page_data[
|
||||||
|
@ -158,7 +158,8 @@ class PublicHandler(BaseHandler):
|
|||||||
logger.info(
|
logger.info(
|
||||||
f"User: {user_data} Logged in from IP: {self.get_remote_ip()}"
|
f"User: {user_data} Logged in from IP: {self.get_remote_ip()}"
|
||||||
)
|
)
|
||||||
|
if not user_data.last_ip and user_data.username == 'admin':
|
||||||
|
self.controller.first_login = True
|
||||||
# record this login
|
# record this login
|
||||||
user_data.last_ip = self.get_remote_ip()
|
user_data.last_ip = self.get_remote_ip()
|
||||||
user_data.last_login = Helpers.get_time_as_string()
|
user_data.last_login = Helpers.get_time_as_string()
|
||||||
|
@ -23,7 +23,28 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
<!-- Page Title Header Ends-->
|
<!-- Page Title Header Ends-->
|
||||||
|
{% if data['first_log'] %}
|
||||||
|
<script>
|
||||||
|
$(document).ready(function() {
|
||||||
|
bootbox.alert({
|
||||||
|
backdrop: true,
|
||||||
|
title: 'Your Feedback Is Appreciated...',
|
||||||
|
message: '<p>We will only request this information from the admin user once... 😊</p>'
|
||||||
|
+'<p><strong>All data collected is completely anonymous</strong> and is only used to improve Crafty 4.0 and allow us to more accurately report the number of Crafty 4 users.</p><iframe width="640px" height="480px"'
|
||||||
|
+'src="https://forms.office.com/Pages/ResponsePage.aspx?id=LwLajNkpXU2CKc95G1oO3MN0Hu3oEUNLr-EtLx31TS5UNUNVQlFNVUVYMEc'
|
||||||
|
+'1V1BKS0FQUUlERUtWQy4u&embed=true" frameborder="0" marginwidth="0" marginheight="0" style="border: none; max-width:100%;'
|
||||||
|
+' max-height:100vh" allowfullscreen webkitallowfullscreen mozallowfullscreen msallowfullscreen> </iframe>',
|
||||||
|
buttons: {
|
||||||
|
ok: {
|
||||||
|
label: 'Skip Survey/Done',
|
||||||
|
className: 'btn-secondary'
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
|
{% end %}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12 grid-margin">
|
<div class="col-md-12 grid-margin">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
|
Loading…
Reference in New Issue
Block a user