Skip to content

Commit

Permalink
Merge pull request #304 from yileifeng/lang-landing-page
Browse files Browse the repository at this point in the history
Add new lang selector landing page
  • Loading branch information
dnlnashed authored Jun 5, 2024
2 parents 3ec2b09 + 968192c commit 35b4caf
Show file tree
Hide file tree
Showing 28 changed files with 95 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ jobs:
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `Your demo site is ready! 🚀 Visit it here: https://${{github.repository_owner}}.github.io/storylines-editor/${{github.head_ref}}/#/en/editor`
body: `Your demo site is ready! 🚀 Visit it here: https://${{github.repository_owner}}.github.io/storylines-editor/${{github.head_ref}}`
})
2 changes: 1 addition & 1 deletion public/index-ca-en.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta content="width=device-width,initial-scale=1" name="viewport" />

<title>RAMP Storylines</title>
<title>RAMP Storylines Editor</title>

<script src="https://code.highcharts.com/highcharts.js" type="text/javascript" charset="utf-8"></script>
<script src="https://code.highcharts.com/modules/data.js" type="text/javascript" charset="utf-8"></script>
Expand Down
2 changes: 1 addition & 1 deletion public/index-ca-fr.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta content="width=device-width,initial-scale=1" name="viewport" />

<title>Scénarios de PCAR</title>
<title>Éditeur de scénarios de la PCAR</title>

<script src="https://code.highcharts.com/highcharts.js" type="text/javascript" charset="utf-8"></script>
<script src="https://code.highcharts.com/modules/data.js" type="text/javascript" charset="utf-8"></script>
Expand Down
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<link rel="stylesheet" href="scripts/highcharts-editor/highcharts-editor.min.css" />
<link rel="stylesheet" href="scripts/ramp4/ramp.css" />

