Deleted unused pages + UI structure changes + Direct Chat styles!

This commit is contained in:
Bofh 2020-12-24 16:50:17 +01:00
parent 1e19fc7dbc
commit 4aa5f4d341
14 changed files with 63 additions and 314 deletions

View File

@ -59,7 +59,7 @@ export default {
favorites: 'Favorites',
federated: 'Federated',
home: 'Home',
local: 'Local',
meet: 'Meet!',
notifications: 'Notifications',
mutedUsers: 'Muted users',
pinnedStatuses: 'Pinned toots',
@ -77,7 +77,7 @@ export default {
federatedTimeline: 'Federated timeline',
localTimeline: 'Local timeline',
// community page
community: 'Community',
chat: 'Chat',
pinnableTimelines: 'Pinnable timelines',
timelines: 'Timelines',
lists: 'Lists',
@ -188,7 +188,7 @@ export default {
overLimit: '{count} {count, plural, =1 {character} other {characters}} over limit',
underLimit: '{count} {count, plural, =1 {character} other {characters}} remaining',
composeStatus: 'Compose toot',
postStatus: 'Toot!',
postStatus: 'Send!',
contentWarning: 'Content warning',
dropToUpload: 'Drop to upload',
invalidFileType: 'Invalid file type',
@ -314,17 +314,16 @@ export default {
profilePageForAccount: 'Profile page for {account}',
// About page
about: 'About',
aboutApp: 'About Pinafore',
aboutApp: 'About FediLove',
aboutAppDescription: `
<p>
Pinafore is
<a rel="noopener" target="_blank"
href="https://github.com/nolanlawson/pinafore">free and open-source software</a>
created by
<a rel="noopener" target="_blank" href="https://nolanlawson.com">Nolan Lawson</a>
FediLove is a Pinafore fork. It is
<a rel="noopener" target="_blank" href="https://git.nogafam.es/nogafam/fedilove-ui">open-source software</a>
adapted by
<a rel="noopener" target="_blank" href="https://masto.nogafam.es/@admin">bofh@nogafam.es</a>
and distributed under the
<a rel="noopener" target="_blank"
href="https://github.com/nolanlawson/pinafore/blob/master/LICENSE">GNU Affero General Public License</a>.
href="https://github.com/nolanlawson/pinafore/blob/master/LICENSE">AGPL License</a>.
</p>
<h2 id="privacy-policy">Privacy Policy</h2>

View File

@ -3,7 +3,7 @@ import { basename } from './utils'
const WEBSITE = 'https://pinafore.social'
const SCOPES = 'read write follow push'
const CLIENT_NAME = 'Pinafore'
const CLIENT_NAME = 'FediLove'
export function registerApplication (instanceName, redirectUri) {
const url = `${basename(instanceName)}/api/v1/apps`

View File

@ -75,6 +75,7 @@
.status-article.status-in-timeline {
border-bottom: 1px solid var(--main-border);
background: var(--article-bg);
}
.status-article.status-direct {

View File

@ -1,174 +0,0 @@
{#if $isUserLoggedIn}
<div class="community-page">
<FocusRestoration realm="community">
<RadioGroup
id="pinnables"
length={numPinnable}
label="{intl.pinnableTimelines}">
<h2 class="community-header">
{intl.timelines}
</h2>
<PageList label="{intl.timelines}">
{#each staticPinnables as staticPinnable, i}
<PageListItem href={staticPinnable.href}
label={staticPinnable.label}
icon={staticPinnable.icon}
pinnable="true"
pinIndex={i}
/>
{/each}
</PageList>
{#if listsLength}
<h2 class="community-header">
{intl.lists}
</h2>
<PageList label="{intl.lists}">
{#each $lists as list, i}
<PageListItem href="/lists/{list.id}"
label={list.title}
icon="#fa-bars"
pinnable="true"
pinIndex={staticPinnablesLength + i}
/>
{/each}
</PageList>
{/if}
</RadioGroup>
<h2 class="community-header">
Instance settings
</h2>
<PageList label="{intl.instanceSettings}">
{#if isLockedAccount}
<PageListItem href="/requests"
label={followRequestsLabel}
icon="#fa-user-plus"
/>
{/if}
<PageListItem href="/muted"
label="{intl.mutedUsers}"
icon="#fa-volume-off"
/>
<PageListItem href="/blocked"
label="{intl.blockedUsers}"
icon="#fa-ban"
/>
<PageListItem href="/pinned"
label="{intl.pinnedStatuses}"
icon="#fa-thumb-tack"
/>
</PageList>
</FocusRestoration>
</div>
{:else}
<HiddenFromSSR>
<FreeTextLayout>
<h1>{intl.community}</h1>
<p>{intl.communityNotLoggedIn}</p>
</FreeTextLayout>
</HiddenFromSSR>
<div style="display: none">
<!-- TODO: this is just a hack so that `sapper export` knows to crawl these files -->
<!-- Note that these links have to be spread out or else they result in ECONNRESET errors during crawling -->
<!-- See also search.html -->
<a href="/requests">{intl.followRequests}</a>
<a href="/muted">{intl.mutedUsers}</a>
<a href="/blocked">{intl.blockedUsers}</a>
<a href="/pinned">{intl.pinnedStatuses}</a>
</div>
{/if}
<style>
.community-page {
margin: 20px;
}
@media (max-width: 767px) {
.community-page {
margin: 20px 10px;
}
}
</style>
<script>
import FreeTextLayout from '../../_components/FreeTextLayout.html'
import { store } from '../../_store/store.js'
import HiddenFromSSR from '../../_components/HiddenFromSSR'
import PageList from '../../_components/community/PageList.html'
import PageListItem from '../../_components/community/PageListItem.html'
import RadioGroup from '../../_components/radio/RadioGroup.html'
import { updateListsForInstance } from '../../_actions/lists'
import { updateFollowRequestCountIfLockedAccount } from '../../_actions/followRequests'
import FocusRestoration from '../../_components/FocusRestoration.html'
import { formatIntl } from '../../_utils/formatIntl'
export default {
async oncreate () {
const { currentInstance } = this.store.get()
if (currentInstance) {
await Promise.all([
updateListsForInstance(currentInstance),
updateFollowRequestCountIfLockedAccount(currentInstance)
])
}
},
store: () => store,
components: {
FreeTextLayout,
HiddenFromSSR,
PageList,
PageListItem,
RadioGroup,
FocusRestoration
},
data: () => ({
staticPinnables: [
{
href: '/local',
label: 'intl.localTimeline',
icon: '#fa-users'
},
{
href: '/federated',
label: 'intl.federatedTimeline',
icon: '#fa-globe'
},
{
href: '/favorites',
label: 'intl.favorites',
icon: '#fa-star'
},
{
href: '/direct',
label: 'intl.directMessages',
icon: '#fa-envelope'
},
{
href: '/bookmarks',
label: 'intl.bookmarks',
icon: '#fa-bookmark'
}
]
}),
computed: {
isLockedAccount: ({ $currentVerifyCredentials }) => $currentVerifyCredentials && $currentVerifyCredentials.locked,
followRequestsLabel: ({ $hasFollowRequests, $numberOfFollowRequests }) => (
formatIntl('intl.followRequestsLabel', {
hasFollowRequests: $hasFollowRequests,
count: $numberOfFollowRequests
})
),
listsLength: ({ $lists }) => $lists ? $lists.length : 0,
staticPinnablesLength: ({ staticPinnables }) => staticPinnables.length,
numPinnable: ({ listsLength, staticPinnablesLength }) => listsLength + staticPinnablesLength
}
}
</script>

View File

@ -1,32 +0,0 @@
{#if $isUserLoggedIn}
<TimelinePage timeline="local">
{#if $pinnedPage !== '/local'}
<DynamicPageBanner title="{intl.localTimeline}" icon="#fa-users"/>
{/if}
</TimelinePage>
{:else}
<HiddenFromSSR>
<FreeTextLayout>
<h1>{intl.local}</h1>
<p>{intl.localTimelineNotLoggedIn}</p>
</FreeTextLayout>
</HiddenFromSSR>
{/if}
<script>
import TimelinePage from '../_components/TimelinePage.html'
import FreeTextLayout from '../_components/FreeTextLayout.html'
import { store } from '../_store/store.js'
import HiddenFromSSR from '../_components/HiddenFromSSR'
import DynamicPageBanner from '../_components/DynamicPageBanner.html'
export default {
store: () => store,
components: {
TimelinePage,
FreeTextLayout,
HiddenFromSSR,
DynamicPageBanner
}
}
</script>

View File

@ -14,7 +14,6 @@
<!-- TODO: this is just a hack so that `sapper export` knows to crawl these files -->
<!-- Note that these links have to be spread out or else they result in ECONNRESET errors during crawling -->
<!-- See also community/index.html -->
<a href="/local">{intl.local}</a>
<a href="/federated">{intl.federated}</a>
<a href="/favorites">{intl.favorites}</a>
<a href="/direct">{intl.directMessages}</a>

View File

@ -2,9 +2,6 @@
<h1>{intl.settings}</h1>
<SettingsList>
<SettingsListRow>
<SettingsListButton href="/settings/general" label="{intl.general}"/>
</SettingsListRow>
<SettingsListRow>
<SettingsListButton href="/settings/instances" label="{intl.instances}"/>
</SettingsListRow>

View File

@ -2,6 +2,6 @@ export const TIMELINE_BATCH_SIZE = 20
export const timelines = {
home: { name: 'home', label: 'intl.home' },
local: { name: 'local', label: 'intl.local' },
local: { name: 'local', label: 'intl.meet' },
federated: { name: 'federated', label: 'intl.federated' }
}

View File

@ -58,10 +58,10 @@ export function navComputations (store) {
}
} else { // local
pinnedPageObject = {
name: 'local',
href: '/local',
name: 'federated',
href: '/federated',
svg: '#fa-users',
label: 'intl.local'
label: 'intl.meet'
}
}
@ -80,16 +80,10 @@ export function navComputations (store) {
},
pinnedPageObject,
{
name: 'community',
href: '/community',
name: 'direct',
href: '/direct',
svg: '#fa-comments',
label: 'intl.community'
},
{
name: 'search',
href: '/search',
svg: '#fa-search',
label: 'intl.search'
label: 'intl.chat'
},
{
name: 'settings',

View File

@ -1,20 +0,0 @@
<Title name="{intl.community}" />
<LazyPage {pageComponent} {params} />
<script>
import Title from '../_components/Title.html'
import LazyPage from '../_components/LazyPage.html'
import pageComponent from '../_pages/community/index.html'
export default {
components: {
Title,
LazyPage
},
data: () => ({
pageComponent
})
}
</script>

View File

@ -1,20 +0,0 @@
<Title name="{intl.local}" />
<LazyPage {pageComponent} {params} />
<script>
import Title from './_components/Title.html'
import LazyPage from './_components/LazyPage.html'
import pageComponent from './_pages/local.html'
export default {
components: {
Title,
LazyPage
},
data: () => ({
pageComponent
})
}
</script>

View File

@ -1,20 +0,0 @@
<Title name="{intl.search}" />
<LazyPage {pageComponent} {params} />
<script>
import Title from './_components/Title.html'
import LazyPage from './_components/LazyPage.html'
import pageComponent from './_pages/search.html'
export default {
components: {
Title,
LazyPage
},
data: () => ({
pageComponent
})
}
</script>

View File

@ -1,20 +0,0 @@
<Title name="{intl.generalSettings}" settingsPage={true} />
<LazyPage {pageComponent} {params} />
<script>
import Title from '../_components/Title.html'
import LazyPage from '../_components/LazyPage.html'
import pageComponent from '../_pages/settings/general.html'
export default {
components: {
Title,
LazyPage
},
data: () => ({
pageComponent
})
}
</script>

View File

@ -16,6 +16,9 @@ $nav-a-bg-hover: lighten($nav-bg, 25%);
$nav-a-border: #ffa700;
$nav-a-border-hover: #fff;
$nav-active-bg: lighten($nav-a-selected-bg-hover, 15%);
$main-border: #ececec;
$article-bg: #fff;
$deemphasized-text-color: #939393;
@import "_base.scss";
@import "_dark.scss";
@ -35,4 +38,46 @@ $nav-active-bg: lighten($nav-a-selected-bg-hover, 15%);
--nav-a-border: #{$nav-a-border};
--nav-a-border-hover: #{$nav-a-border-hover};
--nav-active-bg: #{$nav-active-bg};
--main-border: #{$main-border};
--article-bg: #{$article-bg};
--deemphasized-text-color: #{$deemphasized-text-color};
}
div.timeline > div.virtual-list {
article.status-article > div.status-content {
position: relative;
top: 1em;
}
}
div.timeline > div.the-list {
div.list-item {
article.status-article {
background: #e8e8e8;
border-radius: 1.5em;
margin: .5em 1em;
float: right;
border: 1px solid #c6c5c5;
box-shadow: 6px 6px 6px #dbd7d7;
}
article.status-article {
a.status-sidebar {
visibility: collapse;
width: 0;
height: 0;
}
span.status-author-handle {
visibility: collapse;
}
}
}
}
div.timeline article {
.status-toolbar {
visibility: collapse;
width: 0;
height: 0;
}
}