...
 
Commits (2)
<script>
import { _ } from 'svelte-i18n';
export let message = $_('error.generic.message');
</script>
<div>
<h2>{$_('error.generic.title')}</h2>
<p>{message}</p>
</div>
<style>
div {
background: repeating-linear-gradient( -45deg, red, red 5px, black 5px, black 10px );
border: 5px solid red;
color: yellow;
font-family: 'ヒラギノ角ゴ ProN' , 'Hiragino Kaku Gothic ProN' , '游ゴシック' , '游ゴシック体' , YuGothic , 'Yu Gothic' , 'メイリオ' , Meiryo , 'MS ゴシック' , 'MS Gothic' , HiraKakuProN-W3 , 'TakaoExゴシック' , TakaoExGothic , 'MotoyaLCedar' , 'Droid Sans Japanese' , sans-serif;
margin: 0 10px 0 0;
padding: 100px 5px;
text-align: center;
}
h2, p {
background-color: black;
font-size: 1em;
}
h2 {
text-transform: uppercase;
}
</style>
<script>
import { _ } from 'svelte-i18n';
import { forums } from '../../stores/forums.js';
import ErrorBlock from '../error_block/error_block.svelte';
</script>
<nav title="List of Forums">
{#if !$forums.length}
<ErrorBlock message={$_('forum_list.error.unavailable')} />
{/if}
<ul>
{#each $forums as forum}
<li>
......
<script>
export let params;
import ErrorBlock from '../error_block/error_block.svelte';
</script>
<ErrorBlock />
<h1>Topic Index.</h1>
<p>This component lists topics for category or tag with id: {params.id}</p>
import { addMessages, getLocaleFromNavigator, init } from 'svelte-i18n';
import en from './translations/en.json';
addMessages('en', en);
init({
fallbackLocale: 'en',
initialLocale: getLocaleFromNavigator()
});
{
"error": {
"generic": {
"title": "Error!",
"message": "Unknown error has occurred. Panic!"
}
},
"forum_list": {
"error": {
"unavailable": "Forum list unavailable."
}
}
}
<script>
import LightRouter from 'lightrouter';
// Initialize localization
import './config/i18n';
// Global components
import ForumList from './components/forum_list/forum_list.svelte';
import Header from './components/header/header.svelte';
......
......@@ -15,11 +15,8 @@ const internals = {
handleChangeFeed(data) {
console.log(data);
// No old value == add
if (!data.old_val) {
console.log('Adding new data');
return internals.forums.push(data.new_val);
}
......@@ -27,8 +24,6 @@ const internals = {
const index = internals.forums.findIndex((element) => element.id === data.old_val.id);
if (index > -1) {
console.log(`Found old data at index ${index}`);
if (data.new_val) {
return internals.forums.splice(index, 1, data.new_val || undefined);
}
......
This diff is collapsed.
......@@ -21,26 +21,20 @@
"watch": "parcel ./app/index.html"
},
"dependencies": {
"@hapi/joi": "17.1.0",
"getenv2": "^2.0.0",
"koa": "^2.11.0",
"koa-send": "^5.0.0",
"koa-static": "^5.0.0",
"lightrouter": "^0.3.3",
"rethinkdb": "^2.4.2",
"uuid": "^7.0.2",
"ws": "^7.2.3"
"eventemitter3": "^4.0.4",
"lightrouter": "^0.3.3"
},
"devDependencies": {
"@hapi/eslint-config-hapi": "^13.0.2",
"@hapi/eslint-plugin-hapi": "^4.3.5",
"eslint": "^6.8.0",
"eslint": "^7.3.0",
"eslint-plugin-svelte3": "^2.7.3",
"htmlhint": "^0.11.0",
"htmlhint": "^0.14.0",
"parcel-bundler": "^1.12.4",
"parcel-plugin-static-files-copy": "^2.3.1",
"parcel-plugin-static-files-copy": "^2.4.3",
"parcel-plugin-svelte": "^4.0.6",
"svelte": "^3.19.2"
"svelte": "^3.23.2",
"svelte-i18n": "^3.0.4"
},
"keywords": [
"forum"
......