Links edition

This commit is contained in:
chris2tof committed 2011-05-13 09:08:42 +08:00
1 parent d9ba76ebd5
commit 24ae7ed5e3
31 files changed
+184 -98

No files matched your search

-11
View File
@@ -1,11 +0,0 @@
<td><%= item.class %></td>
<td><%= link_to item.name, admin_items_path(:parent_id => item.id) %></td>
<td><%= item.i18n_variable[I18n.locale] rescue nil %>
<td><%= item.position %></td>
<td><%= item.is_published.to_s %></td>
<td>
<%= link_to t(:show), item.url %> |
<%= link_to t(:edit), edit_admin_page_path(item) %> |
<%= link_to t(:delete), admin_page_path(item), :confirm => t('sure?'), :method => :delete %>
</td>
@@ -0,0 +1 @@
<%= render_node_and_children(Item.first(:conditions => {:parent_id => nil})) %>
+6 -37
View File
@@ -1,55 +1,24 @@
<% content_for :sidebar do %>
<div id='sidebar'><%= render 'layouts/site_map_left_bar' %></div>
<div id='sidebar'><%= render 'admin/items/site_map_left_bar' %></div>
<% end -%>
<% content_for :page_specific_javascript do %>
<script type="text/javascript" charset="utf-8">
<!-- <script type="text/javascript" charset="utf-8">
$('a.sidebar_link').live( "click", function(){
$(this).removeClass('sidebar_link');
$('.sidebar_no_link').addClass('sidebar_link');
$('.sidebar_no_link').removeClass('sidebar_no_link');
$(this).addClass('sidebar_no_link');
});
</script>
</script> -->
<% end -%>
<% content_for :page_specific_css do %>
<style type="text/css">
<!-- <style type="text/css">
.sidebar_no_link {
pointer-events: none;
cursor: default;
}
</style>
</style> -->
<% end %>
<%= render 'layouts/page' %>
<!-- <%= flash_messages %>
<h1><%= t('admin.list_items') %>: <%= show_parent_items_link unless @parent_item.nil? %></h1>
<% if !Layout.exist_one? %>
<div style='color:red'><%= t('admin.no_layout') %>: <%= link_to t('create').downcase, new_admin_layout_path %></div>
<br/>
<% else %>
<table>
<tr>
<th><%= t('admin.class') %></th>
<th><%= t('admin.name') %></th>
<th><%= t('admin.title') %></th>
<th><%= t('admin.position') %></th>
<th><%= t('admin.published?') %></th>
<th><%= t('admin.action') %></th>
<th></th>
</tr>
<% @items.each do |item| %>
<tr>
<%= render :partial => item.class.to_s.downcase, :locals => { :item => item } %>
<!--<td><%= link_to t(:move_up, :scope => :admin), up_admin_item_path(item), :method => :put %> |
<%= link_to t(:move_down, :scope => :admin), down_admin_item_path(item), :method => :put %></td>-->
</tr>
<% end if @items %>
</table>
<% end %>
<%= render :partial => "snippets", :locals => { :snippets => @snippets } %> -->
<%= render "admin/#{@item._type.downcase.pluralize}/show" %>
+3 -3
View File
@@ -1,9 +1,9 @@
$('#main').empty();
switch ("<%= escape_javascript(@page._type)%>") {
switch ("<%= escape_javascript(@item._type)%>") {
case 'Link':
$('#main').append("TODO: page to edit the link");
$('#main').append("<%= escape_javascript(render(:partial => 'admin/links/show')) %>");
break;
case 'Page':
$('#main').append("<%= escape_javascript(render(:partial => 'layouts/page')) %>");
$('#main').append("<%= escape_javascript(render(:partial => 'page')) %>");
break;
};