<title><%= htmlWebpackPlugin.options.title %></title>
<title>RAMP Storylines Editor</title>
</head>
<body>
<div id="app"></div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ import {
SlideshowPanel,
SourceCounts
} from '@/definitions';
import ChartPreviewV from '@/components/editor/helpers/chart-preview.vue';
import ConfirmationModalV from '@/components/editor/helpers/confirmation-modal.vue';
import ChartPreviewV from './helpers/chart-preview.vue';
import ConfirmationModalV from './helpers/confirmation-modal.vue';
import draggable from 'vuedraggable';
@Options({
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@
<script lang="ts">
import { Options, Prop, Vue, Watch } from 'vue-property-decorator';
import { ConfigFileStructure, MetadataContent, Slide, SourceCounts, StoryRampConfig } from '@/definitions';
import { VueSpinnerOval } from 'vue3-spinners';
import SlideEditorV from './slide-editor.vue';
import SlideTocV from './slide-toc.vue';
import MetadataContentV from './helpers/metadata-content.vue';
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
class="editor-input"
type="number"
:value="config.range[0]"
@input="$emit('time-slider-changed', 'range', 0, $event.target.value)"
@input="$emit('time-slider-changed', 'range', 0, ($event.target as HTMLInputElement).value)"
/>
<span class="mx-3"> {{ $t('editor.map.timeslider.to') }} </span>
<input
class="editor-input"
type="number"
:value="config.range[1]"
@input="$emit('time-slider-changed', 'range', 1, $event.target.value)"
@input="$emit('time-slider-changed', 'range', 1, ($event.target as HTMLInputElement).value)"
/>
</div>
<br />
Expand All @@ -23,14 +23,14 @@
class="editor-input ml-3"
type="number"
:value="config.start[0]"
@input="$emit('time-slider-changed', 'start', 0, $event.target.value)"
@input="$emit('time-slider-changed', 'start', 0, ($event.target as HTMLInputElement).value)"
/>
<span class="mx-3"> {{ $t('editor.map.timeslider.to') }} </span>
<input
class="editor-input"
type="number"
:value="config.start[1]"
@input="$emit('time-slider-changed', 'start', 1, $event.target.value)"
@input="$emit('time-slider-changed', 'start', 1, ($event.target as HTMLInputElement).value)"
/>
</div>
<br />
Expand All @@ -49,7 +49,7 @@
<input
class="editor-input"
:value="config.attribute"
@input="$emit('time-slider-changed', 'attribute', undefined, $event.target.value)"
@input="$emit('time-slider-changed', 'attribute', undefined, ($event.target as HTMLInputElement).value)"
/>
</div>
<br />
Expand All @@ -59,7 +59,7 @@
<input
class="editor-input w-full"
:value="config.layers || ''"
@input="$emit('time-slider-changed', 'layers', undefined, $event.target.value)"
@input="$emit('time-slider-changed', 'layers', undefined, ($event.target as HTMLInputElement).value)"
/>
</div>
<br /><br />
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions src/components/editor/landing.vue → src/components/home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@

<script lang="ts">
import { Vue } from 'vue-property-decorator';
import { useUserStore } from '../../stores/userStore';
import { useUserStore } from '../stores/userStore';
export default class LandingV extends Vue {
get userName() {
export default class HomeV extends Vue {
get userName(): string {
const userStore = useUserStore();
return userStore.userProfile.userName || 'Guest';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
import { Options, Prop, Vue } from 'vue-property-decorator';
import { ConfigFileStructure, ImageFile, ImagePanel, PanelType, SlideshowPanel, SourceCounts } from '@/definitions';
import draggable from 'vuedraggable';
import ImagePreviewV from '@/components/editor/helpers/image-preview.vue';
import ImagePreviewV from './helpers/image-preview.vue';
@Options({
components: {
Expand Down
55 changes: 55 additions & 0 deletions src/components/landing.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<template>
<div class="relative">
<div class="absolute top-0 right-0 bg-white text-black p-2">
{{ $t('editor.landing.greeting') }} {{ userName }}!
</div>
<div class="flex flex-col items-center">
<h1 class="text-2xl font-bold mt-4">{{ title }}</h1>
<div class="flex justify-center mt-12 mb-32">
<div class="lang-selector border-4 border-gray-400 border-solid mx-8">
<router-link
:to="{ name: 'home', params: { lang: 'en' } }"
class="flex justify-center h-full w-full"
target
>
<button class="text-2xl text-white font-bold">English</button>
</router-link>
</div>
<div class="lang-selector border-4 border-gray-400 border-solid mx-8">
<router-link
:to="{ name: 'home', params: { lang: 'fr' } }"
class="flex justify-center h-full w-full"
target
>
<button class="text-2xl text-white font-bold">Français</button>
</router-link>
</div>
</div>
</div>
</div>
</template>

<script lang="ts">
import { Vue } from 'vue-property-decorator';
import { useUserStore } from '../stores/userStore';
export default class LandingV extends Vue {
title = document.title;
get userName(): string {
const userStore = useUserStore();
return userStore.userProfile.userName || 'Guest';
}
}
</script>

<style lang="scss">
.lang-selector {
height: 18vh;
width: 32vh;
background-color: #26374a;
}
.lang-selector:hover {
background-color: #2572b4;
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
import { Options, Prop, Vue } from 'vue-property-decorator';
import { ConfigFileStructure, MapPanel, SourceCounts, TimeSliderConfig } from '@/definitions';
import { VueFinalModal } from 'vue-final-modal';
import defaultConfig from '../../../public/ramp-default.json';
import defaultConfig from '../../public/ramp-default.json';
import TimeSliderEditorV from './helpers/time-slider-editor.vue';
import { createInstance } from 'ramp-config-editor_editeur-config-pcar';
import 'ramp-config-editor_editeur-config-pcar/dist/style.css';
Expand Down Expand Up @@ -246,12 +246,12 @@ select {
}
}
.edit-map {
content: url('../../assets/edit-icon.svg');
content: url('../assets/edit-icon.svg');
margin: 0 auto;
margin-bottom: 20px;
}
.add-map {
content: url('../../assets/add.svg');
content: url('../assets/add.svg');
margin: 0 auto;
margin-bottom: 20px;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ import {
} from '@/definitions';
import { VueSpinnerOval } from 'vue3-spinners';
import { VueFinalModal } from 'vue-final-modal';
import { useUserStore } from '../../stores/userStore';
import { useUserStore } from '../stores/userStore';
const JSZip = require('jszip');
const axios = require('axios').default;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
import { Options, Vue } from 'vue-property-decorator';
import { ConfigFileStructure, StoryRampConfig } from '@/definitions';
import { VueSpinnerOval } from 'vue3-spinners';
import { AxiosError } from 'axios';
@Options({
components: {
Expand Down Expand Up @@ -128,12 +129,13 @@ export default class StoryPreviewV extends Vue {
});
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
fetch(this.apiUrl + `/retrieveMessages`).then((res: any) => {
axios
.post(process.env.VUE_APP_NET_API_URL + '/api/log/create', {
messages: res.data.messages
})
.catch((error: any) => console.log(error.response || error));
.catch((error: AxiosError) => console.log(error.response || error));
});
});
} else {
Expand Down Expand Up @@ -197,7 +199,7 @@ $font-list: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
.prose a:not([panel])::after {
content: url('../../assets/popout.svg');
content: url('../assets/popout.svg');
}
.w-mobile-full {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,9 @@
<script lang="ts">
import { Options, Prop, Vue } from 'vue-property-decorator';
import { ConfigFileStructure, SourceCounts, VideoFile, VideoPanel } from '@/definitions';
import draggable from 'vuedraggable';
import VideoPreviewV from '@/components/editor/helpers/video-preview.vue';
import VideoPreviewV from './helpers/video-preview.vue';
@Options({
components: {
Expand Down
2 changes: 2 additions & 0 deletions src/lang/lang.csv
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ timeslider.play,Play,1,Lecture,1
timeslider.pause,Pause,1,Pause,1
fullscreen.activate,Enter Fullscreen,1,Afficher le mode plein écran,1
fullscreen.deactivate,Exit Fullscreen,1,Quitter le mode plein écran,1
editor.lang.en,English,1,Anglais,1
editor.lang.fr,French,1,Français,1
editor.feedback,Send Us Feedback,1,Envoyez-nous vos commentaires,0
editor.feedback.subject,Storylines Editor Feedback,1,Commentaires de l'éditeur de scénarios,0
editor.window.title,RAMP Storylines Editor,1,Éditeur de scénarios de la PCAR,1
Expand Down
15 changes: 11 additions & 4 deletions src/router/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
import LandingV from '@/components/editor/landing.vue';
import MetadataEditorV from '@/components/editor/metadata-editor.vue';
import StoryPreviewV from '@/components/editor/preview.vue';
import LandingV from '@/components/landing.vue';
import HomeV from '@/components/home.vue';
import MetadataEditorV from '@/components/metadata-editor.vue';
import StoryPreviewV from '@/components/preview.vue';
import { createRouter, createWebHashHistory, RouteLocationNormalized } from 'vue-router';

const routes = [
{
path: '/',
name: 'landing',
component: LandingV,
meta: { title: 'editor.window.title' }
},
{
path: '/:lang/editor',
name: 'home',
component: LandingV,
component: HomeV,
meta: { title: 'editor.window.title' }
},
{
Expand Down

0 comments on commit 35b4caf

Please sign in to comment.