only images are listed in the image dialog

Oleg committed Dec 14, 2011
commit 61d6f2fc028562a7b2924151edc68ef544bdd07d
Showing 3 changed files with 6 additions and 3 deletions
app/assets/stylesheets/comfortable_mexican_sofa/files.css +1 -1
@@ @@ -113,7 +113,7 @@
}
#cms_body #cms_dialog form.image_url {
position: absolute;
- z-index: 999;
+ z-index: 9999;
width: 650px;
}
#cms_body #cms_dialog form.image_url label {
app/views/cms_admin/dialogs/image.html.erb +1 -1
@@ @@ -4,4 +4,4 @@
<input type='submit' value='<%= t('.insert') %>'/>
</form>
- <%= render :partial => 'cms_admin/files/index' %>
\ No newline at end of file
+ <%= render :partial => 'cms_admin/files/index', :locals => {:type => 'image' } %>
\ No newline at end of file
app/views/cms_admin/files/_index.html.erb +4 -1
@@ @@ -1,3 +1,6 @@
+ <% type ||= nil %>
+ <% files_scope = (type == 'image') ? @site.files.images : @site.files %>
+
<div class='box file_uploads'>
<%= form_for :file, :url => cms_admin_site_files_path(@site), :html => {:multipart => true} do |form| %>
@@ @@ -6,7 +9,7 @@
<% end %>
<div class='uploaded_files'>
- <% @site.files.order(:label).each do |file| %>
+ <% files_scope.order(:label).each do |file| %>
<%= render :partial => 'cms_admin/files/file', :object => file %>
<% end %>
</div>