Normalize modal close buttons, and cancel/submit button styles

pull/2546/head
Rigel Kent 2020-03-06 16:58:55 +01:00
parent de702865f4
commit 54e7884775
No known key found for this signature in database
GPG Key ID: 5E53E96A494E452F
10 changed files with 38 additions and 25 deletions

View File

@ -1,6 +1,7 @@
<ng-template #modal let-hide="close"> <ng-template #modal let-hide="close">
<div class="modal-header"> <div class="modal-header">
<h4 i18n class="modal-title">Settings</h4> <h4 i18n class="modal-title">Settings</h4>
<my-global-icon iconName="cross" aria-label="Close" role="button" (click)="hide()"></my-global-icon>
</div> </div>
<div class="modal-body"> <div class="modal-body">

View File

@ -60,7 +60,7 @@ export class ConfirmComponent implements OnInit {
showModal () { showModal () {
this.inputValue = '' this.inputValue = ''
this.openedModal = this.modalService.open(this.confirmModal) this.openedModal = this.modalService.open(this.confirmModal, { centered: true })
this.openedModal.result this.openedModal.result
.then(() => this.confirmService.confirmResponse.next(true)) .then(() => this.confirmService.confirmResponse.next(true))

View File

@ -1,4 +1,4 @@
<div class="input-group"> <div class="input-group input-group-sm">
<input #urlInput (click)="urlInput.select()" type="text" class="form-control readonly" readonly [value]="value" /> <input #urlInput (click)="urlInput.select()" type="text" class="form-control readonly" readonly [value]="value" />
<div class="input-group-append"> <div class="input-group-append">

View File

@ -4,7 +4,7 @@
.header, .header,
.dropdown-item, .dropdown-item,
.input-container { .input-container {
padding: 6px 24px 10px 24px; padding: 8px 24px;
} }
.header { .header {
@ -54,11 +54,12 @@
} }
.playlist { .playlist {
display: flex; display: inline-flex;
cursor: pointer; cursor: pointer;
my-peertube-checkbox { my-peertube-checkbox {
margin-right: 10px; margin-right: 10px;
align-self: center;
} }
.display-name { .display-name {

View File

@ -18,8 +18,12 @@
<div class="form-group" *ngIf="video.isLocal"> <div class="form-group" *ngIf="video.isLocal">
<my-peertube-checkbox <my-peertube-checkbox
inputName="unfederate" formControlName="unfederate" inputName="unfederate" formControlName="unfederate"
i18n-labelText labelText="Unfederate the video (ask for its deletion from the remote instances)" i18n-labelText labelText="Unfederate the video"
></my-peertube-checkbox> >
<ng-container ngProjectAs="description">
<span i18n>This will ask remote instances to delete it</span>
</ng-container>
</my-peertube-checkbox>
</div> </div>
<div class="form-group inputs"> <div class="form-group inputs">

View File

@ -1,8 +1,7 @@
import { AfterViewInit, Component, EventEmitter, Input, OnChanges, Output, ViewChild } from '@angular/core' import { Component, EventEmitter, Input, OnChanges, Output, ViewChild } from '@angular/core'
import { I18n } from '@ngx-translate/i18n-polyfill' import { I18n } from '@ngx-translate/i18n-polyfill'
import { DropdownAction, DropdownButtonSize, DropdownDirection } from '@app/shared/buttons/action-dropdown.component' import { DropdownAction, DropdownButtonSize, DropdownDirection } from '@app/shared/buttons/action-dropdown.component'
import { AuthService, ConfirmService, Notifier, ServerService } from '@app/core' import { AuthService, ConfirmService, Notifier } from '@app/core'
import { BlocklistService } from '@app/shared/blocklist'
import { Video } from '@app/shared/video/video.model' import { Video } from '@app/shared/video/video.model'
import { VideoService } from '@app/shared/video/video.service' import { VideoService } from '@app/shared/video/video.service'
import { VideoDetails } from '@app/shared/video/video-details.model' import { VideoDetails } from '@app/shared/video/video-details.model'
@ -73,10 +72,8 @@ export class VideoActionsDropdownComponent implements OnChanges {
private notifier: Notifier, private notifier: Notifier,
private confirmService: ConfirmService, private confirmService: ConfirmService,
private videoBlacklistService: VideoBlacklistService, private videoBlacklistService: VideoBlacklistService,
private serverService: ServerService,
private screenService: ScreenService, private screenService: ScreenService,
private videoService: VideoService, private videoService: VideoService,
private blocklistService: BlocklistService,
private redundancyService: RedundancyService, private redundancyService: RedundancyService,
private i18n: I18n private i18n: I18n
) { } ) { }

View File

@ -29,15 +29,11 @@
<ng-template #visitorModal let-modal> <ng-template #visitorModal let-modal>
<div class="modal-header"> <div class="modal-header">
<h4 class="modal-title" id="modal-basic-title" i18n>You are one step away from commenting</h4> <h4 class="modal-title" id="modal-basic-title" i18n>You are one step away from commenting</h4>
<button type="button" class="close" aria-label="Close" (click)="hideVisitorModal()"></button> <my-global-icon iconName="cross" aria-label="Close" role="button" (click)="hideVisitorModal()"></my-global-icon>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<span i18n> <span i18n>
If you have an account on this instance, you can login: You can comment using an account on any ActivityPub-compatible instance.
</span>
<span class="btn btn-sm mx-3" role="button" (click)="gotoLogin()" i18n>login to comment</span>
<span i18n>
Otherwise, you can comment using an account on any ActivityPub-compatible instance.
On most platforms, you can find the video by typing its URL in the search bar and then comment it On most platforms, you can find the video by typing its URL in the search bar and then comment it
from within the software's interface. from within the software's interface.
</span> </span>
@ -50,5 +46,10 @@
<span i18n class="action-button action-button-cancel" role="button" (click)="hideVisitorModal()"> <span i18n class="action-button action-button-cancel" role="button" (click)="hideVisitorModal()">
Cancel Cancel
</span> </span>
<input
type="submit" i18n-value value="Login to comment" class="action-button-submit"
(click)="gotoLogin()"
>
</div> </div>
</ng-template> </ng-template>

View File

@ -17,10 +17,6 @@ my-input-readonly-copy {
@include peertube-select-container(200px); @include peertube-select-container(200px);
} }
.action-button-cancel {
margin-right: 0 !important;
}
.qr-code-group { .qr-code-group {
text-align: center; text-align: center;
} }

View File

@ -95,15 +95,15 @@ $icon-font-path: '~@neos21/bootstrap3-glyphicons/assets/fonts/';
} }
my-global-icon { my-global-icon {
@include icon(24px); @include icon(22px);
position: relative; position: relative;
top: 3px; top: 5px;
float: right; float: right;
margin: 0; margin: 0;
padding: 0; padding: 0;
opacity: 1; opacity: .5;
} }
} }
@ -113,7 +113,7 @@ $icon-font-path: '~@neos21/bootstrap3-glyphicons/assets/fonts/';
.action-button-cancel { .action-button-cancel {
@include peertube-button; @include peertube-button;
@include grey-button; @include tertiary-button;
display: inline-block; display: inline-block;
margin-right: 10px; margin-right: 10px;

View File

@ -150,6 +150,19 @@
} }
} }
@mixin tertiary-button {
color: $grey-foreground-color;
background-color: transparent;
&[disabled], &.disabled {
cursor: default;
}
my-global-icon {
@include apply-svg-color(transparent)
}
}
@mixin grey-button { @mixin grey-button {
&, &:active, &:focus { &, &:active, &:focus {
background-color: $grey-background-color; background-color: $grey-background-color;