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

View file

@ -254,18 +254,22 @@
<div {{action (toggle "isShowModalLink" this)}} class="blue pointer f8"> {{if this.isShowModalLink "Data Attribute" "Link"}} </div> <div {{action (toggle "isShowModalLink" this)}} class="blue pointer f8"> {{if this.isShowModalLink "Data Attribute" "Link"}} </div>
</div> </div>
<div class="flex items-center justify-center mt1 gh-show-modal-link-form relative"> <div class="flex items-center justify-center mt1 gh-show-modal-link-form relative">
<GhTextInput <div class="gh-portal-page-url-container">
@value={{this.showModalLinkOrAttribute}} <div class="page-url-label">
@type="text" {{#if this.isShowModalLink}}
@disabled={{true}} <span class="page-url-disabled">{{this.siteUrl}}/</span><span>{{this.showModalLinkOrAttribute}}</span>
/> {{else}}
<button type="button" {{action (perform this.copyLinkOrAttribute)}} class="gh-portal-setting-copy"> {{this.showModalLinkOrAttribute}}
{{#if this.copyLinkOrAttribute.isRunning}} {{/if}}
{{svg-jar "check-circle" class="w4 v-mid mr1 stroke-darkgrey"}} Copied </div>
{{else}} <button type="button" {{action (perform this.copyLinkOrAttribute)}} class="gh-portal-setting-copy">
<span data-tooltip="Copy">{{svg-jar "copy" class="w4 v-mid fill-darkgrey"}}</span> {{#if this.copyLinkOrAttribute.isRunning}}
{{/if}} {{svg-jar "check-circle" class="w4 v-mid mr1 stroke-darkgrey"}} Copied
</button> {{else}}
<span data-tooltip="Copy">{{svg-jar "copy" class="w4 v-mid fill-darkgrey"}}</span>
{{/if}}
</button>
</div>
</div> </div>
<div> <div>
<span onclick={{action "switchPreviewPage" "links"}} class="blue pointer f7">Show more</span> <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 () { showModalLinkOrAttribute: computed('isShowModalLink', function () {
if (this.isShowModalLink) { if (this.isShowModalLink) {
return `${this.config.get('blogUrl')}/#/portal`; return `#/portal`;
} }
return `data-portal`; return `data-portal`;
}), }),
@ -147,6 +147,7 @@ export default ModalComponent.extend({
if (portalButtonIcon && !defaultIconKeys.includes(portalButtonIcon)) { if (portalButtonIcon && !defaultIconKeys.includes(portalButtonIcon)) {
this.set('customIcon', this.settings.get('portalButtonIcon')); this.set('customIcon', this.settings.get('portalButtonIcon'));
} }
this.siteUrl = this.config.get('blogUrl');
}, },
didInsertElement() { didInsertElement() {

View file

@ -317,11 +317,12 @@
align-items: center; align-items: center;
top: 2px; top: 2px;
right: 2px; right: 2px;
height: 34px; height: 32px;
padding: 3px 8px 5px 9px; padding: 0 8px 0 9px;
border-radius: 2px; border-radius: 2px;
background: var(--white); background: var(--white);
border: 1px solid var(--whitegrey); border: 1px solid var(--whitegrey);
font-size: 1.3rem;
} }
.gh-portal-siteiframe { .gh-portal-siteiframe {
@ -369,7 +370,7 @@
letter-spacing: 0; letter-spacing: 0;
text-rendering: optimizeLegibility; text-rendering: optimizeLegibility;
background: var(--white); background: var(--white);
width: 600px; width: 640px;
padding: 32px; padding: 32px;
margin: 0 auto; margin: 0 auto;
border-radius: 5px; border-radius: 5px;
@ -430,14 +431,41 @@
width: 130px; width: 130px;
} }
.gh-portal-links-table .page-url-container { .gh-portal-page-url-container {
position: relative; 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 { .gh-portal-page-url-container .page-url-slash {
position: absolute; color: var(--midlightgrey);
right: 2px; font-weight: 400;
top: 2px; }
.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 { .gh-portal-custom-icon {
@ -461,4 +489,4 @@
.gh-portal-custom-icon .gh-portal-button-deleteicon { .gh-portal-custom-icon .gh-portal-button-deleteicon {
display: none; display: none;
background: color-mod(var(--darkgrey) a(0.8)); background: color-mod(var(--darkgrey) a(0.8));
} }