Skip to content
This repository has been archived by the owner on May 5, 2022. It is now read-only.

Commit

Permalink
Merge pull request #1031 from CTemplar/dev
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
The-Hidden-Hand authored Feb 17, 2021
2 parents d2705bf + 47d83ea commit 38d5ee7
Show file tree
Hide file tree
Showing 28 changed files with 562 additions and 287 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ctemplar",
"version": "2.5.14",
"version": "2.5.15",
"license": "Apache",
"main": "electron-main.js",
"description": "Angular webclient (with Linux, macOS and Windows desktop clients) for CTemplar's encrypted email service.",
Expand Down
85 changes: 72 additions & 13 deletions src/app/mail/mail-detail/mail-detail.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ <h5 class="ui-header-subtitle text-dark mb-0 mail-subject">
</div>
</div>

<div class="ui-body is-xs bg-faded cursor-pointer mail-header" *ngIf="isShowTrashRelatedChildren || (mailFolder !== mailFolderTypes.TRASH && mail.folder !== mailFolderTypes.TRASH) || (mailFolder === mailFolderTypes.TRASH && mail.folder === mailFolderTypes.TRASH)" (click)="parentMailCollapsed = !parentMailCollapsed">
<div class="ui-body is-xs bg-faded cursor-pointer mail-header" *ngIf="isShowTrashRelatedChildren || (mailFolder !== mailFolderTypes.TRASH && mail.folder !== mailFolderTypes.TRASH) || (mailFolder === mailFolderTypes.TRASH && mail.folder === mailFolderTypes.TRASH)" (click)="onClickParentHeader()">
<div class="row">
<div class="col-8">
<div class="mailbox-sender-content">
Expand Down Expand Up @@ -297,17 +297,47 @@ <h5 class="ui-header-subtitle text-dark mb-0 mail-subject">
</div>
<div>
<label class="folder-batch" [style.background]="folderColors[mail.folder]">{{ mail.folder }}</label>
<i class="fas fa-angle-down expand-collapse" *ngIf="parentMailCollapsed"></i>
<i class="fas fa-angle-up expand-collapse" *ngIf="!parentMailCollapsed"></i>
<i class="fas fa-angle-down expand-collapse" *ngIf="!mailExpandedStatus[mail.id]"></i>
<i class="fas fa-angle-up expand-collapse" *ngIf="mailExpandedStatus[mail.id]"></i>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- Password Decryption Form -->
<div class="ui-body is-xs bg-faded mail-header decrypt-password-form-container" [ngbCollapse]="!mailExpandedStatus[mail.id]" id="ngb-collapse" *ngIf="isPasswordEncrypted[mail.id] && !decryptedContents[mail.id]">
<div class="password-decryption-desc">
{{'mail_detail.password_encryption_message_desc' | translate}}
<div class="password-decryption-desc-password-hint text-dark">
{{'mail_detail.password_hint' | translate}}
<div class="font-weight-bold font-style-italic d-inline-block">
{{mail.encryption && mail.encryption.password_hint ? mail.encryption.password_hint : ''}}
</div>
</div>
</div>
<div class="mt-3" *ngIf="errorMessageForDecryptingWithPassword[mail.id]">
<span class="validate-message mt-3">Password is incorrect</span>
</div>
<div class="decrypt-password-form mb-3">
<div class="input-group decrypt-password-element mr-2">
<input class="form-control form-control-sm border-right-0" type="password" id="parentPasswordVC" [placeholder]="'settings.password' | translate"/>
<span class="input-group-addon password-toggle bg-white text-muted" id="passwordToggle" (click)="togglePassword('parentPasswordVC')">
<i class="fa fa-eye"></i>
<i class="fa fa-eye-slash"></i>
</span>
</div>
<div class="d-flex justify-content-end decrypt-password-element">
<button class="btn btn-user-action" (click)="decryptWithPassword('parentPasswordVC', mail)">
<i class="fas fa-unlock position-left"></i>
<span>Decrypt</span>
</button>
</div>
</div>
</div>

