2018-08-26 09:35:53 +00:00
|
|
|
<template>
|
2018-09-05 11:00:10 +00:00
|
|
|
<div id="content" class="app-social">
|
2018-08-26 09:35:53 +00:00
|
|
|
<div id="app-navigation">
|
2018-10-10 07:11:37 +00:00
|
|
|
<app-navigation :menu="menu"></app-navigation>
|
2018-08-26 09:35:53 +00:00
|
|
|
</div>
|
|
|
|
<div id="app-content">
|
2018-09-05 11:00:10 +00:00
|
|
|
<div class="social__container">
|
2018-10-10 07:11:37 +00:00
|
|
|
<div class="social__welcome">
|
|
|
|
<a class="close icon-close" href="#"><span class="hidden-visually">Close</span></a>
|
|
|
|
<h3>🎉{{ t('social', 'Nextcloud becomes part of the federated social networks!') }}</h3>
|
|
|
|
<p>
|
|
|
|
{{ t('social', 'We have automatically created a social account for you. Your social id is the same as the federated cloud id:') }}
|
|
|
|
<span class="social-id">{{ socialId }}</span>
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
<div class="social__timeline">
|
|
|
|
<div class="new-post" data-id="">
|
|
|
|
<div class="new-post-author">
|
|
|
|
<div class="avatar currentUser" data-username="admin"><img src="/index.php/avatar/admin/32?v=1" alt=""></div>
|
|
|
|
</div>
|
|
|
|
<form class="new-post-form">
|
|
|
|
<div class="author currentUser">Julius Haertl</div>
|
|
|
|
<div contenteditable="true" class="message" data-placeholder="New comment …"></div>
|
|
|
|
<input class="submit icon-confirm has-tooltip" type="submit" value="" title="" data-original-title="Post">
|
|
|
|
<div class="submitLoading icon-loading-small hidden"></div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
<timeline-entry v-for="entry in timeline" :key="entry.id" :item="entry"></timeline-entry>
|
|
|
|
</div>
|
2018-08-26 09:35:53 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
2018-10-10 07:11:37 +00:00
|
|
|
<style scoped>
|
|
|
|
.social__welcome {
|
|
|
|
padding: 15px;
|
|
|
|
background-color: var(--color-background-dark);
|
|
|
|
}
|
|
|
|
|
|
|
|
.social__welcome h3 {
|
|
|
|
margin-top: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.social__welcome .icon-close {
|
|
|
|
float:right;
|
|
|
|
}
|
|
|
|
|
|
|
|
.social-id {
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
.new-post {
|
|
|
|
display: flex;
|
|
|
|
padding: 10px;
|
|
|
|
border-bottom: 1px solid var(--color-background-dark);
|
|
|
|
|
|
|
|
}
|
|
|
|
.new-post-author {
|
|
|
|
padding: 5px;
|
|
|
|
}
|
|
|
|
.new-post-form {
|
|
|
|
flex-grow: 1;
|
|
|
|
position: relative;
|
|
|
|
}
|
|
|
|
.message {
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
input[type=submit] {
|
|
|
|
width: 44px;
|
|
|
|
height: 44px;
|
|
|
|
margin: 0;
|
|
|
|
padding: 13px;
|
|
|
|
background-color: transparent;
|
|
|
|
border: none;
|
|
|
|
opacity: 0.3;
|
|
|
|
position: absolute;
|
|
|
|
bottom: 0;
|
|
|
|
right: 0;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
|
|
|
|
|
2018-08-26 09:35:53 +00:00
|
|
|
<script>
|
|
|
|
import {
|
|
|
|
PopoverMenu,
|
|
|
|
AppNavigation
|
2018-10-01 15:32:51 +00:00
|
|
|
} from 'nextcloud-vue';
|
2018-10-10 07:11:37 +00:00
|
|
|
import TimelineEntry from './components/TimelineEntry';
|
2018-08-26 09:35:53 +00:00
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'App',
|
|
|
|
components: {
|
2018-10-10 07:11:37 +00:00
|
|
|
PopoverMenu, AppNavigation, TimelineEntry
|
2018-08-26 09:35:53 +00:00
|
|
|
},
|
|
|
|
data: function () {
|
|
|
|
return {
|
2018-10-10 07:11:37 +00:00
|
|
|
|
2018-08-26 09:35:53 +00:00
|
|
|
};
|
|
|
|
},
|
2018-10-10 07:46:26 +00:00
|
|
|
beforeMount: function() {
|
|
|
|
let example = {
|
|
|
|
message: 'Want to #DropDropbox? #DeleteGoogle? #decentralize? We got you covered, easy as a piece of 🥞\n' +
|
|
|
|
'\n' +
|
|
|
|
'Get started right now: https://nextcloud.com/signup',
|
|
|
|
author: 'Nextcloud 📱☁️💻',
|
|
|
|
authorId: '@nextcloud@mastodon.xyz',
|
|
|
|
authorAvatar: OC.linkTo('social', 'img/nextcloud.png'),
|
|
|
|
timestamp: '1 day ago'
|
|
|
|
};
|
|
|
|
let data = [];
|
|
|
|
for (let i=0; i<20; i++) {
|
|
|
|
example.id = Math.floor((Math.random() * 100));
|
|
|
|
data.push(example);
|
|
|
|
}
|
|
|
|
this.$store.commit('addToTimeline', data);
|
|
|
|
},
|
2018-08-26 09:35:53 +00:00
|
|
|
computed: {
|
2018-10-10 07:11:37 +00:00
|
|
|
socialId: function() {
|
|
|
|
return '@' + OC.getCurrentUser().uid + '@' + OC.getHost();
|
|
|
|
},
|
|
|
|
timeline: function() {
|
2018-10-10 07:46:26 +00:00
|
|
|
return this.$store.getters.getTimeline;
|
2018-10-10 07:11:37 +00:00
|
|
|
},
|
2018-08-26 09:35:53 +00:00
|
|
|
menu: function () {
|
|
|
|
let defaultCategories = [
|
|
|
|
{
|
2018-09-05 11:00:10 +00:00
|
|
|
id: 'social-timeline',
|
2018-08-26 09:35:53 +00:00
|
|
|
classes: [],
|
|
|
|
href: '#',
|
2018-09-05 11:00:10 +00:00
|
|
|
icon: 'icon-category-monitoring',
|
|
|
|
text: t('social', 'Timeline'),
|
2018-08-26 09:35:53 +00:00
|
|
|
},
|
|
|
|
{
|
2018-09-05 11:00:10 +00:00
|
|
|
id: 'social-your-posts',
|
|
|
|
classes: [],
|
|
|
|
href: '#',
|
|
|
|
icon: 'icon-user',
|
|
|
|
text: t('social', 'Your posts'),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: 'social-friends',
|
|
|
|
classes: [],
|
|
|
|
href: '#',
|
|
|
|
icon: 'icon-category-social',
|
|
|
|
text: t('social', 'Friends'),
|
2018-08-26 09:35:53 +00:00
|
|
|
},
|
|
|
|
{
|
2018-09-05 11:00:10 +00:00
|
|
|
id: 'social-favorites',
|
2018-08-26 09:35:53 +00:00
|
|
|
classes: [],
|
|
|
|
href: '#',
|
2018-09-05 11:00:10 +00:00
|
|
|
icon: 'icon-favorite',
|
|
|
|
text: t('social', 'Favorites'),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: 'social-direct-messages',
|
|
|
|
classes: [],
|
|
|
|
href: '#',
|
|
|
|
icon: 'icon-comment',
|
2018-08-26 09:35:53 +00:00
|
|
|
utils: {
|
2018-09-05 11:00:10 +00:00
|
|
|
counter: 3,
|
2018-08-26 09:35:53 +00:00
|
|
|
},
|
2018-09-05 11:00:10 +00:00
|
|
|
text: t('social', 'Direct messages'),
|
2018-08-26 09:35:53 +00:00
|
|
|
},
|
|
|
|
];
|
|
|
|
return {
|
|
|
|
items: defaultCategories,
|
|
|
|
loading: false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|