_text_editor_sidebar.html.erb
2.52 KB
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
<% default_folder = content_id_to_str default_folder_for_image_upload(profile) %>
<div class='text-editor-sidebar'>
<span class='button-add' data-value='<%= _('Add to the text') %>'></span>
<span class='button-zoom' data-value='<%= _('Zoom in') %>'></span>
<span class='button-close' data-value='<%= _('Close') %>'></span>
<div class='header'><strong><%= _('Insert media') %></strong><%= button('vertical-toggle', _('Show/Hide'), '#') %></div>
<%= render(:partial => 'textile_quick_reference') if @article.editor?(Article::Editor::TEXTILE) %>
<div class='text-editor-sidebar-box' id='media-upload-box'>
<div id='media-upload-form'>
<%= form_tag({ :action => 'media_upload' }, :multipart => true) do %>
<div class='formfield'>
<%= select_profile_folder(
_('Choose folder to upload files:'),
:parent_id, profile, default_folder, {}, {},
"type='Folder' or type='Gallery'"
) %>
<%= button(:newfolder, _('New folder'), '#', :id => 'new-folder-button') %>
</div>
<p><%= file_field_tag('file', :multiple => true) %></p>
<% end %>
</div>
<div class='hide-and-show-uploads'>
<%= link_to(_('Hide all uploads'), nil, :id => 'hide-uploads', :style => 'display: none;', 'data-bootstraped' => false) %>
<%= link_to(_('Show all uploads'), nil, :id => 'show-uploads', :style => 'display: none;') %>
</div>
</div>
<div id='published-media' class='text-editor-sidebar-box' data-url='<%= url_for({:controller => 'cms', :action => 'published_media_items', :profile => profile.identifier}) %>'>
<%= select_profile_folder(nil, :parent_id, profile, 'recent-media', {}, {},
"type='Folder' or type='Gallery'", {:root_label => _('Recent media')}) %>
<%= labelled_form_field _('Search among your uploaded files'), text_field_tag('q', '', placeholder: _('Write words about the file you are looking for')) %>
<%= render :partial => 'drag_and_drop_note' %>
<div class='items'>
<%= render :partial => 'published_media_items' %>
</div>
</div>
</div>
<script id="template-upload" type="text/x-tmpl">
<div id="file-{%= o.id %}" class="upload" title="{%= o.name %}">
<div class="file-name">{%=o.name%}</div>
<div class="percentage"></div>
<div class="progress"><div class="bar" style="width: 0%;"></div></div>
</div>
</script>
<%= render :partial => 'media_new_folder', :locals => {:default_folder => default_folder} %>
<%= javascript_include_tag 'jquery.fileupload.js', 'tmpl.js', 'media-panel.js' %>