1
0
Fork 0
mirror of https://github.com/TryGhost/Ghost-Admin.git synced 2023-12-14 02:33:04 +01:00

Updated Portal links design

no refs.
- in Portal settings domain and the path are separated visually so that it conveys the concept of using the relative URL instead of absolute
- for similar reasons, copy link copies only the path part
This commit is contained in:
Peter Zimon 2020-10-12 13:56:37 +02:00
parent 2b1bf70b91
commit 09bced72bb
4 changed files with 109 additions and 40 deletions

View file

@ -15,9 +15,15 @@
<tr>
<td class="pagename">Default</td>
<td class='page-url'>
<div class="page-url-container">
<input class="gh-input" value={{if isLink (concat this.siteUrl '/#/portal') 'data-portal'}} disabled="disabled" />
<button type="button" {{action (perform this.copyDefault (if isLink (concat this.siteUrl '/#/portal') 'data-portal'))}} class="gh-portal-setting-copy">
<div class="gh-portal-page-url-container">
<div class="page-url-label">
{{#if isLink}}
<span class="page-url-disabled">{{this.siteUrl}}/</span><span>#/portal</span>
{{else}}
data-portal
{{/if}}
</div>
<button type="button" {{action (perform this.copyDefault (if isLink '/#/portal' 'data-portal'))}} class="gh-portal-setting-copy">
{{#if this.copyDefault.isRunning}}
{{svg-jar "check-circle" class="w3 v-mid mr2 stroke-darkgrey"}} Copied
{{else}}
@ -30,9 +36,15 @@
<tr>
<td class='pagename'>Sign up</td>
<td class='page-url'>
<div class="page-url-container">
<input class="gh-input" value={{if isLink (concat this.siteUrl '/#/portal/signup') 'data-portal="signup"'}} disabled="disabled" />
<button type="button" {{action (perform this.copySignup (if isLink (concat this.siteUrl '/#/portal/signup') 'data-portal="signup"'))}} class="gh-portal-setting-copy">
<div class="gh-portal-page-url-container">
<div class="page-url-label">
{{#if isLink}}
<span class="page-url-disabled">{{this.siteUrl}}/</span><span>#/portal/signup</span>
{{else}}
data-portal="signup"
{{/if}}
</div>
<button type="button" {{action (perform this.copySignup (if isLink '/#/portal/signup' 'data-portal="signup"'))}} class="gh-portal-setting-copy">
{{#if this.copySignup.isRunning}}
{{svg-jar "check-circle" class="w3 v-mid mr2 stroke-darkgrey"}} Copied
{{else}}
@ -45,9 +57,15 @@
<tr>
<td class='pagename'>Sign in</td>
<td class='page-url'>
<div class="page-url-container">
<input class="gh-input" value={{if isLink (concat this.siteUrl '/#/portal/signin') 'data-portal="signin"'}} disabled="disabled" />
<button type="button" {{action (perform this.copySignin (if isLink (concat this.siteUrl '/#/portal/signin') 'data-portal="signin"'))}} class="gh-portal-setting-copy">
<div class="gh-portal-page-url-container">
<div class="page-url-label">
{{#if isLink}}
<span class="page-url-disabled">{{this.siteUrl}}/</span><span>#/portal/signin</span>
{{else}}
data-portal="signin"
{{/if}}
</div>
<button type="button" {{action (perform this.copySignin (if isLink '/#/portal/signin' 'data-portal="signin"'))}} class="gh-portal-setting-copy">
{{#if this.copySignin.isRunning}}
{{svg-jar "check-circle" class="w3 v-mid mr2 stroke-darkgrey"}} Copied
{{else}}
@ -60,9 +78,15 @@
<tr>
<td class='pagename'>Account home</td>
<td class='page-url'>
<div class="page-url-container">
<input class="gh-input" value={{if isLink (concat this.siteUrl '/#/portal/account') 'data-portal="account"'}} disabled="disabled" />
<button type="button" {{action (perform this.copyAccountHome (if isLink (concat this.siteUrl '/#/portal/account') 'data-portal="account"'))}} class="gh-portal-setting-copy">
<div class="gh-portal-page-url-container">
<div class="page-url-label">
{{#if isLink}}
<span class="page-url-disabled">{{this.siteUrl}}/</span><span>#/portal/account</span>
{{else}}
data-portal="account"
{{/if}}
</div>
<button type="button" {{action (perform this.copyAccountHome (if isLink '/#/portal/account' 'data-portal="account"'))}} class="gh-portal-setting-copy">
{{#if this.copyAccountHome.isRunning}}
{{svg-jar "check-circle" class="w3 v-mid mr2 stroke-darkgrey"}} Copied
{{else}}
@ -75,9 +99,15 @@
<tr>
<td class='pagename'>Account/Plans</td>
<td class='page-url'>
<div class="page-url-container">
<input class="gh-input" value={{if isLink (concat this.siteUrl '/#/portal/account/plans') 'data-portal="account/plans"'}} disabled="disabled" />
<button type="button" {{action (perform this.copyAccountPlans (if isLink (concat this.siteUrl '/#/portal/account/plans') 'data-portal="account/plans"'))}} class="gh-portal-setting-copy">
<div class="gh-portal-page-url-container">
<div class="page-url-label">
{{#if isLink}}
<span class="page-url-disabled">{{this.siteUrl}}/</span><span>#/portal/account/plans</span>
{{else}}
data-portal="account/plans"
{{/if}}
</div>
<button type="button" {{action (perform this.copyAccountPlans (if isLink '/#/portal/account/plans' 'data-portal="account/plans"'))}} class="gh-portal-setting-copy">
{{#if this.copyAccountPlans.isRunning}}
{{svg-jar "check-circle" class="w3 v-mid mr2 stroke-darkgrey"}} Copied
{{else}}
@ -90,9 +120,15 @@
<tr>
<td class='pagename'>Account/Profile</td>
<td class='page-url'>
<div class="page-url-container">
<input class="gh-input" value={{if isLink (concat this.siteUrl '/#/portal/account/profile') 'data-portal="account/profile"'}} disabled="disabled" />
<button type="button" {{action (perform this.copyAccountProfile (if isLink (concat this.siteUrl '/#/portal/account/profile') 'data-portal="account/profile"'))}} class="gh-portal-setting-copy">
<div class="gh-portal-page-url-container">
<div class="page-url-label">
{{#if isLink}}
<span class="page-url-disabled">{{this.siteUrl}}/</span><span>#/portal/account/profile</span>
{{else}}
data-portal="account/profile"
{{/if}}
</div>
<button type="button" {{action (perform this.copyAccountProfile (if isLink '/#/portal/account/profile' 'data-portal="account/profile"'))}} class="gh-portal-setting-copy">
{{#if this.copyAccountProfile.isRunning}}
{{svg-jar "check-circle" class="w3 v-mid mr2 stroke-darkgrey"}} Copied
{{else}}

View file

@ -254,18 +254,22 @@
<div {{action (toggle "isShowModalLink" this)}} class="blue pointer f8"> {{if this.isShowModalLink "Data Attribute" "Link"}} </div>
</div>
<div class="flex items-center justify-center mt1 gh-show-modal-link-form relative">
<GhTextInput
@value={{this.showModalLinkOrAttribute}}
@type="text"
@disabled={{true}}
/>
<button type="button" {{action (perform this.copyLinkOrAttribute)}} class="gh-portal-setting-copy">
{{#if this.copyLinkOrAttribute.isRunning}}
{{svg-jar "check-circle" class="w4 v-mid mr1 stroke-darkgrey"}} Copied
{{else}}
<span data-tooltip="Copy">{{svg-jar "copy" class="w4 v-mid fill-darkgrey"}}</span>
{{/if}}
</button>
<div class="gh-portal-page-url-container">
<div class="page-url-label">
{{#if this.isShowModalLink}}
<span class="page-url-disabled">{{this.siteUrl}}/</span><span>{{this.showModalLinkOrAttribute}}</span>
{{else}}
{{this.showModalLinkOrAttribute}}
{{/if}}
</div>
<button type="button" {{action (perform this.copyLinkOrAttribute)}} class="gh-portal-setting-copy">
{{#if this.copyLinkOrAttribute.isRunning}}
{{svg-jar "check-circle" class="w4 v-mid mr1 stroke-darkgrey"}} Copied
{{else}}
<span data-tooltip="Copy">{{svg-jar "copy" class="w4 v-mid fill-darkgrey"}}</span>
{{/if}}
</button>
</div>
</div>
<div>
<span onclick={{action "switchPreviewPage" "links"}} class="blue pointer f7">Show more</span>

View file

@ -73,7 +73,7 @@ export default ModalComponent.extend({
showModalLinkOrAttribute: computed('isShowModalLink', function () {
if (this.isShowModalLink) {
return `${this.config.get('blogUrl')}/#/portal`;
return `#/portal`;
}
return `data-portal`;
}),
@ -147,6 +147,7 @@ export default ModalComponent.extend({
if (portalButtonIcon && !defaultIconKeys.includes(portalButtonIcon)) {
this.set('customIcon', this.settings.get('portalButtonIcon'));
}
this.siteUrl = this.config.get('blogUrl');
},
didInsertElement() {

View file

@ -317,11 +317,12 @@
align-items: center;
top: 2px;
right: 2px;
height: 34px;
padding: 3px 8px 5px 9px;
height: 32px;
padding: 0 8px 0 9px;
border-radius: 2px;
background: var(--white);
border: 1px solid var(--whitegrey);
font-size: 1.3rem;
}
.gh-portal-siteiframe {
@ -369,7 +370,7 @@
letter-spacing: 0;
text-rendering: optimizeLegibility;
background: var(--white);
width: 600px;
width: 640px;
padding: 32px;
margin: 0 auto;
border-radius: 5px;
@ -430,14 +431,41 @@
width: 130px;
}
.gh-portal-links-table .page-url-container {
.gh-portal-page-url-container {
position: relative;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 1.4rem;
padding: 5px 4px 5px 8px;
height: 38px;
background: var(--whitegrey-l2);
border-radius: 4px;
border: 1px solid var(--whitegrey);
color: var(--darkgrey);
font-weight: 500;
width: 100%;
}
.gh-portal-links-table .page-url-container .gh-portal-setting-copy {
position: absolute;
right: 2px;
top: 2px;
.gh-portal-page-url-container .page-url-slash {
color: var(--midlightgrey);
font-weight: 400;
}
.gh-portal-page-url-container .page-url-label {
max-width: 380px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.gh-show-modal-link-form .page-url-label {
max-width: 230px;
}
.gh-portal-page-url-container .page-url-disabled {
color: var(--midlightgrey);
font-weight: 400;
}
.gh-portal-custom-icon {
@ -461,4 +489,4 @@
.gh-portal-custom-icon .gh-portal-button-deleteicon {
display: none;
background: color-mod(var(--darkgrey) a(0.8));
}
}