Commit 889bb656 authored by Yorrd's avatar Yorrd
Browse files

feat: initial commit

parent c67dfd3d
[submodule "imports/client/adornis-components"]
path = imports/client/adornis-components
[submodule "imports/git_modules/adornis-components"]
path = imports/git_modules/adornis-components
url = ../../orga/modules/adornis-components.git
[submodule "imports/client/cms-components"]
path = imports/client/cms-components
url = ../../orga/modules/cms-components.git
[submodule "imports/types"]
path = imports/types
[submodule "imports/git_modules/types"]
path = imports/git_modules/types
url = ../../orga/modules/types.git
[submodule "imports/client/base"]
path = imports/client/base
[submodule "imports/git_modules/base"]
path = imports/git_modules/base
url = ../../orga/modules/base.git
[submodule "server/mails"]
path = server/mails
[submodule "imports/git_modules/mails"]
path = imports/git_modules/mails
url = ../../orga/modules/mails.git
[submodule "imports/git_modules/design"]
path = imports/git_modules/design
url = ../../orga/modules/design.git
[submodule "imports/git_modules/chat"]
path = imports/git_modules/chat
url = ../../orga/modules/chat.git
[submodule "imports/git_modules/baseql"]
path = imports/git_modules/baseql
url = ../../orga/modules/baseql.git
[submodule "imports/git_modules/users"]
path = imports/git_modules/users
url = ../../orga/modules/users.git
[submodule "imports/git_modules/forms"]
path = imports/git_modules/forms
url = ../../orga/modules/forms.git
......@@ -17,3 +17,4 @@ notices-for-facebook-graph-api-2
1.5-add-dynamic-import-package
1.6.2-split-underscore-from-meteor-base
1.7-split-underscore-from-meteor-base
1.8.3-split-jquery-from-blaze
......@@ -5,21 +5,21 @@
# but you can also edit it by hand.
meteor-base@1.4.0 # Packages every Meteor app needs to have
mobile-experience@1.0.5 # Packages for a great mobile UX
mongo@1.8.0-beta190.1 # The database Meteor supports right now
mobile-experience@1.1.0 # Packages for a great mobile UX
mongo@1.9.0 # The database Meteor supports right now
reactive-var@1.0.11 # Reactive variable for tracker
tracker@1.2.0 # Meteor's client-side reactive programming library
standard-minifier-css@1.6.0-beta190.1
standard-minifier-js@2.6.0-beta190.1
standard-minifier-css@1.6.0
standard-minifier-js@2.6.0
dynamic-import@0.5.1
server-render@0.3.1
ecmascript@0.14.0-beta190.1
ecmascript@0.14.2
es5-shim@4.8.0
jagi:astronomy
static-html
accounts-password@1.5.1
accounts-password@1.6.0
fourseven:scss
ostrio:files
typescript@3.7.0-beta190.1
typescript@3.7.5
METEOR@1.9-beta.1
METEOR@1.10.1
accounts-base@1.4.4
accounts-password@1.5.1
accounts-base@1.6.0
accounts-password@1.6.0
allow-deny@1.1.0
autoupdate@1.6.0
babel-compiler@7.5.0-beta190.1
babel-runtime@1.5.0-beta190.1
babel-compiler@7.5.2
babel-runtime@1.5.0
base64@1.0.12
binary-heap@1.0.11
blaze-tools@1.0.10
boilerplate-generator@1.6.0
boilerplate-generator@1.7.0
caching-compiler@1.2.1
caching-html-compiler@1.1.3
callback-hook@1.1.0
callback-hook@1.3.0
check@1.3.1
ddp@1.4.0
ddp-client@2.3.3
ddp-common@1.4.0
ddp-rate-limiter@1.0.7
ddp-server@2.3.0
ddp-server@2.3.1
deps@1.0.12
diff-sequence@1.1.1
dynamic-import@0.5.1
ecmascript@0.14.0-beta190.1
ecmascript@0.14.2
ecmascript-runtime@0.7.0
ecmascript-runtime-client@0.10.0-beta190.1
ecmascript-runtime-server@0.9.0-beta190.1
ejson@1.1.0
ecmascript-runtime-client@0.10.0
ecmascript-runtime-server@0.9.0
ejson@1.1.1
email@1.2.3
es5-shim@4.8.0
fetch@0.1.1
......@@ -35,34 +35,34 @@ html-tools@1.0.11
htmljs@1.0.11
http@1.4.2
id-map@1.1.0
inter-process-messaging@0.1.0
inter-process-messaging@0.1.1
jagi:astronomy@2.7.3
launch-screen@1.1.1
launch-screen@1.2.0
livedata@1.0.18
localstorage@1.2.0
logging@1.1.20
mdg:validation-error@0.5.1
meteor@1.9.3
meteor-base@1.4.0
minifier-css@1.5.0-beta190.1
minifier-js@2.6.0-beta190.1
minimongo@1.4.5
mobile-experience@1.0.5
mobile-status-bar@1.0.14
modern-browsers@0.1.4
modules@0.15.0-beta190.1
modules-runtime@0.12.0-beta190.1
mongo@1.8.0-beta190.1
minifier-css@1.5.0
minifier-js@2.6.0
minimongo@1.5.0
mobile-experience@1.1.0
mobile-status-bar@1.1.0
modern-browsers@0.1.5
modules@0.15.0
modules-runtime@0.12.0
mongo@1.9.0
mongo-decimal@0.1.1
mongo-dev-server@1.1.0
mongo-id@1.0.7
npm-bcrypt@0.9.3
npm-mongo@3.3.0-beta190.1
npm-mongo@3.7.0
ordered-dict@1.1.0
ostrio:cookies@2.4.0
ostrio:files@1.11.2
ostrio:cookies@2.6.0
ostrio:files@1.14.0
promise@0.11.2
random@1.1.0
random@1.2.0
rate-limit@1.0.9
reactive-var@1.0.11
reload@1.3.0
......@@ -71,16 +71,16 @@ routepolicy@1.1.0
server-render@0.3.1
service-configuration@1.0.11
sha@1.0.9
socket-stream-client@0.2.2
socket-stream-client@0.2.3
spacebars-compiler@1.1.3
srp@1.0.12
standard-minifier-css@1.6.0-beta190.1
standard-minifier-js@2.6.0-beta190.1
standard-minifier-css@1.6.0
standard-minifier-js@2.6.0
static-html@1.2.2
templating-tools@1.1.2
tracker@1.2.0
typescript@3.7.0-beta190.1
typescript@3.7.5
underscore@1.0.10
url@1.2.0
webapp@1.7.4
webapp@1.9.0
webapp-hashing@1.0.9
<body style="overflow-x: hidden">
<a-loader>
<div
slot="loader-content"
style="height: 100vh; width: 100vw; top: 0; position: absolute; display: flex; flex-direction: column; align-items: center; justify-content: center; background-color: white; color: black; z-index: -1"
>
<img src="/loader.svg" style="max-width: 20px; margin-top: 20px;" />
</div>
<main-element></main-element>
</a-loader>
<main-element></main-element>
<noscript
>Hey there, unfortunately you can't use this page without JavaScript. Please update your browser and allow
JavaScript execution
......
import '../../imports/client/adornis-components/a-loader';
import '../../imports/client/main-element';
import './web-worker';
import './receive-ssr';
import { generateBase, generate } from '@adornis/design/generate';
import { spacing, tokens } from '@adornis/design/generate-base/tokens';
import { generateFontResets, fontReset } from 'imports/git_modules/design/generate-base/font-resets';
import { AdornisRouter } from 'imports/git_modules/adornis-components/a-router';
generateBase(spacing);
generateFontResets();
generate('ccb', {
markus: {
background: 'pink',
},
box: {
...tokens(spacing).box,
background: 'violet',
},
chatbox: {
...tokens(spacing).box,
minHeight: '400px',
maxWidth: '1000px',
border: '1px solid grey',
},
button: {
...tokens(spacing).box,
background: 'dark-grey',
height: '48px',
width: '100px',
borderStyle: 'solid',
zIndex: '999',
},
stack: {
...tokens(spacing).stack,
'[centeraligned]': { alignItems: 'center' },
},
});
generateFontResets('ccb', {
h1: { ...fontReset(1, 0.1, 'Barlow'), fontWeight: 'bold', fontSize: '24px' },
h3: { ...fontReset(1, 0.1, 'Barlow'), fontWeight: 'bold', fontSize: '20px' },
h4: { ...fontReset(1, 0.1, 'Barlow'), fontWeight: 'bold', fontSize: '18px' },
text: { ...fontReset(1, 0.1, 'Barlow'), fontSize: '16px' },
});
AdornisRouter.init(['/:page']);
import '@adornis/users/client/auto-relogin';
export TYPESCRIPT_DISABLE_WARNINGS=true
export DATADIR="/tmp"
export METEOR_PORT="3000"
export ROOT_URL="http://adornis.de:${METEOR_PORT}/"
echo "Change Mongo URL in deploy/start.sh and uncomment following code"
#export MONGO_URL="mongodb://mongo:3001/<changeMONGOURL>"
#echo $METEOR_PORT
#meteor --mobile-server=127.0.0.1:$METEOR_PORT --port $METEOR_PORT --settings settings.json
\ No newline at end of file
export ROOT_URL="https://coronachatbot.livelinks.adornis.de/"
export MONGO_URL="mongodb://mongo:3001/coronachatbot"
meteor --mobile-server=127.0.0.1 --settings settings.json
\ No newline at end of file
Subproject commit b16a2a5284b8b8df5c15e15a0882dd7cf511aa7f
Subproject commit 736b3624466e964cc795e9db56faa4b5f2a2a32a
import { element, ScopingElement, html } from '@adornis/base';
import { EmotionMixin } from '@adornis/design';
import '@material/mwc-icon';
import '@material/mwc-list';
import '@material/mwc-list/mwc-list-item';
import { colors } from './globals';
import './ccb-chat';
@element('ccb-admin')
export class CCBAdmin extends EmotionMixin(ScopingElement) {
public render() {
return html`
<a-stack horizontal size="lg">
<mwc-list style=${{ width: '20vw', minWidth: '400px' }}>
<mwc-list-item graphic="avatar">
<mwc-icon slot="graphic"> chat </mwc-icon>
<ccb-text> chat 1 </ccb-text>
</mwc-list-item>
<mwc-list-item graphic="avatar">
<mwc-icon slot="graphic"> chat </mwc-icon>
<ccb-text> chat 2 </ccb-text>
</mwc-list-item>
<mwc-list-item graphic="avatar">
<mwc-icon slot="graphic" style=${{ color: colors.alert }}> announcement </mwc-icon>
<ccb-text> chat 3 </ccb-text>
</mwc-list-item>
</mwc-list>
<a-box padding="lg">
<ccb-chat></ccb-chat>
</a-box>
</a-stack>
`;
}
}
// @element('ccb-chat-list-entry')
// export
import { element, html, ScopingElement, exposeAttribute, rerender } from '@adornis/base';
import { Loader } from '@adornis/adornis-components/loader';
import { spacing } from '@adornis/design/generate-base/tokens';
import { createEmotionComponent, EmotionMixin } from 'imports/git_modules/design';
import { RenderProps } from 'imports/git_modules/base/reactive-lit-element';
import { BehaviorSubject } from 'rxjs';
import { AdornisDialog } from '@adornis/adornis-components/a-dialog';
@element('ccb-botbar')
export class ccbBotbar extends EmotionMixin(ScopingElement) {
public render() {
return html`
<a-box endjustified horizontal centeraligned style="padding: 0 ${spacing.md}">
<a-stack horizontal size="md"
><ccb-h4 class="${this.css({ cursor: 'pointer' })}" href="/datenschutz">Datenschutz</ccb-h4>
<ccb-h4
class="${this.css({ cursor: 'pointer', position: 'relative' })}"
@click=${() =>
AdornisDialog.showPopup(
resolve =>
html`
<a-stack padding="md" size="sm">
<ccb-h3>Adornis Ventures UG (haftungsbeschränkt)</ccb-h3>
<ccb-text>Am Sand 14</ccb-text>
<ccb-text>61184 Karben</ccb-text>
<ccb-text>Deutschland</ccb-text>
<ccb-text>Registergericht Amtsgericht Frankfurt am Main, HRB 106794</ccb-text>
<ccb-text>Geschäftsführer: Kai Brobeil</ccb-text>
<ccb-text>E-Mail: info@adornis.de</ccb-text>
<ccb-text>Telefon: 0176 815 48 505</ccb-text>
<a-box horizontal centerjustified style="padding: ${spacing.md} 0 0 0"
><mwc-icon
class="${this.css({ cursor: 'pointer', userselect: 'none' })}"
@click=${() => resolve()}
>highlight_off</mwc-icon
></a-box
>
</a-stack>
`,
)}
>Impressum
</ccb-h4>
</a-stack>
</a-box>
`;
}
}
import { element, ScopingElement, html } from 'imports/git_modules/base';
import { EmotionMixin } from 'imports/git_modules/design';
import { spacing } from 'imports/git_modules/design/generate-base/tokens';
import { colors } from './globals';
const moment = require('moment');
import '@material/mwc-icon';
import '@adornis/chat/client/a-chat';
import { AdornisChat } from '@adornis/chat/client/a-chat';
import { AdornisInput } from 'imports/git_modules/forms/a-input';
@element('ccb-chat')
export class CCBChat extends EmotionMixin(ScopingElement) {
public render() {
return html`
<ccb-chat-override .chatID="${'1'}"></ccb-chat-override>
`;
}
}
@element('ccb-chat-override')
export class CCBChatOverride extends AdornisChat {
public chatLine(msg: ChatMessage, index: number) {
const left = msg.author !== (this.ownID.getValue() || Meteor.userId());
return html`
<a-stack
padding="sm"
size="xs"
class="${this.css({ background: colors.chatPrimary, borderRadius: spacing.xs, color: colors.chatTextColor })}"
>
${this.chatBubble(msg, left)}
<ccb-text
horizontal
endjustified
class="${this.css({ fontSize: '11px', marginTop: '8px', marginBottom: '-8px' })}"
>${moment(msg.sent).format('HH:mm')}</ccb-text
>
</a-stack>
`;
}
public chatInput(send: (text: string) => void) {
return html`
<a-stack horizontal size="md" padding="md" class="${this.css({ background: 'white', width: '100%' })}">
<a-input
id="chatinput"
placeholder="Welche Frage hast du?"
class="${this.css({ flex: '1' })}"
.nonBlur="${'true'}"
.value="${this.preFillInput}"
@submit="${(e: CustomEvent) => {
send(e.detail.value);
(this.$('chatinput') as AdornisInput).value.next('');
}}"
></a-input>
<mwc-icon
style="color: var(--light-blue); cursor: pointer;"
@click="${() => {
send((this.$('chatinput') as AdornisInput).getValue() as string);
(this.$('chatinput') as AdornisInput).value.next('');
}}"
>play_arrow</mwc-icon
>
</a-stack>
`;
}
}
import { element, html } from '@adornis/base';
import { AdornisDBView, AttributeField } from '@adornis/adornis-components/a-dbview';
import { Content } from 'imports/db/contents';
import { BehaviorSubject } from 'rxjs';
import { ifDefined } from 'lit-html/directives/if-defined';
import { takeUntil, distinctUntilChanged, map, switchMap } from 'rxjs/operators';
import { RenderProps } from '@adornis/base/reactive-lit-element';
import { rxRepeat } from '@adornis/base/rx-repeat';
import { spacing } from '@adornis/design/generate-base/tokens';
import { AdornisUser } from '@adornis/users/db';
import '@material/mwc-textfield';
import '@material/mwc-icon-button';
@element('ccb-contents-admin')
export class CCBContentsAdmin extends AdornisDBView<Content> {
constructor() {
super();
this.baseQLClass.next(Content);
AdornisUser.currentUser
.pipe(takeUntil(this.disconnected))
.subscribe(user => this.entities.next(Content.find({ createdBy: user?._id }).whenReady));
this.selectedFields
.pipe(
distinctUntilChanged((x, y) => x.length === y.length),
takeUntil(this.disconnected),
)
.subscribe(selectedFields => {
console.log('selectedFields: ', selectedFields);
this.selectedFields.next(selectedFields.filter(f => !['createdAt', 'createdBy'].includes(f)));
});
}
public render({ fields, selectedFields, entities, sorting }: RenderProps<AdornisDBView<Content>>) {
return html`
${this.searchBar()}
<a-stack size="md" style=${{ padding: `0 ${spacing.xxl}` }}>
${this.addNewEntry(fields)} Du hast
${this.entities.pipe(switchMap(ents => ents.pipe(map(ents => ents.length))))} von insgesamt
${Content.count({}).whenReady} Einträgen erstellt. Der durchschnittliche Nutzer erstellt
${Content.count({}).whenReady.pipe(
switchMap(count => AdornisUser.count({}).whenReady.pipe(map(userCount => count / userCount))),
)}
Einträge.
</a-stack>
<a-stack size="md" padding="xxl">
${rxRepeat(entities.pipe(map(ents => ents.sort(this.sortFunctionWithSortObject(sorting)))), (entity, index) =>
this.itemCard(entity, selectedFields, index),
)}
</a-stack>
`;
}
protected itemCard(entity: Content, selectedFields: string[], index: number) {
return html`
<ccb-stack padding="lg" size="md" elevation="2" class="${this.css({ position: 'relative' })}">
${this.fieldDisplays(this.getField('Rechtsgebiet')!, entity, index)}
${this.fieldDisplays(this.getField('Frage')!, entity, index)}
${this.fieldDisplays(this.getField('Antwort')!, entity, index)}
${this.fieldDisplays(this.getField('Quelle')!, entity, index)}
${this.fieldDisplays(this.getField('Ansprechpartner')!, entity, index)}
<div
class="${this.css({
position: 'absolute',
top: spacing.sm,
right: spacing.sm,
})}"
>
${this.saveField(entity, index)}
</div>
</ccb-stack>
`;
}
protected saveField(data: T, index: number) {
return html`
<a-box ?secondary="${index % 2}" fullsize centered>
${data.whenChanging.pipe(
map(data =>
data.dirty
? html`
<mwc-icon-button
class="${this.css({ cursor: 'pointer', background: 'green', color: 'white' })}"
@click="${() => {
data.save();
}}"
icon="save"
label="Speichern"
></mwc-icon-button>
`
: '',
),
)}
</a-box>
`;
}
private getField(key: string) {
return this.fields.getValue().find(field => field.name === key);
}
protected attributeSelection() {
return html``;
}
protected fieldDisplays(field: AttributeField, data: Content, index: number) {
switch (field.name) {
case 'Rechtsgebiet':
case 'Frage':
case 'Quelle':
case 'Ansprechpartner':
return html`
<mwc-textfield
.label="${field.name}"
.value="${ifDefined(data[field.name])}"
@input="${e => {
const value = e.currentTarget.value;
if (data[field.name] === value) return;
data[field.name] = value;
}}"
></mwc-textfield>
`;
case 'Antwort':
return html`
<a-writer
class="${this.css({ border: '1px solid lightgrey', padding: spacing.sm })}"
placeholder="Antwort"
.enableEditing="${true}"
.useHTML="${true}"
.string="${ifDefined(data[field.name])}"
@string-changed="${e => {
const value = e.detail.value;
if (data[field.name] === value) return;
data[field.name] = value;
}}"
></a-writer>
`;
default:
return super.fieldDisplays(field, data, index);
}
}
protected csvUploadButton() {
return html``;
}
}
This diff is collapsed.
import { element, html, ScopingElement, exposeAttribute, rerender } from '@adornis/base';
import { Loader } from '@adornis/adornis-components/loader';
import { spacing } from '@adornis/design/generate-base/tokens';
import { createEmotionComponent, EmotionMixin } from 'imports/git_modules/design';
import { RenderProps } from 'imports/git_modules/base/reactive-lit-element';
import { BehaviorSubject } from 'rxjs';
import { isAbsolute } from 'path';
const backgroundImgStyle = { width: '100%', height: '100%' };
@element('background-img')
class BackgroundImage extends EmotionMixin(ScopingElement) {
@exposeAttribute @rerender public src = new BehaviorSubject('');
public render({ src }: RenderProps<BackgroundImage>) {
return html`
<img src="${src}" class=${this.css(backgroundImgStyle)} />
`;
}
}