annotate app/views/pastes/new.html.erb @ 418:a69dd2d37950

Prevent adding unrelated classes and funny characters
author nanaya <me@myconan.net>
date Thu, 17 Sep 2015 01:13:14 +0900
parents 080dd141898c
children 967233b26404
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
398
851432f21603 Nope, failing at redesigning.
nanaya <me@myconan.net>
parents: 395
diff changeset
1 <% provide :title, t(".title") %>
402
a18e19139f57 Markdown preview \o/
nanaya <me@myconan.net>
parents: 398
diff changeset
2
398
851432f21603 Nope, failing at redesigning.
nanaya <me@myconan.net>
parents: 395
diff changeset
3 <%= form_for @paste do |f| %>
379
2ad092e60975 [mq]: new-design
nanaya <me@myconan.net>
parents: 306
diff changeset
4 <%= render "shared/filter_spam" %>
398
851432f21603 Nope, failing at redesigning.
nanaya <me@myconan.net>
parents: 395
diff changeset
5
851432f21603 Nope, failing at redesigning.
nanaya <me@myconan.net>
parents: 395
diff changeset
6 <div class="form-group <%= error_class f.object, :paste %>">
851432f21603 Nope, failing at redesigning.
nanaya <me@myconan.net>
parents: 395
diff changeset
7 <%= f.text_area :paste, :autofocus => true, :class => "form-control paste-paste js-paste-paste", :rows => 20 %>
2
42de15334db1 Added the pastes.
Edho Arief <edho@myconan.net>
parents:
diff changeset
8 </div>
189
b4b7a29b70f6 Initial work for paste deletion.
Edho Arief <edho@myconan.net>
parents: 56
diff changeset
9
402
a18e19139f57 Markdown preview \o/
nanaya <me@myconan.net>
parents: 398
diff changeset
10
a18e19139f57 Markdown preview \o/
nanaya <me@myconan.net>
parents: 398
diff changeset
11 <div class="row"><div class="col-xs-12">
a18e19139f57 Markdown preview \o/
nanaya <me@myconan.net>
parents: 398
diff changeset
12 <%= link_to t(".preview_md"), "#",
a18e19139f57 Markdown preview \o/
nanaya <me@myconan.net>
parents: 398
diff changeset
13 :class => "btn btn-default js-paste-preview-md pull-right"
a18e19139f57 Markdown preview \o/
nanaya <me@myconan.net>
parents: 398
diff changeset
14 %>
403
e0626046579a Rearrange stuff.
nanaya <me@myconan.net>
parents: 402
diff changeset
15 </div></div>
e0626046579a Rearrange stuff.
nanaya <me@myconan.net>
parents: 402
diff changeset
16
417
080dd141898c Add support for explicit highlighter languages
nanaya <me@myconan.net>
parents: 410
diff changeset
17 <div class="row"><div class="col-sm-3">
080dd141898c Add support for explicit highlighter languages
nanaya <me@myconan.net>
parents: 410
diff changeset
18 <div class="form-group <%= error_class f.object, :key %>">
403
e0626046579a Rearrange stuff.
nanaya <me@myconan.net>
parents: 402
diff changeset
19 <%= f.label :key, t(".deletion_key") %>
e0626046579a Rearrange stuff.
nanaya <me@myconan.net>
parents: 402
diff changeset
20 <%= f.text_field :key, :class => "form-control" %>
e0626046579a Rearrange stuff.
nanaya <me@myconan.net>
parents: 402
diff changeset
21 </div>
402
a18e19139f57 Markdown preview \o/
nanaya <me@myconan.net>
parents: 398
diff changeset
22
417
080dd141898c Add support for explicit highlighter languages
nanaya <me@myconan.net>
parents: 410
diff changeset
23 <div class="form-group">
080dd141898c Add support for explicit highlighter languages
nanaya <me@myconan.net>
parents: 410
diff changeset
24 <label><%= t(".privacy.label") %></label>
379
2ad092e60975 [mq]: new-design
nanaya <me@myconan.net>
parents: 306
diff changeset
25
417
080dd141898c Add support for explicit highlighter languages
nanaya <me@myconan.net>
parents: 410
diff changeset
26 <div class="radio-container">
080dd141898c Add support for explicit highlighter languages
nanaya <me@myconan.net>
parents: 410
diff changeset
27 <% paste_privacy_options.each do |label, value| %>
080dd141898c Add support for explicit highlighter languages
nanaya <me@myconan.net>
parents: 410
diff changeset
28 <div class="radio">
080dd141898c Add support for explicit highlighter languages
nanaya <me@myconan.net>
parents: 410
diff changeset
29 <label>
080dd141898c Add support for explicit highlighter languages
nanaya <me@myconan.net>
parents: 410
diff changeset
30 <%= f.radio_button :is_private, value %>
080dd141898c Add support for explicit highlighter languages
nanaya <me@myconan.net>
parents: 410
diff changeset
31 <%= t(".privacy.#{label}") %>
080dd141898c Add support for explicit highlighter languages
nanaya <me@myconan.net>
parents: 410
diff changeset
32 </label>
080dd141898c Add support for explicit highlighter languages
nanaya <me@myconan.net>
parents: 410
diff changeset
33 </div>
080dd141898c Add support for explicit highlighter languages
nanaya <me@myconan.net>
parents: 410
diff changeset
34 <% end %>
080dd141898c Add support for explicit highlighter languages
nanaya <me@myconan.net>
parents: 410
diff changeset
35 </div>
379
2ad092e60975 [mq]: new-design
nanaya <me@myconan.net>
parents: 306
diff changeset
36 </div>
417
080dd141898c Add support for explicit highlighter languages
nanaya <me@myconan.net>
parents: 410
diff changeset
37
080dd141898c Add support for explicit highlighter languages
nanaya <me@myconan.net>
parents: 410
diff changeset
38 <div class="form-group">
080dd141898c Add support for explicit highlighter languages
nanaya <me@myconan.net>
parents: 410
diff changeset
39 <%= f.label :language %>
080dd141898c Add support for explicit highlighter languages
nanaya <me@myconan.net>
parents: 410
diff changeset
40
080dd141898c Add support for explicit highlighter languages
nanaya <me@myconan.net>
parents: 410
diff changeset
41 <%= f.select :language, [], { :prompt => t(".language_none") }, :class => "form-control" %>
080dd141898c Add support for explicit highlighter languages
nanaya <me@myconan.net>
parents: 410
diff changeset
42 </div>
379
2ad092e60975 [mq]: new-design
nanaya <me@myconan.net>
parents: 306
diff changeset
43
417
080dd141898c Add support for explicit highlighter languages
nanaya <me@myconan.net>
parents: 410
diff changeset
44 <div class="form-group">
080dd141898c Add support for explicit highlighter languages
nanaya <me@myconan.net>
parents: 410
diff changeset
45 <%= f.button :class => "btn btn-primary" %>
403
e0626046579a Rearrange stuff.
nanaya <me@myconan.net>
parents: 402
diff changeset
46
417
080dd141898c Add support for explicit highlighter languages
nanaya <me@myconan.net>
parents: 410
diff changeset
47 <%= link_to t(".clear"), "#", :class => "btn btn-danger js-paste-clear" %>
080dd141898c Add support for explicit highlighter languages
nanaya <me@myconan.net>
parents: 410
diff changeset
48 </div>
080dd141898c Add support for explicit highlighter languages
nanaya <me@myconan.net>
parents: 410
diff changeset
49 </div></div>
2
42de15334db1 Added the pastes.
Edho Arief <edho@myconan.net>
parents:
diff changeset
50 <% end %>
402
a18e19139f57 Markdown preview \o/
nanaya <me@myconan.net>
parents: 398
diff changeset
51
409
130dc1054fd2 Fix styling.
nanaya <me@myconan.net>
parents: 408
diff changeset
52 <div class="modal fade js-paste-preview-md-modal" tabindex="-1" role="dialog">
402
a18e19139f57 Markdown preview \o/
nanaya <me@myconan.net>
parents: 398
diff changeset
53 <div class="modal-dialog" role="document">
a18e19139f57 Markdown preview \o/
nanaya <me@myconan.net>
parents: 398
diff changeset
54 <div class="modal-content">
a18e19139f57 Markdown preview \o/
nanaya <me@myconan.net>
parents: 398
diff changeset
55 <div class="modal-body js-paste-preview-md-box">
a18e19139f57 Markdown preview \o/
nanaya <me@myconan.net>
parents: 398
diff changeset
56 </div>
a18e19139f57 Markdown preview \o/
nanaya <me@myconan.net>
parents: 398
diff changeset
57 <div class="modal-footer">
a18e19139f57 Markdown preview \o/
nanaya <me@myconan.net>
parents: 398
diff changeset
58 <button type="button" class="btn btn-default" data-dismiss="modal">
408
f3cdc83b87b4 Add about.
nanaya <me@myconan.net>
parents: 407
diff changeset
59 <%= t("buttons.close") %>
402
a18e19139f57 Markdown preview \o/
nanaya <me@myconan.net>
parents: 398
diff changeset
60 </button>
a18e19139f57 Markdown preview \o/
nanaya <me@myconan.net>
parents: 398
diff changeset
61 </div>
a18e19139f57 Markdown preview \o/
nanaya <me@myconan.net>
parents: 398
diff changeset
62 </div>
a18e19139f57 Markdown preview \o/
nanaya <me@myconan.net>
parents: 398
diff changeset
63 </div>
a18e19139f57 Markdown preview \o/
nanaya <me@myconan.net>
parents: 398
diff changeset
64 </div>