OSDN Git Service

t#:
[laoz/laoz.git] / app / views / section / show.rhtml
1 <!-- 章単体表示 -->
2 <h2>
3   <%= render :partial => 'navi', 
4     :locals => {:item => @section} 
5   -%>
6 </h2>
7 <table>
8 <tr>
9 <td width="80%">
10   <div class="show">
11     <div>
12       <%= link_to(h('編集へ'), :action => :edit, :id => @section.id) %>
13     </div>
14     <h3>原文</h3>
15     <div class="source">
16       <%= simple_format(@section.disp_source) %>
17     </div>
18     <h3>読み下し文</h3>
19     <div class="japanese">
20       <%= srb(@section.disp_japanese) %>
21     </div>
22     <h3>解釈</h3>
23     <div class="myself">
24       <%= simple_format(@section.disp_myself) %>
25     </div>
26     <h3>備考</h3>
27     <div class="note">
28       <%= simple_format(ennote(enlink(@section.disp_note))) %>
29     </div>
30     <h3>超解釈</h3>
31     <div class="etc">
32       <%= h(@section.etc) %>
33     </div>
34     <h3>テーマ</h3>
35     <div class="thema-list">
36       <% @sec_themas.each do |st| -%>
37         <span>
38           <%= link_to(h(st.thema.caption), 
39             :controller => '/thema', :action => :show, :id => st.thema.id
40           ) %>
41         </span>
42       <% end -%>
43       <% form_tag :controller => '/section', :action => :link_thema, :id => @section.id do -%>
44         <%= select 'thema_section', 'thema_id', @themas %>
45         <%= submit_tag "この章と関連付ける" %>
46       <% end -%>
47       <% form_tag :controller => '/thema', :action => 'create', :id => @section.id do -%>
48         <%= text_field 'thema', 'caption', :size => 40 %>
49         <%= submit_tag "テーマを新規登録" %>
50       <% end -%>
51     </div>
52     <h3>ヒント</h3>
53     <div class="hint">
54       <% @hint_letters.each do |hl| -%>
55         <div>
56           <%= link_to(h(hl.letter.letter), 
57             :controller => '/letter', :action => :show, :id => hl.letter.id
58           ) %>
59           (<%= h(hl.letter.yomi) %>)
60         </div>
61         <div class="hint-letter">
62           <%= simple_format(enlink(hl.letter.disp_detail)) %>
63         </div>
64       <% end -%>
65       <% @hint_words.each do |hw| -%>
66         <div>
67           <%= link_to(h(hw.word.letter), 
68             :controller => '/words', :action => :show, :id => hw.word.id
69           ) %>
70           (<%= h(hw.word.yomi) %>)
71         </div>
72         <div class="hint-word">
73           <%= simple_format(enlink(hw.word.disp_detail)) %>
74         </div>
75       <% end -%>
76     </div>
77     <div class="edit">
78       <%= link_to(h('編集へ'), :action => :edit, :id => @section.id) %>
79     </div>
80     <% if @user -%>
81       <%= render :partial => '/hateda/section_show' %>
82     <% end -%>
83     <h3>参考解釈</h3>
84     <div class="trans">
85       <%= h(@section.trans) %>
86     </div>
87     <h3>参考英訳</h3>
88     <div class="english">
89       <%= h(@section.english) %>
90     </div>
91   </div>
92 </td>
93 <td width="10%">
94   <h3>熟語登録</h3>
95   <% form_tag :controller => '/words', :action => 'create' do -%>
96     <%= text_field 'word', 'letter', :size => 8 %>
97     <%= submit_tag "登録" %>
98   <% end -%>
99   <h3>出現熟語</h3>
100   <div>
101     <%= h(@word_count) %>種/
102     <%= h(@word_sum) %>語
103   </div>
104   <% form_tag :controller => '/section', :action => :word_checks, :id => @section.id do -%>
105     <% if @sec_words.empty? -%>
106     <% else -%>
107       <%= submit_tag "更新" %>
108       <div class="word-list">
109         <% @sec_words.each do |sw| -%>
110           <div>
111           <span>
112             <%= link_to(h(sw.word.letter), 
113               {:controller => '/words', :action => :show, :id => sw.word.id}, 
114               {:class => (sw.chk == 0 ? 'unchecked' : 'checked')}
115             ) %>
116           </span>
117           <span><%= check_box_tag(sw.id, '1', sw.bchk) %></span>
118           </div>
119         <% end -%>
120       </div>
121       <%= submit_tag "更新" %>
122     <% end -%>
123   <% end -%>
124 </td>
125 <td>
126   <h3>出現文字</h3>
127   <div>
128     <%= h(@letter_count) %>種/
129     <%= h(@letter_sum) %>語
130   </div>
131   <% form_tag :controller => '/section', :action => :letter_checks, :id => @section.id do -%>
132     <% if @sec_letters.empty? -%>
133     <% else -%>
134       <%= submit_tag "更新" %>
135       <div class="letter-list">
136         <% @sec_letters.each do |sl| -%>
137           <div>
138           <span>
139             <%= link_to(h(sl.letter.letter), 
140               {:controller => '/letter', :action => :show, :id => sl.letter.id}, 
141               {:class => (sl.chk == 0 ? 'unchecked' : 'checked')}
142             ) %>
143           </span>
144           <span><%= check_box_tag(sl.id, '1', sl.bchk) %></span>
145           </div>
146         <% end -%>
147       </div>
148       <%= submit_tag "更新" %>
149     <% end -%>
150   <% end -%>
151 </td>
152 </tr>
153 </table>
154 <h2>
155   <%= render :partial => 'navi', 
156     :locals => {:item => @section} 
157   -%>
158 </h2>
159 <!-- /章単体表示 -->
160