Update components
This commit is contained in:
parent
552e950d7a
commit
4ad573c8de
2 changed files with 107 additions and 10 deletions
|
@ -12,6 +12,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-else-if="page == 'cameraRoll'">
|
<div v-else-if="page == 'cameraRoll'">
|
||||||
<div class="card status-card card-md-rounded-0" style="display:flex;">
|
<div class="card status-card card-md-rounded-0" style="display:flex;">
|
||||||
<div class="card-header d-inline-flex align-items-center justify-content-between bg-white">
|
<div class="card-header d-inline-flex align-items-center justify-content-between bg-white">
|
||||||
|
@ -42,6 +43,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<div class="card status-card card-md-rounded-0 w-100 h-100" style="display:flex;">
|
<div class="card status-card card-md-rounded-0 w-100 h-100" style="display:flex;">
|
||||||
<div class="card-header d-inline-flex align-items-center justify-content-between bg-white">
|
<div class="card-header d-inline-flex align-items-center justify-content-between bg-white">
|
||||||
|
@ -91,8 +93,21 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body p-0 border-top">
|
<div class="card-body p-0 border-top">
|
||||||
|
<div v-if="page == 'licensePicker'" class="w-100 h-100" style="min-height: 280px;">
|
||||||
|
<div class="list-group list-group-flush">
|
||||||
|
<div
|
||||||
|
v-for="(item, index) in availableLicenses"
|
||||||
|
class="list-group-item cursor-pointer"
|
||||||
|
:class="{
|
||||||
|
'text-primary': licenseIndex === index,
|
||||||
|
'font-weight-bold': licenseIndex === index
|
||||||
|
}"
|
||||||
|
@click="toggleLicense(index)">
|
||||||
|
{{item.name}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div v-if="page == 'textOptions'" class="w-100 h-100" style="min-height: 280px;">
|
<div v-if="page == 'textOptions'" class="w-100 h-100" style="min-height: 280px;">
|
||||||
test
|
|
||||||
</div>
|
</div>
|
||||||
<div v-if="page == 'addText'" class="w-100 h-100" style="min-height: 280px;">
|
<div v-if="page == 'addText'" class="w-100 h-100" style="min-height: 280px;">
|
||||||
<div class="mt-2">
|
<div class="mt-2">
|
||||||
|
@ -315,7 +330,10 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="border-bottom">
|
<div class="border-bottom">
|
||||||
<p class="px-4 mb-0 py-2 cursor-pointer" @click="showTagCard()">Tag people <span class="ml-2 badge badge-primary">NEW</span></p>
|
<p class="px-4 mb-0 py-2 cursor-pointer" @click="showTagCard()">Tag people</p>
|
||||||
|
</div>
|
||||||
|
<div class="border-bottom">
|
||||||
|
<p class="px-4 mb-0 py-2 cursor-pointer" @click="showLicenseCard()">Add license <span class="ml-2 badge badge-primary">NEW</span></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="border-bottom">
|
<div class="border-bottom">
|
||||||
<p class="px-4 mb-0 py-2 cursor-pointer" @click="showLocationCard()" v-if="!place">Add location</p>
|
<p class="px-4 mb-0 py-2 cursor-pointer" @click="showLocationCard()" v-if="!place">Add location</p>
|
||||||
|
@ -565,11 +583,19 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="font-weight-bold text-muted small">License</label>
|
<label class="font-weight-bold text-muted small">License</label>
|
||||||
<input type="text" class="form-control" v-model="media[carouselCursor].license" placeholder="All Rights Reserved (Default license)">
|
<!-- <input type="text" class="form-control" v-model="media[carouselCursor].license" placeholder="All Rights Reserved (Default license)"> -->
|
||||||
<p class="help-text small text-muted mb-0 d-flex justify-content-between">
|
<!-- <p class="help-text small text-muted mb-0 d-flex justify-content-between">
|
||||||
<span></span>
|
<span></span>
|
||||||
<span>{{media[carouselCursor].license ? media[carouselCursor].license.length : 0}}/140</span>
|
<span>{{media[carouselCursor].license ? media[carouselCursor].license.length : 0}}/140</span>
|
||||||
</p>
|
</p> -->
|
||||||
|
<select class="form-control" v-model="licenseIndex">
|
||||||
|
<option
|
||||||
|
v-for="(item, index) in availableLicenses"
|
||||||
|
:value="index"
|
||||||
|
:selected="index === licenseIndex">
|
||||||
|
{{item.name}}
|
||||||
|
</option>
|
||||||
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -707,7 +733,8 @@ export default {
|
||||||
'editMedia',
|
'editMedia',
|
||||||
'cameraRoll',
|
'cameraRoll',
|
||||||
'tagPeopleHelp',
|
'tagPeopleHelp',
|
||||||
'textOptions'
|
'textOptions',
|
||||||
|
'licensePicker'
|
||||||
],
|
],
|
||||||
cameraRollMedia: [],
|
cameraRollMedia: [],
|
||||||
taggedUsernames: [],
|
taggedUsernames: [],
|
||||||
|
@ -744,7 +771,46 @@ export default {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
availableLicenses: [
|
||||||
|
{
|
||||||
|
id: 1,
|
||||||
|
name: "All Rights Reserved"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 5,
|
||||||
|
name: "Public Domain Work"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 6,
|
||||||
|
name: "Public Domain Dedication (CC0)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 11,
|
||||||
|
name: "Attribution"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 12,
|
||||||
|
name: "Attribution-ShareAlike"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 13,
|
||||||
|
name: "Attribution-NonCommercial"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 14,
|
||||||
|
name: "Attribution-NonCommercial-ShareAlike"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 15,
|
||||||
|
name: "Attribution-NoDerivs"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 16,
|
||||||
|
name: "Attribution-NonCommercial-NoDerivs"
|
||||||
}
|
}
|
||||||
|
],
|
||||||
|
licenseIndex: 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -934,7 +1000,8 @@ export default {
|
||||||
comments_disabled: this.commentsDisabled,
|
comments_disabled: this.commentsDisabled,
|
||||||
place: this.place,
|
place: this.place,
|
||||||
tagged: this.taggedUsernames,
|
tagged: this.taggedUsernames,
|
||||||
optimize_media: this.optimizeMedia
|
optimize_media: this.optimizeMedia,
|
||||||
|
license: this.availableLicenses[this.licenseIndex].id
|
||||||
};
|
};
|
||||||
axios.post('/api/compose/v0/publish', data)
|
axios.post('/api/compose/v0/publish', data)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
|
@ -1026,6 +1093,10 @@ export default {
|
||||||
this.showTagCard();
|
this.showTagCard();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'licensePicker':
|
||||||
|
this.page = 3;
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
this.namedPages.indexOf(this.page) != -1 ?
|
this.namedPages.indexOf(this.page) != -1 ?
|
||||||
this.page = (this.textMode ? 'addText' : 3) :
|
this.page = (this.textMode ? 'addText' : 3) :
|
||||||
|
@ -1270,7 +1341,18 @@ export default {
|
||||||
showTextOptions() {
|
showTextOptions() {
|
||||||
this.page = 'textOptions';
|
this.page = 'textOptions';
|
||||||
this.pageTitle = 'Text Post Options';
|
this.pageTitle = 'Text Post Options';
|
||||||
}
|
},
|
||||||
|
|
||||||
|
showLicenseCard() {
|
||||||
|
this.pageTitle = 'Select a License';
|
||||||
|
this.page = 'licensePicker';
|
||||||
|
},
|
||||||
|
|
||||||
|
toggleLicense(index) {
|
||||||
|
this.licenseIndex = index;
|
||||||
|
this.pageTitle = '';
|
||||||
|
this.page = 3;
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
|
@ -22,7 +22,7 @@
|
||||||
:alt="altText(status)"/>
|
:alt="altText(status)"/>
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<div :title="status.media_attachments[0].description">
|
<div :title="status.media_attachments[0].description" style="position: relative;">
|
||||||
<img class="card-img-top"
|
<img class="card-img-top"
|
||||||
:src="status.media_attachments[0].url"
|
:src="status.media_attachments[0].url"
|
||||||
loading="lazy"
|
loading="lazy"
|
||||||
|
@ -30,6 +30,21 @@
|
||||||
:width="width()"
|
:width="width()"
|
||||||
:height="height()"
|
:height="height()"
|
||||||
onerror="this.onerror=null;this.src='/storage/no-preview.png'">
|
onerror="this.onerror=null;this.src='/storage/no-preview.png'">
|
||||||
|
|
||||||
|
<p
|
||||||
|
v-if="status.media_attachments[0].license"
|
||||||
|
style="
|
||||||
|
margin-bottom: 0;
|
||||||
|
padding: 0 5px;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 10px;
|
||||||
|
text-align: right;
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
right: 0;
|
||||||
|
border-top-left-radius: 5px;
|
||||||
|
background: linear-gradient(0deg, rgba(0,0,0,0.5), rgba(0,0,0,0.5));
|
||||||
|
"><a :href="status.url" class="font-weight-bold text-light">Photo</a> by <a :href="status.account.url" class="font-weight-bold text-light">@{{status.account.username}}</a> licensed under <a :href="status.media_attachments[0].license.url" class="font-weight-bold text-light">{{status.media_attachments[0].license.title}}</a></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue