Integration of pop-up and generic js.erb

This commit is contained in:
chris2tof committed 2011-12-28 20:49:53 +08:00
1 parent 62aaf79491
commit 245def9cb6
14 files changed
+1613 -54

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
<tr id="asset_<%= asset.id %>" class="have">
<td><%= asset.id %></td>
<td><div class="assets_pic"><%= image_tag(asset.data.url) %></div>
<%#= link_to asset.filename, asset.data.url, :target => '_blank' %>
</td>
<td><%= asset.description %></td>
<td><%= asset.data.file.content_type %></td>
<td><%= asset.data_filename %></td>
<td><%= number_to_human_size(asset.data.file.file_length) %></td>
<td class="action">
<%= link_to t(:edit), edit_admin_asset_path(asset), :remote => true, :class => 'edit' %>
<%= link_to t(:delete), admin_asset_path(asset), :confirm => t('sure?'), :method => :delete, :remote => true, :class => 'delete' %>
</td>
</tr>
<tr>
<td colspan="5"></td>
</tr>
+12
View File
@@ -0,0 +1,12 @@
<div id='pop_up_content' class="main2">
<h1><%= t('editing_asset') %></h1>
<%= form_for @asset, :url => admin_asset_path(@asset), :html => {:id => 'ajaxForm', :multipart => true } do |f| %>
<%= f.error_messages %>
<%= render :partial => "form", :locals => { :f => f } %>
<div class="button_bar">
<%= link_back if is_html %>
<a id='submit_button'><%= t(:update) %></a>
</div>
<% end %>
</div>
+14
View File
@@ -0,0 +1,14 @@
<div id='pop_up_content' class="main2">
<h1><%= t('admin.new_asset') %></h1>
<%= form_for :asset, :url => admin_assets_path, :html => {:id => 'ajaxForm', :multipart => true }, :remote => true do |f| %>
<%= f.error_messages %>
<%= render :partial => "form", :locals => { :f => f } %>
<div class="button_bar">
<%= link_back if is_html %>
<a id='submit_button'><%= t(:create) %></a>
</div>
<% end %>
</div>
+8 -11
View File
@@ -1,12 +1,9 @@
<div class="main2">
<h1><%= t('editing_asset') %></h1>
<% content_for :secondary do %>
<div class="assets_setup">
<ul class="list">
<li><%= link_to t(:new_asset, :scope => :admin), new_admin_asset_path, :remote => true, :class => 'button positive' %></li>
</ul>
</div>
<% end -%>
<% form_for @asset, :url => admin_asset_path(@asset), :html => { :multipart => true } do |f| %>
<%= f.error_messages %>
<%= render :partial => "form", :locals => { :f => f } %>
<p>
<%= f.submit t('update') %> <%= link_back %>
</p>
<% end %>
</div>
<%= render :partial => 'edit', :locals => {:is_html => true} %>
+15 -31
View File
@@ -1,7 +1,7 @@
<% content_for :secondary do %>
<div class="assets_setup">
<ul class="list">
<li><%= link_to t(:new_asset, :scope => :admin), new_admin_asset_path, :class => 'button positive' %></li>
<li><%= link_to t(:new_asset, :scope => :admin), new_admin_asset_path, :remote => true, :class => 'button positive' %></li>
</ul>
</div>
<% end -%>
@@ -10,35 +10,19 @@
<h1><%= t('admin.list_assets') %></h1>
<table>
<thead>
<tr>
<td><%= t('admin.id') %></th>
<td><%= t('admin.file_name') %></th>
<td><%= t('admin.description') %></th>
<td><%= t('admin.format') %></th>
<td><%= t('admin.orig_upload_file') %></th>
<td><%= t('admin.file_size') %></th>
<td><%= t('admin.action') %></th>
</tr>
</thead>
<% @assets.each do |asset| %>
<tr class="have">
<td><%= asset.id %></td>
<td><div class="assets_pic"><%= image_tag(asset.data.url) %></div>
<%#= link_to asset.filename, asset.data.url, :target => '_blank' %>
</td>
<td><%= asset.description %></td>
<td><%= asset.data.file.content_type %></td>
<td><%= asset.data_filename %></td>
<td><%= number_to_human_size(asset.data.file.file_length) %></td>
<td class="action">
<%= link_to t(:edit), edit_admin_asset_path(asset), :class => 'edit' %>
<%= link_to t(:delete), admin_asset_path(asset), :confirm => t('sure?'), :method => :delete, :class => 'delete' %>
</td>
</tr>
<tr>
<td colspan="5"></td>
</tr>
<% end %>
<thead>
<tr>
<td><%= t('admin.id') %></th>
<td><%= t('admin.file_name') %></th>
<td><%= t('admin.description') %></th>
<td><%= t('admin.format') %></th>
<td><%= t('admin.orig_upload_file') %></th>
<td><%= t('admin.file_size') %></th>
<td><%= t('admin.action') %></th>
</tr>
</thead>
<tbody id='asset_tbody'>
<%= render :partial => 'asset', :collection => @assets %>
<tbody>
</table>
</div>