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 %> <% # 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--> <!--Widget start-->
<%= f.error_messages %>
<div id="sub-wiget"> <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 id="widget-picture" class="widget-box widget-size-300">
<div class="widget-action clear"> <div class="widget-action clear">
<a class="action"><i title="Upload pictures" class="icon-exclamation-sign icon-white tip"></i></a> <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">
<div id="post-body-content" class="clear"> <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.label :category %>
<%= f.select :bulletin_category_id, @bulletin_categorys.collect{|t| [ t.i18n_variable[I18n.locale], t.id ]}, {}, :class => "input-medium" %> <%= 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"> <ul class="nav nav-tabs">
<a class="btn dropdown-toggle" href="#" data-toggle="dropdown"> <li class="active"><a data-toggle="tab" href="#chinese">Chinese</a></li>
English <li><a data-toggle="tab" href="#english">English</a></li>
<span class="caret"></span> </ul>
</a> <div class="tab-content">
<ul class="dropdown-menu"> <div id="chinese" class="tab-pane active">
<li><a href="#">English</a></li> <div class="title">
<li><a href="#">Chinese</a></li> <input type="text" placeholder="輸入標題" class="post-title">
<li><a href="#">Japanese</a></li> </div>
<li><a href="#">French</a></li> </div>
<li><a href="#">German</a></li> <div id="english" class="tab-pane">
<!--<li class="divider"></li> <div class="title">
<li><a href="#">Separated link</a></li>--> <input type="text" placeholder="Enter title here" class="post-title">
</ul> </div>
<div class="editor"></div>
<div class="editor"></div>
</div>
</div> </div>
<div class="title"> <div class="title">
@ -137,14 +149,14 @@
<%= f.fields_for :title, (@bulletin.new_record? ? @bulletin.build_title : @bulletin.title ) do |f| %> <%= f.fields_for :title, (@bulletin.new_record? ? @bulletin.build_title : @bulletin.title ) do |f| %>
<% @site_valid_locales.each do |locale| %> <% @site_valid_locales.each do |locale| %>
<td> <td>
<%= I18nVariable.from_locale(locale) %> <%= I18nVariable.from_locale(locale) %>
<%= f.text_field locale, :class=>'post-title' %> <%= f.text_field locale, :class=>'post-title' %>
</td> </td>
<% end %> <% end %>
<% end %> <% end %>
</div> </div>
<div class="title"> <div class="editor">
<%= f.label :subtitle %> <%= f.label :subtitle %>
<%= f.fields_for :subtitle, (@bulletin.new_record? ? @bulletin.build_subtitle : @bulletin.subtitle ) do |f| %> <%= f.fields_for :subtitle, (@bulletin.new_record? ? @bulletin.build_subtitle : @bulletin.subtitle ) do |f| %>
<% @site_valid_locales.each do |locale| %> <% @site_valid_locales.each do |locale| %>
@ -156,7 +168,7 @@
<% end %> <% end %>
</div> </div>
<div class="title"> <div class="editor">
<%= f.label :text %> <%= f.label :text %>
<%= f.fields_for :text, (@bulletin.new_record? ? @bulletin.build_text : @bulletin.text ) do |f| %> <%= f.fields_for :text, (@bulletin.new_record? ? @bulletin.build_text : @bulletin.text ) do |f| %>
<% @site_valid_locales.each do |locale| %> <% @site_valid_locales.each do |locale| %>
@ -168,7 +180,6 @@
<% end %> <% end %>
</div> </div>
<div class="main-wiget"> <div class="main-wiget">
<div id="widget-link" class="widget-box"> <div id="widget-link" class="widget-box">
<div class="widget-action clear"> <div class="widget-action clear">
@ -183,6 +194,7 @@
<% @site_valid_locales.each do |locale| %> <% @site_valid_locales.each do |locale| %>
<div class="control-group"> <div class="control-group">
<th>Name - <%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %></th> <th>Name - <%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %></th>
</div>
<% end %> <% end %>
<th class="span1"></th> <th class="span1"></th>
</tr> </tr>
@ -214,10 +226,6 @@
</table> </table>
</div> </div>
</div> </div>
</div>
<div class="main-wiget">
<div id="widget-file" class="widget-box"> <div id="widget-file" class="widget-box">
<div class="widget-action clear"> <div class="widget-action clear">
<a class="action"><i title="Added to the file" class="icon-exclamation-sign icon-white tip"></i></a> <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>
</div> </div>
<!--Post End--> <!--Post End-->
</div>
<div class="form-actions"> <div class="form-actions">
<%= f.submit 'Submit/送出', :class=>'btn btn-primary' %> <%= f.submit 'Submit/送出', :class=>'btn btn-primary' %>
</div> <%= link_back %>
</div>
</div>