<!--Mail Content-->
<section class="mailbox-section" *ngIf="isShowTrashRelatedChildren || (mailFolder !== mailFolderTypes.TRASH && mail.folder !== mailFolderTypes.TRASH) || (mailFolder === mailFolderTypes.TRASH && mail.folder === mailFolderTypes.TRASH)" id="ngb-collapse" [ngbCollapse]="parentMailCollapsed">
<section class="mailbox-section" *ngIf="isShowTrashRelatedChildren || (mailFolder !== mailFolderTypes.TRASH && mail.folder !== mailFolderTypes.TRASH) || (mailFolder === mailFolderTypes.TRASH && mail.folder === mailFolderTypes.TRASH)" id="ngb-collapse" [ngbCollapse]="!mailExpandedStatus[mail.id]">
<div class="ui-body mail-content" *ngIf="decryptedContents[mail.id]">
<div ngbDropdown placement="bottom-right" class="mailbox-dropdown msg-reply-dropdown dropdown-xs">
<button ngbDropdownToggle class="actions-btn actions-btn-sm msg-reply-btn" role="button" id="messageReplyDropdownMenuButton"></button>
Expand Down Expand Up @@ -352,16 +382,15 @@ <h5 class="ui-header-subtitle text-dark mb-0 mail-subject">
</ng-template>
</div>
</div>

<div align="center" class="decryption-spinner" *ngIf="decryptedContents[mail.id] == null">
<div align="center" class="decryption-spinner" *ngIf="mailExpandedStatus[mail.id] && !decryptedContents[mail.id] && (isDecrypting[mail.id] || (!isDecrypting[mail.id] && !isPasswordEncrypted[mail.id]))">
<img class="mt-3" [src]="loadingImage | safe: 'url'" />
<div class="mt-3">
{{ 'mail_detail.decryp_4096_bit' | translate }}
</div>
</div>

<!-- Attachments list starts -->
<ul class="list-style-none mt-3" *ngIf="mail.attachments?.length > 0">
<ul class="list-style-none mt-3" *ngIf="decryptedContents[mail.id] && mail.attachments?.length > 0">
<ng-container *ngFor="let attachment of mail.attachments">
<li class="download-attachment-wrapper mr-1" *ngIf="!attachment.is_inline">
<app-progress-bar [active]="decryptedAttachments[attachment.id]?.inProgress"></app-progress-bar>
Expand Down Expand Up @@ -405,7 +434,7 @@ <h5 class="ui-header-subtitle text-dark mb-0 mail-subject">
<ng-container *ngSwitchDefault>
<div [ngClass]="{ 'last-child': childIndex === mail.children.length - 1 }">
<section class="mailbox-section" id="{{ childMail.id }}-print-section">
<div class="ui-body is-bordered-bottom bg-faded cursor-pointer mail-header" (click)="onClickChildHeader(childIndex)">
<div class="ui-body is-bordered-bottom bg-faded cursor-pointer mail-header" (click)="onClickChildHeader(childMail)">
<div class="row">
<div class="col-8">
<div class="mailbox-sender-content">
Expand Down Expand Up @@ -493,18 +522,48 @@ <h5 class="ui-header-subtitle text-dark mb-0 mail-subject">
</div>
<div>
<label class="folder-batch" [style.background]="folderColors[childMail.folder]">{{ childMail.folder }}</label>
<i class="fas fa-angle-down expand-collapse" *ngIf="childMailCollapsed[childIndex]"></i>
<i class="fas fa-angle-up expand-collapse" *ngIf="!childMailCollapsed[childIndex]"></i>
<i class="fas fa-angle-down expand-collapse" *ngIf="!mailExpandedStatus[childMail.id]"></i>
<i class="fas fa-angle-up expand-collapse" *ngIf="mailExpandedStatus[childMail.id]"></i>
</div>
</div>
</div>
</div>
<app-progress-bar [active]="decryptedContents[childMail.id] == null" *ngIf="childIndex === properFolderLastChildIndex"> </app-progress-bar>
<app-progress-bar [active]="decryptedContents[childMail.id] == null" *ngIf="mailExpandedStatus[childMail.id] && !decryptedContents[childMail.id] && (isDecrypting[childMail.id] || !isPasswordEncrypted[childMail.id])"> </app-progress-bar>
</div>
</section>

