aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFlorian CUNY <poslovitch@bentobox.world>2020-11-30 15:05:57 +0100
committerGitHub <noreply@github.com>2020-11-30 15:05:57 +0100
commitf45c7cc770963670b3f2f1ac11d3ee3afc84a7ec (patch)
tree3e58515c37c49f353d14dc52957339d81ee0bb2a
parent972de8f111fcacf523cf33062dd734e498df1081 (diff)
downloadPeerTube-f45c7cc770963670b3f2f1ac11d3ee3afc84a7ec.tar.gz
PeerTube-f45c7cc770963670b3f2f1ac11d3ee3afc84a7ec.tar.zst
PeerTube-f45c7cc770963670b3f2f1ac11d3ee3afc84a7ec.zip
Added Markdown formatting in all the fields of the "About" page (#3371)
* Added Markdown formatting in all the fields of the "About" page Fixes https://github.com/Chocobozzz/PeerTube/issues/3368 * Fixed compilation error in AboutInstanceComponent Moved creationReason, maintenanceLifetime and businessModel into the html dict * Removed textareaHeight for all md textareas in EditCustomConfig HTML * Fixed failing bundlewatch
-rw-r--r--client/src/app/+about/about-instance/about-instance.component.html14
-rw-r--r--client/src/app/+about/about-instance/about-instance.component.ts11
-rw-r--r--client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html30
-rw-r--r--client/src/app/shared/shared-instance/instance.service.ts3
4 files changed, 28 insertions, 30 deletions
diff --git a/client/src/app/+about/about-instance/about-instance.component.html b/client/src/app/+about/about-instance/about-instance.component.html
index 045bb3fbc..bb337fdf3 100644
--- a/client/src/app/+about/about-instance/about-instance.component.html
+++ b/client/src/app/+about/about-instance/about-instance.component.html
@@ -21,7 +21,7 @@
21 21
22 <div class="anchor" id="administrators-and-sustainability"></div> 22 <div class="anchor" id="administrators-and-sustainability"></div>
23 <a 23 <a
24 *ngIf="html.administrator || maintenanceLifetime || businessModel" 24 *ngIf="html.administrator || html.maintenanceLifetime || html.businessModel"
25 class="anchor-link" 25 class="anchor-link"
26 routerLink="/about/instance" 26 routerLink="/about/instance"
27 fragment="administrators-and-sustainability" 27 fragment="administrators-and-sustainability"
@@ -47,7 +47,7 @@
47 <div [innerHTML]="html.administrator"></div> 47 <div [innerHTML]="html.administrator"></div>
48 </div> 48 </div>
49 49
50 <div class="block creation-reason" *ngIf="creationReason"> 50 <div class="block creation-reason" *ngIf="html.creationReason">
51 <div class="anchor" id="creation-reason"></div> 51 <div class="anchor" id="creation-reason"></div>
52 <a 52 <a
53 class="anchor-link" 53 class="anchor-link"
@@ -58,10 +58,10 @@
58 <h3 i18n class="section-title">Why we created this instance</h3> 58 <h3 i18n class="section-title">Why we created this instance</h3>
59 </a> 59 </a>
60 60
61 <p>{{ creationReason }}</p> 61 <div [innerHTML]="html.creationReason"></div>
62 </div> 62 </div>
63 63
64 <div class="block maintenance-lifetime" *ngIf="maintenanceLifetime"> 64 <div class="block maintenance-lifetime" *ngIf="html.maintenanceLifetime">
65 <div class="anchor" id="maintenance-lifetime"></div> 65 <div class="anchor" id="maintenance-lifetime"></div>
66 <a 66 <a
67 class="anchor-link" 67 class="anchor-link"
@@ -72,10 +72,10 @@
72 <h3 i18n class="section-title">How long we plan to maintain this instance</h3> 72 <h3 i18n class="section-title">How long we plan to maintain this instance</h3>
73 </a> 73 </a>
74 74
75 <p>{{ maintenanceLifetime }}</p> 75 <div [innerHTML]="html.maintenanceLifetime"></div>
76 </div> 76 </div>
77 77
78 <div class="block business-model" *ngIf="businessModel"> 78 <div class="block business-model" *ngIf="html.businessModel">
79 <div class="anchor" id="business-model"></div> 79 <div class="anchor" id="business-model"></div>
80 <a 80 <a
81 class="anchor-link" 81 class="anchor-link"
@@ -86,7 +86,7 @@
86 <h3 i18n class="section-title">How we will pay for this instance</h3> 86 <h3 i18n class="section-title">How we will pay for this instance</h3>
87 </a> 87 </a>
88 88
89 <p>{{ businessModel }}</p> 89 <div [innerHTML]="html.businessModel"></div>
90 </div> 90 </div>
91 91
92 <div class="anchor" id="information"></div> 92 <div class="anchor" id="information"></div>
diff --git a/client/src/app/+about/about-instance/about-instance.component.ts b/client/src/app/+about/about-instance/about-instance.component.ts
index 92ecd5263..7eb382a46 100644
--- a/client/src/app/+about/about-instance/about-instance.component.ts
+++ b/client/src/app/+about/about-instance/about-instance.component.ts
@@ -24,13 +24,12 @@ export class AboutInstanceComponent implements OnInit, AfterViewChecked {
24 codeOfConduct: '', 24 codeOfConduct: '',
25 moderationInformation: '', 25 moderationInformation: '',
26 administrator: '', 26 administrator: '',
27 creationReason: '',
28 maintenanceLifetime: '',
29 businessModel: '',
27 hardwareInformation: '' 30 hardwareInformation: ''
28 } 31 }
29 32
30 creationReason = ''
31 maintenanceLifetime = ''
32 businessModel = ''
33
34 languages: string[] = [] 33 languages: string[] = []
35 categories: string[] = [] 34 categories: string[] = []
36 35
@@ -69,10 +68,6 @@ export class AboutInstanceComponent implements OnInit, AfterViewChecked {
69 68
70 this.shortDescription = about.instance.shortDescription 69 this.shortDescription = about.instance.shortDescription
71 70
72 this.creationReason = about.instance.creationReason
73 this.maintenanceLifetime = about.instance.maintenanceLifetime
74 this.businessModel = about.instance.businessModel
75
76 this.html = await this.instanceService.buildHtml(about) 71 this.html = await this.instanceService.buildHtml(about)
77 72
78 this.initialized = true 73 this.initialized = true
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html
index 0927523f1..70533475a 100644
--- a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html
+++ b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html
@@ -162,11 +162,11 @@
162 <div class="form-group form-group-right col-12 col-lg-8 col-xl-9"> 162 <div class="form-group form-group-right col-12 col-lg-8 col-xl-9">
163 163
164 <div class="form-group"> 164 <div class="form-group">
165 <label i18n for="instanceAdministrator">Who is behind the instance?</label> 165 <label i18n for="instanceAdministrator">Who is behind the instance?</label><my-help helpType="markdownText"></my-help>
166 <div i18n class="label-small-info">A single person? A non-profit? A company?</div> 166 <div i18n class="label-small-info">A single person? A non-profit? A company?</div>
167 167
168 <my-markdown-textarea 168 <my-markdown-textarea
169 name="instanceAdministrator" formControlName="administrator" textareaMaxWidth="500px" textareaHeight="75px" 169 name="instanceAdministrator" formControlName="administrator" textareaMaxWidth="500px"
170 [classes]="{ 'input-error': formErrors['instance.administrator'] }" 170 [classes]="{ 'input-error': formErrors['instance.administrator'] }"
171 ></my-markdown-textarea> 171 ></my-markdown-textarea>
172 172
@@ -174,35 +174,35 @@
174 </div> 174 </div>
175 175
176 <div class="form-group"> 176 <div class="form-group">
177 <label i18n for="instanceCreationReason">Why did you create this instance?</label> 177 <label i18n for="instanceCreationReason">Why did you create this instance?</label><my-help helpType="markdownText"></my-help>
178 <div i18n class="label-small-info">To share your personal videos? To open registrations and allow people to upload what they want?</div> 178 <div i18n class="label-small-info">To share your personal videos? To open registrations and allow people to upload what they want?</div>
179 179
180 <textarea 180 <my-markdown-textarea
181 id="instanceCreationReason" formControlName="creationReason" class="small" class="form-control" 181 id="instanceCreationReason" formControlName="creationReason" textareaMaxWidth="500px"
182 [ngClass]="{ 'input-error': formErrors['instance.creationReason'] }" 182 [ngClass]="{ 'input-error': formErrors['instance.creationReason'] }"
183 ></textarea> 183 ></my-markdown-textarea>
184 <div *ngIf="formErrors.instance.creationReason" class="form-error">{{ formErrors.instance.creationReason }}</div> 184 <div *ngIf="formErrors.instance.creationReason" class="form-error">{{ formErrors.instance.creationReason }}</div>
185 </div> 185 </div>
186 186
187 <div class="form-group"> 187 <div class="form-group">
188 <label i18n for="instanceMaintenanceLifetime">How long do you plan to maintain this instance?</label> 188 <label i18n for="instanceMaintenanceLifetime">How long do you plan to maintain this instance?</label><my-help helpType="markdownText"></my-help>
189 <div i18n class="label-small-info">It's important to know for users who want to register on your instance</div> 189 <div i18n class="label-small-info">It's important to know for users who want to register on your instance</div>
190 190
191 <textarea 191 <my-markdown-textarea
192 id="instanceMaintenanceLifetime" formControlName="maintenanceLifetime" class="form-control small" 192 id="instanceMaintenanceLifetime" formControlName="maintenanceLifetime" textareaMaxWidth="500px"
193 [ngClass]="{ 'input-error': formErrors['instance.maintenanceLifetime'] }" 193 [ngClass]="{ 'input-error': formErrors['instance.maintenanceLifetime'] }"
194 ></textarea> 194 ></my-markdown-textarea>
195 <div *ngIf="formErrors.instance.maintenanceLifetime" class="form-error">{{ formErrors.instance.maintenanceLifetime }}</div> 195 <div *ngIf="formErrors.instance.maintenanceLifetime" class="form-error">{{ formErrors.instance.maintenanceLifetime }}</div>
196 </div> 196 </div>
197 197
198 <div class="form-group"> 198 <div class="form-group">
199 <label i18n for="instanceBusinessModel">How will you finance the PeerTube server?</label> 199 <label i18n for="instanceBusinessModel">How will you finance the PeerTube server?</label><my-help helpType="markdownText"></my-help>
200 <div i18n class="label-small-info">With your own funds? With user donations? Advertising?</div> 200 <div i18n class="label-small-info">With your own funds? With user donations? Advertising?</div>
201 201
202 <textarea 202 <my-markdown-textarea
203 id="instanceBusinessModel" formControlName="businessModel" class="form-control small" 203 id="instanceBusinessModel" formControlName="businessModel" textareaMaxWidth="500px"
204 [ngClass]="{ 'input-error': formErrors['instance.businessModel'] }" 204 [ngClass]="{ 'input-error': formErrors['instance.businessModel'] }"
205 ></textarea> 205 ></my-markdown-textarea>
206 <div *ngIf="formErrors.instance.businessModel" class="form-error">{{ formErrors.instance.businessModel }}</div> 206 <div *ngIf="formErrors.instance.businessModel" class="form-error">{{ formErrors.instance.businessModel }}</div>
207 </div> 207 </div>
208 208
@@ -221,7 +221,7 @@
221 <div i18n class="label-small-info">i.e. 2vCore 2GB RAM, a direct the link to the server you rent, etc.</div> 221 <div i18n class="label-small-info">i.e. 2vCore 2GB RAM, a direct the link to the server you rent, etc.</div>
222 222
223 <my-markdown-textarea 223 <my-markdown-textarea
224 name="instanceHardwareInformation" formControlName="hardwareInformation" textareaMaxWidth="500px" textareaHeight="75px" 224 name="instanceHardwareInformation" formControlName="hardwareInformation" textareaMaxWidth="500px"
225 [classes]="{ 'input-error': formErrors['instance.hardwareInformation'] }" 225 [classes]="{ 'input-error': formErrors['instance.hardwareInformation'] }"
226 ></my-markdown-textarea> 226 ></my-markdown-textarea>
227 227
diff --git a/client/src/app/shared/shared-instance/instance.service.ts b/client/src/app/shared/shared-instance/instance.service.ts
index fcfa59f28..0a30446df 100644
--- a/client/src/app/shared/shared-instance/instance.service.ts
+++ b/client/src/app/shared/shared-instance/instance.service.ts
@@ -45,6 +45,9 @@ export class InstanceService {
45 codeOfConduct: '', 45 codeOfConduct: '',
46 moderationInformation: '', 46 moderationInformation: '',
47 administrator: '', 47 administrator: '',
48 creationReason: '',
49 maintenanceLifetime: '',
50 businessModel: '',
48 hardwareInformation: '' 51 hardwareInformation: ''
49 } 52 }
50 53