Repository navigation
Expand file tree
/
Copy pathcomments.php
More file actions
194 lines (173 loc) · 8.28 KB
/
Copy pathcomments.php
File metadata and controls
194 lines (173 loc) · 8.28 KB
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
<?php
if(post_password_required()) {
return;
}
?>
<!-- Comments anchor -->
<a name="comments"></a>
<?php if ( have_comments() ) : ?>
<header class="page-header text-right">
<h4 class="comments-title">
<?php
printf(
_nx('One comment',
'%1$s comments',
get_comments_number(),
null,
'gitsta'
),
number_format_i18n(
get_comments_number()
)
);
?>
</h4>
</header>
<ol class="comment-list media-list">
<?php
// Comments
// see inc/Comments.php, inc/Partials/*.php
wp_list_comments(array('callback' => 'Gitsta_ThemeComments::format', 'avatar_size' => 50));
?>
</ol>
<?php if((get_comment_pages_count() > 1) && (get_option('page_comments'))): ?>
<ul class="pager">
<li class="previous"><?php previous_comments_link(__('Older comments', 'gitsta')); ?></li>
<li class="next"><?php next_comments_link(__('Newer comments', 'gitsta')); ?></li>
</ul>
<?php endif; // Comment navigation ?>
<?php endif; // have_comments() ?>
<hr>
<?php
// Comment form
if(comments_open()):
?>
<a name="respond"></a>
<div class="comment-body media" id="respond">
<div class="pull-left" href="#">
<?php
// Show avatar for logged users
global $current_user;
wp_get_current_user();
echo get_avatar($current_user->user_email, 50);
?>
</div>
<div class="media-body comment">
<div class="media-body-wrap panel panel-default comment">
<div class="panel-heading" style="padding-bottom: 0;">
<ul class="nav nav-tabs" style="position: relative; top: 1px;">
<li class="active"><a href="#write" data-toggle="tab"><i class="fa fa-pencil"></i> <?php _e('Reply', 'gitsta'); ?></a></li>
<?php
// These tabs are hidden, if markdown support option is disabled
if(get_gitsta_theme_option('comment_markdown_support') == 1):
?>
<li><a href="#preview" data-toggle="tab" class="preview-reply"><i class="fa fa-eye"></i> <?php _e('Preview', 'gitsta'); ?></a></li>
<li><a href="#help" data-toggle="tab" class="preview-reply"><i class="fa fa-question"></i> <?php _e('Help', 'gitsta'); ?></a></li>
<?php
endif;
?>
</ul>
</div>
<div class="panel-body">
<div class="tab-content">
<div id="write" class="tab-pane active">
<?php
$gitsta_form_commenter = wp_get_current_commenter();
$gitsta_form_req = get_option('require_name_email');
$gitsta_form_aria_req = ($req ? " aria-required='true'" : '');
$gitsta_form_author = '<div class="row">
<div class="col-md-4">
<input class="form-control" placeholder="' . __('Name', 'gitsta') . '" id="author" name="author" type="text" value="' . esc_attr($gitsta_form_commenter['comment_author']) . '" size="30"' . $gitsta_form_aria_req . ' />
</div>';
$gitsta_form_mail = '<div class="col-md-4">
<input class="form-control" placeholder="' . __('E-Mail', 'gitsta') . '" id="email" name="email" type="text" value="' . esc_attr($gitsta_form_commenter['comment_author_email']) . '" size="30"' . $gitsta_form_aria_req . ' />
</div>';
$gitsta_form_url = '<div class="col-md-4">
<input class="form-control" placeholder="' . __('URL', 'gitsta') . '" id="url" name="url" type="text" value="' . esc_attr($gitsta_form_commenter['comment_author_url']) . '" size="30" />
</div>
</div><!-- /row -->';
// Call the comments form
comment_form(array(
'title_reply' => '</h3>',
'title_reply_to' => '</h3><div class="alert alert-info">Replying to %s. '.cancel_comment_reply_link('Click here to cancel reply.').'</div>',
'cancel_reply_link' => '<em></em>',
'label_submit' => __('Post comment', 'gitsta'),
'fields' => array(
'author' =>
$gitsta_form_author,
'email' =>
$gitsta_form_mail,
'url' =>
$gitsta_form_url
),
'comment_field' => '<br><p><textarea placeholder="' . __('Markdown enabled', 'gitsta') . '" id="comment" class="form-control" name="comment" cols="45" rows="8" aria-required="true"></textarea></p>',
'comment_notes_after' => '',
'comment_notes_before' => ''
));
?>
</div>
<?php
// These tabs are hidden, if markdown support option is disabled
if(get_gitsta_theme_option('comment_markdown_support') == 1):
?>
<div id="preview" class="tab-pane">
<!-- Markdown preview tab -->
<div id="markdown-preview"></div>
</div>
<div id="help" class="tab-pane">
<!-- Markdown help tab -->
<table class="table table-striped">
<thead>
<tr>
<th style="width: 50%;"><?php _e('Markdown', 'gitsta'); ?></th>
<th style="width: 50%;"><?php _e('Result', 'gitsta'); ?></th>
</tr>
</thead>
<tbody>
<tr>
<td>*text*</td>
<td><i>text</i></td>
</tr>
<tr>
<td>**text**</td>
<td><b>text</b></td>
</tr>
<tr>
<td>***text***</td>
<td><i><b>text</b></i></td>
</tr>
<tr>
<td>`code`</td>
<td><code>code</code></td>
</tr>
<tr>
<td>~~~<br>
more code
<br>~~~~</td>
<td>
<pre>
more code</pre>
</td>
</tr>
<tr>
<td>[Link](http://www.example.com)</td>
<td><a href="http://www.example.com">Link</a></td>
</tr>
<tr>
<td>* Listitem</td>
<td><ul><li>Listitem</li></ul></td>
</tr>
<tr>
<td>> Quote</td>
<td><blockquote>Quote</blockquote></td>
</tr>
</tbody>
</table>
</div>
<?php endif; // if markdown support for comments is enabled ?>
</div>
</div>
</div>
</div>
</div>
<?php endif; ?>