-
Notifications
You must be signed in to change notification settings - Fork 1
/
test.html.twig
108 lines (93 loc) · 2.44 KB
/
test.html.twig
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>LtUpvoteBundleTest page</title>
<link rel="stylesheet" type="text/css" href="{{ asset('/bundles/ltupvote/css/lt-upvote.css') }}">
<style>
body {
padding: 10px;
}
h1 {
font-size: 16px;
}
p {
margin: 11px;
}
div.test-container {
border: 1px solid lightgray;
margin-bottom: 5px;
}
div.test-contents {
display: inline-block;
vertical-align: middle;
color: #2e6da4;
font-size: 18px
}
</style>
</head>
<body>
<h1 class="test-header">LtUpvoteBundle test page</h1>
<div class="test-container">
{{ render(
controller(
'lt_upvote_bundle.controller.default:renderUpvote',
{
'subjectId': 1,
'subjectType': 'testPost1',
}
)
) }}
<div class="test-contents">This voting is not restricted. Every visitor has one vote per element.</div>
</div>
<div class="test-container">
{{ render(
controller(
'lt_upvote_bundle.controller.default:renderUpvote',
{
'subjectId': 2,
'subjectType': 'testPost2',
}
)
) }}
<div class="test-contents">Do not show downvote button.</div>
</div>
<div class="test-container">
{{ render(
controller(
'lt_upvote_bundle.controller.default:renderUpvote',
{
'subjectId': 1,
'subjectType': 'testPost3',
}
)
) }}
<div class="test-contents">Downvoting is allowed for logged in users only.</div>
</div>
{{ render(
controller(
'lt_upvote_bundle.controller.default:renderUpvote',
{
'subjectId': 2,
'subjectType': 'testComment',
'class': 'style1'
}
)
) }} Was this helpful?
<script src="{{asset('/bundles/ltupvote/js/lt-upvote.js')}}"></script>
<script language="JavaScript"><!--
ltupvote.init();
//-->
</script>
<script language="JavaScript"><!--
addEventListener('ltu', function(event) {
console.log(event.detail);
if (event.detail.unauthorizedError) {
alert('You need to be logged in to perform this action');
//alternatively show login screen
}
})
//-->
</script>
</body>
</html>