@ -1,8 +0,0 @@ | |||
projects: | |||
Mobilizon: | |||
schemaPath: schema.graphql | |||
extensions: | |||
endpoints: | |||
dev: | |||
url: 'http://localhost:4000/api' | |||
introspect: true |
@ -1 +1,2 @@ | |||
src/i18n/*.json | |||
src/i18n/*.json | |||
coverage/ |
@ -0,0 +1,19 @@ | |||
module.exports = { | |||
preset: "@vue/cli-plugin-unit-jest/presets/typescript-and-babel", | |||
collectCoverage: true, | |||
collectCoverageFrom: [ | |||
"**/*.{vue,ts}", | |||
"!**/node_modules/**", | |||
"!get_union_json.ts", | |||
], | |||
coverageReporters: ["html", "text", "text-summary"], | |||
// The following should fix the issue with svgs and ?inline loader (see Logo.vue), but doesn't work | |||
// | |||
// transform: { | |||
// "^.+\\.svg$": "<rootDir>/tests/unit/svgTransform.js", | |||
// }, | |||
// moduleNameMapper: { | |||
// "^@/(.*svg)(\\?inline)$": "<rootDir>/src/$1", | |||
// "^@/(.*)$": "<rootDir>/src/$1", | |||
// }, | |||
}; |
@ -0,0 +1,90 @@ | |||
#!/bin/bash | |||
set -eu | |||
output_dir="../priv/static/img/pics" | |||
resolutions=( | |||
480 | |||
1024 | |||
1920 | |||
) | |||
ignore=( | |||
homepage_background.png | |||
) | |||
file_extension () { | |||
filename=$(basename -- "$file") | |||
echo "${filename##*.}" | |||
} | |||
file_name () { | |||
filename=$(basename -- "$file") | |||
echo "${filename%.*}" | |||
} | |||
convert_image () { | |||
name=$(file_name) | |||
extension=$(file_extension) | |||
res="$1w" | |||
output="$output_dir/$name-$res.$extension" | |||
convert -geometry "$resolution"x $file $output | |||
} | |||
produce_webp () { | |||
name=$(file_name) | |||
output="$output_dir/$name.webp" | |||
cwebp $file -quiet -o $output | |||
} | |||
progress() { | |||
local w=80 p=$1; shift | |||
# create a string of spaces, then change them to dots | |||
printf -v dots "%*s" "$(( $p*$w/100 ))" ""; dots=${dots// /.}; | |||
# print those dots on a fixed-width space plus the percentage etc. | |||
printf "\r\e[K|%-*s| %3d %% %s" "$w" "$dots" "$p" "$*"; | |||
} | |||
echo "Generating responsive versions of the picturesโฆ" | |||
if ! command -v convert &> /dev/null | |||
then | |||
echo "$(tput setaf 1)ERROR: The convert command could not be found. You need to install ImageMagick.$(tput sgr 0)" | |||
exit 1 | |||
fi | |||
nb_files=$( shopt -s nullglob ; set -- $output_dir/* ; echo $#) | |||
tasks=$((${#resolutions[@]}*$nb_files)) | |||
i=1 | |||
for file in $output_dir/* | |||
do | |||
if [[ -f $file ]]; then | |||
for resolution in "${resolutions[@]}"; do | |||
convert_image $resolution | |||
progress $(($i*100/$tasks)) still working... | |||
i=$((i+1)) | |||
done | |||
fi | |||
done | |||
echo -e "\nDone!" | |||
echo "Generating optimized versions of the picturesโฆ" | |||
if ! command -v cwebp &> /dev/null | |||
then | |||
echo "$(tput setaf 1)ERROR: The cwebp command could not be found. You need to install webp.$(tput sgr 0)" | |||
exit 1 | |||
fi | |||
nb_files=$( shopt -s nullglob ; set -- $output_dir/* ; echo $#) | |||
i=1 | |||
for file in $output_dir/* | |||
do | |||
if [[ -f $file ]]; then | |||
produce_webp | |||
progress $(($i*100/$nb_files)) still working... | |||
i=$((i+1)) | |||
fi | |||
done | |||
echo -e "\nDone!" |
@ -0,0 +1,18 @@ | |||
declare global { | |||
interface GeolocationCoordinates { | |||
readonly accuracy: number; | |||
readonly altitude: number | null; | |||
readonly altitudeAccuracy: number | null; | |||
readonly heading: number | null; | |||
readonly latitude: number; | |||
readonly longitude: number; | |||
readonly speed: number | null; | |||
} | |||
interface GeolocationPosition { | |||
readonly coords: GeolocationCoordinates; | |||
readonly timestamp: number; | |||
} | |||
} | |||
export {}; |
@ -1,11 +0,0 @@ | |||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 248.16 46.78"> | |||
<title>Mobilizon Logo</title> | |||
<g data-name="header"> | |||
<path d="M0 45.82l3.18-40.8a29.88 29.88 0 015.07-.36 27.74 27.74 0 014.95.36l4.86 17.16a92.19 92.19 0 012.34 10.08h.36a92.19 92.19 0 012.34-10.08L28 5.02a29.23 29.23 0 015-.36 29.23 29.23 0 015 .36l3.18 40.8a13.61 13.61 0 01-3.63.42 23.41 23.41 0 01-3.63-.24l-1.2-19.92q-.36-5.52-.48-12.84h-.44l-7.32 26.51a25.62 25.62 0 01-4 .3 23.36 23.36 0 01-3.84-.3L9.36 13.24H9q-.3 8.94-.48 12.84L7.26 46a22.47 22.47 0 01-3.6.24A13.75 13.75 0 010 45.82zM74 31.06q0 8-4.26 12.3a12.21 12.21 0 01-9 3.42 12.21 12.21 0 01-9-3.42q-4.26-4.26-4.26-12.3t4.24-12.31a12.21 12.21 0 019-3.42 12.21 12.21 0 019 3.42Q74 23.02 74 31.06zM60.75 20.98q-5.67 0-5.67 10.08t5.67 10.08q5.67 0 5.67-10.08t-5.67-10.08zM103.2 19.75q2.7 4.11 2.7 11.28T102 42.31a13.18 13.18 0 01-10 4.11 31.41 31.41 0 01-11.34-2V2.2l.4-.45h2.76A4 4 0 0187 2.83a5.38 5.38 0 01.93 3.57v11.94a12.08 12.08 0 017.56-2.7 8.71 8.71 0 017.71 4.11zm-9.72 2a7.28 7.28 0 00-5.58 2.82v16a15 15 0 004.08.54 5.25 5.25 0 004.68-2.67q1.68-2.67 1.68-7.59 0-9.03-4.86-9.1zM121 22v23.94a20.85 20.85 0 01-3.66.3 23 23 0 01-3.78-.3V24.75q0-3.24-2.7-3.24h-.72a9.32 9.32 0 01-.3-2.58 10.7 10.7 0 01.3-2.7 39.63 39.63 0 014.38-.24h1a5.19 5.19 0 014 1.62A6.27 6.27 0 01121 22z" /> | |||
<path d="M119.82.84a7.37 7.37 0 01.6 3 7.37 7.37 0 01-.6 3 7.46 7.46 0 01-3.87.84 6.49 6.49 0 01-3.69-.93 7.37 7.37 0 01-.6-3 7.37 7.37 0 01.6-3 8.09 8.09 0 013.87-.84 7.05 7.05 0 013.69.93z" fill="#fff" /> | |||
<path d="M139.08 40.42h2a10.23 10.23 0 01.6 3.18 9.24 9.24 0 01-.18 2.1 38.47 38.47 0 01-5.64.54q-6.48 0-6.48-7v-37l.36-.42h2.88a3.94 3.94 0 013.12 1.05 5.52 5.52 0 01.9 3.57v31.31q-.02 2.67 2.44 2.67zM155.94 22v23.94a20.85 20.85 0 01-3.66.3 23 23 0 01-3.78-.3V24.75q0-3.24-2.7-3.24h-.72a9.32 9.32 0 01-.3-2.58 10.7 10.7 0 01.3-2.7 39.63 39.63 0 014.38-.24h1a5.19 5.19 0 014.05 1.62 6.27 6.27 0 011.43 4.39z" /> | |||
<path d="M154.8 2.84a7.37 7.37 0 01.6 3 7.37 7.37 0 01-.6 3 7.46 7.46 0 01-3.87.84 6.49 6.49 0 01-3.69-.93 7.37 7.37 0 01-.6-3 7.37 7.37 0 01.6-3 8.09 8.09 0 013.87-.84 7.05 7.05 0 013.69.93z" fill="#fff" /> | |||
<path d="M163.08 39.22l8.76-11.82q1.32-1.8 4.8-5.7l-.18-.3a63.09 63.09 0 01-7.74.42H163a9.79 9.79 0 01-.24-2.34 15.8 15.8 0 01.42-3.3h20.4a16.31 16.31 0 011 4.26 4.1 4.1 0 01-.78 2.34L175 34.66a64.65 64.65 0 01-4.56 5.7l.18.24q3.12-.3 5.22-.3h2.58a15.35 15.35 0 006.12-.9 9.4 9.4 0 01.72 3.12q0 3.42-4.32 3.42h-18a14.27 14.27 0 01-.9-3.93 5.08 5.08 0 011.04-2.79zM215.88 31.06q0 8-4.26 12.3a13.63 13.63 0 01-18.06 0q-4.26-4.26-4.26-12.3t4.26-12.31a13.63 13.63 0 0118.06 0q4.26 4.27 4.26 12.31zm-13.29-10.08q-5.67 0-5.67 10.08t5.67 10.08q5.67 0 5.67-10.08t-5.67-10.08zM247 25.84v13.32a11 11 0 001.2 5.64 7 7 0 01-4.41 1.56q-2.43 0-3.33-1.14a5.69 5.69 0 01-.9-3.54V27.4a7.74 7.74 0 00-.72-3.87 2.78 2.78 0 00-2.58-1.17 8.62 8.62 0 00-6.3 3v20.58a20.85 20.85 0 01-3.66.3 23 23 0 01-3.78-.3v-29.7l.42-.36h2.76q3.42 0 4.08 3.6 4.38-3.84 8.73-3.84t6.42 2.82a12.17 12.17 0 012.07 7.38z" /> | |||
<path d="M57.26 10.75a7.37 7.37 0 01-.6-3 7.37 7.37 0 01.6-3 8.09 8.09 0 013.87-.84 7.05 7.05 0 013.69.84 7.37 7.37 0 01.6 3 7.37 7.37 0 01-.6 3 7.46 7.46 0 01-3.87.84 6.49 6.49 0 01-3.69-.84zM198.26 10.75a7.37 7.37 0 01-.6-3 7.37 7.37 0 01.6-3 8.09 8.09 0 013.87-.84 7.05 7.05 0 013.69.84 7.37 7.37 0 01.6 3 7.37 7.37 0 01-.6 3 7.46 7.46 0 01-3.87.84 6.49 6.49 0 01-3.69-.84z" fill="#fff" /> | |||
</g> | |||
</svg> |
@ -1,94 +0,0 @@ | |||
<docs> | |||
```vue | |||
<participant-card :participant="{ actor: { preferredUsername: 'user1', name: 'someoneIDontLike' }, role: 'REJECTED' }" /> | |||
``` | |||
```vue | |||
<participant-card :participant="{ actor: { preferredUsername: 'user2', name: 'someoneWhoWillWait' }, role: 'NOT_APPROVED' }" /> | |||
``` | |||
```vue | |||
<participant-card :participant="{ actor: { preferredUsername: 'user3', name: 'a_participant' }, role: 'PARTICIPANT' }" /> | |||
``` | |||
```vue | |||
<participant-card :participant="{ actor: { preferredUsername: 'me', name: 'myself' }, role: 'CREATOR' }" /> | |||
``` | |||
</docs> | |||
<template> | |||
<article class="card"> | |||
<div class="card-content"> | |||
<div class="media"> | |||
<div class="media-left" v-if="participant.actor.avatar"> | |||
<figure class="image is-48x48"> | |||
<img :src="participant.actor.avatar.url" /> | |||
</figure> | |||
</div> | |||
<div class="media-content"> | |||
<span ref="title">{{ actorDisplayName }}</span | |||
><br /> | |||
<small class="has-text-grey" v-if="participant.actor.domain" | |||
>@{{ participant.actor.preferredUsername }}@{{ participant.actor.domain }}</small | |||
> | |||
<small class="has-text-grey" v-else>@{{ participant.actor.preferredUsername }}</small> | |||
</div> | |||
</div> | |||
</div> | |||
<footer class="card-footer"> | |||
<b-button | |||
v-if="[ParticipantRole.NOT_APPROVED, ParticipantRole.REJECTED].includes(participant.role)" | |||
@click="accept(participant)" | |||
type="is-success" | |||
class="card-footer-item" | |||
>{{ $t("Approve") }}</b-button | |||
> | |||
<b-button | |||
v-if="participant.role === ParticipantRole.NOT_APPROVED" | |||
@click="reject(participant)" | |||
type="is-danger" | |||
class="card-footer-item" | |||
>{{ $t("Reject") }}</b-button | |||
> | |||
<b-button | |||
v-if="participant.role === ParticipantRole.PARTICIPANT" | |||
@click="exclude(participant)" | |||
type="is-danger" | |||
class="card-footer-item" | |||
>{{ $t("Exclude") }}</b-button | |||
> | |||
<span v-if="participant.role === ParticipantRole.CREATOR" class="card-footer-item">{{ | |||
$t("Creator") | |||
}}</span> | |||
</footer> | |||
</article> | |||
</template> | |||
<script lang="ts"> | |||
import { Component, Prop, Vue } from "vue-property-decorator"; | |||
import { IParticipant, ParticipantRole } from "../../types/participant.model"; | |||
import { IPerson, Person } from "../../types/actor"; | |||
@Component | |||
export default class ParticipantCard extends Vue { | |||
@Prop({ required: true }) participant!: IParticipant; | |||
@Prop({ type: Function }) accept!: Function; | |||
@Prop({ type: Function }) reject!: Function; | |||
@Prop({ type: Function }) exclude!: Function; | |||
ParticipantRole = ParticipantRole; | |||
get actorDisplayName(): string { | |||
const actor = new Person(this.participant.actor as IPerson); | |||
return actor.displayName(); | |||
} | |||
} | |||
</script> | |||
<style lang="scss"> | |||
.card-footer-item { | |||
height: $control-height; | |||
} | |||
</style> |