Commit 3ba913e7 authored by 神楽坂玲奈's avatar 神楽坂玲奈

导航栏初步,感觉现在语言包更纠结了

git-svn-id: http://glupx.googlecode.com/svn/trunk/Reliz@80 189f022a-1064-8ae2-3e6f-c4a67275c50b
parent f5bc91b6
......@@ -57,6 +57,8 @@ class ApplicationController < ActionController::Base
end
end
#p @site[:themes]
@navigations = Navigation.find_all_by_super_id 0
end
#def redirect_to_thc
#p 'WARNING: '+params[:anything]+"?"+env['QUERY_STRING']
......
class Navigation < ActiveRecord::Base
belongs_to :super, :class_name => "::Navigation"
has_many :subs, :class_name => "::Navigation", :foreign_key => :super_id
end
<div id="navigation">
<div id="navigations">
<ul>
<li class="menu_1"><%=link_to t('navi.forum'), :"boards", :hidefocus => true, :id => :mn_index %></li>
<li class="menu_1"><%=link_to t('navi.forum'), :controller => :boards, :action => :index, :hidefocus => true, :id => :mn_index %></li>
<% @navigations.each do |navigation| %>
<li class="navigation"><%=link_to navigation.name, navigation.url %></li>
<% end %>
</ul>
</div>
\ No newline at end of file
......@@ -3,7 +3,7 @@ class DemoData < ActiveRecord::Migration
Board.create :id => 1,
:superboard_id => 0,
:name => "综合讨论中心"
Board.create :id => 2,
:superboard_id => 1,
:name => "测试版块",
......@@ -11,12 +11,36 @@ class DemoData < ActiveRecord::Migration
:notice => "版块公告",
:logo => "http://bbs.66rpg.com/data/attachment/common/skin/VX.png",
:banner => "http://ftp.66rpg.com/WEB_PLUS/attachment/forum/201104/24/221009dzbmkp6666pp3mue.jpg"
Link.create :id => 1,
:name => "66RPG 实验室",
:displayorder => 0,
:introduction => "Reliz 开发组",
:url => "http://lab.66rpg.com:3000/",
:logo => "http://bbs.66rpg.com/logo.gif"
Navigation.create :id => 1,
:name => "论坛",
:displayorder => 0,
:url => "/boards",
:usergroup_id => 0,
:super_id => 0
Navigation.create :id => 2,
:name => "测试导航1",
:displayorder => 1,
:url => "/boards",
:usergroup_id => 0,
:super_id => 1
Navigation.create :id => 3,
:name => "测试导航2",
:displayorder => 1,
:url => "/boards",
:usergroup_id => 0,
:super_id => 1
end
......
......@@ -10,7 +10,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20111042772026) do
ActiveRecord::Schema.define(:version => 20111042872025) do
create_table "boards", :force => true do |t|
t.string "name", :default => "", :null => false
......
This diff is collapsed.
408
\ No newline at end of file
1348
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment