_text_editor_sidebar.html.erb 2.02 KB
<div class='text-editor-sidebar'>
  <%= render(:partial => 'textile_quick_reference') if @article.is_a?(TextileArticle) %>
  <div class='text-editor-sidebar-box' id='media-upload-box'>
    <div class='header'><strong><%= _('Insert media') %></strong></div>
    <div id='media-upload-form'>
      <%= form_tag({ :action => 'media_upload' }, :multipart => true) do %>
        <div class='formfield'>
          <% default_folder = content_id_to_str default_folder_for_image_upload(profile) %>
          <%= select_profile_folder(
                _('Choose folder to upload files:'),
                :parent_id, profile, default_folder, {}, {},
                "type='Folder' or type='Gallery'"
          ) %>
        </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}) %>'>
    <div class='header'><strong><%= _('Published media') %></strong></div>
    <%= select_profile_folder(nil, :parent_id, profile, 'recent-media', {}, {},
        "type='Folder' or type='Gallery'", {:root_label => _('Recent media')}) %>
    <%= labelled_form_field _('Search'), text_field_tag('q') %>
    <%= 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="{%= S(o.name).slugify().s %}" class="upload">
    {%=o.name%}<span class="percentage"></span>
    <div class="progress"><div class="bar" style="width: 0%;"></div></div>
  </div>
</script>

<%= javascript_include_tag 'jquery.fileupload.js', 'tmpl.js', 'media-panel.js' %>