1
0
Fork 0

Fix checkbox margins

This commit is contained in:
Chocobozzz 2018-11-19 14:34:01 +01:00
parent a8a6322778
commit 361805c48b
No known key found for this signature in database
GPG key ID: 583A612D890159BE
8 changed files with 69 additions and 54 deletions

View file

@ -87,15 +87,19 @@
<div i18n class="inner-form-title">Signup</div> <div i18n class="inner-form-title">Signup</div>
<my-peertube-checkbox <div class="form-group">
inputName="signupEnabled" formControlName="signupEnabled" <my-peertube-checkbox
i18n-labelText labelText="Signup enabled" inputName="signupEnabled" formControlName="signupEnabled"
></my-peertube-checkbox> i18n-labelText labelText="Signup enabled"
></my-peertube-checkbox>
</div>
<my-peertube-checkbox *ngIf="isSignupEnabled()" <div class="form-group">
inputName="signupRequiresEmailVerification" formControlName="signupRequiresEmailVerification" <my-peertube-checkbox *ngIf="isSignupEnabled()"
i18n-labelText labelText="Signup requires email verification" inputName="signupRequiresEmailVerification" formControlName="signupRequiresEmailVerification"
></my-peertube-checkbox> i18n-labelText labelText="Signup requires email verification"
></my-peertube-checkbox>
</div>
<div *ngIf="isSignupEnabled()" class="form-group"> <div *ngIf="isSignupEnabled()" class="form-group">
<label i18n for="signupLimit">Signup limit</label> <label i18n for="signupLimit">Signup limit</label>
@ -110,15 +114,19 @@
<div i18n class="inner-form-title">Import</div> <div i18n class="inner-form-title">Import</div>
<my-peertube-checkbox <div class="form-group">
inputName="importVideosHttpEnabled" formControlName="importVideosHttpEnabled" <my-peertube-checkbox
i18n-labelText labelText="Video import with HTTP URL (i.e. YouTube) enabled" inputName="importVideosHttpEnabled" formControlName="importVideosHttpEnabled"
></my-peertube-checkbox> i18n-labelText labelText="Video import with HTTP URL (i.e. YouTube) enabled"
></my-peertube-checkbox>
</div>
<my-peertube-checkbox <div class="form-group">
inputName="importVideosTorrentEnabled" formControlName="importVideosTorrentEnabled" <my-peertube-checkbox
i18n-labelText labelText="Video import with a torrent file or a magnet URI enabled" inputName="importVideosTorrentEnabled" formControlName="importVideosTorrentEnabled"
></my-peertube-checkbox> i18n-labelText labelText="Video import with a torrent file or a magnet URI enabled"
></my-peertube-checkbox>
</div>
<div i18n class="inner-form-title">Administrator</div> <div i18n class="inner-form-title">Administrator</div>
@ -184,13 +192,15 @@
</div> </div>
</div> </div>
<my-peertube-checkbox <div class="form-group">
inputName="servicesTwitterWhitelisted" formControlName="servicesTwitterWhitelisted" <my-peertube-checkbox
i18n-labelText labelText="Instance whitelisted by Twitter" inputName="servicesTwitterWhitelisted" formControlName="servicesTwitterWhitelisted"
i18n-helpHtml helpHtml="If your instance is whitelisted by Twitter, a video player will be embedded in the Twitter feed on PeerTube video share.<br /> i18n-labelText labelText="Instance whitelisted by Twitter"
If the instance is not whitelisted, we use an image link card that will redirect on your PeerTube instance.<br /><br /> i18n-helpHtml helpHtml="If your instance is whitelisted by Twitter, a video player will be embedded in the Twitter feed on PeerTube video share.<br />
Check this checkbox, save the configuration and test with a video URL of your instance (https://example.com/videos/watch/blabla) on <a target='_blank' rel='noopener noreferrer' href='https://cards-dev.twitter.com/validator'>https://cards-dev.twitter.com/validator</a> to see if you instance is whitelisted." If the instance is not whitelisted, we use an image link card that will redirect on your PeerTube instance.<br /><br />
></my-peertube-checkbox> Check this checkbox, save the configuration and test with a video URL of your instance (https://example.com/videos/watch/blabla) on <a target='_blank' rel='noopener noreferrer' href='https://cards-dev.twitter.com/validator'>https://cards-dev.twitter.com/validator</a> to see if you instance is whitelisted."
></my-peertube-checkbox>
</div>
</ng-template> </ng-template>
</ngb-tab> </ngb-tab>
@ -199,11 +209,13 @@
<div i18n class="inner-form-title">Transcoding</div> <div i18n class="inner-form-title">Transcoding</div>
<my-peertube-checkbox <div class="form-group">
inputName="transcodingEnabled" formControlName="transcodingEnabled" <my-peertube-checkbox
i18n-labelText labelText="Transcoding enabled" inputName="transcodingEnabled" formControlName="transcodingEnabled"
i18n-helpHtml helpHtml="If you disable transcoding, many videos from your users will not work!" i18n-labelText labelText="Transcoding enabled"
></my-peertube-checkbox> i18n-helpHtml helpHtml="If you disable transcoding, many videos from your users will not work!"
></my-peertube-checkbox>
</div>
<ng-template [ngIf]="isTranscodingEnabled()"> <ng-template [ngIf]="isTranscodingEnabled()">
@ -226,7 +238,6 @@
[inputName]="getResolutionKey(resolution)" [formControlName]="getResolutionKey(resolution)" [inputName]="getResolutionKey(resolution)" [formControlName]="getResolutionKey(resolution)"
i18n-labelText labelText="Resolution {{resolution}} enabled" i18n-labelText labelText="Resolution {{resolution}} enabled"
></my-peertube-checkbox> ></my-peertube-checkbox>
</div> </div>
</ng-template> </ng-template>

View file

@ -15,15 +15,19 @@
</div> </div>
</div> </div>
<my-peertube-checkbox <div class="form-group">
inputName="webTorrentEnabled" formControlName="webTorrentEnabled" <my-peertube-checkbox
i18n-labelText labelText="Use WebTorrent to exchange parts of the video with others" inputName="webTorrentEnabled" formControlName="webTorrentEnabled"
></my-peertube-checkbox> i18n-labelText labelText="Use WebTorrent to exchange parts of the video with others"
></my-peertube-checkbox>
</div>
<my-peertube-checkbox <div class="form-group">
inputName="autoPlayVideo" formControlName="autoPlayVideo" <my-peertube-checkbox
i18n-labelText labelText="Automatically plays video" inputName="autoPlayVideo" formControlName="autoPlayVideo"
></my-peertube-checkbox> i18n-labelText labelText="Automatically plays video"
></my-peertube-checkbox>
</div>
<input type="submit" i18n-value value="Save" [disabled]="!form.valid"> <input type="submit" i18n-value value="Save" [disabled]="!form.valid">
</form> </form>

View file

@ -1,7 +1,7 @@
import * as Bluebird from 'bluebird' import * as Bluebird from 'bluebird'
import * as validator from 'validator' import * as validator from 'validator'
import { ResultList } from '../../shared/models' import { ResultList } from '../../shared/models'
import { Activity, ActivityPubActor } from '../../shared/models/activitypub' import { Activity } from '../../shared/models/activitypub'
import { ACTIVITY_PUB } from '../initializers' import { ACTIVITY_PUB } from '../initializers'
import { ActorModel } from '../models/activitypub/actor' import { ActorModel } from '../models/activitypub/actor'
import { signJsonLDObject } from './peertube-crypto' import { signJsonLDObject } from './peertube-crypto'
@ -106,10 +106,10 @@ function buildSignedActivity (byActor: ActorModel, data: Object) {
return signJsonLDObject(byActor, activity) as Promise<Activity> return signJsonLDObject(byActor, activity) as Promise<Activity>
} }
function getActorUrl (activityActor: string | ActivityPubActor) { function getAPUrl (activity: string | { id: string }) {
if (typeof activityActor === 'string') return activityActor if (typeof activity === 'string') return activity
return activityActor.id return activity.id
} }
function checkUrlsSameHost (url1: string, url2: string) { function checkUrlsSameHost (url1: string, url2: string) {
@ -123,7 +123,7 @@ function checkUrlsSameHost (url1: string, url2: string) {
export { export {
checkUrlsSameHost, checkUrlsSameHost,
getActorUrl, getAPUrl,
activityPubContextify, activityPubContextify,
activityPubCollectionPagination, activityPubCollectionPagination,
buildSignedActivity buildSignedActivity

View file

@ -5,15 +5,15 @@ import * as url from 'url'
import * as uuidv4 from 'uuid/v4' import * as uuidv4 from 'uuid/v4'
import { ActivityPubActor, ActivityPubActorType } from '../../../shared/models/activitypub' import { ActivityPubActor, ActivityPubActorType } from '../../../shared/models/activitypub'
import { ActivityPubAttributedTo } from '../../../shared/models/activitypub/objects' import { ActivityPubAttributedTo } from '../../../shared/models/activitypub/objects'
import { checkUrlsSameHost, getActorUrl } from '../../helpers/activitypub' import { checkUrlsSameHost, getAPUrl } from '../../helpers/activitypub'
import { isActorObjectValid, normalizeActor } from '../../helpers/custom-validators/activitypub/actor' import { isActorObjectValid, normalizeActor } from '../../helpers/custom-validators/activitypub/actor'
import { isActivityPubUrlValid } from '../../helpers/custom-validators/activitypub/misc' import { isActivityPubUrlValid } from '../../helpers/custom-validators/activitypub/misc'
import { retryTransactionWrapper, updateInstanceWithAnother } from '../../helpers/database-utils' import { retryTransactionWrapper, updateInstanceWithAnother } from '../../helpers/database-utils'
import { logger } from '../../helpers/logger' import { logger } from '../../helpers/logger'
import { createPrivateAndPublicKeys } from '../../helpers/peertube-crypto' import { createPrivateAndPublicKeys } from '../../helpers/peertube-crypto'
import { doRequest, doRequestAndSaveToFile, downloadImage } from '../../helpers/requests' import { doRequest, downloadImage } from '../../helpers/requests'
import { getUrlFromWebfinger } from '../../helpers/webfinger' import { getUrlFromWebfinger } from '../../helpers/webfinger'
import { AVATARS_SIZE, CONFIG, IMAGE_MIMETYPE_EXT, PREVIEWS_SIZE, sequelizeTypescript } from '../../initializers' import { AVATARS_SIZE, CONFIG, IMAGE_MIMETYPE_EXT, sequelizeTypescript } from '../../initializers'
import { AccountModel } from '../../models/account/account' import { AccountModel } from '../../models/account/account'
import { ActorModel } from '../../models/activitypub/actor' import { ActorModel } from '../../models/activitypub/actor'
import { AvatarModel } from '../../models/avatar/avatar' import { AvatarModel } from '../../models/avatar/avatar'
@ -43,7 +43,7 @@ async function getOrCreateActorAndServerAndModel (
recurseIfNeeded = true, recurseIfNeeded = true,
updateCollections = false updateCollections = false
) { ) {
const actorUrl = getActorUrl(activityActor) const actorUrl = getAPUrl(activityActor)
let created = false let created = false
let actor = await fetchActorByUrl(actorUrl, fetchType) let actor = await fetchActorByUrl(actorUrl, fetchType)

View file

@ -1,5 +1,5 @@
import { Activity, ActivityType } from '../../../../shared/models/activitypub' import { Activity, ActivityType } from '../../../../shared/models/activitypub'
import { checkUrlsSameHost, getActorUrl } from '../../../helpers/activitypub' import { checkUrlsSameHost, getAPUrl } from '../../../helpers/activitypub'
import { logger } from '../../../helpers/logger' import { logger } from '../../../helpers/logger'
import { ActorModel } from '../../../models/activitypub/actor' import { ActorModel } from '../../../models/activitypub/actor'
import { processAcceptActivity } from './process-accept' import { processAcceptActivity } from './process-accept'
@ -40,7 +40,7 @@ async function processActivities (
continue continue
} }
const actorUrl = getActorUrl(activity.actor) const actorUrl = getAPUrl(activity.actor)
// When we fetch remote data, we don't have signature // When we fetch remote data, we don't have signature
if (options.signatureActor && actorUrl !== options.signatureActor.url) { if (options.signatureActor && actorUrl !== options.signatureActor.url) {

View file

@ -11,7 +11,7 @@ import { doRequest } from '../../helpers/requests'
import { getOrCreateActorAndServerAndModel } from './actor' import { getOrCreateActorAndServerAndModel } from './actor'
import { logger } from '../../helpers/logger' import { logger } from '../../helpers/logger'
import { CRAWL_REQUEST_CONCURRENCY } from '../../initializers' import { CRAWL_REQUEST_CONCURRENCY } from '../../initializers'
import { checkUrlsSameHost, getActorUrl } from '../../helpers/activitypub' import { checkUrlsSameHost, getAPUrl } from '../../helpers/activitypub'
async function shareVideoByServerAndChannel (video: VideoModel, t: Transaction) { async function shareVideoByServerAndChannel (video: VideoModel, t: Transaction) {
if (video.privacy === VideoPrivacy.PRIVATE) return undefined if (video.privacy === VideoPrivacy.PRIVATE) return undefined
@ -41,7 +41,7 @@ async function addVideoShares (shareUrls: string[], instance: VideoModel) {
}) })
if (!body || !body.actor) throw new Error('Body or body actor is invalid') if (!body || !body.actor) throw new Error('Body or body actor is invalid')
const actorUrl = getActorUrl(body.actor) const actorUrl = getAPUrl(body.actor)
if (checkUrlsSameHost(shareUrl, actorUrl) !== true) { if (checkUrlsSameHost(shareUrl, actorUrl) !== true) {
throw new Error(`Actor url ${actorUrl} has not the same host than the share url ${shareUrl}`) throw new Error(`Actor url ${actorUrl} has not the same host than the share url ${shareUrl}`)
} }

View file

@ -9,7 +9,7 @@ import { AccountVideoRateModel } from '../../models/account/account-video-rate'
import { logger } from '../../helpers/logger' import { logger } from '../../helpers/logger'
import { CRAWL_REQUEST_CONCURRENCY } from '../../initializers' import { CRAWL_REQUEST_CONCURRENCY } from '../../initializers'
import { doRequest } from '../../helpers/requests' import { doRequest } from '../../helpers/requests'
import { checkUrlsSameHost, getActorUrl } from '../../helpers/activitypub' import { checkUrlsSameHost, getAPUrl } from '../../helpers/activitypub'
import { ActorModel } from '../../models/activitypub/actor' import { ActorModel } from '../../models/activitypub/actor'
import { getVideoDislikeActivityPubUrl, getVideoLikeActivityPubUrl } from './url' import { getVideoDislikeActivityPubUrl, getVideoLikeActivityPubUrl } from './url'
@ -26,7 +26,7 @@ async function createRates (ratesUrl: string[], video: VideoModel, rate: VideoRa
}) })
if (!body || !body.actor) throw new Error('Body or body actor is invalid') if (!body || !body.actor) throw new Error('Body or body actor is invalid')
const actorUrl = getActorUrl(body.actor) const actorUrl = getAPUrl(body.actor)
if (checkUrlsSameHost(actorUrl, rateUrl) !== true) { if (checkUrlsSameHost(actorUrl, rateUrl) !== true) {
throw new Error(`Rate url ${rateUrl} has not the same host than actor url ${actorUrl}`) throw new Error(`Rate url ${rateUrl} has not the same host than actor url ${actorUrl}`)
} }

View file

@ -29,7 +29,7 @@ import { createRates } from './video-rates'
import { addVideoShares, shareVideoByServerAndChannel } from './share' import { addVideoShares, shareVideoByServerAndChannel } from './share'
import { AccountModel } from '../../models/account/account' import { AccountModel } from '../../models/account/account'
import { fetchVideoByUrl, VideoFetchByUrlType } from '../../helpers/video' import { fetchVideoByUrl, VideoFetchByUrlType } from '../../helpers/video'
import { checkUrlsSameHost } from '../../helpers/activitypub' import { checkUrlsSameHost, getAPUrl } from '../../helpers/activitypub'
async function federateVideoIfNeeded (video: VideoModel, isNewVideo: boolean, transaction?: sequelize.Transaction) { async function federateVideoIfNeeded (video: VideoModel, isNewVideo: boolean, transaction?: sequelize.Transaction) {
// If the video is not private and published, we federate it // If the video is not private and published, we federate it
@ -167,7 +167,7 @@ async function getOrCreateVideoAndAccountAndChannel (options: {
const refreshViews = options.refreshViews || false const refreshViews = options.refreshViews || false
// Get video url // Get video url
const videoUrl = typeof options.videoObject === 'string' ? options.videoObject : options.videoObject.id const videoUrl = getAPUrl(options.videoObject)
let videoFromDatabase = await fetchVideoByUrl(videoUrl, fetchType) let videoFromDatabase = await fetchVideoByUrl(videoUrl, fetchType)
if (videoFromDatabase) { if (videoFromDatabase) {