added ListResearch App
This commit is contained in:
		@ -29,6 +29,7 @@ app.manage.profile=Manage profile
 | 
				
			|||||||
app.studentList=Students List
 | 
					app.studentList=Students List
 | 
				
			||||||
app.users=Users
 | 
					app.users=Users
 | 
				
			||||||
app.manage.researcherProfile=Manage researcher profile
 | 
					app.manage.researcherProfile=Manage researcher profile
 | 
				
			||||||
 | 
					app.list.researches = List researches
 | 
				
			||||||
request.moreInfos=More Infos
 | 
					request.moreInfos=More Infos
 | 
				
			||||||
request.accept=Accept
 | 
					request.accept=Accept
 | 
				
			||||||
request.refuse=Refuse
 | 
					request.refuse=Refuse
 | 
				
			||||||
 | 
				
			|||||||
@ -29,6 +29,7 @@ app.manage.profile=Gérer le profil
 | 
				
			|||||||
app.studentList=Liste des étudiants
 | 
					app.studentList=Liste des étudiants
 | 
				
			||||||
app.users=Utilisateurs
 | 
					app.users=Utilisateurs
 | 
				
			||||||
app.manage.researcherProfile= gérer son profil de chercheur
 | 
					app.manage.researcherProfile= gérer son profil de chercheur
 | 
				
			||||||
 | 
					app.list.researches = lister les recherches
 | 
				
			||||||
request.moreInfos=Plus d'Infos
 | 
					request.moreInfos=Plus d'Infos
 | 
				
			||||||
request.accept=Accepter
 | 
					request.accept=Accepter
 | 
				
			||||||
request.refuse=Refuser
 | 
					request.refuse=Refuser
 | 
				
			||||||
 | 
				
			|||||||
@ -1,8 +1,83 @@
 | 
				
			|||||||
