forked from publify/publify
/
_form.html.erb
132 lines (121 loc) · 6.01 KB
/
_form.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<input type="hidden" name="user_textfilter" id="user_textfilter" value="<%= current_user.text_filter_name %>" />
<div id="autosave"><%= set_autosave_tag(@article) %></div>
<div id="article_keywords_auto_complete" class="auto_complete"></div>
<h2 class='page-header'>
<i class='icon-large icon-article-new'></i>
<%= _("#{controller.action_name.to_s.capitalize} article") %>
<span class='pull-right'>
<span id='preview_link'><%= link_to(_("Preview"), {:controller => '/articles', :action => 'preview', :id => @article.id}, {:target => 'new', :class => 'btn'}) if @article.id %></span>
<input id='save_draft' type="submit" value="<%= _('Save as draft') %>" name="article[draft]" class='btn' />
<%= save( _("Publish")) %>
</span>
</h2>
<%= error_messages_for 'article' %>
<div>
<div class='span9'>
<div>
<%= text_field 'article', 'title', :class => 'input-block-level', :placeholder => _('Title') %>
</div>
<%= render('images', { :images => @images}) unless @images.empty? %>
<div id="editor">
<i class='icon icon-media'></i> <span id='image-link'><%= toggle_element 'carousel-wrapper', _("Images") %></span>
<div id='quicktags'>
<script type="text/javascript">edToolbar('article_body_and_extended', '<%= @article.text_filter %>');</script>
</div>
<div id='simple_editor'>
<%= text_area('article', 'body_and_extended', {:class => 'input-block-level', :height => '360px'}) %>
<%= render 'admin/shared/macros' %>
</div>
</div>
<div class='separator'>
<h4><%= _("Excerpt") %></h4>
<%= text_area 'article', 'excerpt', {:height => '150', :class => 'input-block-level', :rows => '5'} %>
<span class='help-block'><%=_("Excerpts are post summaries that show only on your blog homepage and won’t appear on the post itself") %></span>
</div>
<div class='well'>
<fieldset>
<legend><%= _("Publish settings") %></legend>
<div class='control-group'>
<p><%= _("Status") %>: <strong><%= _(@article.state.to_s.downcase) %></strong> <%= toggle_element 'status' %></p>
<div id='status' style='display: none;'>
<label for="article_published" class='checkbox'>
<%= check_box 'article', 'published' %>
<%= _("Published") %>
</label>
<%= ok_button('status') %>
</div>
</div>
<div class='control-group'>
<p><%= _("Comments are %s and trackbacks are %s", content_tag(:strong, get_feedback_status(@article.allow_comments)), content_tag(:strong, get_feedback_status(@article.allow_pings))) %>
<%= toggle_element 'conversation' %></p>
<div id='conversation' style='display: none'>
<label for="article_allow_pings" class='checkbox'>
<%= check_box 'article', 'allow_pings' %>
<%= _("Allow trackbacks") %>
</label>
<label for="article_allow_comments" class='checkbox'>
<%= check_box 'article', 'allow_comments' %>
<%= _("Allow comments") %>
</label>
<p><span class='btn btn-mini'><%= toggle_element 'conversation', "OK" %></span></p>
</div>
</div>
<div class='control-group'>
<p><%= _("Published") %> <strong><%= publish_now_or_already_published @article %></strong> <%= toggle_element 'publish' %></p>
<div id='publish' class='input-append' style='display: none;'>
<%= calendar_date_select 'article', 'published_at' %>
<%= ok_button('publish') %>
</div>
</div>
<div class='control-group'>
<p><%= _("Visibility") %>: <strong><%= @article.password.nil? || @article.password.empty? ? _("public") : _("protected") %></strong> <%= toggle_element 'visibility' %></p>
<div id='visibility' style='display: none'>
<label for="article_password"><%= _("Password:") %>
<%= password_field :article, :password, :class => 'span10' %>
</label>
<%= ok_button('visibility') %>
</div>
</div>
<div class='control-group'>
<%= _("Permalink") %>: <%= toggle_element 'permalink' %>
<div class='inputs-list' id='permalink' style='display: none'>
<%= text_field 'article', 'permalink', {:class => 'span10'} %>
<%= ok_button('permalink') %>
</div>
</div>
<div class='control-group'>
<%= _("Article filter") %>: <strong id='text_filter_placeholder'><%= _("#{@article.text_filter.description}") %></strong> <%= toggle_element 'text_filter' %>
<div id='text_filter' style='display: none'>
<select name="article[text_filter]" id="article_text_filter">
<%= options_for_select text_filter_options, @article.text_filter %>
</select>
<%= ok_button('text_filter') %>
</div>
</div>
</fieldset>
</div>
<div class='form-actions'>
<div class='pull-right'>
<%= link_to_destroy_with_profiles(@article) unless @article.id.nil? or @article.state.to_s.downcase == 'draft' %>
<span id='destroy_link'><%= link_to_destroy_draft @article %></span>
<input id='save_draft' type="submit" value="<%= _('Save as draft') %>" name="article[draft]" class='btn info' />
<%= save( _("Publish")) %>
</div>
</div>
</div>
</div>
<div class='span3'>
<div class='well'>
<h4><%= _("Categories") %></h4>
<%= render 'categories' %>
</div>
<div class='well'>
<h4><%= _("Tags") %></h4>
<div class='class'>
<%= text_field 'article', 'keywords', {:autocomplete => 'off', :class => 'input-block-level'} %>
<p class='alert alert-warning'><%=_("Separate tags with commas. Use double quotes (") around multi-word tags, e.g. "opera house".") %></p>
</div>
<%= auto_complete_field 'article_keywords', { :url => { :action => "auto_complete_for_article_keywords"}, :method => 'get', :tokens => ','}%>
</div>
<%= get_post_types %>
</div>