Bootylicious

 view release on metacpan or  search on metacpan

bootylicious  view on Meta::CPAN



@@ article.html.ep
% stash title => $article->title, description => $article->description;
<div class="text">
    <h1 class="title"><%= link_to_article $article %></h1>
    <%= include 'article-meta', article => $article %>
    <div class="article-content">
        <%= render_article $article %>
    </div>
%= include 'article-pingbacks', pingbacks => $article->pingbacks if $article->pingbacks->size;
%= include 'article-comments', comments => $article->comments if comments_enabled && $article->comments->size;
%= include 'article-comment-form' if comments_enabled;
%= include 'article-pager', next => $article->next, prev => $article->prev;
</div>


@@ article-pingbacks.html.ep
<div id="pingbacks">
    <h2>Pingbacks</h2>
    <div class="content">
        <ul>
        % while (my $pingback = $pingbacks->next) {
            <li><%= date $pingback->created %> <%= link_to $pingback->source_uri %></li>
        % }
        </ul>
    </div>
</div>


@@ article-comments.html.ep
<div id="comments">
    <h2>Comments (<%= $comments->size %>)</h2>
    <div class="content">
        % while (my $comment = $comments->next) {
        <div id="comment-<%= $comment->number %>" class="comment">
            <%= gravatar $comment->email %>

            <span class="author"><%= comment_author $comment %></span> says:
            <div class="meta">
                <%= date $comment->created %>
            </div>

            <div class="content">
            <%== render_comment $comment %>
            </div>
        </div>
        % }
    </div>
</div>


@@ article-comment-form.html.ep
<div id="comment-form">
% if ($article->comments_enabled) {
    <h2>Add comment</h2>
    <div class="content">
        <div class="tip-required">
            Fields marked <span class="required">*</span> are required.<br />
            <div class="tip-required-bot">
            This form has a bot protection mechanism, that requires Cookies.<br />
            Please, don't disable them.
            </div>
        </div>
        %= form_for 'comment' => {year => $article->created->year, month => $article->created->month, alias => $article->name}, method => 'post' => begin
        <label for="author">Name <span class="required">*</span></label><br />
        <%= input_tag 'author', class => 'comment' %><br />
        <%= validator_error 'author' %>

        <label for="email">E-mail</label><br />
        <%= input_tag 'email', class => 'comment' %>
        <span class="tip"><%= link_to 'http://gravatar.com' => begin %>Gravatar<% end %>-friendly</span>
        <br />
        <%= validator_error 'email' %>

        <label for="url">Website</label><br />
        <%= input_tag 'url', class => 'comment' %><br />
        <%= validator_error 'url' %>
        
        % use Mojo::Util 'md5_sum';
        % my $comment_name = md5_sum($article->created->year, $article->created->month, $article->name);
        <label for="content">Comment <span class="required">*</span></label><br />
        <%= text_area 'content', class => 'bpr' %>
        <%= text_area $comment_name %><br />
        <%= validator_error $comment_name %>

        <div class="comment-tags">Paragraphs are created automatically. Available tags: [quote], [code].</div>

        <%= submit_button 'Post comment' %>
        % end
    </div>
% }
% else {
    <h2>Comments for this article has been disabled</h2>
% }
</div>


@@ article-pager.html.ep
    <div id="pager">
    <span class="active">
%   if ($prev) {
        <span class="arrow">&larr; </span><%= link_to_article $prev %> &nbsp;
%   }
|
%   if ($next) {
        &nbsp;<%= link_to_article $next %><span class="arrow"> &rarr;</span>
%   }
    </span>
    </div>


@@ page.html.ep
% stash title => $page->title, description => $page->description;
<div class="text">
    <h1 class="title">
        <%= $page->title %>
    </h1>
    <%== render_page $page %>
</div>



( run in 2.044 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )