From 06021f4971a41b47cbd7c630ae52f94cc57eaa25 Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Thu, 16 Feb 2017 12:51:08 +0100 Subject: Add .node-version --- .node-version | 1 + 1 file changed, 1 insertion(+) create mode 100644 .node-version diff --git a/.node-version b/.node-version new file mode 100644 index 00000000..b26a34e4 --- /dev/null +++ b/.node-version @@ -0,0 +1 @@ +7.2.1 -- cgit v1.2.3-70-g09d2 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 ++++-- test/unit/specs/modules/statuses.spec.js | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) 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 } diff --git a/test/unit/specs/modules/statuses.spec.js b/test/unit/specs/modules/statuses.spec.js index c130cbf3..b1581e03 100644 --- a/test/unit/specs/modules/statuses.spec.js +++ b/test/unit/specs/modules/statuses.spec.js @@ -79,6 +79,24 @@ describe('The Statuses module', () => { expect(state.timelines.public.newStatusCount).to.equal(1) }) + it('counts the status as new if it has not been seen on this timeline', () => { + const state = cloneDeep(defaultState) + const status = makeMockStatus({id: 1}) + + mutations.addNewStatuses(state, { statuses: [status], timeline: 'public' }) + mutations.addNewStatuses(state, { statuses: [status], timeline: 'friends' }) + + expect(state.allStatuses).to.eql([status]) + expect(state.timelines.public.statuses).to.eql([status]) + expect(state.timelines.public.visibleStatuses).to.eql([]) + expect(state.timelines.public.newStatusCount).to.equal(1) + + expect(state.allStatuses).to.eql([status]) + expect(state.timelines.friends.statuses).to.eql([status]) + expect(state.timelines.friends.visibleStatuses).to.eql([]) + expect(state.timelines.friends.newStatusCount).to.equal(1) + }) + it('add the statuses to allStatuses if no timeline is given', () => { const state = cloneDeep(defaultState) const status = makeMockStatus({id: 1}) -- cgit v1.2.3-70-g09d2 From 8aea3949807ce8aa5a3b06a7be1a503b639e6a9b Mon Sep 17 00:00:00 2001 From: lambadalambda Date: Thu, 16 Feb 2017 07:44:09 -0500 Subject: Update .gitlab-ci.yml --- .gitlab-ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fbe1f599..9561e061 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,7 @@ # This file is a template, and might need editing before it works on your project. # Official framework image. Look for the different tagged releases at: # https://hub.docker.com/r/library/node/tags/ -image: node:6 +image: node:7 before_script: # Install ssh-agent if not already installed, it is required by Docker. @@ -45,6 +45,7 @@ deploy: only: - develop script: - - npm install + - npm install -g yarn + - yarn - npm run build - scp -r dist/* pleroma@tenshi.heldscal.la:~/pleroma -- cgit v1.2.3-70-g09d2 From 2203585a79217e371150a4deb05c6a006a3206a8 Mon Sep 17 00:00:00 2001 From: lambadalambda Date: Thu, 16 Feb 2017 07:48:36 -0500 Subject: Update .gitlab-ci.yml --- .gitlab-ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9561e061..c05e34f4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -29,12 +29,14 @@ cache: test: script: - - npm install + - npm install -g yarn + - yarn - npm run unit build: script: - - npm install + - npm install -g yarn + - yarn - npm run build artifacts: paths: -- 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(-) 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(-) 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 d7c9261dab6ad2cfedd4042ddd595cd3efee542d Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Thu, 16 Feb 2017 16:07:07 +0100 Subject: Prevent FOUC. --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 52216b15..668b21bb 100644 --- a/index.html +++ b/index.html @@ -7,7 +7,7 @@ - +
-- 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 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 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 @@