Change the design for the whole site form designs index

This commit is contained in:
chris committed 2012-12-07 12:14:31 +08:00
1 parent c74ead8318
commit ff435a4af4
9 files changed
+38 -1

No files matched your search

+1
View File
@@ -9,6 +9,7 @@
</ul>
</div>
</td>
<td class="span1"><%= radio_button_tag 'design_default', design.id, (@site.design.id.to_s.eql?(design.id.to_s) ? true : false), :class => 'design_default', :rel => admin_sites_path %> <%=@site.design.id.to_s.eql?(design.id.to_s)%></td>
<td class="span7"><%= design.intro %></td>
<td class="span2"><%= design.author %></td>
</tr>
+13 -1
View File
@@ -2,6 +2,7 @@
<tr>
<th class="span1 strong"></th>
<th class="span2"></th>
<th class="span1"></th>
<th class="span7"></th>
<th class="span2"></th>
</tr>
@@ -9,4 +10,15 @@
<tbody>
<tbody id="tbody_designs" class="sort-holder">
<%= render :partial => 'design', :collection => @designs %>
</tbody>
</tbody>
<% content_for :page_specific_javascript do %>
<script>
$(document).ready(function(){
$(document).on('change', '.design_default', function(){
$(this).attr('value');
$.getScript($(this).attr('rel') + '/' + $(this).val() + '/change_design');
});
});
</script>
<% end %>
@@ -1,4 +1,5 @@
<%= render_sort_bar(true, delete_admin_designs_path(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options]),
['title', 'title','span2', :title],
['', '', 'span1', :default],
['intro', 'intro', 'span7', :intro],
['author', 'author', 'span2', :author]).html_safe %>