Mercurial > zeropaste
comparison 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 |
comparison
equal
deleted
inserted
replaced
394:6feb8c2574a1 | 395:26f8c634052c |
---|---|
1 <% provide :title, "Paste ##{@paste.id}" %> | 1 <% provide :title, "Paste ##{@paste.id}" %> |
2 | 2 |
3 <div id="paste-show" data-id="<%= @paste.id %>"> | 3 <div class="paste-content"> |
4 <ul id="paste-mode" class="nav nav-tabs"> | 4 <div class="paste-nav"> |
5 <li class="active"><%= link_to 'Plain', '#pl', :data => { :toggle => 'pill' } %></li> | 5 <%= link_to 'Plain', '#pl', :class => "paste-nav-item active" %> |
6 <li><%= link_to 'Highlight', '#hl', :data => { :toggle => 'pill' } %></li> | 6 <%= link_to 'Highlight', '#hl', :class => "paste-nav-item" %> |
7 <li><%= link_to 'Markdown', '#md', :data => { :toggle => 'pill' } %></li> | 7 <%= link_to 'Markdown', '#md', :class => "paste-nav-item" %> |
8 </ul> | 8 </div> |
9 | 9 |
10 <div id="paste"> | 10 <% lines = @paste.paste.split("\n") %> |
11 <% lines = @paste.paste.split("\n") %> | 11 <%# list number contains <n> + "." + <2.5 * spaces (approx)> %> |
12 <%# list number contains <n> + "." + <2.5 * spaces (approx)> %> | 12 <ol style="padding-left: <%= lines.size.to_s.length + 4 %>ch" class="paste-plain monospaced"> |
13 <ol style="padding-left: <%= lines.size.to_s.length + 4 %>ch"> | 13 <% lines.each.with_index(1) do |line, i| %> |
14 <% lines.each.with_index(1) do |line, i| %> | 14 <li id="L<%= i %>" class="line"> |
15 <li id="L<%= i %>"> | 15 <%= line %> |
16 <%= line %> | 16 </li> |
17 </li> | 17 <% end %> |
18 <% end %> | 18 </ol> |
19 </ol> | |
20 </div> | |
21 </div> | 19 </div> |
22 | 20 |
23 <nav id="paste-show-nav"> | 21 <div class="settings"> |
24 <%= form_for @paste, :method => :delete, :authenticity_token => false do |f| %> | 22 <%= form_for @paste, :method => :delete, :authenticity_token => false, :html => { :class => "settings-item settings-item--inline" } do |f| %> |
25 | 23 |
26 <div class="row"><div class="col-md-4"> | 24 <%= f.text_field :key, :value => nil, :placeholder => 'Deletion key', :autofocus => f.object.errors.any?, :class => "main-textarea" %> |
27 <div class="input-group"> | 25 |
28 <%= f.text_field :key, :value => nil, :placeholder => 'Deletion key', :class => "form-control", :autofocus => f.object.errors.any? %> | 26 <%= f.button 'Delete this paste', :class => 'btn btn--danger btn--min-width' %> |
29 <span class="input-group-btn"> | |
30 <%= f.button 'Delete this paste', :class => 'btn btn-danger' %> | |
31 </span> | |
32 </div> | |
33 </div></div> | |
34 <% end %> | 27 <% end %> |
35 | 28 |
36 <ul class="nav nav-pills"> | 29 </div> |
37 <li><%= link_to 'Raw', paste_path(@paste, :txt) %></li> | 30 |
38 <li><%= link_to 'Derive', root_path(:base => @paste) %></li> | 31 <div class="paste-nav paste-nav--bottom"> |
39 <li><%= link_to 'More Paste', root_path %></li> | 32 <%= link_to 'Raw', paste_path(@paste, :txt), :class => "paste-nav-item" %> |
40 </ul> | 33 <%= link_to 'Derive', root_path(:base => @paste), :class => "paste-nav-item" %> |
41 </nav> | 34 <%= link_to 'More Paste', root_path, :class => "paste-nav-item" %> |
35 </div> |