NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

{% fetchxml accDetailsQuery %}
<fetch mapping='logical'>
<entity name='appstore_accelerator'>
<attribute name='appstore_name' />
<attribute name='appstore_description' />
<attribute name='appstore_avgrating' />
<attribute name='appstore_videolink' />
<attribute name='appstore_link' />
<attribute name='appstore_userguidelink' />
<attribute name='appstore_acceleratorstatus' />
<attribute name='appstore_productcategory' />
<attribute name='appstore_serviceline' />
<filter type='and'>
<condition attribute='appstore_acceleratorid' operator='eq' value="{{request.params['acceleratorid']}}" />
</filter>
</entity>
</fetch>
{% endfetchxml %}

{% fetchxml carouselsQuery %}
<fetch distinct="true" mapping="logical" output-format="xml-platform" version="1.0" returntotalrecordcount="true">
<entity name='annotation'>
<attribute name='filename' />
<attribute name='documentbody' />
<attribute name='mimetype' />
<filter type='and'>
<condition attribute='objectid' operator='eq' value="{{request.params['acceleratorid']}}" />
</filter>
</entity>
</fetch>
{% endfetchxml %}

{% fetchxml appstore %}
<fetch distinct="true" mapping="logical" output-format="xml-platform" version="1.0" returntotalrecordcount="true">
<entity name="appstore_productandservices">
<attribute name="appstore_name" />
<attribute name="appstore_logo" />
<attribute name="appstore_productandservicesid" />
</entity>
</fetch>
{% endfetchxml %}

{% fetchxml associatedprodandservices %}
<fetch distinct="true" mapping="logical" output-format="xml-platform" version="1.0" returntotalrecordcount="true">
<entity name="appstore_accelerator">
<attribute name="appstore_acceleratorid" />
<attribute name="appstore_productandservices" />
<filter type="and">
<condition attribute="appstore_acceleratorid" operator="eq" value="{{request.params['acceleratorid']}}" />
</filter>
</entity>
</fetch>
{% endfetchxml %}

{% fetchxml relatedcontacts %}
<fetch distinct="true" mapping="logical" output-format="xml-platform" version="1.0" returntotalrecordcount="true">
<entity name="appstore_accelerator">
<attribute name="appstore_acceleratorid" />
<attribute name="appstore_primarycontact_name" />
<attribute name="appstore_primarycontactemail" />
<attribute name="appstore_secondarycontactname1" />
<attribute name="appstore_secondarycontactemail1" />
<attribute name="appstore_secondarycontactname2" />
<attribute name="appstore_secondarycontactemail2" />
<filter type="and">
<condition attribute="appstore_acceleratorid" operator="eq" value="{{request.params['acceleratorid']}}" />
</filter>
</entity>
</fetch>
{% endfetchxml %}

{% fetchxml userRatingsQuery %}
<fetch distinct="true" mapping="logical" output-format="xml-platform" version="1.0" returntotalrecordcount="true">
<entity name='appstore_rating'>
<attribute name='appstore_acceleratorrating' />
<filter type='and'>
<condition attribute='appstore_accelerator' operator='eq' value="{{request.params['acceleratorid']}}" />
<condition attribute='appstore_contact' operator='eq' value='{{user.contactid}}' />
</filter>
</entity>
</fetch>
{% endfetchxml %}
<!-- Get the mapping that matches the accelerator-->
{% fetchxml mappingQuery %}
<fetch distinct="true" mapping="logical" output-format="xml-platform" version="1.0" returntotalrecordcount="true">
<entity name="appstore_mappingreviewertoservicelineandproductcategory">
<!-- Select the ID of the mapping record -->
<attribute name="appstore_mappingreviewertoservicelineandproductcategoryid" />
<filter type='and'>
<!-- Filter by the provided Product Category value -->
<condition attribute="appstore_productandservices" operator="eq" value="{{ accDetailsQuery.results.entities[0]['appstore_productcategory'] }}" />
<!-- Filter by the provided Service Line value -->
<condition attribute="appstore_serviceline" operator="eq" value="{{ accDetailsQuery.results.entities[0]['appstore_serviceline'] }}" />
</filter>
</entity>
</fetch>
{% endfetchxml %}


