comparison app/views/pastes/show.html.erb @ 398:851432f21603

Nope, failing at redesigning.
author nanaya <me@myconan.net>
date Sun, 06 Sep 2015 03:52:52 +0900
parents 26f8c634052c
children d647e79136d8
comparison
equal deleted inserted replaced
395:26f8c634052c 398:851432f21603
1 <% provide :title, "Paste ##{@paste.id}" %> 1 <% provide :title, "Paste ##{@paste.id}" %>
2 2
3 <div class="paste-content"> 3 <div class="row"><div class="col-xs-12">
4 <div class="paste-nav"> 4 <ul class="nav nav-tabs" role="tablist">
5 <%= link_to 'Plain', '#pl', :class => "paste-nav-item active" %> 5 <% [
6 <%= link_to 'Highlight', '#hl', :class => "paste-nav-item" %> 6 { :title => t(".plain"), :target => "pl", :active => true },
7 <%= link_to 'Markdown', '#md', :class => "paste-nav-item" %> 7 { :title => t(".highlight"), :target => "hl" },
8 </div> 8 { :title => t(".markdown"), :target => "md" }
9 9 ].each do |el| %>
10 <% lines = @paste.paste.split("\n") %> 10 <li role="presentation" class="<%= "active" if el[:active] %>">
11 <%# list number contains <n> + "." + <2.5 * spaces (approx)> %> 11 <%= link_to el[:title], "##{el[:target]}",
12 <ol style="padding-left: <%= lines.size.to_s.length + 4 %>ch" class="paste-plain monospaced"> 12 :data => { :toggle => "tab" },
13 <% lines.each.with_index(1) do |line, i| %> 13 :aria => { :controls => el[:target] },
14 <li id="L<%= i %>" class="line"> 14 :role => "tab",
15 <%= line %> 15 :class => "js-show-tab-#{el[:target]}"
16 %>
16 </li> 17 </li>
17 <% end %> 18 <% end %>
18 </ol> 19 </ul>
20 </div></div>
21
22 <div class="row js-showing-paste"><div class="col-xs-12"><div class="paste-show">
23 <div class="tab-content">
24 <div role="tabpanel" class="tab-pane active" id="pl">
25 <pre class="paste-show__content"><code class="js-paste-pl"><%= @paste.paste %></code></pre>
26 </div>
27
28 <div role="tabpanel" class="tab-pane" id="hl">
29 <pre class="paste-show__content"><code class="js-paste-hl zp-hl"></code></pre>
30 </div>
31
32 <div role="tabpanel" class="tab-pane" id="md">
33 <div class="js-paste-md"></div>
34 </div>
35 </div>
36 </div></div></div>
37
38 <div class="row">
39 <%= form_for @paste, :method => :delete, :authenticity_token => false do |f| %>
40 <div class="form-group <%= error_class f.object, :key %> col-sm-4">
41 <div class="input-group">
42 <%= f.text_field :key,
43 :value => nil,
44 :placeholder => t("pastes.new.deletion_key"),
45 :autofocus => f.object.errors.any?,
46 :class => "form-control"
47 %>
48
49 <span class="input-group-btn">
50 <%= f.button t(".delete"), :class => "btn btn-danger" %>
51 </span>
52 </div>
53 </div>
54 <% end %>
19 </div> 55 </div>
20 56
21 <div class="settings"> 57 <hr />
22 <%= form_for @paste, :method => :delete, :authenticity_token => false, :html => { :class => "settings-item settings-item--inline" } do |f| %> 58 <ul class="nav nav-pills">
23 59 <li role="presentation">
24 <%= f.text_field :key, :value => nil, :placeholder => 'Deletion key', :autofocus => f.object.errors.any?, :class => "main-textarea" %> 60 <%= link_to t(".raw"), paste_path(@paste, :txt) %>
25 61 </li>
26 <%= f.button 'Delete this paste', :class => 'btn btn--danger btn--min-width' %> 62 <li role="presentation">
27 <% end %> 63 <%= link_to t(".derive"), root_path(:base => @paste) %>
28 64 </li>
29 </div> 65 <li role="presentation">
30 66 <%= link_to t(".more"), root_path %>
31 <div class="paste-nav paste-nav--bottom"> 67 </li>
32 <%= link_to 'Raw', paste_path(@paste, :txt), :class => "paste-nav-item" %> 68 </ul>
33 <%= link_to 'Derive', root_path(:base => @paste), :class => "paste-nav-item" %>
34 <%= link_to 'More Paste', root_path, :class => "paste-nav-item" %>
35 </div>