forked from DiscipleTools/disciple-tools-theme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
template-notifications.php
98 lines (78 loc) · 4.43 KB
/
template-notifications.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<?php
/*
Template Name: Notifications
*/
dt_please_log_in();
if ( ! current_user_can( 'access_disciple_tools' ) ) {
wp_safe_redirect( '/registered' );
exit();
}
$dt_user = wp_get_current_user(); // query to get new notifications
get_header(); ?>
<script>
jQuery(document).ready(function () {
get_notifications(false, true);
});
</script>
<div id="content" class="template-notifications notifications-page">
<div id="inner-content" class="grid-x grid-margin-x">
<div class="large-8 large-offset-2 small-12 cell ">
<div class="bordered-box">
<h3 class="section-header"><?php esc_html_e( "Notifications", "disciple_tools" ); ?><button class="help-button float-right" data-section="notifications-template-help-text">
<img class="help-icon" src="<?php echo esc_html( get_template_directory_uri() . '/dt-assets/images/help.svg' ) ?>"/>
</button></h3>
<div class="grid-x">
<div class="cell">
<div class="grid-x grid-margin-x " style="border-bottom: 1px solid #ccc;">
<div class="small-4 medium-5 cell">
<div class="grid-x align-middle">
<span class="badge alert notification-count" style="display:none;"> </span>
<div class="new-notification-label"><strong><?php esc_html_e( 'New', 'disciple_tools' )?></strong></div>
</div>
</div>
<div class="small-4 medium-2 cell">
<div class="expanded small button-group">
<button id="all" type="button"
onclick="toggle_buttons('all'); get_notifications( all = true, true, );"
class="button hollow"><?php echo esc_html_x( 'All', 'List Filters', 'disciple_tools' ) ?>
</button>
<button id="new" type="button"
onclick="toggle_buttons('new'); get_notifications( all = false, true );"
class="button"><?php esc_html_e( 'Unread', 'disciple_tools' )?>
</button>
</div>
</div>
<div class="small-4 medium-5 cell" style="text-align:right;">
<span class="hide-for-small-only">
<a onclick="mark_all_viewed()"><?php esc_html_e( 'Mark all as read', 'disciple_tools' ) ?></a> -
<a href="<?php echo esc_url( home_url( '/' ) ); ?>settings/#notifications">
<?php esc_html_e( 'Settings', 'disciple_tools' )?>
</a>
</span>
<span class="show-for-small-only">
<a onclick="mark_all_viewed()"><?php esc_html_e( 'Mark All', 'disciple_tools' ) ?></a>
</span>
</div>
</div>
</div>
</div>
<div id="notification-list" class="grid-x"><span class="loading-spinner active" style="margin:1em;"></span></div>
<div class="grid-x">
<div class="cell">
<div class="grid-x grid-margin-x grid-margin-y">
<div class="small-12 medium-6 medium-offset-3 cell center">
<a id="next-all" onclick="get_notifications( true, false )" style="display:none;">
<?php esc_html_e( 'Load more notifications', 'disciple_tools' )?>
</a>
<a id="next-new" onclick="get_notifications( false, false )">
<?php esc_html_e( 'Load more notifications', 'disciple_tools' ) ?>
</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div> <!-- end #inner-content -->
</div> <!-- end #content -->
<?php get_footer(); ?>