From e892fffda797c4d5e6aef54a488f15f55526a29d Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Thu, 16 Feb 2017 12:51:24 +0100 Subject: Correctly calculate the newStatusesCount. Fixes a bug when viewing an updating twkn while logged in. --- src/modules/statuses.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/modules/statuses.js b/src/modules/statuses.js index b1aa404a..871172b5 100644 --- a/src/modules/statuses.js +++ b/src/modules/statuses.js @@ -153,16 +153,18 @@ const addNewStatuses = (state, { statuses, showImmediately = false, timeline, us } } + // Decide if we should treat the status as new for this timeline. + let resultForCurrentTimeline // Some statuses should only be added to the global status repository. if (timeline && addToTimeline) { - mergeOrAdd(timelineObject.statuses, status) + resultForCurrentTimeline = mergeOrAdd(timelineObject.statuses, status) } if (timeline && showImmediately) { // Add it directly to the visibleStatuses, don't change // newStatusCount mergeOrAdd(timelineObject.visibleStatuses, status) - } else if (timeline && addToTimeline && result.new) { + } else if (timeline && addToTimeline && resultForCurrentTimeline.new) { // Just change newStatuscount timelineObject.newStatusCount += 1 } -- cgit v1.2.3-70-g09d2 From ae388d79278157e33d9818f6365d0d2fb1c116b5 Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Thu, 16 Feb 2017 14:23:59 +0100 Subject: Be strict about putting changes in mutations. --- src/main.js | 3 ++- src/modules/users.js | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/main.js b/src/main.js index 84db5c86..20489d42 100644 --- a/src/main.js +++ b/src/main.js @@ -38,7 +38,8 @@ const store = new Vuex.Store({ api: apiModule, config: configModule }, - plugins: [createPersistedState(persistedStateOptions)] + plugins: [createPersistedState(persistedStateOptions)], + strict: process.env.NODE_ENV !== 'production' }) const routes = [ diff --git a/src/modules/users.js b/src/modules/users.js index dd65afe1..ae90abbd 100644 --- a/src/modules/users.js +++ b/src/modules/users.js @@ -33,6 +33,9 @@ export const mutations = { }, addNewUsers (state, users) { each(users, (user) => mergeOrAdd(state.users, user)) + }, + setUserForStatus (state, status) { + status.user = find(state.users, status.user) } } @@ -54,11 +57,11 @@ const users = { // Reconnect users to statuses each(statuses, (status) => { - status.user = find(store.state.users, status.user) + store.commit('setUserForStatus', status) }) // Reconnect users to retweets each(compact(map(statuses, 'retweeted_status')), (status) => { - status.user = find(store.state.users, status.user) + store.commit('setUserForStatus', status) }) }, loginUser (store, userCredentials) { -- cgit v1.2.3-70-g09d2 From 5481cf00a3c8cc2a8707155e7b7383f2ebff92b1 Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Thu, 16 Feb 2017 15:58:49 +0100 Subject: Make user profiles visible inline. --- src/components/status/status.js | 10 ++++++++-- src/components/status/status.vue | 12 +++++++++++- src/services/style_setter/style_setter.js | 2 +- 3 files changed, 20 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/components/status/status.js b/src/components/status/status.js index 3d1d50fb..030e22b5 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -3,6 +3,7 @@ import FavoriteButton from '../favorite_button/favorite_button.vue' import RetweetButton from '../retweet_button/retweet_button.vue' import DeleteButton from '../delete_button/delete_button.vue' import PostStatusForm from '../post_status_form/post_status_form.vue' +import UserCardContent from '../user_card_content/user_card_content.vue' const Status = { props: [ @@ -12,7 +13,8 @@ const Status = { data: () => ({ replying: false, expanded: false, - unmuted: false + unmuted: false, + userExpanded: false }), computed: { retweet () { return !!this.statusoid.retweeted_status }, @@ -34,7 +36,8 @@ const Status = { FavoriteButton, RetweetButton, DeleteButton, - PostStatusForm + PostStatusForm, + UserCardContent }, methods: { toggleReplying () { @@ -45,6 +48,9 @@ const Status = { }, toggleMute () { this.unmuted = !this.unmuted + }, + toggleUserExpanded () { + this.userExpanded = !this.userExpanded } } } diff --git a/src/components/status/status.vue b/src/components/status/status.vue index c215a00b..0c004936 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -18,10 +18,13 @@
+
+ +

