index.html.ep 1.21 KB
Newer Older
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
% # vim:set sw=4 ts=4 sts=4 ft=html.epl expandtab:
% layout 'default';
% title 'Lstu';
<h1>Let's Shorten That Url</h1>
<p>
    <small>&copy; 2013 <%= link_to 'http://www.fiat-tux.fr' => begin %>Luc Didry<% end %>
        <%=l 'license' %> <%= link_to 'http://www.wtfpl.net/' => begin %>WTFPL<% end %>
        <%= link_to 'https://github.com/ldidry/lstu' => begin %><%=l 'about' %><% end %>
    </small>
</p>
<form class="form-inline" role="form" method="POST" action="<%== url_for 'add' %>">
    <div class="form-group">
        <label class="sr-only" for="lsturl"><%=l 'url_to_shorten' %></label>
        <input type="url" name="lsturl" id="lsturl" class="form-control" placeholder="<%=l 'url_to_shorten' %>" required></input>
    </div>
    <%= submit_button l('go'), class => 'btn btn-default btn-primary' %>
</form>

% if (defined(flash('short')) && defined(flash('url'))) {
    <h3 class="alert alert-success">
        <%= link_to flash('url') => begin %><%== flash('url') %><%= end %></a> =&gt;
        <%= link_to url_for('/')->to_abs.flash('short') => begin %><%= url_for('/')->to_abs.flash('short') %><%= end %>
    </h3>
% }
% if (defined(flash('msg'))) {
    <h3 class="alert alert-danger"><%== flash('msg') %><h3>
% }