Skip to content

Commit

Permalink
Merge pull request #2 from tklein1801/acp
Browse files Browse the repository at this point in the history
Add acp
  • Loading branch information
tklein1801 authored Apr 28, 2021
2 parents e4b1dbc + 912cf68 commit 587f985
Show file tree
Hide file tree
Showing 14 changed files with 1,328 additions and 78 deletions.
20 changes: 20 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
## Changelogs

### [BBS-Mitfahrzentrale v0.3-pre](https://github.com/tklein1801/BBS-Mitfahrzentrale/releases/tag/v0.3-pre)

#### Hinzugefügt

- **Adminbereich** wurde hinzugefügt
- Benutzer einsehen & bearbeiten
- Admins ernennen
- Benutzer manuell verifizieren
- Anzeigen einsehen & bearbeiten

#### Geändert

- **API-Dokumentation** wurde angepasst
- **BBS-Mitfahrzentrale Dokumentation** wurde angepasst
- **Kleinere Änderungen** am **Design** wurde mit dem Update hinzugefügt
- Es wird nun **eu.ui-avatars** anstelle von FontAwesome Icons als Profilbild verwendet
_(Code wurde erst diesen Release eingebaut)_
- Änderungen an Endpoints sowie API wurden vorgenommen um diese kompatibel mit dem Adminbereich zu machen
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,4 @@ _Eine bebilderte Installationsanleitung findest du [hier](./assets/doc/Installie
[Fontawesome v5.6.3](https://fontawesome.com)
[PHP Router](https://github.com/steampixel/simplePHPRouter/tree/master)
[NanoID](https://github.com/ai/nanoid)
[eu.ui-avatars.com](eu.ui-avatars.com)
39 changes: 39 additions & 0 deletions assets/css/master.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assets/css/master.css.map

Large diffs are not rendered by default.

36 changes: 36 additions & 0 deletions assets/css/master.scss
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ a {
color: $orange;
}
}
a.badge.bg-orange {
text-decoration: none;
&:hover {
color: white;
background-color: rgba($color: $orange, $alpha: 0.9);
}
}
.font-weight-bold {
font-weight: bold;
}
Expand Down Expand Up @@ -133,6 +140,27 @@ a {
}
}

// Table
table {
background-color: $blueDark;
tr {
border: transparent;
&:hover {
background-color: rgba($color: $blue, $alpha: 0.95);
}

th {
border-bottom-width: 0 !important;
}

th,
td {
vertical-align: middle;
white-space: nowrap;
}
}
}

// Form
.form-label {
margin-bottom: 0;
Expand Down Expand Up @@ -409,6 +437,14 @@ hr.divider {
// Profile Stylesheet
.profile-container {
background-color: $blueDark;
.profile-image {
width: 7rem;
height: 7rem;
margin-left: calc(50% - 3.5rem);
border-radius: 50%;
border: 3px solid $orange;
}

.form-control {
padding-left: 0.75rem;
&:read-only {
Expand Down
61 changes: 51 additions & 10 deletions assets/doc/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@
| ------------------------- | -------------------------------------------------------------- |
| `auth/user-already-exist` | Der Benutzer existiert bereits |
| `auth/user-not-found` | Der Benutzer existiert nicht |
| `auth/not-an-admin` | Der Benutzer ist kein Admin |
| `auth/password-invalid` | Das Passwort passt nicht zur angegeben E-Mail |
| `auth/key-invalid` | `RestAPI` Der angegebene API-Key existiert nicht |
| `auth/key-not-set` | `RestAPI` Es wurde kein API-Key zur authentifizierung gefunden |
| `ride/not-the-creator` | Du bist nicht der Ersteller der Anzeiger |

> Der API-Key welcher für bestimmte Endpoints mitgeschickt werden muss (erkenntlich gemacht durch Authentification: (string) apiKey) muss als POST-Parameter mit der Anfrage verschickt werden und wird nicht extra bei den Parametern der Anfrage aufgelistet!
## user

```
Expand Down Expand Up @@ -38,16 +41,56 @@ Response 200 (application/json)
```

```
GET /get
POST /get
Authentification: (string) apiKey
Params: (string) apiKey
Response 200 (application/json)
```

```
POST /update
Authentification: (string) apiKey
Params: (string) apiKey, (string) phone, (string) password
Params: (string) phone, (string|null) password
Response 200 (application/json)
```

## admin

```
POST /user/get
Authentification: (string) apiKey
Params: (int) userId
Response 200 (application/json)
```

```
POST /user/update
Authentification: (string) apiKey
Params: (int) userId, (int) verified, (int) admin, (string) name, (string) surname, (string) email, (string) phone, (string|null) password
Response 200 (application/json)
```

```
POST /ride/user
Authentification: (string) apiKey
Params: (int) userId
Response 200 (application/json)
```

```
POST /ride/all
Authentification: (string) apiKey
Response 200 (application/json)
```

```
POST /ride/offer
Authentification: (int) rideId
Response 200 (application/json)
```

```
POST /ride/update
Authentification: (int) rideId, (string) title, (string) information, (int) price, (int) seats, (int) startAt, (int) startPlz, (string) startCity, (string) startAdress, (int) destinationPlz, (string) destinationCity, (string) destinationAdress
Response 200 (application/json)
```

Expand All @@ -73,26 +116,26 @@ Response 200 (application/json)

## ride

_If the user is signed in the api-key is set by default_
> _If the user is signed in the api-key is set by default_
```
POST /create
Authentification: (string) apiKey
Params: (string) apiKey, (int) driver, (string) title, (string) information, (int) price, (int) seats, (int) startAt, (int) startPlz, (string) startCity, (string) startAdress, (int) destinationPlz, (string) destinationCity, (string) destinationAdress
Params: (int) driver, (string) title, (string) information, (int) price, (int) seats, (int) startAt, (int) startPlz, (string) startCity, (string) startAdress, (int) destinationPlz, (string) destinationCity, (string) destinationAdress
Response 200 (application/json)
```

```
POST /update
Authentification: (string) apiKey
Params: (string) apiKey, (int) rideId, (string) information, (int) price, (int) seats, (int) startAt, (int) startPlz, (string) startCity, (string) startAdress, (int) destinationPlz, (string) destinationCity, (string) destinationAdress
Params: (int) rideId, (string) information, (int) price, (int) seats, (int) startAt, (int) startPlz, (string) startCity, (string) startAdress, (int) destinationPlz, (string) destinationCity, (string) destinationAdress
Response 200 (application/json)
```

```
POST /delete
Authentification: (string) apiKey
Params: (string) apiKey, (int) rideId
Params: (int) rideId
Response 200 (application/json)
```

Expand All @@ -104,14 +147,12 @@ Response 200 (application/json)
```
GET /favorites
Authentification: (string) apiKey
Params: (string) apiKey
Response 200 (application/json)
```

```
GET /user
POST /user
Authentification: (string) apiKey
Params: (string) apiKey
Response 200 (application/json)
```

Expand Down
Loading

0 comments on commit 587f985

Please sign in to comment.