annotate app/views/pastes/show.html.erb @ 395:26f8c634052c

Complete rework.
author nanaya <me@myconan.net>
date Sat, 27 Jun 2015 14:46:01 +0900
parents 91dabc034389
children 851432f21603
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
98
58aa32120b54 Added paste id to title.
Edho Arief <edho@myconan.net>
parents: 90
diff changeset
1 <% provide :title, "Paste ##{@paste.id}" %>
190
d4682cea8e58 Fun with alerts.
Edho Arief <edho@myconan.net>
parents: 189
diff changeset
2
395
26f8c634052c Complete rework.
nanaya <me@myconan.net>
parents: 390
diff changeset
3 <div class="paste-content">
26f8c634052c Complete rework.
nanaya <me@myconan.net>
parents: 390
diff changeset
4 <div class="paste-nav">
26f8c634052c Complete rework.
nanaya <me@myconan.net>
parents: 390
diff changeset
5 <%= link_to 'Plain', '#pl', :class => "paste-nav-item active" %>
26f8c634052c Complete rework.
nanaya <me@myconan.net>
parents: 390
diff changeset
6 <%= link_to 'Highlight', '#hl', :class => "paste-nav-item" %>
26f8c634052c Complete rework.
nanaya <me@myconan.net>
parents: 390
diff changeset
7 <%= link_to 'Markdown', '#md', :class => "paste-nav-item" %>
26f8c634052c Complete rework.
nanaya <me@myconan.net>
parents: 390
diff changeset
8 </div>
264
fa4a1ba990ae Simplified pastes#show view.
edogawaconan <me@myconan.net>
parents: 263
diff changeset
9
395
26f8c634052c Complete rework.
nanaya <me@myconan.net>
parents: 390
diff changeset
10 <% lines = @paste.paste.split("\n") %>
26f8c634052c Complete rework.
nanaya <me@myconan.net>
parents: 390
diff changeset
11 <%# list number contains <n> + "." + <2.5 * spaces (approx)> %>
26f8c634052c Complete rework.
nanaya <me@myconan.net>
parents: 390
diff changeset
12 <ol style="padding-left: <%= lines.size.to_s.length + 4 %>ch" class="paste-plain monospaced">
26f8c634052c Complete rework.
nanaya <me@myconan.net>
parents: 390
diff changeset
13 <% lines.each.with_index(1) do |line, i| %>
26f8c634052c Complete rework.
nanaya <me@myconan.net>
parents: 390
diff changeset
14 <li id="L<%= i %>" class="line">
26f8c634052c Complete rework.
nanaya <me@myconan.net>
parents: 390
diff changeset
15 <%= line %>
26f8c634052c Complete rework.
nanaya <me@myconan.net>
parents: 390
diff changeset
16 </li>
26f8c634052c Complete rework.
nanaya <me@myconan.net>
parents: 390
diff changeset
17 <% end %>
26f8c634052c Complete rework.
nanaya <me@myconan.net>
parents: 390
diff changeset
18 </ol>
100
90b59418828a Three times more fun with tabs (added plain and markdown tab).
Edho Arief <edho@myconan.net>
parents: 98
diff changeset
19 </div>
2
42de15334db1 Added the pastes.
Edho Arief <edho@myconan.net>
parents:
diff changeset
20
395
26f8c634052c Complete rework.
nanaya <me@myconan.net>
parents: 390
diff changeset
21 <div class="settings">
26f8c634052c Complete rework.
nanaya <me@myconan.net>
parents: 390
diff changeset
22 <%= form_for @paste, :method => :delete, :authenticity_token => false, :html => { :class => "settings-item settings-item--inline" } do |f| %>
265
6cca1ab53337 Infinitely better error messages and notice.
edogawaconan <me@myconan.net>
parents: 264
diff changeset
23
395
26f8c634052c Complete rework.
nanaya <me@myconan.net>
parents: 390
diff changeset
24 <%= f.text_field :key, :value => nil, :placeholder => 'Deletion key', :autofocus => f.object.errors.any?, :class => "main-textarea" %>
26f8c634052c Complete rework.
nanaya <me@myconan.net>
parents: 390
diff changeset
25
26f8c634052c Complete rework.
nanaya <me@myconan.net>
parents: 390
diff changeset
26 <%= f.button 'Delete this paste', :class => 'btn btn--danger btn--min-width' %>
390
91dabc034389 Improved styling for show.
nanaya <me@myconan.net>
parents: 388
diff changeset
27 <% end %>
189
b4b7a29b70f6 Initial work for paste deletion.
Edho Arief <edho@myconan.net>
parents: 179
diff changeset
28
395
26f8c634052c Complete rework.
nanaya <me@myconan.net>
parents: 390
diff changeset
29 </div>
26f8c634052c Complete rework.
nanaya <me@myconan.net>
parents: 390
diff changeset
30
26f8c634052c Complete rework.
nanaya <me@myconan.net>
parents: 390
diff changeset
31 <div class="paste-nav paste-nav--bottom">
26f8c634052c Complete rework.
nanaya <me@myconan.net>
parents: 390
diff changeset
32 <%= link_to 'Raw', paste_path(@paste, :txt), :class => "paste-nav-item" %>
26f8c634052c Complete rework.
nanaya <me@myconan.net>
parents: 390
diff changeset
33 <%= link_to 'Derive', root_path(:base => @paste), :class => "paste-nav-item" %>
26f8c634052c Complete rework.
nanaya <me@myconan.net>
parents: 390
diff changeset
34 <%= link_to 'More Paste', root_path, :class => "paste-nav-item" %>
26f8c634052c Complete rework.
nanaya <me@myconan.net>
parents: 390
diff changeset
35 </div>