fix for submit a site and also history stuff added.

This commit is contained in:
Harry Bomrah 2017-03-16 15:13:53 +08:00
parent b006a18fbf
commit 5fd826683b
13 changed files with 827 additions and 216 deletions

File diff suppressed because it is too large Load Diff

View File

@ -73,128 +73,189 @@
text-align: center;
}
/* line 91, ../sass/rwd.scss */
.cp-main .cp-content .cp-contract-detail {
padding: 20px 0;
}
/* line 93, ../sass/rwd.scss */
.cp-main .cp-content .cp-contract-detail .sub-title {
margin: 40px auto 10px;
}
/* line 95, ../sass/rwd.scss */
.cp-main .cp-content .cp-contract-detail .sub-title.ft {
margin: 20px auto 10px;
}
/* line 99, ../sass/rwd.scss */
.cp-main .cp-content .cp-contract-detail .line-contract {
width: 90%;
}
/* line 102, ../sass/rwd.scss */
.cp-main .cp-content .cp-contract-detail .line-contract.qt .header-detail {
float: left;
}
/* line 105, ../sass/rwd.scss */
.cp-main .cp-content .cp-contract-detail .line-contract.qt .content-detail {
float: right;
}
/* line 116, ../sass/rwd.scss */
.cp-main .cp-content .cp-contract-detail .line-contract.buttons .btn {
width: 100%;
margin: 0 0 10px;
}
/* line 121, ../sass/rwd.scss */
.cp-main .cp-content .cp-contract-detail .line-contract .header-detail {
display: block;
float: none;
width: 100%;
}
/* line 126, ../sass/rwd.scss */
.cp-main .cp-content .cp-contract-detail .line-contract .content-detail {
display: block;
float: none;
width: 100%;
}
/* line 133, ../sass/rwd.scss */
.cp-main .cp-content .cp-requested-detail {
padding: 20px 0;
}
/* line 135, ../sass/rwd.scss */
.cp-main .cp-content .cp-requested-detail .line-detail {
width: 90%;
}
/* line 141, ../sass/rwd.scss */
.cp-main .cp-content .cp-requested-detail .line-detail .header-detail {
display: block;
float: none;
width: 100%;
}
/* line 146, ../sass/rwd.scss */
.cp-main .cp-content .cp-requested-detail .line-detail .content-detail {
display: block;
float: none;
width: 100%;
}
/* line 159, ../sass/rwd.scss */
.cp-main .cp-content .cp-addsite-step1 .box-addsite-forms .box-form .line-add.box-buttons .btn {
margin: 0 10px;
}
/* line 103, ../sass/rwd.scss */
/* line 167, ../sass/rwd.scss */
.cp-main .cp-content .cp-function-box .cp-search-box {
float: none;
width: 100%;
margin: 0 0 20px;
}
/* line 110, ../sass/rwd.scss */
/* line 174, ../sass/rwd.scss */
.cp-main .cp-content .cp-profile-setting .line-profile {
width: 100%;
}
/* line 112, ../sass/rwd.scss */
/* line 176, ../sass/rwd.scss */
.cp-main .cp-content .cp-profile-setting .line-profile label {
float: none;
width: 100%;
}
/* line 116, ../sass/rwd.scss */
/* line 180, ../sass/rwd.scss */
.cp-main .cp-content .cp-profile-setting .line-profile input {
float: none;
width: 100%;
}
/* line 120, ../sass/rwd.scss */
/* line 184, ../sass/rwd.scss */
.cp-main .cp-content .cp-profile-setting .line-profile textarea {
float: none;
width: 100%;
}
/* line 124, ../sass/rwd.scss */
/* line 188, ../sass/rwd.scss */
.cp-main .cp-content .cp-profile-setting .line-profile .pull-r {
float: none;
width: 100%;
}
}
@media only screen and (max-width: 480px) {
/* line 137, ../sass/rwd.scss */
/* line 201, ../sass/rwd.scss */
.cp-banner .box-banner .item-ba .text-ba {
font-size: 15px;
width: 80%;
text-align: center;
}
/* line 147, ../sass/rwd.scss */
/* line 211, ../sass/rwd.scss */
.cp-main .cp-login-page .cp-login-box {
width: 100%;
}
/* line 149, ../sass/rwd.scss */
/* line 213, ../sass/rwd.scss */
.cp-main .cp-login-page .cp-login-box .line-login {
width: 100%;
max-width: 100vw;
}
/* line 159, ../sass/rwd.scss */
/* line 223, ../sass/rwd.scss */
.cp-main .cp-content .cp-addsite-step1 .box-addsite-forms .box-form .form-title {
margin: 0 20px 20px;
}
/* line 162, ../sass/rwd.scss */
/* line 226, ../sass/rwd.scss */
.cp-main .cp-content .cp-addsite-step1 .box-addsite-forms .box-form .box-check-host {
float: none;
width: 100%;
}
/* line 167, ../sass/rwd.scss */
/* line 231, ../sass/rwd.scss */
.cp-main .cp-content .cp-addsite-step1 .box-addsite-forms .box-form .line-add label {
display: block;
float: none;
width: 100%;
}
/* line 172, ../sass/rwd.scss */
/* line 236, ../sass/rwd.scss */
.cp-main .cp-content .cp-addsite-step1 .box-addsite-forms .box-form .line-add .form-control {
float: none;
width: 100%;
}
/* line 176, ../sass/rwd.scss */
/* line 240, ../sass/rwd.scss */
.cp-main .cp-content .cp-addsite-step1 .box-addsite-forms .box-form .line-add .title-custom-check {
width: calc(100% - 30px);
}
/* line 180, ../sass/rwd.scss */
/* line 244, ../sass/rwd.scss */
.cp-main .cp-content .cp-addsite-step1 .box-addsite-forms .box-form .line-add.box-buttons .btn {
margin: 0 5px;
width: calc(50% - 20px);
font-size: 12px;
}
/* line 188, ../sass/rwd.scss */
/* line 252, ../sass/rwd.scss */
.cp-main .cp-content .cp-addsite-step1 .box-addsite-forms .box-form .default-mod-list .item-mod {
width: 100%;
margin: 0 0 10px;
}
/* line 193, ../sass/rwd.scss */
/* line 257, ../sass/rwd.scss */
.cp-main .cp-content .cp-addsite-step1 .box-addsite-forms .box-form .box-drop {
display: block;
}
/* line 195, ../sass/rwd.scss */
/* line 259, ../sass/rwd.scss */
.cp-main .cp-content .cp-addsite-step1 .box-addsite-forms .box-form .box-drop .additional-mod-list {
width: 100%;
margin: 0 0 20px;
}
/* line 199, ../sass/rwd.scss */
/* line 263, ../sass/rwd.scss */
.cp-main .cp-content .cp-addsite-step1 .box-addsite-forms .box-form .box-drop .selected-mod-list {
width: 100%;
margin: 0;
}
/* line 208, ../sass/rwd.scss */
/* line 272, ../sass/rwd.scss */
.cp-main .cp-content .list-ticket .item-ticket {
padding: 30px 0 0;
}
/* line 210, ../sass/rwd.scss */
/* line 274, ../sass/rwd.scss */
.cp-main .cp-content .list-ticket .item-ticket .subject-ticket {
padding: 10px;
}
/* line 214, ../sass/rwd.scss */
/* line 278, ../sass/rwd.scss */
.cp-main .cp-content .list-ticket .item-ticket .info-ticket span {
display: block;
}
/* line 221, ../sass/rwd.scss */
/* line 285, ../sass/rwd.scss */
.cp-main .cp-content .list-servers .item-servers {
padding: 30px 0 0;
}
/* line 223, ../sass/rwd.scss */
/* line 287, ../sass/rwd.scss */
.cp-main .cp-content .list-servers .item-servers .name-server {
padding: 10px;
}
/* line 229, ../sass/rwd.scss */
/* line 293, ../sass/rwd.scss */
.cp-main .cp-content .cp-function-box .cp-search-box {
float: none;
width: 100%;

View File

@ -35,7 +35,7 @@ class ClientManagementsController < CPanelController
rs.type = rs.site_id == "newsite" ? "newsite" : "existing"
rs.save
session[:addsitestouser] = true
session[:request_uid] = sr.uid
session[:request_uid] = rs.uid
redirect_to cpanel_add_site_path
end
@ -180,6 +180,17 @@ class ClientManagementsController < CPanelController
redirect_to cpanel_myprofilepassword_path
end
def history
case params[:type]
when nil
@objects = SiteRequest.where(:c_panel_user_id => current_cpanel_user.id).desc(:created_at)
end
end
def see_request
@site_request = SiteRequest.where(:uid => params[:request_uid]).first rescue nil
end
private
def is_site_authorized_to_user?

View File

@ -0,0 +1,37 @@
<div class="line-detail">
<span class="header-detail">Requested Date : </span>
<span class="content-detail"><%= @site_request.created_at.strftime("%d %B %Y - %H:%M") %></span>
</div>
<% if @site_request.sites_to_add.count > 0 %>
<div class="line-detail">
<span class="header-detail">Sites To Add : </span>
<span class="content-detail">
<ol>
<% @site_request.sites_to_add.each_with_index do |sid,i| %>
<% site = RegisteredSite.where(:site_domain => sid).first rescue nil %>
<% if !site.nil? %>
<li><a href="http://<%= site.site_domain %>" target="_blank"><%= site.title %></li>
<% else %>
<li><a href="http://<%= sid %>" target="_blank"><%= sid %></a>&nbsp;&nbsp;<i class="fa fa-ban" aria-hidden="true"></i></li>
<% end %>
<% end %>
</ol>
</span>
</div>
<% end %>
<% if @site_request.sites_added.count > 0 %>
<div class="line-detail">
<span class="header-detail">Sites Added : </span>
<span class="content-detail">
<ol>
<% @site_request.sites_added.each_with_index do |sid,i| %>
<% site = RegisteredSite.find(sid) rescue nil %>
<% if !site.nil? %>
<li><a href="http://<%= site.site_domain %>" target="_blank"><%= site.title %></li>
<% end %>
<% end %>
</ol>
</span>
</div>
<% end %>

View File

@ -0,0 +1,73 @@
<div class="line-detail">
<span class="header-detail">Requested Date : </span>
<span class="content-detail"><%= @site_request.created_at.strftime("%d %B %Y - %H:%M") %></span>
</div>
<% if @site_request.type == "existing" %>
<div class="line-detail">
<span class="header-detail">Site Title : </span>
<span class="content-detail"><%= @site_request.get_site.title %></span>
</div>
<div class="line-detail">
<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>
</div>
<% else %>
<% if @site_request.host_with_rulingdigital %>
<div class="line-detail">
<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 %>
<% if !@site_request.optional_modules.blank? %>
<div class="line-detail">
<span class="header-detail">Optional Module(s) : </span>
<span class="content-detail">
<% rsm = RegisteredModule.find(@site_request.optional_modules) %>
<% rsm.each do |mod| %>
<span class="label label-info"><%= mod.name %></span>
<% end %>
</span>
</div>
<% end %>
<% if @site_request.custom_module %>
<div class="line-detail">
<span class="header-detail">Custom Module : </span>
<span class="content-detail"><span class="label label-success">Yes</span></span>
</div>
<div class="line-detail">
<span class="header-detail">Module Details : </span>
<span class="content-detail"><%= nl2br @site_request.custom_module_details %> </span>
</div>
<% end %>
<% if !@site_request.template_number.empty? %>
<div class="line-detail">
<span class="header-detail">Template Number : </span>
<span class="content-detail"><%= @site_request.template_number %> </span>
</div>
<% end %>
<% if @site_request.custom_template %>
<div class="line-detail">
<span class="header-detail">Custom Template : </span>
<span class="content-detail"><span class="label label-success">Yes</span></span>
</div>
<div class="line-detail">
<span class="header-detail">Template Details : </span>
<span class="content-detail"><%= nl2br @site_request.custom_template_details %> </span>
</div>
<% end %>
<% if @site_request.rwd %>
<div class="line-detail">
<span class="header-detail">RWD : </span>
<span class="content-detail"><span class="label label-success">Yes</span></span>
</div>
<% end %>

View File

@ -6,6 +6,7 @@
<ul class="list-sidebar">
<li class="item-sidebar"><a class="btn-sidebar" href="/cpanel/sites"><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_myprofile_path %>"><i class="fa fa-address-card" aria-hidden="true"></i><%= t("client_management.profile") %></a></li>
<li class="item-sidebar"><a class="btn-sidebar" href="<%= cpanel_myhistory_path %>"><i class="fa fa-history" aria-hidden="true"></i><%= t("client_management.history") %></a></li>
<li class="item-sidebar"><a class="btn-sidebar" href="#"><i class="fa fa-question-circle-o" aria-hidden="true"></i><%= t("client_management.help_and_faq") %></a></li>
<li class="item-sidebar"><a class="btn-sidebar" href="#"><i class="fa fa-user-circle-o" aria-hidden="true"></i><%= t("client_management.get_in_contact") %></a></li>
</ul>

View File

@ -2,6 +2,7 @@
<ul class="list-sidebar">
<li class="item-sidebar"><a class="btn-sidebar" href="/cpanel/sites"><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_myprofile_path %>"><i class="fa fa-address-card" aria-hidden="true"></i><%= t("client_management.profile") %></a></li>
<li class="item-sidebar"><a class="btn-sidebar" href="<%= cpanel_myhistory_path %>"><i class="fa fa-history" aria-hidden="true"></i><%= t("client_management.history") %></a></li>
<li class="item-sidebar"><a class="btn-sidebar" href="#"><i class="fa fa-question-circle-o" aria-hidden="true"></i><%= t("client_management.help_and_faq") %></a></li>
<li class="item-sidebar"><a class="btn-sidebar" href="#"><i class="fa fa-user-circle-o" aria-hidden="true"></i><%= t("client_management.get_in_contact") %></a></li>
</ul>

View File

@ -0,0 +1,53 @@
<% content_for :page_menu do %>
<ul class="list-sidebar">
<li class="item-sidebar"><a class="btn-sidebar" href="/cpanel/sites"><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_myprofile_path %>"><i class="fa fa-address-card" aria-hidden="true"></i><%= t("client_management.profile") %></a></li>
<li class="item-sidebar active"><a class="btn-sidebar" href="<%= cpanel_myhistory_path %>"><i class="fa fa-history" aria-hidden="true"></i><%= t("client_management.history") %></a></li>
<li class="item-sidebar"><a class="btn-sidebar" href="#"><i class="fa fa-question-circle-o" aria-hidden="true"></i><%= t("client_management.help_and_faq") %></a></li>
<li class="item-sidebar"><a class="btn-sidebar" href="#"><i class="fa fa-user-circle-o" aria-hidden="true"></i><%= t("client_management.get_in_contact") %></a></li>
</ul>
<% end %>
<section class="cp-content col-md-10">
<h2 class="cp-page-title">
History
</h2>
<div class="cp-submenu-box">
<a href="#" class="submenu-item active">Requests</a>
<a href="#" class="submenu-item">Contracts</a>
<a href="#" class="submenu-item">Purchases</a>
</div>
<div class="cp-addsite-history">
<div class="box-request-history">
<h3 class="sub-title">Requests</h3>
<% @objects.each do |obj| %>
<div class="item-history">
<% case obj.type %>
<% when "newsite" %>
<span class="site-title-history"><a href="/cpanel/request/<%= obj.uid %>">New Site</a></span>
<% when "existing" %>
<span class="site-title-history"><a href="/cpanel/request/<%= obj.uid %>">New Request for <strong><%= obj.get_site.title %></strong></a></span>
<% when "addsites" %>
<span class="site-title-history"><a href="/cpanel/request/<%= obj.uid %>">Request for adding sites</a></span>
<% end %>
<div class="info-site">
<span class="url-site"><i class="fa fa-hashtag" aria-hidden="true"></i>Request ID: <%= obj.uid %></a></span>
<% if obj.type == "existing" %>
<span class="url-site"><i class="fa fa-laptop" aria-hidden="true"></i><a href="http://<%= obj.get_site.site_domain %>" target="_blank"><%= obj.get_site.site_domain %></a></span>
<% end %>
<span class="time-site"><i class="fa fa-clock-o" aria-hidden="true"></i>Time :&nbsp;&nbsp;<%= obj.created_at.strftime("%d %B %Y - %H:%M") %></span>
</div>
<span class="action-site">
<% if !obj.completed %>
<a href="#" class="btn btn-warning">Cancel</a>
<% else %>
<% if (obj.type == "newsite" || obj.type == "existing") && !obj.request_contract.nil? %>
<a href="#" class="btn btn-info">Contract</a>
<% end %>
<% end %>
</span>
</div>
<% end %>
</div>
</div>
</section>

View File

@ -2,6 +2,7 @@
<ul class="list-sidebar">
<li class="item-sidebar active"><a class="btn-sidebar" href="#"><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_myprofile_path %>"><i class="fa fa-address-card" aria-hidden="true"></i><%= t("client_management.profile") %></a></li>
<li class="item-sidebar"><a class="btn-sidebar" href="<%= cpanel_myhistory_path %>"><i class="fa fa-history" aria-hidden="true"></i><%= t("client_management.history") %></a></li>
<li class="item-sidebar"><a class="btn-sidebar" href="#"><i class="fa fa-question-circle-o" aria-hidden="true"></i><%= t("client_management.help_and_faq") %></a></li>
<li class="item-sidebar"><a class="btn-sidebar" href="#"><i class="fa fa-user-circle-o" aria-hidden="true"></i><%= t("client_management.get_in_contact") %></a></li>
</ul>

View File

@ -2,6 +2,7 @@
<ul class="list-sidebar">
<li class="item-sidebar"><a class="btn-sidebar" href="/cpanel/sites"><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_myprofile_path %>"><i class="fa fa-address-card" aria-hidden="true"></i><%= t("client_management.profile") %></a></li>
<li class="item-sidebar"><a class="btn-sidebar" href="<%= cpanel_myhistory_path %>"><i class="fa fa-history" aria-hidden="true"></i><%= t("client_management.history") %></a></li>
<li class="item-sidebar"><a class="btn-sidebar" href="#"><i class="fa fa-question-circle-o" aria-hidden="true"></i><%= t("client_management.help_and_faq") %></a></li>
<li class="item-sidebar"><a class="btn-sidebar" href="#"><i class="fa fa-user-circle-o" aria-hidden="true"></i><%= t("client_management.get_in_contact") %></a></li>
</ul>
@ -28,7 +29,9 @@
<%= f.submit "Save", :class => "btn btn-primary" %>
</div>
<div class="line-profile">
<a href="<%= cpanel_myprofilepassword_path %>" class="link-profile">Click here to change password.</a>
<div class="pull-r">
<a href="<%= cpanel_myprofilepassword_path %>" class="link-profile">Click here to change password.</a>
</div>
</div>
<% end %>
</div>

View File

@ -2,6 +2,7 @@
<ul class="list-sidebar">
<li class="item-sidebar"><a class="btn-sidebar" href="/cpanel/sites"><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_myprofile_path %>"><i class="fa fa-address-card" aria-hidden="true"></i><%= t("client_management.profile") %></a></li>
<li class="item-sidebar"><a class="btn-sidebar" href="<%= cpanel_myhistory_path %>"><i class="fa fa-history" aria-hidden="true"></i><%= t("client_management.history") %></a></li>
<li class="item-sidebar"><a class="btn-sidebar" href="#"><i class="fa fa-question-circle-o" aria-hidden="true"></i><%= t("client_management.help_and_faq") %></a></li>
<li class="item-sidebar"><a class="btn-sidebar" href="#"><i class="fa fa-user-circle-o" aria-hidden="true"></i><%= t("client_management.get_in_contact") %></a></li>
</ul>
@ -33,7 +34,9 @@
<%= f.submit "Save", :class => "btn btn-primary" %>
</div>
<div class="line-profile">
<a href="<%= cpanel_myprofile_path %>" class="link-profile">Click here to change profile.</a>
<div class="pull-r">
<a href="<%= cpanel_myprofile_path %>" class="link-profile">Click here to change profile.</a>
</div>
</div>
<% end %>
</div>

View File

@ -0,0 +1,26 @@
<% content_for :page_menu do %>
<ul class="list-sidebar">
<li class="item-sidebar"><a class="btn-sidebar" href="/cpanel/sites"><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_myprofile_path %>"><i class="fa fa-address-card" aria-hidden="true"></i><%= t("client_management.profile") %></a></li>
<li class="item-sidebar active"><a class="btn-sidebar" href="<%= cpanel_myhistory_path %>"><i class="fa fa-history" aria-hidden="true"></i><%= t("client_management.history") %></a></li>
<li class="item-sidebar"><a class="btn-sidebar" href="#"><i class="fa fa-question-circle-o" aria-hidden="true"></i><%= t("client_management.help_and_faq") %></a></li>
<li class="item-sidebar"><a class="btn-sidebar" href="#"><i class="fa fa-user-circle-o" aria-hidden="true"></i><%= t("client_management.get_in_contact") %></a></li>
</ul>
<% end %>
<section class="cp-content col-md-10">
<h2 class="cp-page-title">
Site Request - #<%= @site_request.uid %>
<div class="pull-right"><span class="label label-primary"><%= @site_request.get_request_type %></span></div>
</h2>
<div class="cp-requested-detail">
<% case @site_request.type %>
<% when "newsite","existing" %>
<%= render :partial => "site_spec" %>
<% when "addsites" %>
<%= render :partial => "add_site_spec" %>
<% end %>
<div class="line-detail middle">
<a class="btn btn-success" href="<%= cpanel_myhistory_path %>">OK</a>
</div>
</div>
</section>

View File

@ -38,6 +38,10 @@ Rails.application.routes.draw do
get "myprofilepassword" => "client_managements#myprofilepassword", as: "cpanel_myprofilepassword"
patch "update_member_profile_password" => "client_managements#update_member_profile_password"
# history
get "history" => "client_managements#history", as: "cpanel_myhistory"
get "request/:request_uid" => "client_managements#see_request"
# ticket
get "site/:site_uid/new_ticket" => "client_managements#new_ticket"
post "site/:site_uid/create_ticket" => "client_managements#create_ticket"