Skip to content

Commit

Permalink
#132: Remove replacement-tool-page slot
Browse files Browse the repository at this point in the history
Was created for Dynamfit, ChemProps, but those really should be separate
components, so I removed the slot.
  • Loading branch information
roryschadler committed Mar 11, 2022
1 parent 8b869de commit c5386f0
Showing 1 changed file with 62 additions and 66 deletions.
128 changes: 62 additions & 66 deletions app/src/pages/nanomine/tools/MCRToolTemplate/MCRToolTemplate.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,84 +3,80 @@
<slot :name="name" v-if="cardSlots.includes(name)"></slot>
</template>
</tool-card>
<div class="md-layout md-alignment-top-center" v-else-if="!card">
<div class="md-layout md-alignment-top-center" v-else>
<div class="md-layout-item md-size-60 md-layout md-alignment-top-center md-gutter">
<!-- Allows tool to override all content if desired, instead of fitting into the format. -->
<slot name="replacement-tool-page">
<div :class="`section_${name}`" class="" :key="name">
<dialog-box :active="dialogBoxActive">
<template #title>{{ dialog.title }}</template>
<template #content v-html="dialog.content">{{ dialog.content }}</template>
<template #actions>
<md-button @click.native.prevent="toggleDialogBox">Close</md-button>
</template>
</dialog-box>
<!-- <div class="wrapper md-layout-item md-size-80 md-layout md-alignment-top-left"> -->
<div class="team_header md-layout-item md-size-100">
<h1 class="visualize_header-h1 teams_header">
<slot name="title"></slot>
</h1>
<dialog-box :active="dialogBoxActive">
<template #title>{{ dialog.title }}</template>
<template #content v-html="dialog.content">{{ dialog.content }}</template>
<template #actions>
<md-button @click.native.prevent="toggleDialogBox">Close</md-button>
</template>
</dialog-box>
<div :class="`section_${name}`" class="" :key="name">
<!-- <div class="wrapper md-layout-item md-size-80 md-layout md-alignment-top-left"> -->
<div class="team_header md-layout-item md-size-100">
<h1 class="visualize_header-h1 teams_header">
<slot name="title"></slot>
</h1>
</div>
<div class="md-layout-item md-size-100">
<div v-if="$scopedSlots.description">
<h3>Description</h3>
<slot name="description"></slot>
</div>
<div class="md-layout-item md-size-100">
<div v-if="$scopedSlots.description">
<h3>Description</h3>
<slot name="description"></slot>
</div>
<div v-if="$scopedSlots['input-options']">
<h3>Input Options</h3>
<slot name="input-options"></slot>
</div>
<div v-if="$scopedSlots['input-options']">
<h3>Input Options</h3>
<slot name="input-options"></slot>
</div>
</div>

<div v-if="$scopedSlots.results"
class="md-layout-item md-size-100 md-layout md-alignment-top-left result_container">
<h3>Results</h3>
<slot name="results"></slot>
</div>
<div v-if="$scopedSlots.results"
class="md-layout-item md-size-100 md-layout md-alignment-top-left result_container">
<h3>Results</h3>
<slot name="results"></slot>
</div>

<h3>Image Upload</h3>
<ImageUpload class='imageUpload' @setFiles="setFiles" @set-selectors="setSelectors"
:aspectRatio="job.aspectRatio" :selects='job.selects' :collectDimensions='job.getImageDimensions'
:acceptFileTypes="job.acceptableFileTypes">
</ImageUpload>
<h3>Image Upload</h3>
<ImageUpload class='imageUpload' @setFiles="setFiles" @set-selectors="setSelectors" :aspectRatio="job.aspectRatio"
:selects='job.selects' :collectDimensions='job.getImageDimensions' :acceptFileTypes="job.acceptableFileTypes">
</ImageUpload>

<slot name="submit-button" @click="submit()">
<md-button class="md-layout-item md-size-100 md-primary" @click="submit()">
Submit
</md-button>
</slot>
<slot name="submit-button" @click="submit()">
<md-button class="md-layout-item md-size-100 md-primary" @click="submit()">
Submit
</md-button>
</slot>

<div class="md-layout-item md-size-100" v-if='results.submitted && useWebsocket'>
<h3>Submission Results</h3>
<div v-if='results.obtained'>
<md-button class='resultsButton md-layout-item md-size-100 md-primary' @click="download()">
<span v-if='results.downloading'>Creating zipped file...</span>
<span v-else>Download results</span>
</md-button>
<div class='resultsContainer'>
<div class='resultsSubcontainer'>
<h4 class='resultsSubtitle'>Inputs</h4>
<div v-for='(file, index) in results.files' :key='index'>
<img class='resultsImage' :src='getResultImage(index, "input")'>
</div>
<div class="md-layout-item md-size-100" v-if='results.submitted && useWebsocket'>
<h3>Submission Results</h3>
<div v-if='results.obtained'>
<md-button class='resultsButton md-layout-item md-size-100 md-primary' @click="download()">
<span v-if='results.downloading'>Creating zipped file...</span>
<span v-else>Download results</span>
</md-button>
<div class='resultsContainer'>
<div class='resultsSubcontainer'>
<h4 class='resultsSubtitle'>Inputs</h4>
<div v-for='(file, index) in results.files' :key='index'>
<img class='resultsImage' :src='getResultImage(index, "input")'>
</div>
<div class='resultsSubcontainer'>
<h4 class='resultsSubtitle'>Outputs</h4>
<div v-for='(file, index) in results.files' :key='index'>
<img class='resultsImage' :src='getResultImage(index, "output")'>
</div>
</div>
<div class='resultsSubcontainer'>
<h4 class='resultsSubtitle'>Outputs</h4>
<div v-for='(file, index) in results.files' :key='index'>
<img class='resultsImage' :src='getResultImage(index, "output")'>
</div>
</div>
</div>
<spinner v-else></spinner>
</div>
<!-- </div> -->
<spinner v-else></spinner>
</div>
</slot>
</div>
<div class="md-layout-item md-size-80 md-layout md-alignment-top-center reference-container">
<slot name="references"></slot>
<reference-container v-if="!$scopedSlots.references" :references="referenceList" :openOnLoad="false">
</reference-container>
<!-- </div> -->
</div>
<div class="md-layout-item md-layout md-alignment-top-center reference-container">
<slot name="references"></slot>
<reference-container v-if="!$scopedSlots.references" :references="referenceList" :openOnLoad="false">
</reference-container>
</div>
</div>
</div>

0 comments on commit c5386f0

Please sign in to comment.