-
Notifications
You must be signed in to change notification settings - Fork 0
/
thingwillbeforgotten.txt
131 lines (123 loc) · 4.64 KB
/
thingwillbeforgotten.txt
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
129
130
131
method in answer service
protected function htmlForMainCmt($answer, $count, $isReply = false)
{
$renderTime = $this->renderTime($answer);
$html = '<div class="comment-main-level">
<!-- Avatar -->
<div class="comment-avatar">
<img src="image/images.png" alt="" />
</div>
<!-- Contenedor del Comentario -->
<div class="comment-box">
<div class="comment-head">
<h6 class="comment-name">
<a href="#">Lorena Rojero</a>
</h6>
<span> ' .
$renderTime
.
' </span>
<i class="fa fa-reply reply-btn"></i>
<i class="fa fa-heart"></i>
</div>
<div class="comment-content">
' .
$answer->content
. '
</div>
<br>
' . $this->repCmtForm($answer, $count) . '
</div>
</div>';
if ($isReply) {
$html .= '';
}
return $html;
}
protected function renderHtml($data)
{
$html = '<!-- Avatar -->
<div class="comment-avatar">
<img src="image/images.png" alt="" />
</div>
<!-- Contenedor del Comentario -->
<div class="comment-box">
<div class="comment-head">
<h6 class="comment-name">
<a href="#">Lorena Rojero</a>
</h6>
<span>' .
$this->renderTime($data)
. '</span>
<i class="fa fa-reply reply-btn"></i>
<i class="fa fa-heart"></i>
</div>
<div class="comment-content">
' . $data->content . '
</div>
<br>
' . $this->repCmtForm($data, $data->id) .
'
</div> ';
}
protected function repCmtForm($data, $count)
{
$html = '<div data-comment-id ="' . $count . '" style="display: none ; " class="comment-head cmt-section">
<form method="POST" action="' . URLROOT . 'quest/answer">
<input type="hidden" name="quest[id]" value="' . $_GET['id'] . '">
<input type="hidden" name="quest[parent_id]" value="' . $data->id . '">
<div class="row">
<div class="col-md-4">
<div class="replay-input-name42389">
<input type="text" name="quest[username]" class="name-box24894 input238-design" placeholder="Name" />
</div>
</div>
<div class="col-md-4">
<div class="replay-email-input89298">
<input type="text" name="quest[email]" class="name-box24894 input238-design" placeholder="E-mail" />
</div>
</div>
<div class="col-md-4">
<div class="replay-input-websit128923">
<input type="text" name="quest[website]" class="name-box24894 input238-design" placeholder="Website" />
</div>
</div>
<div class="col-md-12">
<input type="text" name="quest[content]" class="comment-input219882" placeholder="Enter Your Post" />
</div>
<button type="submit"style="width:100%;" class="pos393-submit">
Post Your Answer
</button>
</div>
</form>
</div>';
return $html;
}
html in questdetails.html.php
<script>
// function showCommentForm() {
// var paragraph = document.getElementById("comment289");
// if (paragraph.style.display == "none") {
// paragraph.style.display = "";
// } else {
// paragraph.style.display = "none";
// }
// }
// let keyArr = document.querySelectorAll(".comment-main-level .comment-box ");
// keyArr.forEach(element => {
// console.log(element, 'element');
// let replyBtn = element.querySelector('.comment-head .reply-btn');
// console.log(replyBtn, 'replyBtn');
// replyBtn.addEventListener('click', () => {
// let commentHead = element.querySelector('.comment-box .cmt-section');
// let tempVal = commentHead.getAttribute('data-comment-id');
// console.log(tempVal, 'tempVal');
// let replyForm = document.querySelector(`div[data-comment-id="${tempVal}"]`);
// if (replyForm.style.display == "none") {
// replyForm.style.display = "";
// } else {
// replyForm.style.display = "none";
// }
// })
// })
</script>