fix with what ray needs for the fact_check form

This commit is contained in:
Christophe Vilayphiou 2012-03-23 12:00:48 +08:00
parent bb14a7736f
commit 662c8c7a8a
1 changed files with 65 additions and 58 deletions

View File

@ -1,34 +1,34 @@
<% # encoding: utf-8 %>
<%= f.error_messages %>
<%= f.select :bulletin_category_id, @bulletin_categorys.collect{|t| [ t.i18n_variable[I18n.locale], t.id ]}, {}, :class => "input-medium" %>
<% if is_manager? || @bulletin.bulletin_category.authed_users('fact_check').include?(current_user) || current_user.admin?%>
<div class="field">
<%= label :fact_check_stat, t('announcement.bulletin.fact_check_stat') %>
<%= f.radio_button :is_checked, true%>
<%= label :is_checked_true, t('announcement.bulletin.fact_check_pass') %>
<%= f.radio_button :is_checked, false, (@bulletin.is_checked.nil?? {:checked => true} : {}) %>
<%= label :is_checked_false, t('announcement.bulletin.fact_check_not_pass') %>
<%= label :is_checked_false, t('announcement.bulletin.fact_check_not_pass_reason') %>
<%= f.text_field :not_checked_reason %>
</div>
<% end %>
<div class="field">
<%= f.label :image, t('announcement.image') %><br />
<%= f.file_field :image %>
<% if @bulletin.image.file %>
<%= check_box_tag 'bulletin[image_del]' %>
<%= t('announcement.刪除已上傳檔案') %>
<% end %>
</div>
<!--Widget start-->
<%= f.error_messages %>
<div id="sub-wiget">
<div id="widget-audit" class="widget-box">
<div class="widget-action clear">
<a class="action"><i title="A" class="icon-exclamation-sign icon-white tip"></i></a>
</div>
<h3 class="widget-title"><i class="icons-link icons-white"></i>Audit</h3>
<div class="widget-content">
<% if is_manager? || @bulletin.bulletin_category.authed_users('fact_check').include?(current_user) || current_user.admin?%>
<div class="controls">
<%= f.label :fact_check_stat, t('announcement.bulletin.fact_check_stat') %>
<%= content_tag :label,:class => "radio inline" do -%>
<%= f.radio_button :is_checked, true , {:class => 'privacy'} %>
<%= t('announcement.bulletin.fact_check_pass') %>
<% end -%>
<%= content_tag :label,:class => "radio inline" do -%>
<%= f.radio_button :is_checked, false, (@bulletin.is_checked.nil?? {:checked => true, :class => 'privacy'} : {})%>
<%= t('announcement.bulletin.fact_check_not_pass') %>
<% end -%>
<div class="select-role">
<%= label :is_checked_false, t('announcement.bulletin.fact_check_not_pass_reason') %>
<%= f.text_field :not_checked_reason %>
</div>
</div>
<% end %>
</div>
</div>
<div id="widget-picture" class="widget-box widget-size-300">
<div class="widget-action clear">
<a class="action"><i title="Upload pictures" class="icon-exclamation-sign icon-white tip"></i></a>
@ -112,24 +112,36 @@
<div id="post-body">
<div id="post-body-content" class="clear">
<div class="field">
<%= f.label :image, t('announcement.image') %><br />
<%= f.file_field :image %>
<% if @bulletin.image.file %>
<%= check_box_tag 'bulletin[image_del]' %>
<%= t('announcement.刪除已上傳檔案') %>
<% end %>
</div>
<%= f.label :category %>
<%= f.select :bulletin_category_id, @bulletin_categorys.collect{|t| [ t.i18n_variable[I18n.locale], t.id ]}, {}, :class => "input-medium" %>
<div class="btn-group pull-right">
<a class="btn dropdown-toggle" href="#" data-toggle="dropdown">
English
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li><a href="#">English</a></li>
<li><a href="#">Chinese</a></li>
<li><a href="#">Japanese</a></li>
<li><a href="#">French</a></li>
<li><a href="#">German</a></li>
<!--<li class="divider"></li>
<li><a href="#">Separated link</a></li>-->
</ul>
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#chinese">Chinese</a></li>
<li><a data-toggle="tab" href="#english">English</a></li>
</ul>
<div class="tab-content">
<div id="chinese" class="tab-pane active">
<div class="title">
<input type="text" placeholder="輸入標題" class="post-title">
</div>
</div>
<div id="english" class="tab-pane">
<div class="title">
<input type="text" placeholder="Enter title here" class="post-title">
</div>
<div class="editor"></div>
<div class="editor"></div>
</div>
</div>
<div class="title">
@ -137,14 +149,14 @@
<%= f.fields_for :title, (@bulletin.new_record? ? @bulletin.build_title : @bulletin.title ) do |f| %>
<% @site_valid_locales.each do |locale| %>
<td>
<%= I18nVariable.from_locale(locale) %>
<%= f.text_field locale, :class=>'post-title' %>
</td>
<%= I18nVariable.from_locale(locale) %>
<%= f.text_field locale, :class=>'post-title' %>
</td>
<% end %>
<% end %>
</div>
</div>
<div class="title">
<div class="editor">
<%= f.label :subtitle %>
<%= f.fields_for :subtitle, (@bulletin.new_record? ? @bulletin.build_subtitle : @bulletin.subtitle ) do |f| %>
<% @site_valid_locales.each do |locale| %>
@ -156,7 +168,7 @@
<% end %>
</div>
<div class="title">
<div class="editor">
<%= f.label :text %>
<%= f.fields_for :text, (@bulletin.new_record? ? @bulletin.build_text : @bulletin.text ) do |f| %>
<% @site_valid_locales.each do |locale| %>
@ -168,7 +180,6 @@
<% end %>
</div>
<div class="main-wiget">
<div id="widget-link" class="widget-box">
<div class="widget-action clear">
@ -183,6 +194,7 @@
<% @site_valid_locales.each do |locale| %>
<div class="control-group">
<th>Name - <%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %></th>
</div>
<% end %>
<th class="span1"></th>
</tr>
@ -214,10 +226,6 @@
</table>
</div>
</div>
</div>
<div class="main-wiget">
<div id="widget-file" class="widget-box">
<div class="widget-action clear">
<a class="action"><i title="Added to the file" class="icon-exclamation-sign icon-white tip"></i></a>
@ -262,15 +270,14 @@
</div>
</div>
</div>
</div>
<!--Post End-->
</div>
<div class="form-actions">
<div class="form-actions">
<%= f.submit 'Submit/送出', :class=>'btn btn-primary' %>
</div>
</div>
<%= link_back %>
</div>