{% fetchxml getContactsMapping %}
<fetch distinct="true" mapping="logical" output-format="xml-platform" version="1.0" >
<entity name="contact">
<!-- <attribute name="emailaddress1" />
<attribute name="fullname" /> -->
<attribute name="contactid" />
<link-entity name="appstore_mappingreviewertoservicelinetocontact" from="contactid" to="contactid" link-type="inner" intersect="true">
<filter>
<condition attribute="appstore_mappingreviewertoservicelineandproductcategoryid" operator="eq" value="{{ mappingQuery.results.entities[0]['appstore_mappingreviewertoservicelineandproductcategoryid'] }} "/>
</filter>
</link-entity>
</entity>
</fetch>
{% endfetchxml %}

{% assign fetchedcontacts = getContactsMapping.results.entities %}

{% if fetchedcontacts.size > 0 %}
{% for contact in fetchedcontacts %}
{% if contact["contactid"] == user.contactid %}
<!--The current user matches with one of the fetched contacts -->
{% assign matchedContact = 1 %}
{% break %}
{% endif %}
{% endfor %}
{% endif %}

<!-- {% assign matchedContact = 0 %}

{% for contact in getContactsMapping.results.entities %}
{% if contact.contactid == user.contactid %}
{% assign matchedContact = 1 %}
{% break %}
{% endif %}
{% endfor %} -->


{% assign EnvironmentURL = snippets['appstore_environmenturl'] %}

{% assign userrating=0 %}
{% assign acceleratorName = accDetailsQuery.results.entities[0]["appstore_name"] %}

{% if userRatingsQuery.results.entities.size > 0 %}
{% assign userrating = 1 %}
{% endif %}

{% assign is_reviewer = user | has_role: 'Reviewers' %}
{% assign is_UnderReview = accDetailsQuery.results.entities[0]["appstore_acceleratorstatus"].value %}


<div class="container">
<div class="row">
<div class="col-md-6">
<!-- Breadcrumb Functionality Start -->
<div class="breadcrumb">
<a href="{{ snippets["App Store Site URL"] }}" class="home-link"> </a>
<a href="{{ snippets["App Store Site URL"] }}" class="home-link">
<i class="fa fa-home" style="color: #FFFFFF; font-size:11px; font-weight:400; margin-right: 5px;"></i>
<span class="breadcrumb-text" style="color: #FFFFFF; font-size:11px; font-weight:400;"><label style="cursor: pointer;">Home</label></span>
</a>
<span class="breadcrumb-arrow" style="color: #FFFFFF; font-size:11px; font-weight:400">></span>
<span class="breadcrumb-text" style="color: #FFFFFF; font-size:11px; font-weight:400"><label>{{ accDetailsQuery.results.entities[0]["appstore_name"] }}</label></span>
</div>
<!-- Breadcrumb Functionality End -->

<!-- Display Name, Description, and Average Rating -->
{% if accDetailsQuery.results.entities.size > 0 %}
<h1 id="acc-name">{{ accDetailsQuery.results.entities[0]["appstore_name"] }} {{ accDetailsQuery.results.entities[0]["appstore_acceleratorstatus"] }}</h1>
{% endif %}
<div class="rating-container">
<p id="average-rating">Average Rating:</p>
<!-- Display star rating if needed -->
<div class="star-rating">
{% if accDetailsQuery.results.entities.size > 0 %}
{% assign averageRating = accDetailsQuery.results.entities[0]["appstore_avgrating"] %}
{% assign integerPart = averageRating | floor %}
{% assign decimalPart = averageRating | minus: integerPart %}
{% if decimalPart < 0.5 %} {% assign roundedRating=integerPart %} {% else %}
{% assign roundedRating=integerPart | plus:1 %} {% endif %}
<!-- Display star rating if needed -->
{% for i in (1..5) %}
{% if i <= roundedRating %} <span class="fa fa-star checked"></span>
{% else %}
<span class="fa fa-star"></span>
{% endif %}
{% endfor %}
</div>
{% else %}
<p>No ratings available for this app.</p>
{% endif %}
</div>
<p class="description">{{ accDetailsQuery.results.entities[0]["appstore_description"] }}</p>
{% if accDetailsQuery.results.entities[0]["appstore_userguidelink"] %}
<a href="{{ accDetailsQuery.results.entities[0]['appstore_userguidelink'] }}" target="_blank"> <button class="yellow-button" style="margin-top: 15px;width: 95px; ">How to Access</button> </a>
{% endif %}
{% if accDetailsQuery.results.entities[0]["appstore_link"] %}
<a href="{{ accDetailsQuery.results.entities[0]['appstore_link'] }}" target="_blank"> <button class="yellow-button" style="font-weight: 546;">Live View</button> </a>
{% endif %}
<!-- Video -->
<!-- {% if accDetailsQuery.results.entities[0]["appstore_videolink"] %}
<a href="{{ accDetailsQuery.results.entities[0]['appstore_videolink'] }}" target="_blank">
<img src="/Videoplay.png" alt="Video Icon" style="width: 38px; height: 36px; margin-right: 5px;">
</a>

{% endif %} -->
{% if accDetailsQuery.results.entities[0]["appstore_videolink"] %}
<img src="/Videoplay.png" alt="Video Icon" style="width: 38px; height: 36px; margin-right: 5px;" id="openVideoButton">
{% endif %}

<!-- Hidden modal for the video -->
<div id="videoModal" class="modal">
<div class="modal-content">
<span class="close">&times;</span>
<!-- Embedded video -->
<iframe id="videoFrame" width="560" height="315" src="{{ accDetailsQuery.results.entities[0]['appstore_videolink'] }}" frameborder="0" allowfullscreen></iframe>
<a href="{{ accDetailsQuery.results.entities[0]['appstore_videolink'] }}" target="_blank"><button class="yellow-button">Redirect</button></a>
</div>
</div>

<!--a href="{{ accDetailsQuery.results.entities[0]['appstore_videolink'] }}" target="_blank" class="btn btn-primary" id="redirect">Watch Video</a-->

{% if accDetailsQuery.results.entities[0]["appstore_acceleratorstatus"].value == "961100002" %}
<div class="user-rating-container">
<p class="user-rating-label">User Rating:</p>
<div class="star-widget">
<input type="radio" name="rate" id="rate-5" onclick="handleRating(this)">
<label for="rate-5" class="fas fa-star"></label>
<input type="radio" name="rate" id="rate-4" onclick="handleRating(this)">
<label for="rate-4" class="fas fa-star"></label>
<input type="radio" name="rate" id="rate-3" onclick="handleRating(this)">
<label for="rate-3" class="fas fa-star"></label>
<input type="radio" name="rate" id="rate-2" onclick="handleRating(this)">
<label for="rate-2" class="fas fa-star"></label>
<input type="radio" name="rate" id="rate-1" onclick="handleRating(this)">
<label for="rate-1" class="fas fa-star"></label>
</div>
<div id="hidestar">
{% assign previousRating = userRatingsQuery.results.entities[0]["appstore_acceleratorrating"] %}
<!-- Display star rating if needed -->
{% for i in (1..5) %}
{% if i <= previousRating %} <span class="fa fa-star checked" ></span>
{% else %}
<span class="fa fa-star" ></span>
{% endif %}
{% endfor %}
</div>
<span id="rating-message" style="font-style: italic; font-size: 10px; margin-left: 20px; margin-top: 0px; padding-top: 0px; font-weight: 100; font-family: EYInterstate;"></span>
</div>
{% else %}
<p>&nbsp;</p>
{% endif %}
<!-- Content using the fetched data -->

<div class="dropdown-container">
{% for item in associatedprodandservices.results.entities %}
<div class="prod-dropdown">
<button class="prod-dropdown-toggle">Products and Services<span class="arrow-icon">&#9660;</span></button>
<div class="dropdown-content">
<div class="products-services-list">
<ul>
{% for option in item.appstore_productandservices %}
<li class="product-item">
<div class="logo">
{% assign app = appstore.results.entities | where: "appstore_name",option.label | first %} {% if app %} {% if app.appstore_logo %}
<img src="{{EnvironmentURL}}Image/download.aspx?Entity=appstore_productandservices&Attribute=appstore_logo&Id={{app.appstore_productandservicesid}}" alt="Logo for {{ app.appstore_name }}" class="logo-image" />
{% else %}
<p>No image available 1</p>
{% endif %}
{% else %}
<p>No image available 2</p>
{% endif %}
</div>
<div class="label">{{ option.label }}</div>
</li>
{% endfor %}
</ul>
</div>
</div>
</div>
{% endfor %}
</div>

<p style="color: #FFFFFE;font-size: 10px; font-family: EYInterstate;" class="contacts"><b>Contacts:</b></p>
<div class="card-container">
{% if relatedcontacts.results.entities.size == 1 %}
<div class="card">
<div class="card-body">
<p style="font-family: EYInterstate;"><b><span class="contact-name">{{ relatedcontacts.results.entities[0].appstore_primarycontact_name }}</span></b></p>
<p style="cursor:pointer; font-family: EYInterstate;"><span class="contact-email">{{ relatedcontacts.results.entities[0].appstore_primarycontactemail }}</span></p>
</div>
</div>

{% if relatedcontacts.results.entities[0].appstore_secondarycontactname1 %}
<div class="card">
<div class="card-body">
<p style="font-family: EYInterstate;"><b><span class="contact-name">{{ relatedcontacts.results.entities[0].appstore_secondarycontactname1 }}</span></b></p>
<p style="cursor:pointer; font-family: EYInterstate;"><span class="contact-email">{{ relatedcontacts.results.entities[0].appstore_secondarycontactemail1 }}</span></p>
</div>
</div>
{% endif %}

{% if relatedcontacts.results.entities[0].appstore_secondarycontactname2 %}
<div class="card">
<div class="card-body">
<p style="font-family: EYInterstate;"><b><span class="contact-name">{{ relatedcontacts.results.entities[0].appstore_secondarycontactname2 }}</span></b></p>
<p style="cursor:pointer; font-family: EYInterstate;"><span class="contact-email">{{ relatedcontacts.results.entities[0].appstore_secondarycontactemail2 }}</span></p>
</div>
</div>
{% endif %}

{% endif %}
</div>


</div>
<div class="col-md-6" style="margin-top: 20px;">
{% if carouselsQuery.results.entities.size > 0 %}
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
{% for carousel in carouselsQuery.results.entities %}
<li data-target="#carousel-example-generic" data-slide-to="{{forloop.index0}}"
class="{% if forloop.first %}active{% endif %}"></li>
{% endfor %}
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
{% for caro in carouselsQuery.results.entities %}
<div class="item {% if forloop.first %}active{% endif %}">
<img src=' data:{{ caro["mimetype"] }};base64,{{ caro["documentbody"] }}'>

</div>
{% endfor %}
</div>
<!-- Controls -->
<a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
{% endif %}



</div>
</div>
<hr>
{% if is_reviewer and is_UnderReview == "961100001" %}
<div class="review-page-button" id="button-div">
<span id="review-message" style="font-style: italic; font-size: 11px; margin-right: 10px; margin-top: -2px; padding-top: 0px; font-weight: 100; font-family: EYInterstate; color:white;"></span>
<button class="review-button" id="reject-button">Reject</button>
<button class="review-button" id="accept-button">Accept</button>
<h1>{{ accDetailsQuery.results.entities[0]["appstore_serviceline"] }}</h1>
<!-- <p>{{ mappingQuery.results.entities[0]["appstore_mappingreviewertoservicelineandproductcategoryid"] }}</p> -->

</div>
{% endif %}
</div>




<style>
.row{
background-color:#1A1A24;
color: #FFFFFF;
;
}
#redirect {
background-color: #fcdc7b;
color: black;
border-radius: 4px;
height: 32px;
width: 100x;
font-size: 14px;
font-weight: 400;
}

