moved getFile() and no download when managing
This commit is contained in:
parent
7394a23b45
commit
14c5423328
30
frontend/src/Apps/ScientificPublications/ListResearches.vue
Normal file
30
frontend/src/Apps/ScientificPublications/ListResearches.vue
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
<script setup>
|
||||||
|
|
||||||
|
import FilterComponent from "@/Apps/ScientificPublications/FilterComponent.vue";
|
||||||
|
import ArticleComponent from "@/Apps/ScientificPublications/ResearchComponent.vue";
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div id="main">
|
||||||
|
<FilterComponent :isOpen="isFilterOpened" :allArticles="researchList" @modal-close="closeFilter" @submit="submitFilters()"></FilterComponent>
|
||||||
|
<ArticleComponent :article="articleToDisplay" :isOpen="isResearchOpened" :manage="false" @modal-close="closeResearch" @downloadPdf="downloadArticle(articleToDisplay)" @downloadBibTex="downloadBibTex(articleToDisplay)"></ArticleComponent>
|
||||||
|
<div id="researches">
|
||||||
|
<div id="search">
|
||||||
|
<input type="text" id="search-input" placeholder="search for researches" v-model="input"/>
|
||||||
|
<button id="filterButton" @click="openFilter"> Filters </button>
|
||||||
|
</div>
|
||||||
|
<ul id="researchUL">
|
||||||
|
<li id="researchLi" v-for="n in searchInList(researchList,input)">
|
||||||
|
<div class="vl"> {{n.title}}</div>
|
||||||
|
<div class="vl"> {{ n.researcher.user.firstName +" "+ n.researcher.user.lastName }}</div>
|
||||||
|
<a @click="openResearch(n)"> MoreInfo </a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
@ -67,7 +67,7 @@ async function deleteThisArticle(){
|
|||||||
<li>Views : {{article.views}}</li>
|
<li>Views : {{article.views}}</li>
|
||||||
<li>Access : {{article.access}}</li>
|
<li>Access : {{article.access}}</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div id="downloads" v-if="article.pdfLocation !== null">
|
<div id="downloads" v-if="article.pdfLocation !== null && !manage">
|
||||||
<button @click.stop="emit('downloadBibTex')">Download BibTex</button>
|
<button @click.stop="emit('downloadBibTex')">Download BibTex</button>
|
||||||
<button @click.stop="emit('downloadPdf')">Download Research</button>
|
<button @click.stop="emit('downloadPdf')">Download Research</button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -9,7 +9,8 @@
|
|||||||
import { ref, reactive } from "vue";
|
import { ref, reactive } from "vue";
|
||||||
import FilterComponent from "@/Apps/ScientificPublications/FilterComponent.vue";
|
import FilterComponent from "@/Apps/ScientificPublications/FilterComponent.vue";
|
||||||
import ArticleComponent from "@/Apps/ScientificPublications/ResearchComponent.vue";
|
import ArticleComponent from "@/Apps/ScientificPublications/ResearchComponent.vue";
|
||||||
import {fetchResearcher, fetchResearches, fetchStats, addView, getFile} from "@/rest/ScientificPublications/ResearcherProfile.js";
|
import {fetchResearcher, fetchResearches, fetchStats, addView} from "@/rest/ScientificPublications/ResearcherProfile.js";
|
||||||
|
import {getFile} from "@/rest/ScientificPublications/ManageResearch.js";
|
||||||
const input = ref("");
|
const input = ref("");
|
||||||
const statsOf = ref("");
|
const statsOf = ref("");
|
||||||
const statsBy = ref("");
|
const statsBy = ref("");
|
||||||
|
@ -21,4 +21,13 @@ export async function uploadBibTex(file){
|
|||||||
|
|
||||||
export async function postResearch(data){
|
export async function postResearch(data){
|
||||||
return restPost("/research", data)
|
return restPost("/research", data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function fetchResearches(){
|
||||||
|
return restGet("/researches")
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function getFile(url){
|
||||||
|
const restURL = import.meta.env.VITE_CLYDE_MODE === 'container' ? "http://localhost:8000": import.meta.env.DEV ? "http://localhost:5173" : "https://clyde.herisson.ovh/api"
|
||||||
|
await fetch(restURL + "/"+url, {method: "GET"})
|
||||||
|
}
|
||||||
|
@ -13,9 +13,4 @@ export async function fetchStats(id){
|
|||||||
}
|
}
|
||||||
export async function addView(url){
|
export async function addView(url){
|
||||||
return restPost("/addview/" +url)
|
return restPost("/addview/" +url)
|
||||||
}
|
|
||||||
|
|
||||||
export async function getFile(url){
|
|
||||||
const restURL = import.meta.env.VITE_CLYDE_MODE === 'container' ? "http://localhost:8000": import.meta.env.DEV ? "http://localhost:5173" : "https://clyde.herisson.ovh/api"
|
|
||||||
await fetch(restURL + "/"+url, {method: "GET"})
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user