pleroma-fe/src/components/user_reporting_modal/user_reporting_modal.vue

142 lines
3.2 KiB
Vue
Raw Normal View History

2019-03-19 09:53:11 +01:00
<template>
<div class="modal-view" @click="closeModal" v-if="isOpen">
<div class="user-reporting-panel panel" @click.stop="">
2019-03-20 17:51:43 +01:00
<div class="panel-heading">{{$t('user_reporting.title', [user.screen_name])}}</div>
2019-03-19 09:53:11 +01:00
<div class="panel-body">
<div class="user-reporting-panel-left">
<div>
2019-03-20 17:51:43 +01:00
<p>{{$t('user_reporting.add_comment_description')}}</p>
2019-03-19 09:53:11 +01:00
<textarea
v-model="comment"
class="form-control"
2019-03-20 17:51:43 +01:00
:placeholder="$t('user_reporting.additional_comments')"
2019-03-19 09:53:11 +01:00
rows="1"
@input="resize"
/>
</div>
<div v-if="!user.is_local">
2019-03-20 17:51:43 +01:00
<p>{{$t('user_reporting.forward_description')}}</p>
<Checkbox v-model="forward">{{$t('user_reporting.forward_to', [remoteInstance])}}</Checkbox>
2019-03-19 09:53:11 +01:00
</div>
<div>
2019-03-20 17:51:43 +01:00
<button class="btn btn-default" @click="reportUser" :disabled="processing">{{$t('user_reporting.submit')}}</button>
2019-03-20 17:37:13 +01:00
<div class="alert error" v-if="error">
2019-03-20 17:51:43 +01:00
{{$t('user_reporting.generic_error')}}
2019-03-20 17:37:13 +01:00
</div>
2019-03-19 09:53:11 +01:00
</div>
</div>
<div class="user-reporting-panel-right">
2019-03-22 19:19:50 +01:00
<div v-for="status in statuses" :key="status.id" class="status-fadein user-reporting-panel-sitem">
2019-03-19 09:53:11 +01:00
<Status :inConversation="false" :focused="false" :statusoid="status" />
<Checkbox :checked="isChecked(status.id)" @change="checked => toggleStatus(checked, status.id)" />
</div>
</div>
</div>
</div>
</div>
</template>
<script src="./user_reporting_modal.js"></script>
<style lang="scss">
@import '../../_variables.scss';
.user-reporting-panel {
width: 90vw;
max-width: 700px;
2019-03-22 19:19:50 +01:00
min-height: 20vh;
max-height: 80vh;
2019-03-19 09:53:11 +01:00
.panel-body {
display: flex;
2019-03-22 19:19:50 +01:00
flex-direction: column-reverse;
2019-03-19 09:53:11 +01:00
border-top: 1px solid;
border-color: $fallback--border;
border-color: var(--border, $fallback--border);
}
&-left {
2019-03-22 19:19:50 +01:00
padding: 1.1em 0.7em 0.7em;
2019-03-19 09:53:11 +01:00
line-height: 1.4em;
box-sizing: border-box;
> div {
2019-03-22 19:19:50 +01:00
margin-bottom: 1em;
2019-03-19 09:53:11 +01:00
&:last-child {
margin-bottom: 0;
}
}
p {
margin-top: 0;
}
textarea.form-control {
line-height: 16px;
resize: none;
overflow: hidden;
transition: min-height 200ms 100ms;
min-height: 44px;
width: 100%;
}
.btn {
min-width: 10em;
padding: 0 2em;
}
2019-03-20 17:37:13 +01:00
.alert {
margin: 1em 0 0 0;
2019-03-20 18:46:53 +01:00
line-height: 1.3em;
2019-03-20 17:37:13 +01:00
}
2019-03-19 09:53:11 +01:00
}
&-right {
overflow-y: auto;
overflow-x: hidden;
2019-03-22 19:19:50 +01:00
}
2019-03-19 09:53:11 +01:00
2019-03-22 19:19:50 +01:00
&-sitem {
display: flex;
justify-content: space-between;
border-bottom-width: 1px;
border-bottom-style: solid;
border-color: $fallback--border;
border-color: var(--border, $fallback--border);
> .status-el {
flex: 1;
}
> .checkbox {
margin: 0.75em;
}
}
@media all and (min-width: 801px) {
.panel-body {
flex-direction: row;
}
&-left {
width: 50%;
max-width: 320px;
border-right: 1px solid;
2019-03-19 09:53:11 +01:00
border-color: $fallback--border;
border-color: var(--border, $fallback--border);
2019-03-22 19:19:50 +01:00
padding: 1.1em;
2019-03-19 09:53:11 +01:00
2019-03-22 19:19:50 +01:00
> div {
margin-bottom: 2em;
2019-03-19 09:53:11 +01:00
}
}
2019-03-22 19:19:50 +01:00
&-right {
width: 50%;
flex: 1 1 auto;
}
2019-03-19 09:53:11 +01:00
}
}
</style>