<script setup>
 | 
					<script setup>
 | 
				
			||||||
 | 
					import { ref} 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 {getFile, fetchResearches, addView} from "@/rest/ScientificPublications/ManageResearch.js";
 | 
				
			||||||
 | 
					const input = ref("")
 | 
				
			||||||
 | 
					const isFilterOpened = ref(false);
 | 
				
			||||||
 | 
					const isResearchOpened = ref(false);
 | 
				
			||||||
 | 
					const articleToDisplay = ref(Object)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const researchList = ref(await fetchResearches(1));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const props = defineProps({
 | 
				
			||||||
 | 
					  filters: ref([""]),
 | 
				
			||||||
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const openFilter = () => {
 | 
				
			||||||
 | 
					  isFilterOpened.value = true;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					const closeFilter = () => {
 | 
				
			||||||
 | 
					  isFilterOpened.value = false;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					const submitFilters = ()=>{
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					const openResearch = (article) => {
 | 
				
			||||||
 | 
					  isResearchOpened.value = true;
 | 
				
			||||||
 | 
					  articleToDisplay.value = article;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const closeResearch = () => {
 | 
				
			||||||
 | 
					  isResearchOpened.value =false;
 | 
				
			||||||
 | 
					  articleToDisplay.value = null;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const downloadBibTex = (research) => {
 | 
				
			||||||
 | 
					  getFile(research.bibTexLocation)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const downloadArticle = (research) => {
 | 
				
			||||||
 | 
					  addView(research.pdfLocation)
 | 
				
			||||||
 | 
					  getFile(research.pdfLocation)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function downloadCoAuthors(){
 | 
				
			||||||
 | 
					  //todo
 | 
				
			||||||
 | 
					  const data = JSON.stringify(researcher.value);
 | 
				
			||||||
 | 
					  const blob = new Blob([data], {type:"application/json"});
 | 
				
			||||||
 | 
					  return URL.createObjectURL(blob);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function searchInList(list, searchInput) {
 | 
				
			||||||
 | 
					  let retList = []
 | 
				
			||||||
 | 
					  for (let i = 0; i < list.length; i++) {
 | 
				
			||||||
 | 
					    if (lDistance(list[i].title, searchInput) < 10 || list[i].title.toUpperCase().indexOf(searchInput.toUpperCase()) > -1){
 | 
				
			||||||
 | 
					      retList.push(list[i])
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					  return retList
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function lDistance(s,t){
 | 
				
			||||||
 | 
					  if (!s.length) return t.length;
 | 
				
			||||||
 | 
					  if (!t.length) return s.length;
 | 
				
			||||||
 | 
					  const arr = [];
 | 
				
			||||||
 | 
					  for (let i = 0; i <= t.length; i++) {
 | 
				
			||||||
 | 
					    arr[i] = [i];
 | 
				
			||||||
 | 
					    for (let j = 1; j <= s.length; j++) {
 | 
				
			||||||
 | 
					      arr[i][j] =
 | 
				
			||||||
 | 
					          i === 0
 | 
				
			||||||
 | 
					              ? j
 | 
				
			||||||
 | 
					              : Math.min(
 | 
				
			||||||
 | 
					                  arr[i - 1][j] + 1,
 | 
				
			||||||
 | 
					                  arr[i][j - 1] + 1,
 | 
				
			||||||
 | 
					                  arr[i - 1][j - 1] + (s[j - 1] === t[i - 1] ? 0 : 1)
 | 
				
			||||||
 | 
					              );
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					  return arr[t.length][s.length];
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
</script>
 | 
					</script>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -1,5 +1,5 @@
 | 
				
			|||||||
<script setup>
 | 
					<script setup>
 | 
				
			||||||
import { ref, reactive } from "vue";
 | 
					import { ref} 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 {fetchResearches, } from "@/rest/ScientificPublications/ResearcherProfile.js";
 | 
					import {fetchResearches, } from "@/rest/ScientificPublications/ResearcherProfile.js";
 | 
				
			||||||
@ -10,7 +10,6 @@ const isFilterOpened = ref(false);
 | 
				
			|||||||
const isResearchOpened = ref(false);
 | 
					const isResearchOpened = ref(false);
 | 
				
			||||||
const isPostResearchOpened = ref(false);
 | 
					const isPostResearchOpened = ref(false);
 | 
				
			||||||
const articleToDisplay = ref()
 | 
					const articleToDisplay = ref()
 | 
				
			||||||
const filters = ref([]);
 | 
					 | 
				
			||||||
const changing = ref(false);
 | 
					const changing = ref(false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
let toModify= Object.assign({}, {});
 | 
					let toModify= Object.assign({}, {});
 | 
				
			||||||
 | 
				
			|||||||
@ -9,8 +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} from "@/rest/ScientificPublications/ResearcherProfile.js";
 | 
					import {fetchResearcher, fetchResearches, fetchStats} from "@/rest/ScientificPublications/ResearcherProfile.js";
 | 
				
			||||||
import {getFile} from "@/rest/ScientificPublications/ManageResearch.js";
 | 
					import {getFile, addView} from "@/rest/ScientificPublications/ManageResearch.js";
 | 
				
			||||||
const input = ref("");
 | 
					const input = ref("");
 | 
				
			||||||
const statsOf = ref("");
 | 
					const statsOf = ref("");
 | 
				
			||||||
const statsBy = ref("");
 | 
					const statsBy = ref("");
 | 
				
			||||||
 | 
				
			|||||||
@ -31,3 +31,6 @@ 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"
 | 
					    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"})
 | 
					    await fetch(restURL + "/"+url, {method: "GET"})
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					export async function addView(url){
 | 
				
			||||||
 | 
					    return restPost("/addview/" +url)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -11,6 +11,3 @@ export async function fetchResearches(id){
 | 
				
			|||||||
export async function fetchStats(id){
 | 
					export async function fetchStats(id){
 | 
				
			||||||
    return restGet("/stats/" +id)
 | 
					    return restGet("/stats/" +id)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
export async function addView(url){
 | 
					 | 
				
			||||||
    return restPost("/addview/" +url)
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
@ -13,6 +13,7 @@ import AboutStudent from "@/Apps/Inscription/AboutStudent.vue";
 | 
				
			|||||||
import Msg from "@/Apps/Msg.vue"
 | 
					import Msg from "@/Apps/Msg.vue"
 | 
				
			||||||
import ManageRequests from "@/Apps/Inscription/ManageRequests.vue";
 | 
					import ManageRequests from "@/Apps/Inscription/ManageRequests.vue";
 | 
				
			||||||
import ManageResearcherProfile from "@/Apps/ScientificPublications/ManageResearcherProfile.vue";
 | 
					import ManageResearcherProfile from "@/Apps/ScientificPublications/ManageResearcherProfile.vue";
 | 
				
			||||||
 | 
					import ListResearches from "@/Apps/ScientificPublications/ListResearches.vue";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const apps = {
 | 
					const apps = {
 | 
				
			||||||
		'/login': LoginPage,
 | 
							'/login': LoginPage,
 | 
				
			||||||
@ -23,9 +24,11 @@ const apps = {
 | 
				
			|||||||
		'/students-list' : Students,
 | 
							'/students-list' : Students,
 | 
				
			||||||
		'/manage-researcher-profile' : ManageResearcherProfile,
 | 
							'/manage-researcher-profile' : ManageResearcherProfile,
 | 
				
			||||||
		'/msg' : Msg,
 | 
							'/msg' : Msg,
 | 
				
			||||||
 | 
							'/researches' : ListResearches
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const appsList = {
 | 
					const appsList = {
 | 
				
			||||||
 | 
							'ListResearches': {path:'#/researches', icon:'fa-book-bookmark',text:i18n("app.list.researches")},
 | 
				
			||||||
		'Msg': { path: '#/msg', icon: 'fa-comment', text: i18n("app.messages") },
 | 
							'Msg': { path: '#/msg', icon: 'fa-comment', text: i18n("app.messages") },
 | 
				
			||||||
		'Notification': { path: '#/notifs', icon: 'fa-bell', text: i18n("app.notifications") },
 | 
							'Notification': { path: '#/notifs', icon: 'fa-bell', text: i18n("app.notifications") },
 | 
				
			||||||
		'Forum': { path: '#/forum', icon: 'fa-envelope', text: i18n("app.forum") },
 | 
							'Forum': { path: '#/forum', icon: 'fa-envelope', text: i18n("app.forum") },
 | 
				
			||||||
@ -35,6 +38,7 @@ const appsList = {
 | 
				
			|||||||
		'StudentsList':{ path: '#/students-list',icon: 'fa-users',text: i18n("app.studentList")},
 | 
							'StudentsList':{ path: '#/students-list',icon: 'fa-users',text: i18n("app.studentList")},
 | 
				
			||||||
		'UsersList':{ path: '#/users-list',icon: 'fa-users',text: i18n("app.users")},
 | 
							'UsersList':{ path: '#/users-list',icon: 'fa-users',text: i18n("app.users")},
 | 
				
			||||||
		'ManageResearcherProfile':{path:'#/manage-researcher-profile',icon:'fa-book-bookmark',text:i18n("app.manage.researcherProfile")},
 | 
							'ManageResearcherProfile':{path:'#/manage-researcher-profile',icon:'fa-book-bookmark',text:i18n("app.manage.researcherProfile")},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const currentPath = ref(window.location.hash)
 | 
					const currentPath = ref(window.location.hash)
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user