Commit e944c0de by Nilu

code refactoring

parent a00dd374
......@@ -49,36 +49,6 @@
$(".oneit-radio label").removeClass('checked');
$(ele).closest('label').addClass('checked');
}
function saveOwnBilling(ownBilling)
{
ajaxProcessAddJQ ("<%= request.getContextPath() %>/extensions/adminportal/inc/save_own_billing.jsp", 'form' ,
{hiringTeamID : <%= hiringTeam.getID().longValue() %>, ownBilling : ownBilling},
function () {},
function (jqXHR, textStatus, errorThrown) {
if (jqXHR.status === 0) {
log("Empty Response. Status : " + jqXHR.status + " TextStatus : " + textStatus);
} else {
window.alert("Error processing request:" + errorThrown);
}
},
"POST");
if(ownBilling === true)
{
$('#billing_label').removeClass("show");
$('#billing_label').addClass("hide");
$('#billing_team').removeClass("show");
$('#billing_team').addClass("hide");
}
else
{
$('#billing_label').removeClass("hide");
$('#billing_label').addClass("show");
$('#billing_team').removeClass("hide");
$('#billing_team').addClass("show");
}
}
</script>
<div class="container-fluid">
......@@ -149,42 +119,20 @@
<div class="col-md-6">
<label><oneit:label GUIName="Will this team manage its own billing?" /></label>
</div>
<div id="billing_label" class="<%= "col-md-6 " + (hiringTeam.getManageOwnBilling() ? "hide" : "show") %>" >
<oneit:recalcClass htmlTag="div" classScript="hiringTeam.getManageOwnBilling() ? 'show': 'hide'" hiringTeam="<%= hiringTeam %>">
<label><oneit:label GUIName="Which team will manage the billing?"/></label>
</div>
</div>
<div class="form-group row">
<div class="col-md-6">
<div class="radio radio-primary second-radio-primary oneit-radio">
<label >
<oneit:ormInput obj="<%= hiringTeam %>" type="radio" attributeName="ManageOwnBilling" value="true"/>Yes
</label>
</div>
<div class="radio radio-primary second-radio-primary oneit-radio">
<label>
<oneit:ormInput obj="<%= hiringTeam %>" type="radio" attributeName="ManageOwnBilling" value="false"/>No
</label>
</div>
</div>
</oneit:recalcClass>
</div>
<div class="form-group row">
<%
String trueID = hiringTeam.getObjectID() + "_Y";
String falseID = hiringTeam.getObjectID() + "_N";
String trueSelected = CollectionUtils.equals(hiringTeam.getManageOwnBilling(), Boolean.TRUE) ? "checked" : "";
String falseSelected = CollectionUtils.equals(hiringTeam.getManageOwnBilling(), Boolean.FALSE) ? "checked" : "";
%>
<div class="col-md-6">
<div class="radio radio-primary second-radio-primary">
<input type="radio" name="<%= hiringTeam.getObjectID() %>" value="true" id="<%= trueID %>" <%= trueSelected %> onchange="saveOwnBilling(true);"/>
<label for="<%= trueID %>">
Yes
<div class="radio radio-primary second-radio-primary oneit-radio">
<label >
<oneit:ormInput obj="<%= hiringTeam %>" type="radio" attributeName="ManageOwnBilling" value="true"/>Yes
</label>
</div>
<div class="radio radio-primary second-radio-primary">
<input type="radio" name="<%= hiringTeam.getObjectID() %>" value="false" id="<%= falseID %>" <%= falseSelected %> onchange="saveOwnBilling(false);"/>
<label for="<%= falseID %>">
No
<div class="radio radio-primary second-radio-primary oneit-radio">
<label>
<oneit:ormInput obj="<%= hiringTeam %>" type="radio" attributeName="ManageOwnBilling" value="false"/>No
</label>
</div>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment