add back_end show vocab

This commit is contained in:
thomaschen 2013-08-22 16:46:38 +08:00 committed by chris
parent 8a94eeeee8
commit 667b7f2bd5
4 changed files with 27 additions and 3 deletions

View File

@ -9,7 +9,6 @@
<tr> <tr>
<th class="span2"><%= t :category, :scope => :dictionary %></th> <th class="span2"><%= t :category, :scope => :dictionary %></th>
<th class="span2"><%= t :word, :scope => :dictionary %></th> <th class="span2"><%= t :word, :scope => :dictionary %></th>
<th class="span2"><%= t :definition, :scope => :dictionary %></th>
<th class="span2"><%= t :time, :scope => :dictionary %></th> <th class="span2"><%= t :time, :scope => :dictionary %></th>
<th class="span2"></th> <th class="span2"></th>
</tr> </tr>
@ -20,7 +19,6 @@
<tr> <tr>
<td><%= vocab.dictionary_vocab_category.title %></td> <td><%= vocab.dictionary_vocab_category.title %></td>
<td><%= link_to truncate(vocab.word,length: 25), panel_dictionary_back_end_dictionary_vocab_path(vocab) %></td> <td><%= link_to truncate(vocab.word,length: 25), panel_dictionary_back_end_dictionary_vocab_path(vocab) %></td>
<td><%= truncate(vocab.definition,length: 50) %></td>
<td><% if vocab.created_at > Time.now.beginning_of_day %> <td><% if vocab.created_at > Time.now.beginning_of_day %>
<%="#{time_ago_in_words(vocab.created_at)}"%> <%="#{time_ago_in_words(vocab.created_at)}"%>
<%=t :ago,:scope => :dictionary%> <%=t :ago,:scope => :dictionary%>

View File

@ -0,0 +1,24 @@
<div class="row">
<div class="span8 offset1">
<table class="table table-striped" align ="center">
<tr>
<td ><%= t :category, :scope => :dictionary %></td>
<td><%= @vocab.dictionary_vocab_category.key %></td>
</tr>
<tr>
<td ><%= t :word, :scope => :dictionary %></td>
<td><%= @vocab.word %></td>
</tr>
<tr>
<td ><%= t :definition, :scope => :dictionary %></td>
<td><pre><%= @vocab.definition %></pre></td>
</tr>
<tr>
<td ></td>
<td><%= link_to t(:edit),edit_panel_dictionary_back_end_dictionary_vocab_path(@vocab) %> |
<%= link_to t(:delete), panel_dictionary_back_end_dictionary_vocab_path(@vocab), method: :delete , :data => { :confirm => 'Are you sure?'} %> |
<%= link_to t(:back), panel_dictionary_back_end_dictionary_vocabs_path%></td>
</tr>
</table>
</div>
</div>

View File

@ -17,4 +17,5 @@ en:
category: Category category: Category
word: Word word: Word
definition: Definition definition: Definition
time: Time time: Time
ago: ago

View File

@ -22,3 +22,4 @@ zh_tw:
word: 字彙 word: 字彙
definition: 定義 definition: 定義
time: 時間 time: 時間
ago: