Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Instrument List] Refresh on Stage Update #9040

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 26 additions & 3 deletions modules/instrument_list/templates/instrument_list_controlpanel.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,21 @@
{section name=item loop=$status}
<li>
{if $access.status and $status[item].showlink|default}
<span class="fa-li"><i class="{$status[item].icon|default:'far fa-square'}"></i></span><a href="?candID={$candID}&sessionID={$sessionID}&setStageUpdate={$status[item].label}">{$status[item].label}</a>
{assign var="onclickValue" value="{$status[item].label}"}
<span class="fa-li">
<i class="{$status[item].icon|default:'far fa-square'}"></i>
</span>
<a
onclick="setStageAndUpdate('{$onclickValue}')"
style="cursor: pointer;"
>
{$status[item].label}
</a>
{else}
<span class="fa-li"><i class="{$status[item].icon|default:'far fa-square'}"></i></span>{$status[item].label}
<span class="fa-li"><i class="{$status[item].icon|default:'far fa-square'}"></i></span>{$status[item].label}
{/if}
</li>
{/section}

</ul>

<h3 class="controlPanelSection">Send Time Point</h3>
Expand Down Expand Up @@ -90,3 +98,18 @@
{/if}
</li>
</ul>

<script>
function setStageAndUpdate(stageLabel) {
var url = loris.BaseURL + "/instrument_list/?candID={$candID}&sessionID={$sessionID}&setStageUpdate=" + stageLabel;
try {
fetch(url, {}).then((response) => {
if (response.ok) {
window.location.reload(true);
}
})
} catch (e) {
console.error("An error occurred: " + e.message);
}
}
</script>
Loading