<!-- Password Decryption Form -->
<div class="ui-body is-xs bg-faded mail-header decrypt-password-form-container" [ngbCollapse]="!mailExpandedStatus[childMail.id]" id="ngb-collapse" *ngIf="isPasswordEncrypted[childMail.id] && !decryptedContents[childMail.id]">
<div class="password-decryption-desc">
{{'mail_detail.password_encryption_message_desc' | translate}}
<div class="password-decryption-desc-password-hint text-dark">
{{'mail_detail.password_hint' | translate}}
<div class="font-weight-bold font-style-italic d-inline-block">
{{childMail.encryption && childMail.encryption.password_hint ? childMail.encryption.password_hint : ''}}
</div>
</div>
</div>
<div class="mt-3" *ngIf="errorMessageForDecryptingWithPassword[childMail.id]">
<span class="validate-message mt-3">Password is incorrect</span>
</div>
<div class="decrypt-password-form mb-3">
<div class="input-group decrypt-password-element mr-2">
<input class="form-control form-control-sm border-right-0" type="password" [id]="'childPasswordVC_' + childIndex" [placeholder]="'settings.password' | translate"/>
<span class="input-group-addon password-toggle bg-white text-muted" id="passwordToggle" (click)="togglePassword('childPasswordVC_' + childIndex)">
<i class="fa fa-eye"></i>
<i class="fa fa-eye-slash"></i>
</span>
</div>
<div class="d-flex justify-content-end decrypt-password-element">
<button class="btn btn-user-action" (click)="decryptWithPassword('childPasswordVC_' + childIndex, childMail)">
<i class="fas fa-unlock position-left"></i>
<span>Decrypt</span>
</button>
</div>
</div>
</div>
<!--Mail Content-->
<section class="mailbox-section" id="{{ childMail.id + '-ngb-collapse' }}" [ngbCollapse]="childMailCollapsed[childIndex]">
<section class="mailbox-section" id="{{ childMail.id + '-ngb-collapse' }}" [ngbCollapse]="!mailExpandedStatus[childMail.id]">
<div class="ui-body mail-content" *ngIf="decryptedContents[childMail.id]">
<div ngbDropdown placement="bottom-right" class="mailbox-dropdown msg-reply-dropdown dropdown-xs">
<button ngbDropdownToggle class="actions-btn actions-btn-sm msg-reply-btn" role="button" id="{{ childMail.id }}-messageReplyDropdownMenuButton"></button>
Expand Down Expand Up @@ -578,7 +637,7 @@ <h5 class="ui-header-subtitle text-dark mb-0 mail-subject">
</ul>
<!-- Attachments list ends -->
</section>
<div align="center" class="decryption-spinner" *ngIf="decryptedContents[childMail.id] == null && isDecrypting[childMail.id] === true">
<div align="center" class="decryption-spinner" *ngIf="mailExpandedStatus[childMail.id] && !decryptedContents[childMail.id] && (isDecrypting[childMail.id] || !isPasswordEncrypted[childMail.id])">
<img class="mt-3" [src]="loadingImage | safe: 'url'" />
<div class="mt-3">
{{ 'mail_detail.decryp_4096_bit' | translate }}
Expand Down
15 changes: 15 additions & 0 deletions src/app/mail/mail-detail/mail-detail.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -149,3 +149,18 @@
line-height: 1.5;
}
}

.decrypt-password-form-container {
margin-bottom: 20px;
.decrypt-password-form {
display: flex;
width: 55%;
.decrypt-password-element {
height: 40px;
padding: 3px 0;
button {
color: var(--text-muted);
}
}
}
}
Loading

0 comments on commit 38d5ee7

Please sign in to comment.