forked from RaVbaker/tolk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
show.html.erb
45 lines (39 loc) · 1.14 KB
/
show.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<h1><%= @locale.name %></h1>
<% if @locale.phrases_without_translation.any? %>
<h2>Missing translations</h2>
<table>
<tr><th>Phrase</th><th>Translation</th></tr>
<% for phrase in @locale.phrases_without_translation %>
<tr>
<td>
<%= phrase.key %>
</td>
<td>
<% form_for(Translation.new(:locale => @locale, :phrase => phrase)) do |f| %>
<%= f.hidden_field :locale_id %>
<%= f.hidden_field :phrase_id %>
<%= f.text_field :text %>
<%= f.submit "Update" %> ( <i>Hint:</i> <%= phrase.translations.primary.text -%> )
<% end %>
</td>
</tr>
<% end %>
</table>
<% end %>
<h2>Existing translations</h2>
<table>
<tr><th>Phrase</th><th>Translation</th></tr>
<% for phrase in @locale.phrases_with_translation %>
<tr>
<td>
<%= phrase.key %>
</td>
<td>
<% remote_form_for(phrase.translation) do |f| %>
<%= f.text_field :text %>
<%= f.submit "Update" %> ( <i>Hint:</i> <%= phrase.translations.primary.text -%> )
<% end %>
</td>
</tr>
<% end %>
</table>