<div [innerHTML]="html.codeOfConduct"></div>
</div>
- <div class="block terms" id="terms-section">
+ <div class="block terms">
<div i18n class="section-title">Terms</div>
<div [innerHTML]="html.terms"></div>
</div>
+
+ <div class="middle-title" *ngIf="html.hardwareInformation">
+ Other information
+ </div>
+
+ <div class="block hardware-information">
+ <div i18n class="section-title">Hardware information</div>
+
+ <div [innerHTML]="html.hardwareInformation"></div>
+ </div>
</div>
<div class="col-md-12 col-xl-6">
terms: '',
codeOfConduct: '',
moderationInformation: '',
- administrator: ''
+ administrator: '',
+ hardwareInformation: ''
}
creationReason = ''
<div *ngIf="formErrors.instance.businessModel" class="form-error">{{ formErrors.instance.businessModel }}</div>
</div>
+ <div i18n class="inner-form-title">Other information</div>
+
+ <div class="form-group">
+ <label i18n for="instanceHardwareInformation">On what server/hardware the instance runs?</label>
+ <div class="label-small-info">2vCore 2GB RAM/or directly the link to the server you rent etc</div>
+
+ <my-markdown-textarea
+ id="instanceHardwareInformation" formControlName="hardwareInformation" textareaWidth="500px" textareaHeight="75px" [previewColumn]="true"
+ [classes]="{ 'input-error': formErrors['instance.hardwareInformation'] }"
+ ></my-markdown-textarea>
+
+ <div *ngIf="formErrors.instance.hardwareInformation" class="form-error">{{ formErrors.instance.hardwareInformation }}</div>
+ </div>
+
</ng-container>
</ng-template>
</ngb-tab>
maintenanceLifetime: null,
businessModel: null,
+ hardwareInformation: null,
+
categories: null,
languages: null,
terms: '',
codeOfConduct: '',
moderationInformation: '',
- administrator: ''
+ administrator: '',
+ hardwareInformation: ''
}
- for (const key of [ 'description', 'terms', 'codeOfConduct', 'moderationInformation', 'administrator' ]) {
+ for (const key of Object.keys(html)) {
html[ key ] = await this.markdownService.textMarkdownToHTML(about.instance[ key ])
}
# How will you pay the PeerTube instance server? With you own funds? With users donations? Advertising?
business_model: ''
+ # If you want to explain on what type of hardware your PeerTube instance runs
+ # Example: "2 vCore, 2GB RAM..."
+ hardware_information: '' # Supports Markdown
+
# What are the main languages of your instance? To interact with your users for example
# Uncomment or add the languages you want
# List of supported languages: https://peertube.cpy.re/api/v1/videos/languages
# How will you pay the PeerTube instance server? With you own funds? With users donations? Advertising?
business_model: ''
+ # If you want to explain on what type of hardware your PeerTube instance runs
+ # Example: "2 vCore, 2GB RAM..."
+ hardware_information: '' # Supports Markdown
+
# What are the main languages of your instance? To interact with your users for example
# Uncomment or add the languages you want
# List of supported languages: https://peertube.cpy.re/api/v1/videos/languages
terms: CONFIG.INSTANCE.TERMS,
codeOfConduct: CONFIG.INSTANCE.CODE_OF_CONDUCT,
+ hardwareInformation: CONFIG.INSTANCE.HARDWARE_INFORMATION,
+
creationReason: CONFIG.INSTANCE.CREATION_REASON,
moderationInformation: CONFIG.INSTANCE.MODERATION_INFORMATION,
administrator: CONFIG.INSTANCE.ADMINISTRATOR,
administrator: CONFIG.INSTANCE.ADMINISTRATOR,
maintenanceLifetime: CONFIG.INSTANCE.MAINTENANCE_LIFETIME,
businessModel: CONFIG.INSTANCE.BUSINESS_MODEL,
+ hardwareInformation: CONFIG.INSTANCE.HARDWARE_INFORMATION,
languages: CONFIG.INSTANCE.LANGUAGES,
categories: CONFIG.INSTANCE.CATEGORIES,
get ADMINISTRATOR () { return config.get<string>('instance.administrator') },
get MAINTENANCE_LIFETIME () { return config.get<string>('instance.maintenance_lifetime') },
get BUSINESS_MODEL () { return config.get<string>('instance.business_model') },
+ get HARDWARE_INFORMATION () { return config.get<string>('instance.hardware_information') },
get LANGUAGES () { return config.get<string[]>('instance.languages') || [] },
get CATEGORIES () { return config.get<number[]>('instance.categories') || [] },
administrator: 'Kuja',
maintenanceLifetime: 'forever',
businessModel: 'my super business model',
+ hardwareInformation: '2vCore 3GB RAM',
languages: [ 'en', 'es' ],
categories: [ 1, 2 ],
expect(data.instance.administrator).to.be.empty
expect(data.instance.maintenanceLifetime).to.be.empty
expect(data.instance.businessModel).to.be.empty
+ expect(data.instance.hardwareInformation).to.be.empty
expect(data.instance.languages).to.have.lengthOf(0)
expect(data.instance.categories).to.have.lengthOf(0)
expect(data.instance.administrator).to.equal('Kuja')
expect(data.instance.maintenanceLifetime).to.equal('forever')
expect(data.instance.businessModel).to.equal('my super business model')
+ expect(data.instance.hardwareInformation).to.equal('2vCore 3GB RAM')
expect(data.instance.languages).to.deep.equal([ 'en', 'es' ])
expect(data.instance.categories).to.deep.equal([ 1, 2 ])
administrator: 'Kuja',
maintenanceLifetime: 'forever',
businessModel: 'my super business model',
+ hardwareInformation: '2vCore 3GB RAM',
languages: [ 'en', 'es' ],
categories: [ 1, 2 ],
expect(data.instance.shortDescription).to.equal('my short description')
expect(data.instance.description).to.equal('my super description')
expect(data.instance.terms).to.equal('my super terms')
+ expect(data.instance.codeOfConduct).to.equal('my super coc')
+
+ expect(data.instance.creationReason).to.equal('my super creation reason')
+ expect(data.instance.moderationInformation).to.equal('my super moderation information')
+ expect(data.instance.administrator).to.equal('Kuja')
+ expect(data.instance.maintenanceLifetime).to.equal('forever')
+ expect(data.instance.businessModel).to.equal('my super business model')
+ expect(data.instance.hardwareInformation).to.equal('2vCore 3GB RAM')
+
+ expect(data.instance.languages).to.deep.equal([ 'en', 'es' ])
+ expect(data.instance.categories).to.deep.equal([ 1, 2 ])
})
it('Should remove the custom configuration', async function () {
administrator: 'Kuja',
maintenanceLifetime: 'forever',
businessModel: 'my super business model',
+ hardwareInformation: '2vCore 3GB RAM',
languages: [ 'en', 'es' ],
categories: [ 1, 2 ],
terms: string
codeOfConduct: string
+ hardwareInformation: string
creationReason: string
moderationInformation: string
administrator: string
maintenanceLifetime: string
businessModel: string
+ hardwareInformation: string
languages: string[]
categories: number[]