modification for frontend
This commit is contained in:
parent
afcca1c365
commit
708831e333
|
@ -3,9 +3,14 @@ $('.select-site').on('change', function (e) {
|
||||||
var valueSelected = this.value;
|
var valueSelected = this.value;
|
||||||
// console.log(optionSelected+', '+valueSelected);
|
// console.log(optionSelected+', '+valueSelected);
|
||||||
if ( valueSelected == "newsite" ) {
|
if ( valueSelected == "newsite" ) {
|
||||||
$('.box-check-host').slideDown();
|
$('#new-site-box').slideDown();
|
||||||
}else {
|
$('#maintenance-box').slideUp();
|
||||||
$('.box-check-host').slideUp();
|
}else if(valueSelected == "") {
|
||||||
|
$('#new-site-box').slideUp();
|
||||||
|
$('#maintenance-box').slideUp();
|
||||||
|
}else{
|
||||||
|
$('#new-site-box').slideUp();
|
||||||
|
$('#maintenance-box').slideDown();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,8 @@ class SiteRequest
|
||||||
field :site_id
|
field :site_id
|
||||||
field :host_with_rulingdigital, type: Boolean, default: false
|
field :host_with_rulingdigital, type: Boolean, default: false
|
||||||
field :server_details
|
field :server_details
|
||||||
|
field :maintenance, type: Boolean, default: false
|
||||||
|
field :maintenance_years, type: Integer
|
||||||
field :optional_modules, type: Array, default: []
|
field :optional_modules, type: Array, default: []
|
||||||
field :custom_module, type: Boolean, default: false
|
field :custom_module, type: Boolean, default: false
|
||||||
field :custom_module_details
|
field :custom_module_details
|
||||||
|
|
|
@ -8,6 +8,18 @@
|
||||||
<span class="content-line"><a href="<%= @site_request.get_site.site_domain %>" target="_blank"><%= @site_request.get_site.site_domain %></a>
|
<span class="content-line"><a href="<%= @site_request.get_site.site_domain %>" target="_blank"><%= @site_request.get_site.site_domain %></a>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
<% if @site_request.maintenance %>
|
||||||
|
<div class="line-content">
|
||||||
|
<span class="header-line">Site maintenance : </span>
|
||||||
|
<span class="content-line"><span class="label label-success">Yes</span></a>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="line-content">
|
||||||
|
<span class="header-line">Number of years : </span>
|
||||||
|
<span class="content-line"><%= @site_request.maintenance_years %></a>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<% if @site_request.host_with_rulingdigital %>
|
<% if @site_request.host_with_rulingdigital %>
|
||||||
<div class="line-content">
|
<div class="line-content">
|
||||||
|
|
|
@ -21,11 +21,17 @@
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<% if @site_request.type == "existing" && @site_request.maintenance %>
|
||||||
<div class="line-content">
|
<div class="line-content">
|
||||||
<span class="header-line"><%= f.label :service_cost, "Maintainance Cost:" %></span>
|
<span class="header-line"><%= f.label :service_cost, "Maintenance Cost for #{@site_request.maintenance_years} year(s):" %></span>
|
||||||
<span class="content-line"><%= f.number_field :service_cost, :min => "0" %></span>
|
<span class="content-line"><%= f.number_field :service_cost, :min => "0" %></span>
|
||||||
</div>
|
</div>
|
||||||
|
<% elsif @site_request.type == "newsite" %>
|
||||||
|
<div class="line-content">
|
||||||
|
<span class="header-line"><%= f.label :service_cost, "Maintainance Cost:" %></span>
|
||||||
|
<span class="content-line"><%= f.number_field :service_cost, :min => "0" %></span>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<% if !@site_request.optional_modules.blank? %>
|
<% if !@site_request.optional_modules.blank? %>
|
||||||
<div class="line-content">
|
<div class="line-content">
|
||||||
|
@ -96,7 +102,7 @@
|
||||||
|
|
||||||
<div class="line-content">
|
<div class="line-content">
|
||||||
<span class="header-line">Total Amount :</span>
|
<span class="header-line">Total Amount :</span>
|
||||||
<span class="content-line"><%= @contract.new_record? ? 0 : @contract.total_amount %> NTD.</span>
|
<span class="content-line"><span id="total-amount"><%= @contract.new_record? ? 0 : @contract.total_amount %></span> NTD.</span>
|
||||||
</div>
|
</div>
|
||||||
<% if @contract.new_record? %>
|
<% if @contract.new_record? %>
|
||||||
<%= f.hidden_field :site_request, :value => @site_request.id.to_s %>
|
<%= f.hidden_field :site_request, :value => @site_request.id.to_s %>
|
||||||
|
|
|
@ -84,6 +84,9 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
</ol>
|
</ol>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<% if attrib == "service_cost" %>
|
||||||
|
for <%= @site_request.maintenance_years rescue 1 %> year(s)
|
||||||
|
<% end %>
|
||||||
</span>
|
</span>
|
||||||
<span class="content-line"><%= amount %></span>
|
<span class="content-line"><%= amount %></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -11,22 +11,34 @@
|
||||||
<span class="header-detail">Site Domain : </span>
|
<span class="header-detail">Site Domain : </span>
|
||||||
<span class="content-detail"><a href="http://<%= @site_request.get_site.site_domain %>" target="_blank"><%= @site_request.get_site.site_domain %></a></span>
|
<span class="content-detail"><a href="http://<%= @site_request.get_site.site_domain %>" target="_blank"><%= @site_request.get_site.site_domain %></a></span>
|
||||||
</div>
|
</div>
|
||||||
<% else %>
|
<% if @site_request.maintenance %>
|
||||||
<% if @site_request.host_with_rulingdigital %>
|
<div class="line-detail">
|
||||||
<div class="line-detail">
|
<span class="header-detail">Site maintenance : </span>
|
||||||
<span class="header-detail">Host with RulingDigital : </span>
|
<span class="content-detail"><span class="label label-success">Yes</span></a>
|
||||||
<span class="content-detail"><span class="label label-success">Yes</span></span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<% else %>
|
<div class="line-detail">
|
||||||
<div class="line-detail">
|
<span class="header-detail">Number of years : </span>
|
||||||
<span class="header-detail">Host with RulingDigital : </span>
|
<span class="content-detail"><%= @site_request.maintenance_years %></a>
|
||||||
<span class="content-detail"><span class="label label-danger">No</span></span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="line-detail">
|
<% end %>
|
||||||
<span class="header-detail">Server Details : </span>
|
<% else %>
|
||||||
<span class="content-detail"><%= nl2br @site_request.server_details %> </span>
|
<% if @site_request.host_with_rulingdigital %>
|
||||||
</div>
|
<div class="line-detail">
|
||||||
<% end %>
|
<span class="header-detail">Host with RulingDigital : </span>
|
||||||
|
<span class="content-detail"><span class="label label-success">Yes</span></span>
|
||||||
|
</div>
|
||||||
|
<% else %>
|
||||||
|
<div class="line-detail">
|
||||||
|
<span class="header-detail">Host with RulingDigital : </span>
|
||||||
|
<span class="content-detail"><span class="label label-danger">No</span></span>
|
||||||
|
</div>
|
||||||
|
<div class="line-detail">
|
||||||
|
<span class="header-detail">Server Details : </span>
|
||||||
|
<span class="content-detail"><%= nl2br @site_request.server_details %> </span>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if !@site_request.optional_modules.blank? %>
|
<% if !@site_request.optional_modules.blank? %>
|
||||||
<div class="line-detail">
|
<div class="line-detail">
|
||||||
|
|
|
@ -35,7 +35,17 @@
|
||||||
<div class="line-add">
|
<div class="line-add">
|
||||||
<%= f.label :site_id, "Select or Create" %>
|
<%= f.label :site_id, "Select or Create" %>
|
||||||
<%= f.select :site_id, @user_sites, {:prompt => "------Select or Create------"}, {:class => "form-control select-site"} %>
|
<%= f.select :site_id, @user_sites, {:prompt => "------Select or Create------"}, {:class => "form-control select-site"} %>
|
||||||
<div class="box-check-host">
|
<div class="box-check-host" id="maintenance-box">
|
||||||
|
<div class="line-check-host">
|
||||||
|
<%= f.label :maintenance, "Renew my maintenance" %>
|
||||||
|
<%= f.check_box :maintenance %>
|
||||||
|
</div>
|
||||||
|
<div class="line-check-host">
|
||||||
|
<%= f.label :maintenance_years, "Year(s): " %>
|
||||||
|
<%= f.select :maintenance_years, options_for_select((1..5).collect{|i|[i,i]}), :class=>"form-control" %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="box-check-host" id="new-site-box">
|
||||||
<span class="text-check">Do you want to host with RulingDigital?</span>
|
<span class="text-check">Do you want to host with RulingDigital?</span>
|
||||||
<div class="line-check-host">
|
<div class="line-check-host">
|
||||||
<%= f.radio_button :host_with_rulingdigital, "1", {:class => "radio-check"} %>
|
<%= f.radio_button :host_with_rulingdigital, "1", {:class => "radio-check"} %>
|
||||||
|
@ -135,4 +145,10 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script type="text/javascript" src="/assets/client_management/add_new_site.js"></script>
|
<script type="text/javascript" src="/assets/client_management/add_new_site.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
<% if params[:site].present? %>
|
||||||
|
$("#site_request_site_id").val("<%= params[:site] %>")
|
||||||
|
$("#maintenance-box").slideDown();
|
||||||
|
<% end %>
|
||||||
|
</script>
|
|
@ -18,9 +18,9 @@
|
||||||
<div class="cp-filter-box">
|
<div class="cp-filter-box">
|
||||||
<form action="" method="get">
|
<form action="" method="get">
|
||||||
<%= select_tag "q", options_for_select(@user_sites, params[:q]), :prompt => "All", :class => "form-control" %>
|
<%= select_tag "q", options_for_select(@user_sites, params[:q]), :prompt => "All", :class => "form-control" %>
|
||||||
<input type="submit" value="Filter">
|
<input type="submit" value="Filter" class="btn btn-success">
|
||||||
<% if params[:q].present? %>
|
<% if params[:q].present? %>
|
||||||
<a href="/cpanel/contracts">Clear</a>
|
<a href="/cpanel/contracts" class="btn btn-gray">Clear</a>
|
||||||
<% end %>
|
<% end %>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<ul class="list-sidebar">
|
<ul class="list-sidebar">
|
||||||
<li class="item-sidebar"><a class="btn-sidebar" href="<%= sites_path %>"><i class="fa fa-home" aria-hidden="true"></i><%= t("client_management.my_sites") %></a></li>
|
<li class="item-sidebar"><a class="btn-sidebar" href="<%= sites_path %>"><i class="fa fa-home" aria-hidden="true"></i><%= t("client_management.my_sites") %></a></li>
|
||||||
<li class="item-sidebar"><a class="btn-sidebar" href="/cpanel/site/<%= @site.uid %>"><i class="fa fa-envelope" aria-hidden="true"></i><%= t("client_management.tickets") %></a></li>
|
<li class="item-sidebar"><a class="btn-sidebar" href="/cpanel/site/<%= @site.uid %>"><i class="fa fa-envelope" aria-hidden="true"></i><%= t("client_management.tickets") %></a></li>
|
||||||
<li class="item-sidebar"><a class="btn-sidebar" href="#"><i class="fa fa-server" aria-hidden="true"></i><%= t("client_management.services") %></a></li>
|
<li class="item-sidebar"><a class="btn-sidebar" href="<%= cpanel_add_new_site_path(:site => @site.id) %>"><i class="fa fa-server" aria-hidden="true"></i><%= t("client_management.services") %></a></li>
|
||||||
<li class="item-sidebar"><a class="btn-sidebar" href="#"><i class="fa fa fa-credit-card-alt" aria-hidden="true"></i><%= t("client_management.payments") %></a></li>
|
<li class="item-sidebar"><a class="btn-sidebar" href="#"><i class="fa fa fa-credit-card-alt" aria-hidden="true"></i><%= t("client_management.payments") %></a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
<ul class="list-sidebar">
|
<ul class="list-sidebar">
|
||||||
<li class="item-sidebar"><a class="btn-sidebar" href="<%= sites_path %>"><i class="fa fa-home" aria-hidden="true"></i><%= t("client_management.my_sites") %></a></li>
|
<li class="item-sidebar"><a class="btn-sidebar" href="<%= sites_path %>"><i class="fa fa-home" aria-hidden="true"></i><%= t("client_management.my_sites") %></a></li>
|
||||||
<li class="item-sidebar active"><a class="btn-sidebar" href="/cpanel/site/<%= @site.uid %>"><i class="fa fa-envelope" aria-hidden="true"></i><%= t("client_management.tickets") %></a></li>
|
<li class="item-sidebar active"><a class="btn-sidebar" href="/cpanel/site/<%= @site.uid %>"><i class="fa fa-envelope" aria-hidden="true"></i><%= t("client_management.tickets") %></a></li>
|
||||||
<li class="item-sidebar"><a class="btn-sidebar" href="#"><i class="fa fa-server" aria-hidden="true"></i><%= t("client_management.services") %></a></li>
|
<li class="item-sidebar"><a class="btn-sidebar" href="<%= cpanel_add_new_site_path(:site => @site.id) %>"><i class="fa fa-server" aria-hidden="true"></i><%= t("client_management.services") %></a></li>
|
||||||
<li class="item-sidebar"><a class="btn-sidebar" href="#"><i class="fa fa fa-credit-card-alt" aria-hidden="true"></i><%= t("client_management.payments") %></a></li>
|
<li class="item-sidebar"><a class="btn-sidebar" href="#"><i class="fa fa fa-credit-card-alt" aria-hidden="true"></i><%= t("client_management.payments") %></a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -88,7 +88,12 @@
|
||||||
</ol>
|
</ol>
|
||||||
</span>
|
</span>
|
||||||
<% else %>
|
<% else %>
|
||||||
<span class="header-detail"><%= t("client_management.#{attrib}") %></span>
|
<span class="header-detail">
|
||||||
|
<%= t("client_management.#{attrib}") %>
|
||||||
|
<% if attrib == "service_cost" %>
|
||||||
|
for <%= @site_request.maintenance_years rescue 1 %> year(s)
|
||||||
|
<% end %>
|
||||||
|
</span>
|
||||||
<% end %>
|
<% end %>
|
||||||
<span class="content-detail"><%= amount %></span>
|
<span class="content-detail"><%= amount %></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<ul class="list-sidebar">
|
<ul class="list-sidebar">
|
||||||
<li class="item-sidebar"><a class="btn-sidebar" href="<%= sites_path %>"><i class="fa fa-home" aria-hidden="true"></i><%= t("client_management.my_sites") %></a></li>
|
<li class="item-sidebar"><a class="btn-sidebar" href="<%= sites_path %>"><i class="fa fa-home" aria-hidden="true"></i><%= t("client_management.my_sites") %></a></li>
|
||||||
<li class="item-sidebar active"><a class="btn-sidebar" href="/cpanel/site/<%= @site.uid %>"><i class="fa fa-envelope" aria-hidden="true"></i><%= t("client_management.tickets") %></a></li>
|
<li class="item-sidebar active"><a class="btn-sidebar" href="/cpanel/site/<%= @site.uid %>"><i class="fa fa-envelope" aria-hidden="true"></i><%= t("client_management.tickets") %></a></li>
|
||||||
<li class="item-sidebar"><a class="btn-sidebar" href="#"><i class="fa fa-server" aria-hidden="true"></i><%= t("client_management.services") %></a></li>
|
<li class="item-sidebar"><a class="btn-sidebar" href="<%= cpanel_add_new_site_path(:site => @site.id) %>"><i class="fa fa-server" aria-hidden="true"></i><%= t("client_management.services") %></a></li>
|
||||||
<li class="item-sidebar"><a class="btn-sidebar" href="#"><i class="fa fa fa-credit-card-alt" aria-hidden="true"></i><%= t("client_management.payments") %></a></li>
|
<li class="item-sidebar"><a class="btn-sidebar" href="#"><i class="fa fa fa-credit-card-alt" aria-hidden="true"></i><%= t("client_management.payments") %></a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
<ul class="list-sidebar">
|
<ul class="list-sidebar">
|
||||||
<li class="item-sidebar"><a class="btn-sidebar" href="<%= sites_path %>"><i class="fa fa-home" aria-hidden="true"></i><%= t("client_management.my_sites") %></a></li>
|
<li class="item-sidebar"><a class="btn-sidebar" href="<%= sites_path %>"><i class="fa fa-home" aria-hidden="true"></i><%= t("client_management.my_sites") %></a></li>
|
||||||
<li class="item-sidebar active"><a class="btn-sidebar" href="/cpanel/site/<%= @site.uid %>"><i class="fa fa-envelope" aria-hidden="true"></i><%= t("client_management.tickets") %></a></li>
|
<li class="item-sidebar active"><a class="btn-sidebar" href="/cpanel/site/<%= @site.uid %>"><i class="fa fa-envelope" aria-hidden="true"></i><%= t("client_management.tickets") %></a></li>
|
||||||
<li class="item-sidebar"><a class="btn-sidebar" href="#"><i class="fa fa-server" aria-hidden="true"></i><%= t("client_management.services") %></a></li>
|
<li class="item-sidebar"><a class="btn-sidebar" href="<%= cpanel_add_new_site_path(:site => @site.id) %>"><i class="fa fa-server" aria-hidden="true"></i><%= t("client_management.services") %></a></li>
|
||||||
<li class="item-sidebar"><a class="btn-sidebar" href="#"><i class="fa fa fa-credit-card-alt" aria-hidden="true"></i><%= t("client_management.payments") %></a></li>
|
<li class="item-sidebar"><a class="btn-sidebar" href="#"><i class="fa fa fa-credit-card-alt" aria-hidden="true"></i><%= t("client_management.payments") %></a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
Loading…
Reference in New Issue