98
|
1 <% provide :title, "Paste ##{@paste.id}" %>
|
190
|
2
|
469
|
3 <ul class="nav nav-tabs" role="tablist">
|
|
4 <% [
|
|
5 { title: t(".plain"), target: 'pl', active: true },
|
|
6 { title: t(".highlight"), target: 'hl' },
|
|
7 { title: t(".markdown"), target: 'md' }
|
|
8 ].each do |el| %>
|
|
9 <li class="nav-item">
|
|
10 <%= link_to el[:title], "##{el[:target]}",
|
|
11 data: {
|
|
12 mode: el[:target],
|
|
13 toggle: 'tab',
|
|
14 },
|
|
15 aria: { controls: el[:target] },
|
|
16 role: 'tab',
|
|
17 class: "nav-link #{"active" if el[:active]} js-show-tab"
|
|
18 %>
|
|
19 </li>
|
|
20 <% end %>
|
|
21 </ul>
|
398
|
22
|
469
|
23 <div class="js-showing-paste paste-show">
|
398
|
24 <div class="tab-content">
|
|
25 <div role="tabpanel" class="tab-pane active" id="pl">
|
469
|
26 <pre class="paste-content"><code class="js-paste-pl"><%= @paste.paste %></code></pre>
|
398
|
27 </div>
|
|
28
|
|
29 <div role="tabpanel" class="tab-pane" id="hl">
|
469
|
30 <pre class="paste-content"><code class="js-paste-hl zp-hl lang-<%= @paste.language.try(:parameterize) %>"></code></pre>
|
398
|
31 </div>
|
|
32
|
|
33 <div role="tabpanel" class="tab-pane" id="md">
|
|
34 <div class="js-paste-md"></div>
|
|
35 </div>
|
|
36 </div>
|
469
|
37 </div>
|
398
|
38
|
469
|
39 <%= form_for @paste, method: :delete, authenticity_token: false, html: { class: 'form-row' } do |f| %>
|
|
40 <div class="col-auto my-1">
|
|
41 <%= f.text_field :key,
|
|
42 value: nil,
|
|
43 placeholder: t('pastes.new.deletion_key'),
|
|
44 autofocus: f.object.errors.any?,
|
|
45 autocomplete: 'off',
|
|
46 class: "form-control w-auto #{error_class f.object, :key}"
|
|
47 %>
|
|
48 </div>
|
398
|
49
|
469
|
50 <div class="col-auto my-1">
|
|
51 <%= f.button t(".delete"), class: 'btn btn-danger' %>
|
|
52 </div>
|
|
53 <% end %>
|
2
|
54
|
469
|
55 <div class="row mt-4">
|
|
56 <% [
|
|
57 [t('.raw'), paste_path(@paste, :txt)],
|
|
58 [t('.derive'), root_path(:base => @paste)],
|
|
59 [t('.more'), root_path],
|
|
60 ].each do |label, url| %>
|
|
61 <div class="col-auto">
|
|
62 <%= link_to label, url %>
|
|
63 </div>
|
|
64 <% end %>
|
|
65 </div>
|