annotate app/views/pastes/show.html.erb @ 373:6e3e1e7b0212

Handle unique error in model instead of controller.
author nanaya <me@myconan.net>
date Sat, 06 Jun 2015 22:12:56 +0900
parents 45bf99bfd48b
children 92c62966191b
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
265
6cca1ab53337 Infinitely better error messages and notice.
edogawaconan <me@myconan.net>
parents: 264
diff changeset
3 <% if alert %>
6cca1ab53337 Infinitely better error messages and notice.
edogawaconan <me@myconan.net>
parents: 264
diff changeset
4 <div class="alert alert-danger">
6cca1ab53337 Infinitely better error messages and notice.
edogawaconan <me@myconan.net>
parents: 264
diff changeset
5 <%= alert %>
190
d4682cea8e58 Fun with alerts.
Edho Arief <edho@myconan.net>
parents: 189
diff changeset
6 </div>
d4682cea8e58 Fun with alerts.
Edho Arief <edho@myconan.net>
parents: 189
diff changeset
7 <% end %>
d4682cea8e58 Fun with alerts.
Edho Arief <edho@myconan.net>
parents: 189
diff changeset
8
43
bc088ddb470f Added page header div for show.
Edho Arief <edho@myconan.net>
parents: 42
diff changeset
9 <div class="page-header">
98
58aa32120b54 Added paste id to title.
Edho Arief <edho@myconan.net>
parents: 90
diff changeset
10 <h1><%= content_for :title %></h1>
43
bc088ddb470f Added page header div for show.
Edho Arief <edho@myconan.net>
parents: 42
diff changeset
11 </div>
100
90b59418828a Three times more fun with tabs (added plain and markdown tab).
Edho Arief <edho@myconan.net>
parents: 98
diff changeset
12
261
f057e8c78e50 Fix /show.
edogawaconan <me@myconan.net>
parents: 257
diff changeset
13 <div id="paste-show" data-id="<%= @paste.id %>">
264
fa4a1ba990ae Simplified pastes#show view.
edogawaconan <me@myconan.net>
parents: 263
diff changeset
14 <ul id="paste-mode" class="nav nav-tabs">
288
c8757469da39 The magic hash was broken.
edogawaconan <me@myconan.net>
parents: 287
diff changeset
15 <li class="active"><%= link_to 'Plain', '#pl', :data => { :toggle => 'pill' } %></li>
264
fa4a1ba990ae Simplified pastes#show view.
edogawaconan <me@myconan.net>
parents: 263
diff changeset
16 <li><%= link_to 'Highlight', '#hl', :data => { :toggle => 'pill' } %></li>
fa4a1ba990ae Simplified pastes#show view.
edogawaconan <me@myconan.net>
parents: 263
diff changeset
17 <li><%= link_to 'Markdown', '#md', :data => { :toggle => 'pill' } %></li>
fa4a1ba990ae Simplified pastes#show view.
edogawaconan <me@myconan.net>
parents: 263
diff changeset
18 </ul>
fa4a1ba990ae Simplified pastes#show view.
edogawaconan <me@myconan.net>
parents: 263
diff changeset
19
fa4a1ba990ae Simplified pastes#show view.
edogawaconan <me@myconan.net>
parents: 263
diff changeset
20 <div id="paste" class="tab-content">
214
22c4b5f90e24 Massive javascript and html refactor. Also, ie9
Edho Arief <edho@myconan.net>
parents: 190
diff changeset
21 <div class="tab-pane active" id="pl">
100
90b59418828a Three times more fun with tabs (added plain and markdown tab).
Edho Arief <edho@myconan.net>
parents: 98
diff changeset
22 <pre><%= @paste.paste %></pre>
90b59418828a Three times more fun with tabs (added plain and markdown tab).
Edho Arief <edho@myconan.net>
parents: 98
diff changeset
23 </div>
214
22c4b5f90e24 Massive javascript and html refactor. Also, ie9
Edho Arief <edho@myconan.net>
parents: 190
diff changeset
24 <div class="tab-pane" id="hl">
100
90b59418828a Three times more fun with tabs (added plain and markdown tab).
Edho Arief <edho@myconan.net>
parents: 98
diff changeset
25 <pre class="prettyprint linenums"></pre>
90b59418828a Three times more fun with tabs (added plain and markdown tab).
Edho Arief <edho@myconan.net>
parents: 98
diff changeset
26 </div>
214
22c4b5f90e24 Massive javascript and html refactor. Also, ie9
Edho Arief <edho@myconan.net>
parents: 190
diff changeset
27 <div class="tab-pane" id="md">
105
28518004899a Markdown edition in well.
Edho Arief <edho@myconan.net>
parents: 103
diff changeset
28 <div class="well"></div>
100
90b59418828a Three times more fun with tabs (added plain and markdown tab).
Edho Arief <edho@myconan.net>
parents: 98
diff changeset
29 </div>
264
fa4a1ba990ae Simplified pastes#show view.
edogawaconan <me@myconan.net>
parents: 263
diff changeset
30 </div>
100
90b59418828a Three times more fun with tabs (added plain and markdown tab).
Edho Arief <edho@myconan.net>
parents: 98
diff changeset
31 </div>
2
42de15334db1 Added the pastes.
Edho Arief <edho@myconan.net>
parents:
diff changeset
32
325
45bf99bfd48b Remove authenticity token from form.
edogawaconan <me@myconan.net>
parents: 307
diff changeset
33 <%= form_for @paste, :method => :delete, :authenticity_token => false do |f| %>
265
6cca1ab53337 Infinitely better error messages and notice.
edogawaconan <me@myconan.net>
parents: 264
diff changeset
34
264
fa4a1ba990ae Simplified pastes#show view.
edogawaconan <me@myconan.net>
parents: 263
diff changeset
35 <div class="row"><div class="col-md-4">
261
f057e8c78e50 Fix /show.
edogawaconan <me@myconan.net>
parents: 257
diff changeset
36 <div class="input-group">
265
6cca1ab53337 Infinitely better error messages and notice.
edogawaconan <me@myconan.net>
parents: 264
diff changeset
37 <%= f.text_field :key, :value => nil, :placeholder => 'Deletion key', :class => "form-control", :autofocus => f.object.errors.any? %>
261
f057e8c78e50 Fix /show.
edogawaconan <me@myconan.net>
parents: 257
diff changeset
38 <span class="input-group-btn">
307
1a409564ffad Use button (again).
edogawaconan <me@myconan.net>
parents: 288
diff changeset
39 <%= f.button 'Delete this paste', :class => 'btn btn-danger' %>
261
f057e8c78e50 Fix /show.
edogawaconan <me@myconan.net>
parents: 257
diff changeset
40 </span>
f057e8c78e50 Fix /show.
edogawaconan <me@myconan.net>
parents: 257
diff changeset
41 </div>
264
fa4a1ba990ae Simplified pastes#show view.
edogawaconan <me@myconan.net>
parents: 263
diff changeset
42 </div></div>
fa4a1ba990ae Simplified pastes#show view.
edogawaconan <me@myconan.net>
parents: 263
diff changeset
43 <% end %>
189
b4b7a29b70f6 Initial work for paste deletion.
Edho Arief <edho@myconan.net>
parents: 179
diff changeset
44
264
fa4a1ba990ae Simplified pastes#show view.
edogawaconan <me@myconan.net>
parents: 263
diff changeset
45 <ul class="nav nav-pills">
fa4a1ba990ae Simplified pastes#show view.
edogawaconan <me@myconan.net>
parents: 263
diff changeset
46 <li><%= link_to 'Raw', paste_path(@paste, :txt) %></li>
fa4a1ba990ae Simplified pastes#show view.
edogawaconan <me@myconan.net>
parents: 263
diff changeset
47 <li><%= link_to 'Derive', root_path(:base => @paste) %></li>
fa4a1ba990ae Simplified pastes#show view.
edogawaconan <me@myconan.net>
parents: 263
diff changeset
48 <li><%= link_to 'More Paste', root_path %></li>
fa4a1ba990ae Simplified pastes#show view.
edogawaconan <me@myconan.net>
parents: 263
diff changeset
49 </ul>