forked from kehers/suet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuser.liquid
128 lines (122 loc) · 5.11 KB
/
user.liquid
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
{% include 'partials/header-dashboard.liquid' %}
<section>
<div class="container">
<!--
Country
Device OS
Clients
Platform (mobile/desktop~)
Top clicks
Top opens
Time graph of engagement
-->
<div class="row pad-btm">
<div class="six columns">
<a href="/users">Users</a> <i class="icon-fast-forward"></i>
<h5>{{ data.email }}</h5>
<small><a href="#" class="small-button mail">Quick Mail</a></small>
{% if error %}<p class="error">{{ error }}</p>{% endif %}
{% if info %}<p class="info">{{ info }}</p>{% endif %}
</div>
{% assign or = data.unique_opens | times: 100 | divided_by: data.deliveries | round: 2 %}
{% assign ctr = data.urls | size | times: 100 | divided_by: data.deliveries | round: 2 %}
<div class="six columns">
<div class="row grid">
<div class="three columns">
deliveries <h5 class="inline">{{ data.deliveries }}</h5><br>
<span> </span>
</div>
<div class="five columns">
opens <h5 class="inline">{{ data.opens }}</h5><br>
<span class="fade">{{ data.unique_opens }} unique, {{ or }}% open rate</span>
</div>
<div class="four columns">
clicks <h5 class="inline">{{ data.clicks }}</h5><br>
<span class="fade">{{ data.urls | size }} unique, {{ ctr }}% CTR</span>
</div>
</div>
</div>
</div>
<div class="row">
<div class="eight columns">
<div class="feed">
{% assign last_msg_id = "" %}
{% for log in data.logs %}
{% if log.msg_id != last_msg_id %}
{% if last_msg_id != "" %}</ul></div></div>{% endif %}
<div class="row">
<div class="twelve columns">
<a href="/mails/{{ log.msg_id }}">{{ log.subject }}</a>
<ul class="timeline">
{% endif %}
<li>
<div class="line"></div>
<date>{{ log.timeago }}</date>
{% if log.event == 'clicked' %}
<span class="tag green">{{ log.event }}</span> <a href="/links/{{ log.url | url_encode }}" class="break-words">{{ log.url }}</a> <a href="{{ log.url }}" target="_blank" rel="noopener noreferrer"><i class="icon-open fade"></i></a>
{% elsif log.event == 'opened' %}
<span class="tag yellow">{{ log.event }}</span> <span class="fade">{{ log.client }} on {{ log.os }} ({{ log.platform }}){%if log.city != 'Unknown' %}, {{ log.city }}{% endif %}{%if log.country != 'Unknown' %}, {{ log.country }}{% endif %}</span>
{% elsif log.event == 'dropped' %}
<span class="tag red">{{ log.event }}</span> <span class="fade">{{ log.description }}</span>
{% elsif log.event == 'bounced' %}
<span class="tag pink">{{ log.event }}</span><span class="fade">{{ log.error }}</span>
{% else %}
<span class="tag">{{ log.event }}</span><!--a href="/mails/{{ log.msg_id }}">{{ log.subject }}</a-->
{% endif %}
</li>
{% assign last_msg_id = log.msg_id %}
{% endfor %}
{% if last_msg_id != "" %}</ul></div></div>{% endif %}
</div>
</div>
<div class="four columns">
<p><strong>Clicks</strong></p>
<ul class="list break-words">
{% for url in data.urls %}
<li><a href="/links/{{ url | url_encode }}">{{ url }}</a> <a href="{{ url }}" target="_blank" rel="noopener noreferrer"><i class="icon-open fade"></i></a></li>
{% endfor %}
</ul>
</div>
</div>
</div>
</section>
<div class="modal hide">
<a href="#" class="close">Close <i class="icon-cross"></i></a>
<div style="margin:100px 50px">
<form method="post">
<h5><span class="fade">To:</span> {{ data.email }}</h5>
<div class="row top-10">
<div class="six columns">
<label>From (name)</label>
<input type="text" name="name" class="u-full-width" required>
</div>
<div class="six columns">
<label>From (email)</label>
<input type="email" name="from" class="u-full-width" required>
</div>
</div>
<label class="top-10">Subject</label>
<input type="text" name="subject" class="u-full-width" required>
<label class="top-10">Body</label>
<textarea name="body" class="u-full-width" style="height:300px" required></textarea>
<button type="submit" class="u-full-width button-primary">Send</button>
</form>
</div>
</div>
<script type="text/javascript" src="/js/jquery.js"></script>
<script type="text/javascript">
$('.mail, .close').on('click', function() {
$('.modal').toggleClass('hide');
return false;
});
$(document).keyup(function(e) {
if (e.keyCode == 27) {
if (!$('.modal').hasClass('hide'))
$('.modal').toggleClass('hide');
}
});
$('.modal form').on('submit', function() {
$(this).find(':button').attr('disabled', 'disabled');
});
</script>
{% include 'partials/footer.liquid' %}