{{status.user.name}} @@ -147,4 +150,11 @@ display: block; margin-left: auto; } + + .usercard { + border-style: solid; + border-width: 1px; + border-radius: 1em; + margin-bottom: 1em; + } diff --git a/src/services/style_setter/style_setter.js b/src/services/style_setter/style_setter.js index 79b68b38..0a5be77d 100644 --- a/src/services/style_setter/style_setter.js +++ b/src/services/style_setter/style_setter.js @@ -34,7 +34,7 @@ const setStyle = (href) => { styleSheet.insertRule(`a { color: ${base08Color}`, 'index-max') styleSheet.insertRule(`body { color: ${base05Color}`, 'index-max') - styleSheet.insertRule(`.base05-border { color: ${base05Color}`, 'index-max') + styleSheet.insertRule(`.base05-border { border-color: ${base05Color}`, 'index-max') body.style.display = 'initial' } cssEl.addEventListener('load', setDynamic) -- cgit v1.2.3-70-g09d2 From a3b2be09b3acab977682cc4cc4cebc7d9229f036 Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Thu, 16 Feb 2017 16:59:06 +0100 Subject: Add /cyb/ background by sonyam. --- src/App.js | 5 ++++- src/main.js | 3 ++- static/bg.jpg | Bin 0 -> 229574 bytes static/bgalt.jpg | Bin 0 -> 330583 bytes static/config.json | 3 ++- 5 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 static/bg.jpg create mode 100644 static/bgalt.jpg (limited to 'src') diff --git a/src/App.js b/src/App.js index c326ddfc..736755ea 100644 --- a/src/App.js +++ b/src/App.js @@ -16,7 +16,10 @@ export default { }), computed: { currentUser () { return this.$store.state.users.currentUser }, - style () { return { 'background-image': `url(${this.currentUser.background_image})` } }, + background () { + return this.currentUser.background_image || this.$store.state.config.background + }, + style () { return { 'background-image': `url(${this.background})` } }, sitename () { return this.$store.state.config.name } }, methods: { diff --git a/src/main.js b/src/main.js index 20489d42..68653c37 100644 --- a/src/main.js +++ b/src/main.js @@ -71,7 +71,8 @@ new Vue({ window.fetch('/static/config.json') .then((res) => res.json()) - .then(({name, theme}) => { + .then(({name, theme, background}) => { store.dispatch('setOption', { name: 'name', value: name }) store.dispatch('setOption', { name: 'theme', value: theme }) + store.dispatch('setOption', { name: 'background', value: background }) }) diff --git a/static/bg.jpg b/static/bg.jpg new file mode 100644 index 00000000..60e2311a Binary files /dev/null and b/static/bg.jpg differ diff --git a/static/bgalt.jpg b/static/bgalt.jpg new file mode 100644 index 00000000..fdb666ff Binary files /dev/null and b/static/bgalt.jpg differ diff --git a/static/config.json b/static/config.json index 058c9875..d522e7e2 100644 --- a/static/config.json +++ b/static/config.json @@ -1,4 +1,5 @@ { "name": "Pleroma FE", - "theme": "base16-ashes.css" + "theme": "base16-ashes.css", + "background": "/static/bg.jpg" } -- cgit v1.2.3-70-g09d2 From ce5b3d4c924d6e94b6fbde3c50fdb209e4ec1fab Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Thu, 16 Feb 2017 17:44:36 +0100 Subject: Add logo. --- src/App.js | 1 + src/App.scss | 4 ++++ src/App.vue | 2 +- src/main.js | 3 ++- static/config.json | 3 ++- static/logo.png | Bin 0 -> 2411 bytes 6 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 static/logo.png (limited to 'src') diff --git a/src/App.js b/src/App.js index 736755ea..06634adb 100644 --- a/src/App.js +++ b/src/App.js @@ -19,6 +19,7 @@ export default { 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 } }, diff --git a/src/App.scss b/src/App.scss index c820779a..d39fc749 100644 --- a/src/App.scss +++ b/src/App.scss @@ -63,6 +63,10 @@ nav { align-items: center; flex-basis: 920px; margin: auto; + height: 50px; + background-repeat: no-repeat; + background-position: center; + background-size: contain; } } diff --git a/src/App.vue b/src/App.vue index d2b07d2b..a22307a6 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,7 +1,7 @@