Browse Source

* fix templates

master
Alex 'AdUser' Z 7 years ago
parent
commit
06f152bcd1
  1. 14
      templates/main/form.html.ep
  2. 15
      templates/main/list.html.ep

14
templates/main/form.html.ep

@ -0,0 +1,14 @@
<div id="cmtd_add">
<form method="POST" action="">
<div class="cmtd_head">
<%= l('Name') %>: <%= text_field 'name', required => 1, placeholder => l('Name') %>
<input type="hidden" name="reply" value="">
</div>
<textarea name="text" required=1></textarea>
<div id="cmtd_captcha"></div>
<div class="cmtd_add">
<%= submit_button l('Send') %>
<span id="resp"></span>
</div>
</form>
</div>

15
templates/main/list.html.ep

@ -1,14 +1,23 @@
% my $comments = stash('comments') || []; % my $comments = stash('comments') || [];
<div id="cmtd_main"> <div id="cmtd_main">
<hr>
<%= tag 'h4' => l('Comments') . ':' %>
% if (@{ $comments }) {
% foreach my $cm (@{ $comments }) { % foreach my $cm (@{ $comments }) {
<div id="cmtd_comment"> <div class="cmtd_comment">
<div class="cmtd_head"> <div class="cmtd_head">
<%= tag span => (class => 'cmtd_num') => $cm->{seq} %>, <%= tag a => (class => 'cmtd_num', name => "cm$cm->{seq}") => "# $cm->{seq}" %>,
<%= tag span => (class => 'cmtd_name') => $cm->{name} %>, <%= tag span => (class => 'cmtd_name') => $cm->{name} %>,
<%= tag span => (class => 'cmtd_date') => $cm->{date} %>, <%= tag span => (class => 'cmtd_date') => $cm->{date} %>,
<%= link_to 'Reply' => '#', class => 'reply', 'date-id' => $cm->{seq} %> <%= link_to l('Reply') => '#', class => 'c_add', 'data-cid' => $cm->{seq} %>
</div> </div>
<%= tag 'div' => (class => 'cmtd_text') => $cm->{text} %> <%= tag 'div' => (class => 'cmtd_text') => $cm->{text} %>
</div> </div>
% }
<span id="comment_add"><%= link_to l('Add') => '#', class => 'c_add' %></span>
% } else {
<p id="no_comments_notice">
<%= l('No comments') %>. <%= link_to l('Add') => '#', class => 'c_add' %>?
</p>
% } % }
</div> </div>

Loading…
Cancel
Save