Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F85629815
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
10 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/src/App.js b/src/App.js
index 0636c47dbc..1c6f4fcc96 100644
--- a/src/App.js
+++ b/src/App.js
@@ -1,40 +1,43 @@
import UserPanel from './components/user_panel/user_panel.vue'
import NavPanel from './components/nav_panel/nav_panel.vue'
import Notifications from './components/notifications/notifications.vue'
import UserFinder from './components/user_finder/user_finder.vue'
+import InstanceSpecificPanel from './components/instance_specific_panel/instance_specific_panel.vue'
import ChatPanel from './components/chat_panel/chat_panel.vue'
export default {
name: 'app',
components: {
UserPanel,
NavPanel,
Notifications,
UserFinder,
- ChatPanel
+ ChatPanel,
+ InstanceSpecificPanel
},
data: () => ({
mobileActivePanel: 'timeline'
}),
computed: {
currentUser () { return this.$store.state.users.currentUser },
background () {
return this.currentUser.background_image || this.$store.state.config.background
},
logoStyle () { return { 'background-image': `url(${this.$store.state.config.logo})` } },
style () { return { 'background-image': `url(${this.background})` } },
sitename () { return this.$store.state.config.name },
- chat () { return this.$store.state.chat.channel }
+ chat () { return this.$store.state.chat.channel },
+ showInstanceSpecificPanel () { return this.$store.state.config.showInstanceSpecificPanel}
},
methods: {
activatePanel (panelName) {
this.mobileActivePanel = panelName
},
scrollToTop () {
window.scrollTo(0, 0)
},
logout () {
this.$store.dispatch('logout')
}
}
}
diff --git a/src/App.vue b/src/App.vue
index ec403519b3..2a910bc06b 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -1,42 +1,43 @@
<template>
<div id="app" v-bind:style="style" class="base02-background">
<nav class='container base02-background base05' @click="scrollToTop()" id="nav">
<div class='inner-nav' :style="logoStyle">
<div class='item'>
<router-link :to="{ name: 'root'}">{{sitename}}</router-link>
</div>
<div class='item right'>
<user-finder class="nav-icon"></user-finder>
<router-link :to="{ name: 'settings'}"><i class="icon-cog nav-icon"></i></router-link>
<a href="#" v-if="currentUser" @click.prevent="logout"><i class="icon-logout nav-icon" :title="$t('login.logout')"></i></a>
</div>
</div>
</nav>
<div class="container" id="content">
<div class="panel-switcher">
<button @click="activatePanel('sidebar')" class="base02-background base05">Sidebar</button>
<button @click="activatePanel('timeline')" class="base02-background base05">Timeline</button>
</div>
<div class="sidebar-flexer" :class="{ 'mobile-hidden': mobileActivePanel != 'sidebar'}">
<div class="sidebar-bounds">
<div class="sidebar-scroller">
<div class="sidebar">
<user-panel></user-panel>
<nav-panel></nav-panel>
+ <instance-specific-panel v-if="showInstanceSpecificPanel"></instance-specific-panel>
<chat-panel v-if="currentUser && chat"></chat-panel>
<notifications v-if="currentUser"></notifications>
</div>
</div>
</div>
</div>
<div class="main" :class="{ 'mobile-hidden': mobileActivePanel != 'timeline' }">
<transition name="fade">
<router-view></router-view>
</transition>
</div>
</div>
</div>
</template>
<script src="./App.js"></script>
<style lang="scss" src="./App.scss"></style>
diff --git a/src/components/instance_specific_panel/instance_specific_panel.js b/src/components/instance_specific_panel/instance_specific_panel.js
new file mode 100644
index 0000000000..abd408c8f8
--- /dev/null
+++ b/src/components/instance_specific_panel/instance_specific_panel.js
@@ -0,0 +1,9 @@
+const InstanceSpecificPanel = {
+ computed: {
+ instanceSpecificPanelContent () {
+ return this.$store.state.config.instanceSpecificPanelContent
+ }
+ }
+}
+
+export default InstanceSpecificPanel
diff --git a/src/components/instance_specific_panel/instance_specific_panel.vue b/src/components/instance_specific_panel/instance_specific_panel.vue
new file mode 100644
index 0000000000..b3ea019d0f
--- /dev/null
+++ b/src/components/instance_specific_panel/instance_specific_panel.vue
@@ -0,0 +1,15 @@
+<template>
+ <div class="instance-specific-panel">
+ <div class="panel panel-default base01-background">
+ <div class="panel-body">
+ <div v-html="instanceSpecificPanelContent">
+ </div>
+ </div>
+ </div>
+ </div>
+</template>
+
+<script src="./instance_specific_panel.js" ></script>
+
+<style lang="scss">
+</style>
diff --git a/src/main.js b/src/main.js
index de74511b41..359dbf5293 100644
--- a/src/main.js
+++ b/src/main.js
@@ -1,148 +1,156 @@
import Vue from 'vue'
import VueRouter from 'vue-router'
import Vuex from 'vuex'
import App from './App.vue'
import PublicTimeline from './components/public_timeline/public_timeline.vue'
import PublicAndExternalTimeline from './components/public_and_external_timeline/public_and_external_timeline.vue'
import FriendsTimeline from './components/friends_timeline/friends_timeline.vue'
import TagTimeline from './components/tag_timeline/tag_timeline.vue'
import ConversationPage from './components/conversation-page/conversation-page.vue'
import Mentions from './components/mentions/mentions.vue'
import UserProfile from './components/user_profile/user_profile.vue'
import Settings from './components/settings/settings.vue'
import Registration from './components/registration/registration.vue'
import UserSettings from './components/user_settings/user_settings.vue'
import statusesModule from './modules/statuses.js'
import usersModule from './modules/users.js'
import apiModule from './modules/api.js'
import configModule from './modules/config.js'
import chatModule from './modules/chat.js'
import VueTimeago from 'vue-timeago'
import VueI18n from 'vue-i18n'
import createPersistedState from './lib/persisted_state.js'
import messages from './i18n/messages.js'
import VueChatScroll from 'vue-chat-scroll'
const currentLocale = (window.navigator.language || 'en').split('-')[0]
Vue.use(Vuex)
Vue.use(VueRouter)
Vue.use(VueTimeago, {
locale: currentLocale === 'ja' ? 'ja' : 'en',
locales: {
'en': require('../static/timeago-en.json'),
'ja': require('../static/timeago-ja.json')
}
})
Vue.use(VueI18n)
Vue.use(VueChatScroll)
const persistedStateOptions = {
paths: [
'config.hideAttachments',
'config.hideAttachmentsInConv',
'config.hideNsfw',
'config.autoLoad',
'config.hoverPreview',
'config.streaming',
'config.muteWords',
'config.customTheme',
'users.lastLoginName'
]
}
const store = new Vuex.Store({
modules: {
statuses: statusesModule,
users: usersModule,
api: apiModule,
config: configModule,
chat: chatModule
},
plugins: [createPersistedState(persistedStateOptions)],
strict: false // Socket modifies itself, let's ignore this for now.
// strict: process.env.NODE_ENV !== 'production'
})
const i18n = new VueI18n({
locale: currentLocale,
fallbackLocale: 'en',
messages
})
window.fetch('/static/config.json')
.then((res) => res.json())
.then((data) => {
- const {name, theme, background, logo, registrationOpen} = data
+ const {name, theme, background, logo, registrationOpen, showInstanceSpecificPanel} = data
store.dispatch('setOption', { name: 'name', value: name })
store.dispatch('setOption', { name: 'theme', value: theme })
store.dispatch('setOption', { name: 'background', value: background })
store.dispatch('setOption', { name: 'logo', value: logo })
store.dispatch('setOption', { name: 'registrationOpen', value: registrationOpen })
+ store.dispatch('setOption', { name: 'showInstanceSpecificPanel', value: showInstanceSpecificPanel })
if (data['chatDisabled']) {
store.dispatch('disableChat')
}
const routes = [
{ name: 'root', path: '/', redirect: data['defaultPath'] || '/main/all' },
{ path: '/main/all', component: PublicAndExternalTimeline },
{ path: '/main/public', component: PublicTimeline },
{ path: '/main/friends', component: FriendsTimeline },
{ path: '/tag/:tag', component: TagTimeline },
{ name: 'conversation', path: '/notice/:id', component: ConversationPage, meta: { dontScroll: true } },
{ name: 'user-profile', path: '/users/:id', component: UserProfile },
{ name: 'mentions', path: '/:username/mentions', component: Mentions },
{ name: 'settings', path: '/settings', component: Settings },
{ name: 'registration', path: '/registration', component: Registration },
{ name: 'user-settings', path: '/user-settings', component: UserSettings }
]
const router = new VueRouter({
mode: 'history',
routes,
scrollBehavior: (to, from, savedPosition) => {
if (to.matched.some(m => m.meta.dontScroll)) {
return false
}
return savedPosition || { x: 0, y: 0 }
}
})
/* eslint-disable no-new */
new Vue({
router,
store,
i18n,
el: '#app',
render: h => h(App)
})
})
window.fetch('/static/terms-of-service.html')
.then((res) => res.text())
.then((html) => {
store.dispatch('setOption', { name: 'tos', value: html })
})
window.fetch('/api/pleroma/emoji.json')
.then(
(res) => res.json()
.then(
(values) => {
const emoji = Object.keys(values).map((key) => {
return { shortcode: key, image_url: values[key] }
})
store.dispatch('setOption', { name: 'emoji', value: emoji })
store.dispatch('setOption', { name: 'pleromaBackend', value: true })
},
(failure) => {
store.dispatch('setOption', { name: 'pleromaBackend', value: false })
}
),
(error) => console.log(error)
)
+
+window.fetch('/instance/panel.html')
+ .then((res) => res.text())
+ .then((html) => {
+ store.dispatch('setOption', { name: 'instanceSpecificPanelContent', value: html })
+ })
+
diff --git a/static/config.json b/static/config.json
index 880efca810..38b1062d36 100644
--- a/static/config.json
+++ b/static/config.json
@@ -1,9 +1,10 @@
{
"name": "Pleroma FE",
"theme": "pleroma-dark",
"background": "/static/bg.jpg",
"logo": "/static/logo.png",
- "registrationOpen": false,
+ "registrationOpen": true,
"defaultPath": "/main/all",
- "chatDisabled": false
+ "chatDisabled": false,
+ "showInstanceSpecificPanel": false
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sun, Aug 9, 5:44 AM (1 d, 15 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1724259
Default Alt Text
(10 KB)
Attached To
Mode
rPUFE pleroma-fe-upstream
Attached
Detach File
Event Timeline
Log In to Comment