memberlog/app/views/admin/memberlogs/_form.html.erb

143 lines
4.9 KiB
Plaintext

<% # encoding: utf-8 %>
<% content_for :page_specific_css do %>
<%= stylesheet_link_tag "lib/main-forms" %>
<%= stylesheet_link_tag "lib/fileupload" %>
<%= stylesheet_link_tag "lib/main-list" %>
<%= stylesheet_link_tag "lib/main-form-col2" %>
<style type="text/css">
.ui-helper-hidden-accessible{
display: none;
}
</style>
<% end %>
<% content_for :page_specific_javascript do %>
<%= javascript_include_tag "lib/bootstrap-datetimepicker" %>
<%= javascript_include_tag "lib/datetimepicker/datetimepicker.js" %>
<%= javascript_include_tag "lib/bootstrap-fileupload" %>
<%= javascript_include_tag "lib/file-type" %>
<%= javascript_include_tag "lib/module-area" %>
<% end %>
<!-- Input Area -->
<div class="input-area">
<!-- Language Tabs -->
<div class="nav-name"><strong><%= t(:language) %></strong></div>
<ul class="nav nav-pills language-nav">
<% @site_in_use_locales.each_with_index do |locale, i| %>
<li class="<%= 'active' if i == 0 %>">
<a data-toggle="tab" href=".<%= locale %>"><%= t(locale) %></a>
</li>
<% end %>
<li class="pull-right">
<%= copy_to_all_language_button(".language-nav", ".language-area") %>
</li>
</ul>
<!-- Language -->
<div class="tab-content language-area">
<% @site_in_use_locales.each_with_index do |locale, i| %>
<div class="<%= locale %> tab-pane fade <%= ( i == 0 ) ? "in active" : '' %>">
<!-- memberlog Excuse -->
<div class="control-group input-excuse">
<label class="control-label muted"><%= t('memberlog.excuse') %></label>
<div class="controls">
<div class="textarea">
<%= f.fields_for :excuse_translations do |f| %>
<%= f.text_area locale, rows: 2, class: "input-block-level", value: (@memberlog.excuse_translations[locale] rescue nil) %>
<% end %>
</div>
</div>
</div>
<!-- memberlog Todo-->
<div class="control-group">
<label class="control-label muted"><%= t("memberlog.todo") %></label>
<div class="controls">
<%= f.fields_for :todo_translations do |f| %>
<%= f.text_area locale, class: "input-block-level ckeditor", placeholder: t("memberlog.todo"), value: (@memberlog.todo_translations[locale] rescue nil) %>
<% end %>
</div>
</div>
<!-- memberlog Complete -->
<div class="control-group">
<label class="control-label muted"><%= t("memberlog.complete") %></label>
<div class="controls">
<%= f.fields_for :complete_translations do |f| %>
<%= f.text_area locale, class: "input-block-level ckeditor", placeholder: t("memberlog.complete"), value: (@memberlog.complete_translations[locale] rescue nil) %>
<% end %>
</div>
</div>
</div>
<% end %>
<!-- Module -->
<div class="tab-content module-area">
<!-- Basic Module -->
<div class="tab-pane fade in active" id="basic">
<% if !@member.nil? %>
<div class="control-group big-group">
<label class="control-label muted"><%= t("membelog.staff") %></label>
<div class="controls">
<%= @member.name rescue ''%>
<%= f.hidden_field :member_profile_id, :value => @member.id %>
</div>
</div>
<% else %>
<div class="control-group big-group">
<label class="control-label muted"><%= t("memberlog.staff") %></label>
<div class="controls">
<% members = !@memberlog.member_profile.nil? ? @memberlog.member_profile.to_a : [] %>
<%= render partial: 'admin/member_selects/email_selection_box', locals: {field: 'member_log[member_profile_id]', email_members: members} %>
</div>
</div>
<% end %>
<div class="control-group" data-toggle="buttons-checkbox">
<div class="controls">
<%= f.check_box :finish %><%= t("memberlog.checkout") %>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Form Actions -->
<div class="form-actions">
<%= f.hidden_field :user_id, :value => params[:user_id] if !params[:user_id].blank? %>
<input type="hidden" name="referer_url" value="<%= request.referer %>">
<%= f.submit t('submit'), class: 'btn btn-primary' %>
<%= link_to t('cancel'), request.referer, :class=>"btn" %>
</div>
<script type="text/javascript">
$(document).on('click', '.delete_file', function(){
$(this).parents('.input-prepend').remove();
});
$(document).on('click', '.remove_existing_record', function(){
if(confirm("<%= I18n.t(:sure?)%>")){
$(this).children('.should_destroy').attr('value', 1);
$(this).parents('.start-line').hide();
}
});
function() {
$('#remind-check').prop('checked') ? '':$('.content-box').addClass('hide')
$('#remind-check').on('change', function() {
$(this).prop('checked') ? $('.content-box').removeClass('hide'):$('.content-box').addClass('hide')
})
};
</script>