aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHJ <30-hj@users.noreply.git.pleroma.social>2019-07-06 20:43:38 +0000
committerHJ <30-hj@users.noreply.git.pleroma.social>2019-07-06 20:43:38 +0000
commit8f5379642029f730aa3d905c6980433c6c901486 (patch)
tree2888a000a85d77c221a61bac44e2b246b2f068ff
parent8d6750d9c2816e33a0444cd978f94009d8b85d47 (diff)
parent60b413d02c4be5b3f24ff984e43090620d9a59e1 (diff)
Merge branch 'develop' into 'eslint-fix'
# Conflicts: # src/components/post_status_form/post_status_form.vue
-rw-r--r--src/components/post_status_form/post_status_form.vue166
-rw-r--r--src/components/timeline/timeline.js2
-rw-r--r--src/components/user_profile/user_profile.js2
-rw-r--r--src/i18n/oc.json44
-rw-r--r--src/modules/statuses.js5
-rw-r--r--test/unit/specs/modules/statuses.spec.js4
6 files changed, 64 insertions, 159 deletions
diff --git a/src/components/post_status_form/post_status_form.vue b/src/components/post_status_form/post_status_form.vue
index bc63d90f..8ffacd75 100644
--- a/src/components/post_status_form/post_status_form.vue
+++ b/src/components/post_status_form/post_status_form.vue
@@ -58,150 +58,30 @@
<span v-if="safeDMEnabled">{{ $t('post_status.direct_warning_to_first_only') }}</span>
<span v-else>{{ $t('post_status.direct_warning_to_all') }}</span>
</p>
- <EmojiInput
- v-if="newStatus.spoilerText || alwaysShowSubject"
- v-model="newStatus.spoilerText"
- :suggest="emojiSuggestor"
- class="form-control"
- >
- <input
-
- v-model="newStatus.spoilerText"
- type="text"
- :placeholder="$t('post_status.content_warning')"
- class="form-post-subject"
- >
- </EmojiInput>
- <EmojiInput
- v-model="newStatus.status"
- :suggest="emojiUserSuggestor"
- class="form-control main-input"
- >
- <textarea
- ref="textarea"
- v-model="newStatus.status"
- :placeholder="$t('post_status.default')"
- rows="1"
- :disabled="posting"
- class="form-post-body"
- @keydown.meta.enter="postStatus(newStatus)"
- @keyup.ctrl.enter="postStatus(newStatus)"
- @drop="fileDrop"
- @dragover.prevent="fileDrag"
- @input="resize"
- @paste="paste"
- />
- <p
- v-if="hasStatusLengthLimit"
- class="character-counter faint"
- :class="{ error: isOverLengthLimit }"
- >
- {{ charactersLeft }}
- </p>
- </EmojiInput>
- <div class="visibility-tray">
- <div
- v-if="postFormats.length > 1"
- class="text-format"
- >
- <label
- for="post-content-type"
- class="select"
- >
- <select
- id="post-content-type"
- v-model="newStatus.contentType"
- class="form-control"
- >
- <option
- v-for="postFormat in postFormats"
- :key="postFormat"
- :value="postFormat"
- >
- {{ $t(`post_status.content_type["${postFormat}"]`) }}
- </option>
- </select>
- <i class="icon-down-open" />
- </label>
- </div>
- <div
- v-if="postFormats.length === 1"
- class="text-format"
- >
- <span class="only-format">
- {{ $t(`post_status.content_type["${postFormats[0]}"]`) }}
- </span>
- </div>
-
- <scope-selector
- :show-all="showAllScopes"
- :user-default="userDefaultScope"
- :original-scope="copyMessageScope"
- :initial-scope="newStatus.visibility"
- :on-scope-change="changeVis"
- />
+ </EmojiInput>
+ <div class="visibility-tray">
+ <scope-selector
+ :showAll="showAllScopes"
+ :userDefault="userDefaultScope"
+ :originalScope="copyMessageScope"
+ :initialScope="newStatus.visibility"
+ :onScopeChange="changeVis"/>
+
+ <div class="text-format" v-if="postFormats.length > 1">
+ <label for="post-content-type" class="select">
+ <select id="post-content-type" v-model="newStatus.contentType" class="form-control">
+ <option v-for="postFormat in postFormats" :key="postFormat" :value="postFormat">
+ {{$t(`post_status.content_type["${postFormat}"]`)}}
+ </option>
+ </select>
+ <i class="icon-down-open"></i>
+ </label>
</div>
- </div>
- <poll-form
- v-if="pollsAvailable"
- ref="pollForm"
- :visible="pollFormVisible"
- @update-poll="setPoll"
- />
- <div class="form-bottom">
- <div class="form-bottom-left">
- <media-upload
- ref="mediaUpload"
- :drop-files="dropFiles"
- @uploading="disableSubmit"
- @uploaded="addMediaFile"
- @upload-failed="uploadFailed"
- />
- <div
- v-if="pollsAvailable"
- class="poll-icon"
- >
- <i
- :title="$t('polls.add_poll')"
- class="icon-chart-bar btn btn-default"
- :class="pollFormVisible && 'selected'"
- @click="togglePollForm"
- />
- </div>
+ <div class="text-format" v-if="postFormats.length === 1 && postFormats[0] !== 'text/plain'">
+ <span class="only-format">
+ {{$t(`post_status.content_type["${postFormats[0]}"]`)}}
+ </span>
</div>
-
- <button
- v-if="posting"
- disabled
- class="btn btn-default"
- >
- {{ $t('post_status.posting') }}
- </button>
- <button
- v-else-if="isOverLengthLimit"
- disabled
- class="btn btn-default"
- >
- {{ $t('general.submit') }}
- </button>
- <button
- v-else
- :disabled="submitDisabled"
- type="submit"
- class="btn btn-default"
- >
- {{ $t('general.submit') }}
- </button>
- </div>
- <div
- v-if="error"
- class="alert error"
- >
- Error: {{ error }}
- <i
- class="button-icon icon-cancel"
- @click="clearError"
- />
</div>
<div class="attachments">
<div
@@ -276,7 +156,6 @@
.visibility-tray {
display: flex;
justify-content: space-between;
- flex-direction: row-reverse;
padding-top: 5px;
}
}
@@ -324,6 +203,7 @@
cursor: pointer;
}
+
.error {
text-align: center;
}
diff --git a/src/components/timeline/timeline.js b/src/components/timeline/timeline.js
index 791a8e45..5e24bd15 100644
--- a/src/components/timeline/timeline.js
+++ b/src/components/timeline/timeline.js
@@ -86,7 +86,7 @@ const Timeline = {
if (this.newStatusCount === 0) return
if (this.timeline.flushMarker !== 0) {
- this.$store.commit('clearTimeline', { timeline: this.timelineName })
+ this.$store.commit('clearTimeline', { timeline: this.timelineName, excludeUserId: true })
this.$store.commit('queueFlush', { timeline: this.timelineName, id: 0 })
this.fetchOlderStatuses()
} else {
diff --git a/src/components/user_profile/user_profile.js b/src/components/user_profile/user_profile.js
index eab330e7..7eb4ed3a 100644
--- a/src/components/user_profile/user_profile.js
+++ b/src/components/user_profile/user_profile.js
@@ -31,6 +31,8 @@ const UserProfile = {
}
},
created () {
+ // Make sure that timelines used in this page are empty
+ this.cleanUp()
const routeParams = this.$route.params
this.load(routeParams.name || routeParams.id)
},
diff --git a/src/i18n/oc.json b/src/i18n/oc.json
index ec7f5740..6100a4d2 100644
--- a/src/i18n/oc.json
+++ b/src/i18n/oc.json
@@ -78,6 +78,20 @@
"repeated_you": "a repetit vòstre estatut",
"no_more_notifications": "Pas mai de notificacions"
},
+ "polls": {
+"add_poll": "Ajustar un sondatge",
+ "add_option": "Ajustar d’opcions",
+ "option": "Opcion",
+ "votes": "vòtes",
+ "vote": "Votar",
+ "type": "Tipe de sondatge",
+ "single_choice": "Causida unica",
+ "multiple_choices": "Causida multipla",
+ "expiry": "Durada del sondatge",
+ "expires_in": "Lo sondatge s’acabarà {0}",
+ "expired": "Sondatge acabat {0}",
+ "not_enough_options": "I a pas pro d’opcions"
+ },
"post_status": {
"new_status": "Publicar d’estatuts novèls",
"account_not_locked_warning": "Vòstre compte es pas {0}. Qual que siá pòt vos seguir per veire vòstras publicacions destinadas pas qu’a vòstres seguidors.",
@@ -197,6 +211,7 @@
"loop_video": "Bocla vidèo",
"loop_video_silent_only": "Legir en bocla solament las vidèos sens son (coma los « Gifs » de Mastodon)",
"mutes_tab": "Agamats",
+ "interactions_tab": "Interaccions",
"play_videos_in_modal": "Legir las vidèos dirèctament dins la visualizaira mèdia",
"use_contain_fit": "Talhar pas las pèças juntas per las vinhetas",
"name": "Nom",
@@ -264,8 +279,15 @@
"false": "non",
"true": "òc"
},
- "notifications": "Notificacions",
- "enable_web_push_notifications": "Activar las notificacions web push",
+ "notifications": "Notificacions",
+ "notification_setting": "Receber las notificacions de :",
+ "notification_setting_follows": "Utilizaires que seguissètz",
+ "notification_setting_non_follows": "Utilizaires que seguissètz pas",
+ "notification_setting_followers": "Utilizaires que vos seguisson",
+ "notification_setting_non_followers": "Utilizaires que vos seguisson pas",
+ "notification_mutes": "Per receber pas mai d’un utilizaire en particular, botatz-lo en silenci.",
+ "notification_blocks": "Blocar un utilizaire arrèsta totas las notificacions tan coma quitar de los seguir.",
+ "enable_web_push_notifications": "Activar las notificacions web push",
"style": {
"switcher": {
"keep_color": "Gardar las colors",
@@ -386,14 +408,14 @@
"days": "{0} jorns",
"day_short": "{0} jorn",
"days_short": "{0} jorns",
- "hour": "{0} hour",
- "hours": "{0} hours",
+ "hour": "{0} ora",
+ "hours": "{0} oras",
"hour_short": "{0}h",
"hours_short": "{0}h",
- "in_future": "in {0}",
+ "in_future": "d’aquí {0}",
"in_past": "fa {0}",
- "minute": "{0} minute",
- "minutes": "{0} minutes",
+ "minute": "{0} minuta",
+ "minutes": "{0} minutas",
"minute_short": "{0}min",
"minutes_short": "{0}min",
"month": "{0} mes",
@@ -402,12 +424,12 @@
"months_short": "{0} meses",
"now": "ara meteis",
"now_short": "ara meteis",
- "second": "{0} second",
- "seconds": "{0} seconds",
+ "second": "{0} segonda",
+ "seconds": "{0} segondas",
"second_short": "{0}s",
"seconds_short": "{0}s",
- "week": "{0} setm.",
- "weeks": "{0} setm.",
+ "week": "{0} setmana.",
+ "weeks": "{0} setmanas.",
"week_short": "{0} setm.",
"weeks_short": "{0} setm.",
"year": "{0} an",
diff --git a/src/modules/statuses.js b/src/modules/statuses.js
index e00293c1..cf65c9f4 100644
--- a/src/modules/statuses.js
+++ b/src/modules/statuses.js
@@ -395,8 +395,9 @@ export const mutations = {
state[key] = value
})
},
- clearTimeline (state, { timeline }) {
- state.timelines[timeline] = emptyTl(state.timelines[timeline].userId)
+ clearTimeline (state, { timeline, excludeUserId = false }) {
+ const userId = excludeUserId ? state.timelines[timeline].userId : undefined
+ state.timelines[timeline] = emptyTl(userId)
},
clearNotifications (state) {
state.notifications = emptyNotifications()
diff --git a/test/unit/specs/modules/statuses.spec.js b/test/unit/specs/modules/statuses.spec.js
index ba93138f..f794997b 100644
--- a/test/unit/specs/modules/statuses.spec.js
+++ b/test/unit/specs/modules/statuses.spec.js
@@ -258,11 +258,11 @@ describe('Statuses module', () => {
})
describe('clearTimeline', () => {
- it('keeps userId when clearing user timeline', () => {
+ it('keeps userId when clearing user timeline when excludeUserId param is true', () => {
const state = defaultState()
state.timelines.user.userId = 123
- mutations.clearTimeline(state, { timeline: 'user' })
+ mutations.clearTimeline(state, { timeline: 'user', excludeUserId: true })
expect(state.timelines.user.userId).to.eql(123)
})