Skip to content

Commit 6a608fb

Browse files
committed
feat - add and show reference for notes
1 parent 760bf53 commit 6a608fb

File tree

6 files changed

+18
-8
lines changed

6 files changed

+18
-8
lines changed

frontend/src/app/my-notes/save-note-form/note-editor.component.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,15 @@
7676
</div>
7777
</div>
7878

79+
<div class="form-group pb-2">
80+
<label for="reference">Reference</label>
81+
<input type="url"
82+
class="form-control"
83+
id="reference"
84+
formControlName="reference"
85+
placeholder='Optional reference (web url, project, topic etc.)'>
86+
</div>
87+
7988
<button type="submit" class="btn btn-primary mr-2"
8089
[disabled]="!noteForm.valid">
8190
Save note

frontend/src/app/my-snippets/create-snippet-form/create-snippet-form.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@
131131
class="form-control"
132132
id="sourceUrl"
133133
formControlName="sourceUrl"
134-
placeholder='Where the code snippets are inspired from (source URL, project etc.)'>
134+
placeholder='Optional reference (source url, web url, project etc.)'>
135135
</div>
136136

137137
<div class="form-check mb-4 mt-1">

frontend/src/app/my-snippets/update-snippet-form/update-snippet-form.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@
128128
class="form-control"
129129
id="sourceUrl"
130130
formControlName="sourceUrl"
131-
placeholder='Where the code snippets are inspired from (source URL, project etc.)'>
131+
placeholder='Optional reference (source url, web url, project etc.)'>
132132
</div>
133133

134134
<div *ngIf="!copyToMine && !snippet.public && !snippet.copiedFromId" class="form-check mb-4 mt-1">

frontend/src/app/shared/note-details/note-details.component.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ <h6 class="card-subtitle mb-2 text-muted url-under-title">
88
<span *ngIf="note.reference"><strong>Ref</strong> -
99
<span
1010
*ngIf="note.reference.startsWith('http:') || note.reference.startsWith('https:'); else justText">
11-
<a href="{{note.reference}}" target="_blank">{{note.reference}}</a>
11+
<a href="{{note.reference}}" target="_blank">
12+
{{ note.reference.length > 55 ? note.reference.substring(0, 55) + '...' :note.reference }}
13+
</a>
1214
<sup class="ml-1"><i class="fas fa-external-link-alt"></i></sup>
1315
</span>
1416
<ng-template #justText>

frontend/src/app/shared/snippet-details/snippet-details.component.html

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@ <h6 class="card-subtitle mb-2 text-muted url-under-title">
5353

5454
<ng-container *ngIf="
5555
{
56-
userId: userId$ | async,
57-
userIsLoggedIn: userIsLoggedIn$ | async
56+
userId: userId$ | async
5857
} as observables">
5958

6059
<div class="card-footer" style="padding-right: 0.3rem">
@@ -89,14 +88,14 @@ <h6 class="card-subtitle mb-2 text-muted url-under-title">
8988
<button
9089
*ngIf="snippet.userId !== observables.userId"
9190
type="button" class="btn btn-light btn-sm"
92-
(click)="copyToMine(observables.userIsLoggedIn, snippet)"
91+
(click)="copyToMine(userIsLoggedIn, snippet)"
9392
title="Save to my snippets">
9493
<i class="far fa-copy"></i> Copy to mine
9594
</button>
9695
<button *ngIf="snippet.public || (!snippet.public && snippet.userId === observables.userId)"
9796
class="btn btn-light btn-sm float-right"
9897
title="Share via email or on social media"
99-
(click)="shareSnippetDialog(snippet, observables.userIsLoggedIn, observables.userId)"><i class="fas fa-share"></i> Share
98+
(click)="shareSnippetDialog(snippet, userIsLoggedIn, observables.userId)"><i class="fas fa-share"></i> Share
10099
</button>
101100
</div>
102101

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Codever",
3-
"version": "7.2.2",
3+
"version": "7.3.0",
44
"description": "Codever - bookmarks, snippets and notes manager for developers & co",
55
"scripts": {
66
"test": "echo \"Error: no test specified\" && exit 1",

0 commit comments

Comments
 (0)