.carousel .item {
background-size: cover;
background-repeat: no-repeat;
}
.carousel-inner .item img{
max-height: 300px;
height: auto;
width:100%;
object-fit: cover;
}


.star-rating {
display: inline;
font-size: 10px;
/* font-family: Arial, Helvetica, sans-serif; */
/* Adjust as needed */
}

.fa-star {
color: #9A9797;
/* Color for empty stars */
font-size: 10px;
}

.fa-star.checked {
color: #e1b91b;
/* Color for filled stars */
font-size: 10px;
}

#average-rating {
font-size: 10px;
margin-right: 10px;
font-weight: 700;
padding-bottom: 12px;
color:#FFFFFF;
font-family: EYInterstate;
}

#acc-name {
font-size: 26px;
font-weight: 700;
color: #FFFFFF;
font-family: EYInterstate;
}


.description {
font-size: 11px;
font-weight: 200;
color: #FFFFFF;
font-family: EYInterstate;
}

.yellow-button {
background-color: #FFE600;
color: black;
border-radius: 4px;
height: 32px;
width: 92px;
font-size: 12px;
font-weight: 400;
border: 1px;
font-family: EYInterstate;

}

.rating-container {
display: flex;
}

.prod-dropdown {
position: relative;
display: inline-block;
margin-bottom: 17px;
margin-top: 25px;
}

.prod-dropdown-toggle {
background-color: #2E2E38;
border: 0.5px solid #4D4D5C;
padding: 10px 20px;
cursor: pointer;
position: relative;
width: 250px;
text-align: left; /* Left-align text */
font-size: 11px;
font-weight: lighter;
font-family: EYInterstate;
}

.prod-dropdown-toggle .arrow-icon {
position: absolute;
top: 50%;
right: 20px; /* Adjusted right margin */
transform: translateY(-50%) rotate(0deg); /* Rotate arrow */
transition: transform 0.3s ease; /* Add transition effect */
}

.prod-dropdown-toggle .arrow-icon.up {
transform: translateY(-50%) rotate(180deg); /* Rotate arrow when dropdown is expanded */
}

.dropdown-content {
position: absolute;
background-color: #f9f9f9;
min-width: 250px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
z-index: 1;
display: none;
background-color: #4D4D5C;
max-height: 223px; /* Added on 7th March 2024 */
overflow-y: auto; /* Added on 7th March 2024 */
}

.dropdown-content ul {
margin: 0;
padding: 0;
}

.dropdown-content .product-item {
display: flex;
align-items: center;
padding: 10px;
border-bottom: 1px solid #4D4D5C;
background-color: #2E2E38;
}

.logo {
margin-right: 20px;
}

.logo-image {
width: 35px;
height: 35px;
}

.label {
color: white;
font-weight: 100;
}

.card-container {
display: flex;
gap: 10px;
padding: 20px;
justify-content: flex-start;
margin-left: -40px;
margin-top: -40px;
margin-bottom: -5px;
transition: margin-top 0.3s ease;
}

.card-container.expanded {
margin-top: 150px; /* Adjust this number according to the maximum expanded size of your dropdown */
}

.contacts{
margin-top: 28px;
padding-bottom: 7px;
}

.contacts.expanded {
margin-top: 220px;
margin-bottom: -180px;
}

.card {
flex: 1;
/*border: 1px solid #ccc;*/
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.card-header {
height: 60px;
display: flex;
justify-content: center;
align-items: center;
overflow: hidden;
border-bottom: 1px solid #ccc;
cursor: pointer;
}

.card-header img {
max-width: 100%;
max-height: 100%;
object-fit: cover;
}

.card-body {
padding: 20px;
}

.card-body p {
margin: 0;
color: white;
font-size: 10px;
}

.user-rating-container {
display: flex;
align-items: center;
justify-content: flex-start;
margin-left: 20px;
}


.center {
position: absolute;
top: 45%;
left: 50%;
transform: translate(-50%, -50%);
}

.user-rating-label {
color: #FFFFFE;
font-size: 10px;
margin-top: 14px;
margin-left: -20px;
font-weight: 700;
font-family: EYInterstate;
}

.star-widget {
height: 40px;
width: auto;
text-align: center;
margin-top: 25px;
margin-left: 5px;
}


.star-widget input {
display: none;
}

.star-widget label {
float: right;
font-size: 12px;
color: lightgrey;
margin: 0 2px;
cursor: pointer;
}

.star-widget label:before {
content: '★';
}

.star-widget input:checked~label {
color: gold;
}

.star-widget:not(:checked)>label:hover,
.star-widget:not(:checked)>label:hover~label {
color: gold;
}

.star-widget input:checked>label:hover,
.star-widget input:checked>label:hover~label {
color: gold;
}

.star-widget .result:before {
position: absolute;
content: "";
width: 100%;
left: 50%;
transform: translateX(-47%);
bottom: -30px;
font-size: 30px;
font-weight: 500;
color: gold;
font-family: 'Poppins', sans-serif;
display: none;
}

.star-widget input:checked~.result:before {
display: block;
}

/* Breadcrumb CSS Starts */
.breadcrumb {
font-family: 'EYInterstate', sans-serif; /* Apply the desired font family */
font-size: 14px;
color: #FFFFFF;
margin: 20px;
margin-right: auto;
margin-left: auto;
/* padding-left: 20px; */
}

.breadcrumb a,
.breadcrumb .breadcrumb-text {
text-decoration: none;
color: #FFFFFF;
}

.breadcrumb-arrow {
margin: 0 5px;
}

.breadcrumb a:hover {
text-decoration: underline;
}
/* Breadcrumb CSS End */


#hidestar{
display:none;
font-size: 13px;
}

#openVideoButton{
cursor:pointer;
transition: transform 0.3s ease;
}

#openVideoButto:hover{
transform: scale(1.1);
}

/* Hidden modal by default */
.modal {
display: none;
position: fixed;
z-index: 1;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: auto;
background-color: rgba(0,0,0,0.7);
}

/* Modal content */
.modal-content {
background-color: #1A1A24;
margin: auto;
padding: 20px;
border: 1px solid #888;
width: 60%;
max-width: 600px;
position: absolute;
left: 25%;
top: 20%;
height: 430px;

}

/* Close button */
.close {
color: #aaa;
float: right;
font-size: 28px;
font-weight: bold;
}

.close:hover,
.close:focus {
color: black;
text-decoration: none;
cursor: pointer;
}

.review-page-button {
display: flex;
justify-content: flex-end;
gap: 12px;

}

.review-button {
background-color: transparent;
color: white;
border-radius: 4px;
border: 1px solid #C3C3CB;
height: 32px;
width: 82px;
font-size: 14px;
font-weight: 400;
font-family: EYInterstate;

}

#accept-button {
background-color: #FFE600;
color: black;
border-color: transparent;
margin-top: -10px;
margin-bottom: 10px;
transition: transform 0.3s ease;
}
#accept-button:hover {
transform: scale(1.1);
}


#reject-button {
color: rgb(255, 255, 255);
margin-top: -10px;
margin-bottom: 10px;
transition: transform 0.3s ease;
}

#reject-button:hover {
transform: scale(1.1);
}
hr{
margin-top: 0px;
}

</style>

<script>
// Get the modal
var modal = document.getElementById("videoModal");

// Get the button that opens the modal
var btn = document.getElementById("openVideoButton");

// Added on 5th March 2024 Starts
// Get the carousel indicators
var carouselIndicators = document.querySelector(".carousel-indicators");
// Added on 5th March 2024 Ends


// Get the <span> element that closes the modal
var span = document.getElementsByClassName("close")[0];
console.log(btn);
// When the user clicks the button, open the modal
if(btn){
btn.onclick = function() {
var iframe = document.getElementById('videoFrame');
iframe.src="{{ accDetailsQuery.results.entities[0]['appstore_videolink'] }}";
modal.style.display = "block";
carouselIndicators.style.display = "none"; // Hide the carousel indicators // Added on 5th March 2024
};
}
else {
console.log("Element with id 'openVideoButton' not found.");
}
// When the user clicks on <span> (x), close the modal
if(span){
span.onclick = function() {
modal.style.display = "none";
var iframe = document.getElementById('videoFrame');
iframe.src="";
carouselIndicators.style.display = "block"; // Show the carousel indicators // Added on 5th March 2024
};
}
else {
console.log("Element with class 'close' not found.");
}
// When the user clicks anywhere outside of the modal, close it and show the carousel indicators
window.onclick = function(event) {
if (event.target == modal) {
modal.style.display = "none";
var iframe = document.getElementById('videoFrame');
iframe.src="";
carouselIndicators.style.display = "block"; // Show the carousel indicators // Added on 5th March 2024
}
};


{% include 'Wrapper AJAX Template' %};
{% include 'Error Log Template' %};
var alreadyRated= '{{userrating}}' ;

$(document).ready(function () {
// Add event listener to star rating inputs
$("#accept-button").on("click", acceptReview);
$("#reject-button").on("click", rejectReview);
if(alreadyRated==0){
$(".star-widget input[type='radio']").on("change", saveRating);
}
else{
$("#rating-message").text("You have already rated.");

// var previousRating = parseInt(ratingCount);
// for(var i=1; i<=previousRating;i++){
// $("#rate-" + i).prop("checked",true);
// }
$("#hidestar").css("display","block");
// $(".star-widget input[type='radio']").prop("disabled",true);
// $(".star-widget label").css("cursor","default");
// $(".star-widget label").off("mouseenter mouseleave");
$(".star-widget input[type='radio']").hide();
$(".star-widget label").hide();

}
});


function saveRating() {
var ratingCount = 0;
for(var i=1; i<=5; i++){
var input=document.getElementById("rate-"+i);
if(input.checked){
ratingCount+=i;
}
}
console.log(ratingCount);


var userMail = '{{user.emailaddress1}}'

var appName = '{{acceleratorName}}';


console.log(alreadyRated);
console.log(appName);
console.log(userMail);

// Prepare the object to save in Dataverse table
var ratingObj = {
"appstore_acceleratorrating": ratingCount,
"[email protected]":"/appstore_accelerators({{request.params['acceleratorid']}})",
"[email protected]":"/contacts({{user.contactid}})"

};

// AJAX request to save the rating count
webapi.safeAjax({
type: "POST",
url: "/_api/appstore_ratings",
contentType: "application/json",
data: JSON.stringify(ratingObj),
success: function (data, status, xhr) {
// Print the ID of the newly created table record
console.log("Rating count saved successfully. Entity ID: " + xhr.getResponseHeader("entityid"));
$("#rating-message").text("Ratings Submitted!");
$(".star-widget input[type='radio']").prop("disabled",true);
$(".star-widget label").css("cursor","default");
$(".star-widget label").off("mouseenter mouseleave");
},
error: function (xhr, status, error) {
console.error("Failed to save rating count:", error);
arrlog = {
"appstore_errormessage": status,
"appstore_errorfunction":"saveRating",
"appstore_name":"Accelerator Detail",
"appstore_siteuser":"{{user.fullname}}"
}
logError(arrlog);
}
});
}




/* -------------------------------------------------------------------------------------------------------
document.addEventListener("DOMContentLoaded", function() {
const dropdownToggles = document.querySelectorAll(".prod-dropdown-toggle");

dropdownToggles.forEach(toggle => {
toggle.addEventListener("click", function() {
const dropdownContent = this.nextElementSibling;
const arrowIcon = this.querySelector('.arrow-icon');
dropdownContent.style.display = (dropdownContent.style.display === "none") ? "block" : "none";
arrowIcon.classList.toggle('up');
});
});
});
------------------------------------------------------------------------------------------------------- */

// Products and Services Dropdown functionality
document.addEventListener("DOMContentLoaded", function() {
const dropdownToggles = document.querySelectorAll(".prod-dropdown-toggle");

dropdownToggles.forEach(toggle => {
toggle.addEventListener("click", function() {
const dropdownContent = this.nextElementSibling;
const arrowIcon = this.querySelector('.arrow-icon');
if (dropdownContent.style.display === "block") {
dropdownContent.style.display = "none";
arrowIcon.classList.remove('up');
} else {
dropdownContent.style.display = "block";
arrowIcon.classList.add('up');
}
});
});
});


// Add event listeners to name and email spans
const nameSpans = document.querySelectorAll('.contact-name');
const emailSpans = document.querySelectorAll('.contact-email');

nameSpans.forEach(span => {
span.addEventListener('click', function() {
openOutlookCompose(this.textContent.trim());
});
});

emailSpans.forEach(span => {
span.addEventListener('click', function() {
openOutlookCompose(this.textContent.trim());
});
});

// Function to open Outlook compose window with email
function openOutlookCompose(email) {
window.location.href = 'mailto:' + email;
}

/*------------------------------------------------------------------------------------------
// Function to disable User rating after submitting
// Function to handle rating submission
function handleRating(selectedStar) {
// Get all star inputs
var starInputs = document.querySelectorAll('.star-widget input');

// Disable all star inputs
starInputs.forEach(function(input) {
input.disabled = true;
});

// Provide feedback to the user (if needed)
// document.getElementById('rating-message').innerText = 'Rating Submitted!';
}
-------------------------------------------------------------------------------------------*/

// Function to handle rating submission
function handleRating(selectedStar) {
// Get all star inputs
var starInputs = document.querySelectorAll('.star-widget input');

// Disable all star inputs
starInputs.forEach(function(input) {
input.disabled = true;
});

// Get the selected rating
var selectedRating = parseInt(selectedStar.id.split('-')[1]);

// Change the color of selected stars to golden and unselected stars to grey
for (var i = 1; i <= 5; i++) {
var starLabel = document.querySelector('label[for="rate-' + i + '"]');
if (i <= selectedRating) {
starLabel.style.color = '#e1b91b'; // Golden color for selected stars
} else {
starLabel.style.color = '#9A9797'; // Grey color for unselected stars
}
}

// Provide feedback to the user (if needed)
// document.getElementById('rating-message').innerText = 'Rating Submitted!';
}


function acceptReview(){
var acceptStatus="961100002";
var reviewObj = {
"appstore_acceleratorstatus":acceptStatus
}

webapi.safeAjax({
type: "PATCH",
url: "/_api/appstore_accelerators({{request.params['acceleratorid']}})",
contentType: "application/json",
data: JSON.stringify(reviewObj),
success: function (res) {
$("#review-message").text("Accepted Successfully!");
console.log(res);
},
error: function (xhr, status, error) {
console.error("Failed to accept:", error);
arrlog = {
"appstore_errormessage": status,
"appstore_errorfunction":"acceptReview",
"appstore_name":"Accelerator Detail",
"appstore_siteuser":"{{user.fullname}}"
}
logError(arrlog);
}
});


}

//Reject Button
function rejectReview(){
var rejectStatus="961100000";
var reviewObj = {
"appstore_acceleratorstatus":rejectStatus
}

webapi.safeAjax({
type: "PATCH",
url: "/_api/appstore_accelerators({{request.params['acceleratorid']}})",
contentType: "application/json",
data: JSON.stringify(reviewObj),
success: function (res) {
console.log(res);
$("#review-message").text("Rejected Successfully!");

},
error: function (xhr, status, error) {
console.error("Failed to reject:", error);
arrlog = {
"appstore_errormessage": status,
"appstore_errorfunction":"rejectReview()",
"appstore_name":"Accelerator Detail",
"appstore_siteuser":"{{user.fullname}}"
}
logError(arrlog);
}
});
}

//added on 8th March
document.querySelector('.prod-dropdown-toggle').addEventListener('click', function() {
document.querySelector('.card-container').classList.toggle('expanded');
document.querySelector('.contacts').classList.toggle('expanded');
});

</script>
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.