2017-03-08 06:10:32 +00:00
|
|
|
<% if @site_request.type == "existing" %>
|
|
|
|
<div class="control-group">
|
|
|
|
<label class="control-label">Site Title :</label>
|
|
|
|
<div class="controls">
|
|
|
|
<%= @site_request.get_site.title %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="control-group">
|
|
|
|
<label class="control-label">Site Domain :</label>
|
|
|
|
<div class="controls">
|
|
|
|
<a href="<%= @site_request.get_site.site_domain %>" target="_blank"><%= @site_request.get_site.site_domain %></a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<% else %>
|
|
|
|
<div class="control-group">
|
|
|
|
<%= f.label :new_site_cost, "New Site Cost:", :class => "control-label" %>
|
|
|
|
<div class="controls">
|
|
|
|
<%= f.number_field :new_site_cost, :min => "0" %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<% if @site_request.host_with_rulingdigital %>
|
|
|
|
<div class="control-group">
|
|
|
|
<%= f.label :hosting_with_rulingdigital_cost, "Host with RulingDigital:", :class => "control-label" %>
|
|
|
|
<div class="controls">
|
|
|
|
<%= f.number_field :hosting_with_rulingdigital_cost, :min => "0" %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
<div class="control-group">
|
|
|
|
<%= f.label :service_cost, "Maintainance Cost:", :class => "control-label" %>
|
|
|
|
<div class="controls">
|
|
|
|
<%= f.number_field :service_cost, :min => "0" %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<% if !@site_request.optional_modules.blank? %>
|
|
|
|
<div class="control-group">
|
|
|
|
<%= f.label :option_module_cost, "Optional Modules Cost:", :class => "control-label" %>
|
|
|
|
<% rsm = RegisteredModule.find(@site_request.optional_modules) %>
|
|
|
|
<div class="controls">
|
|
|
|
<ul>
|
|
|
|
<% rsm.each do |mod| %>
|
|
|
|
<li><span class="label label-info"><%= mod.name %></span></li>
|
|
|
|
<% end %>
|
|
|
|
</ul>
|
|
|
|
<%= f.number_field :option_module_cost, :min => "0" %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
<% if @site_request.custom_module %>
|
|
|
|
<div class="control-group">
|
|
|
|
<%= f.label :customized_module_cost, "Optional Module Cost:", :class => "control-label" %>
|
|
|
|
<div class="controls">
|
|
|
|
<%= f.number_field :customized_module_cost, :min => "0" %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
<% if !@site_request.template_number.empty? %>
|
|
|
|
<div class="control-group">
|
|
|
|
<%= f.label :template_cost, "Template Cost:", :class => "control-label" %>
|
|
|
|
<div class="controls">
|
|
|
|
<%= f.number_field :template_cost, :min => "0" %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
<% if @site_request.custom_template %>
|
|
|
|
<div class="control-group">
|
|
|
|
<%= f.label :customized_template_cost, "Customized Template Cost:", :class => "control-label" %>
|
|
|
|
<div class="controls">
|
|
|
|
<%= f.number_field :customized_template_cost, :min => "0" %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
<% if @site_request.rwd %>
|
|
|
|
<div class="control-group">
|
|
|
|
<%= f.label :rwd_cost, "RWD Cost:", :class => "control-label" %>
|
|
|
|
<div class="controls">
|
|
|
|
<%= f.number_field :rwd_cost, :min => "0" %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
2017-03-10 06:53:25 +00:00
|
|
|
<% if !@contract.contract_file.url.nil? %>
|
|
|
|
<a href="<%= @contract.contract_file.url %>" target="_blank">Download Contract</a>
|
|
|
|
<% end %>
|
|
|
|
<div class="control-group">
|
|
|
|
<%= f.label :contract_file, "Contract File:", :class => "control-label" %>
|
|
|
|
<div class="controls">
|
|
|
|
<%= f.file_field :contract_file %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2017-03-08 06:10:32 +00:00
|
|
|
<div>
|
2017-03-10 06:53:25 +00:00
|
|
|
<h3>Total Amount : <span id="total-amount"><%= @contract.new_record? ? 0 : @contract.total_amount %></span> NTD.</h3>
|
2017-03-08 06:10:32 +00:00
|
|
|
</div>
|
2017-03-10 06:53:25 +00:00
|
|
|
<% if @contract.new_record? %>
|
|
|
|
<%= f.hidden_field :site_request, :value => @site_request.id.to_s %>
|
|
|
|
<% end %>
|
2017-03-08 06:10:32 +00:00
|
|
|
<%= f.submit "Submit", :class => "btn btn-primary" %>
|
2017-03-10 06:53:25 +00:00
|
|
|
<a href="<%= see_contract_admin_client_management_path(@contract.id) %>" class="btn">Back</a>
|
2017-03-08 06:10:32 +00:00
|
|
|
<script type="text/javascript">
|
|
|
|
var costFields = $("form.contract-form input[type=number]"),
|
|
|
|
totalAmountDom = $("#total-amount");
|
|
|
|
costFields.on("change",function(){
|
|
|
|
var totalAmount = 0;
|
|
|
|
$.each(costFields,function(){
|
|
|
|
var amt = ($(this).val() == "" ? 0 : $(this).val());
|
|
|
|
totalAmount += parseInt(amt);
|
|
|
|
})
|
|
|
|
totalAmountDom.text(totalAmount);
|
|
|
|
})
|
|
|
|
</script>
|