Merge branch 'small-fixes-and-improvements' into shigusegubu-themes3
This commit is contained in:
commit
9f4e1d5363
11 changed files with 142 additions and 90 deletions
|
|
@ -54,7 +54,7 @@ export default {
|
|||
{
|
||||
variant: 'danger',
|
||||
directives: {
|
||||
background: '--cRed',
|
||||
background: '$blend(--cRed 0.25 --inheritedBackground)',
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
.inner-nav {
|
||||
display: grid;
|
||||
grid-template-rows: var(--navbar-height);
|
||||
grid-template-columns: 2fr auto 2fr;
|
||||
grid-template-columns: minmax(5em, 1fr) auto minmax(5em, 1fr);
|
||||
grid-template-areas: "sitename logo actions";
|
||||
box-sizing: border-box;
|
||||
padding: 0 1.2em;
|
||||
|
|
@ -31,7 +31,7 @@
|
|||
}
|
||||
|
||||
&.-logoLeft .inner-nav {
|
||||
grid-template-columns: auto 2fr 2fr;
|
||||
grid-template-columns: auto minmax(5em, 1fr) minmax(5em, 1fr);
|
||||
grid-template-areas: "logo sitename actions";
|
||||
}
|
||||
|
||||
|
|
@ -92,23 +92,18 @@
|
|||
|
||||
.actions {
|
||||
grid-area: actions;
|
||||
justify-content: flex-end;
|
||||
text-align: right;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.item {
|
||||
flex: 1;
|
||||
line-height: var(--navbar-height);
|
||||
height: var(--navbar-height);
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
||||
&.right {
|
||||
justify-content: flex-end;
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
|
||||
.spacer {
|
||||
width: 1em;
|
||||
min-width: 1em;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,48 +32,50 @@
|
|||
>
|
||||
</router-link>
|
||||
<div class="item right actions">
|
||||
<search-bar
|
||||
<SearchBar
|
||||
v-if="currentUser || !privateMode"
|
||||
@toggled="onSearchBarToggled"
|
||||
@click.stop
|
||||
/>
|
||||
<button
|
||||
class="button-unstyled nav-icon"
|
||||
:title="$t('nav.preferences')"
|
||||
@click.stop="openSettingsModal('user')"
|
||||
>
|
||||
<FAIcon
|
||||
fixed-width
|
||||
class="fa-scale-110 fa-old-padding"
|
||||
icon="cog"
|
||||
/>
|
||||
</button>
|
||||
<button
|
||||
v-if="currentUser && currentUser.role === 'admin'"
|
||||
class="button-unstyled nav-icon"
|
||||
target="_blank"
|
||||
:title="$t('nav.administration')"
|
||||
@click.stop="openSettingsModal('admin')"
|
||||
>
|
||||
<FAIcon
|
||||
fixed-width
|
||||
class="fa-scale-110 fa-old-padding"
|
||||
icon="tachometer-alt"
|
||||
/>
|
||||
</button>
|
||||
<span class="spacer" />
|
||||
<button
|
||||
v-if="currentUser"
|
||||
class="button-unstyled nav-icon"
|
||||
:title="$t('login.logout')"
|
||||
@click.stop.prevent="logout"
|
||||
>
|
||||
<FAIcon
|
||||
fixed-width
|
||||
class="fa-scale-110 fa-old-padding"
|
||||
icon="sign-out-alt"
|
||||
/>
|
||||
</button>
|
||||
<template v-if="searchBarHidden">
|
||||
<button
|
||||
class="button-unstyled nav-icon"
|
||||
:title="$t('nav.preferences')"
|
||||
@click.stop="openSettingsModal('user')"
|
||||
>
|
||||
<FAIcon
|
||||
fixed-width
|
||||
class="fa-scale-110 fa-old-padding"
|
||||
icon="cog"
|
||||
/>
|
||||
</button>
|
||||
<button
|
||||
v-if="currentUser && currentUser.role === 'admin'"
|
||||
class="button-unstyled nav-icon"
|
||||
target="_blank"
|
||||
:title="$t('nav.administration')"
|
||||
@click.stop="openSettingsModal('admin')"
|
||||
>
|
||||
<FAIcon
|
||||
fixed-width
|
||||
class="fa-scale-110 fa-old-padding"
|
||||
icon="tachometer-alt"
|
||||
/>
|
||||
</button>
|
||||
<span class="spacer" />
|
||||
<button
|
||||
v-if="currentUser"
|
||||
class="button-unstyled nav-icon"
|
||||
:title="$t('login.logout')"
|
||||
@click.stop.prevent="logout"
|
||||
>
|
||||
<FAIcon
|
||||
fixed-width
|
||||
class="fa-scale-110 fa-old-padding"
|
||||
icon="sign-out-alt"
|
||||
/>
|
||||
</button>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
<teleport to="#modal">
|
||||
|
|
|
|||
|
|
@ -1,16 +1,39 @@
|
|||
import Draft from 'src/components/draft/draft.vue'
|
||||
import List from 'src/components/list/list.vue'
|
||||
import ConfirmModal from 'src/components/confirm_modal/confirm_modal.vue'
|
||||
|
||||
const Drafts = {
|
||||
components: {
|
||||
Draft,
|
||||
List,
|
||||
ConfirmModal,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
showingConfirmDialog: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
drafts() {
|
||||
return this.$store.getters.draftsArray
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
abandonAll() {
|
||||
this.showingConfirmDialog = true
|
||||
},
|
||||
doAbandonAll() {
|
||||
this.drafts.forEach((draft) => {
|
||||
this.$store.dispatch('abandonDraft', { id: draft.id }).then(() => {
|
||||
this.hideConfirmDialog()
|
||||
})
|
||||
})
|
||||
this.hideConfirmDialog()
|
||||
},
|
||||
hideConfirmDialog() {
|
||||
this.showingConfirmDialog = false
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
export default Drafts
|
||||
|
|
|
|||
|
|
@ -13,36 +13,66 @@
|
|||
>
|
||||
{{ $t('drafts.no_drafts') }}
|
||||
</div>
|
||||
<List
|
||||
v-else
|
||||
:items="drafts"
|
||||
:non-interactive="true"
|
||||
>
|
||||
<template #item="{ item: draft }">
|
||||
<Draft
|
||||
class="draft"
|
||||
:draft="draft"
|
||||
/>
|
||||
</template>
|
||||
</List>
|
||||
<template v-else>
|
||||
<List
|
||||
:items="drafts"
|
||||
:non-interactive="true"
|
||||
>
|
||||
<template #item="{ item: draft }">
|
||||
<Draft
|
||||
class="draft"
|
||||
:draft="draft"
|
||||
/>
|
||||
</template>
|
||||
</List>
|
||||
<div class="remove-all">
|
||||
<button
|
||||
class="btn -danger button-default"
|
||||
@click="abandonAll"
|
||||
>
|
||||
{{ $t('drafts.clean_drafts') }}
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
<teleport to="#modal">
|
||||
<confirm-modal
|
||||
v-if="showingConfirmDialog"
|
||||
:confirm-danger="true"
|
||||
:title="$t('drafts.abandon_confirm_title')"
|
||||
:confirm-text="$t('drafts.abandon_confirm_accept_button')"
|
||||
:cancel-text="$t('drafts.abandon_confirm_cancel_button')"
|
||||
@accepted="doAbandonAll"
|
||||
@cancelled="hideConfirmDialog"
|
||||
>
|
||||
{{ $t('drafts.abandon_all_confirm') }}
|
||||
</confirm-modal>
|
||||
</teleport>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script src="./drafts.js"></script>
|
||||
|
||||
<style lang="scss">
|
||||
.draft {
|
||||
margin: 1em 0;
|
||||
}
|
||||
.Drafts {
|
||||
.draft {
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
.empty-drafs-list-alert {
|
||||
padding: 3em;
|
||||
font-size: 1.2em;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
color: var(--textFaint);
|
||||
.remove-all {
|
||||
margin: 1em;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.empty-drafs-list-alert {
|
||||
padding: 3em;
|
||||
font-size: 1.2em;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
color: var(--textFaint);
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -90,10 +90,10 @@
|
|||
}
|
||||
|
||||
.reply-or-quote-selector {
|
||||
flex-wrap: wrap;
|
||||
margin-bottom: 0.5em;
|
||||
gap: 1em;
|
||||
gap: 0 1em;
|
||||
display: flex;
|
||||
flex-wrap: wrap-reverse;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -112,6 +112,13 @@
|
|||
role="radiogroup"
|
||||
class="reply-or-quote-selector"
|
||||
>
|
||||
<Checkbox
|
||||
v-model="quoteThreadToggled"
|
||||
:radio="true"
|
||||
:disabled="quoteFormVisible"
|
||||
>
|
||||
{{ $t('post_status.quote_option') }}
|
||||
</Checkbox>
|
||||
<Checkbox
|
||||
role="radio"
|
||||
:radio="true"
|
||||
|
|
@ -120,13 +127,6 @@
|
|||
>
|
||||
{{ $t('post_status.reply_option') }}
|
||||
</Checkbox>
|
||||
<Checkbox
|
||||
v-model="quoteThreadToggled"
|
||||
:radio="true"
|
||||
:disabled="quoteFormVisible"
|
||||
>
|
||||
{{ $t('post_status.quote_option') }}
|
||||
</Checkbox>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
|
|
|
|||
|
|
@ -51,8 +51,6 @@
|
|||
class="cancel-icon fa-scale-110 fa-old-padding"
|
||||
/>
|
||||
</button>
|
||||
<span class="spacer" />
|
||||
<span class="spacer" />
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
|
@ -61,18 +59,14 @@
|
|||
|
||||
<style lang="scss">
|
||||
.SearchBar {
|
||||
display: inline-flex;
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
vertical-align: baseline;
|
||||
justify-content: flex-end;
|
||||
|
||||
&.-expanded {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.search-bar-input,
|
||||
.search-button {
|
||||
height: 29px;
|
||||
height: 2em;
|
||||
}
|
||||
|
||||
.search-bar-input {
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@
|
|||
align-self: stretch;
|
||||
width: 1px;
|
||||
background-color: var(--icon);
|
||||
opacity: 0.75;
|
||||
margin: 0.5em 0;
|
||||
}
|
||||
|
||||
|
|
@ -84,7 +85,7 @@
|
|||
&.-with-extra {
|
||||
.action-button-inner,
|
||||
.extra-button {
|
||||
padding-left: 0.2em;
|
||||
padding-left: 0.25em;
|
||||
padding-right: 0.25em;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1884,6 +1884,7 @@
|
|||
"drafts": {
|
||||
"drafts": "Drafts",
|
||||
"no_drafts": "You have no drafts",
|
||||
"clean_drafts": "Remove all drafts",
|
||||
"empty": "(No content)",
|
||||
"poll_tooltip": "Draft contains a poll",
|
||||
"continue": "Continue composing",
|
||||
|
|
@ -1893,6 +1894,7 @@
|
|||
"abandon_confirm": "Do you really want to abandon this draft?",
|
||||
"abandon_confirm_accept_button": "Abandon",
|
||||
"abandon_confirm_cancel_button": "Keep",
|
||||
"abandon_all_confirm": "Do you really want to abandon all drafts?",
|
||||
"replying": "Replying to {statusLink}",
|
||||
"editing": "Editing {statusLink}",
|
||||
"unavailable": "(unavailable)"
|
||||
|
|
|
|||
|
|
@ -499,7 +499,12 @@ export const init = ({
|
|||
}),
|
||||
)
|
||||
const lastVariantRule = variantRules[variantRules.length - 1]
|
||||
if (lastVariantRule) {
|
||||
const lastVariantSelector = ruleToSelector(
|
||||
lastVariantRule,
|
||||
true,
|
||||
)
|
||||
|
||||
if (lastVariantRule && lastVariantSelector !== selector) {
|
||||
inheritRule = lastVariantRule
|
||||
} else {
|
||||
const normalRules = ruleset.filter(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue