Commit 949a945b authored by ty kayn's avatar ty kayn
Browse files

Merge branch 'creation-form' into 'develop'

Creation form

See merge request !46
parents c3972694 b46b57ee
Pipeline #365695 failed with stage
in 2 minutes and 29 seconds
......@@ -39,7 +39,7 @@ EN: All documentation is available in the "doc" folder, mainly in French because
## LIBRARIES USED
| status | lib name | usage |
| status | lib choice_label | usage |
| :-------------: | -------------------------------------------------------------- | --------------------------------------------------------- |
| | [axios](https://github.com/axios/axios) | http client |
| | [bulma](https://bulma.io/) | CSS framework |
......@@ -71,7 +71,7 @@ This project was generated with [Angular CLI](https://github.com/angular/angular
## Code scaffolding
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
Run `ng generate component component-choice_label` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
## Build
......
......@@ -73,7 +73,8 @@
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "framadate:build"
"browserTarget": "framadate:build",
"proxyConfig": "src/proxy.conf.json"
},
"configurations": {
"production": {
......
// TODO: File to be deleted : just temporary documentation of backend API endpoints
/**
*
* -------------------------- -------- -------- ------ ------------------------------------------------
Name Method Scheme Host Path
-------------------------- -------- -------- ------ ------------------------------------------------
_twig_error_test ANY ANY ANY /_error/{code}.{_format}
admin_homepage_get_default GET ANY ANY /admin/
admin_homepage_clean_expired_polls GET ANY ANY /admin/polls/clean/{token}
api_get_poll_comment GET ANY ANY /polls/{id}/comments
api_new_comment POST ANY ANY /polls/{id}/comments
api_poll_comments_delete DELETE ANY ANY /polls/{id}/comments
user_homepageget_default GET ANY ANY /users/
user_homepage_polls_send_by_email GET ANY ANY /users/{email}/polls/send-by-email
api_get_all_polls GET ANY ANY /polls/
api_get_poll GET ANY ANY /polls/{id}
api_update_poll PUT ANY ANY /polls/{id}/{token}
api_new_poll POST ANY ANY /polls/
api_test-mail-polls GET ANY ANY /polls/mail/test-mail-polls/{emailChoice}
api_poll_delete DELETE ANY ANY /polls/{id}
api_check_slug_is_unique GET ANY ANY /polls/slugs/{slug}
api_get_admin_config GET ANY ANY /polls/admin/{token}
api_new_vote_stack POST ANY ANY /polls/{id}/votes
api_update_vote_stack PATCH ANY ANY /votes-stacks/{id}/token/{modifierToken}
api_poll_votes_delete DELETE ANY ANY /polls/{id}/votes/{accessToken}
app.swagger GET ANY ANY /api/doc.json
-------------------------- -------- -------- ------ ------------------------------------------------
*/
------------------------------------------ ---------- -------- ------ ------------------------------------------------
Name Method Scheme Host Path
------------------------------------------ ---------- -------- ------ ------------------------------------------------
_twig_error_test ANY ANY ANY /_error/{code}.{_format}
admin_homepage_get_default GET ANY ANY /admin/
admin_homepage_clean_expired_polls GET ANY ANY /admin/polls/clean/{token}
admin_homepage_migrate_framadate GET ANY ANY /admin/polls/migrate
api_get_poll_comment GET ANY ANY /api/v1/poll/{id}/comments
api_new_comment POST ANY ANY /api/v1/poll/{id}/comment
api_poll_comments_delete DELETE ANY ANY /api/v1/poll/{id}/comments
api_page_home GET ANY ANY /page/
user_homepageget_default GET ANY ANY /user/
user_homepage_polls_send_by_email GET ANY ANY /user/{email}/polls/send-by-email
poll_index GET ANY ANY /poll/
poll_new GET|POST ANY ANY /poll/new
poll_show GET ANY ANY /poll/{id}
poll_edit GET|POST ANY ANY /poll/{id}/edit
poll_delete DELETE ANY ANY /poll/{id}
api_new_vote_stack POST ANY ANY /api/v1/poll/{id}/answer
api_update_vote_stack PATCH ANY ANY /api/v1/vote-stack/{id}/token/{modifierToken}
api_poll_votes_delete DELETE ANY ANY /api/v1/poll/{id}/votes/{accessToken}
api_get_all_polls GET ANY ANY /api/v1/poll/
api_get_poll GET ANY ANY /api/v1/poll/{id}
api_update_poll PUT ANY ANY /api/v1/poll/{id}/{token}
api_new_poll POST ANY ANY /api/v1/poll/
api_test-mail-poll GET ANY ANY /api/v1/poll/mail/test-mail-poll/{emailChoice}
api_poll_delete DELETE ANY ANY /api/v1/poll/{id}
api_check_slug_is_unique GET ANY ANY /api/v1/poll/slug/{slug}
api_get_admin_config GET ANY ANY /api/v1/poll/admin/{token}
overblog_graphql_endpoint ANY ANY ANY /api/graphql/
overblog_graphql_batch_endpoint ANY ANY ANY /api/graphql/batch
overblog_graphql_multiple_endpoint ANY ANY ANY /api/graphql/graphql/{schemaName}
overblog_graphql_batch_multiple_endpoint ANY ANY ANY /api/graphql/graphql/{schemaName}/batch
app.swagger GET ANY ANY /api/doc.json
------------------------------------------ ---------- -------- ------ ------------------------------------------------
/**
* WANTED CHANGES (seraf)
......
[General]
LangCode=fr_FR
PotBaseDir=src/assets/i18n
ProjectID=funky-framadate-front
TargetLangCode=fr_FR
<!--
Collection name attribute represents the name of the menu, e.g., to use menu "File" use "file" or "Help" use "help". You can add new menus.
If you type a relative script file beware that this script is located in $XDG_DATA_HOME/applicationname/
The following example adds an action with the text "Export..." into the "File" menu
<KrossScripting>
<collection name="file" text="File" comment="File menu">
<script name="export" text="Export..." comment="Export content" file="export.py" />
</collection>
</KrossScripting>
-->
\ No newline at end of file
<?xml version='1.0' encoding='UTF-8'?>
<qa version="1.0">
<category name="default"/>
</qa>
......@@ -20,8 +20,10 @@
"compodoc": "compodoc -p tsconfig.app.json",
"mock:server": "json-server --port 8000 --watch ./mocks/db.json --routes ./mocks/routes.json",
"start:proxy": "ng serve --proxy-config proxy.conf.json",
"start:proxymock": "concurrently --kill-others \"yarn mock:server\" \"yarn start:proxy\""
},
"start:proxymock": "concurrently --kill-others \"yarn mock:server\" \"yarn start:proxy\"",
"i18n:init": "ngx-translate-extract --input ./src --output ./src/assets/i18n/template.json --key-as-default-value --replace --format json",
"i18n:extract": "ngx-translate-extract --input ./src --output ./src/assets/i18n/{en,da,de,fi,nb,nl,sv}.json --clean --format json"
},
"private": false,
"dependencies": {
"@angular/animations": "^9.1.1",
......@@ -35,6 +37,8 @@
"@angular/platform-browser": "^9.0.7",
"@angular/platform-browser-dynamic": "^9.0.7",
"@angular/router": "^9.0.7",
"@biesbjerg/ngx-translate-extract": "^7.0.3",
"@biesbjerg/ngx-translate-po-http-loader": "^3.1.0",
"@fullcalendar/core": "^4.4.0",
"@ngx-translate/core": "^12.1.2",
"@ngx-translate/http-loader": "^5.0.0",
......@@ -53,6 +57,7 @@
"rxjs": "^6.5.5",
"rxjs-compat": "^6.5.5",
"short-unique-id": "^3.0.3",
"stream": "^0.0.2",
"tslib": "<2.0.0",
"zone.js": "^0.10.3"
},
......
......@@ -52,6 +52,7 @@ export function HttpLoaderFactory(http: HttpClient): TranslateHttpLoader {
NgxWebstorageModule.forRoot({ prefix: environment.localStorage.key }),
SharedModule,
TranslateModule.forRoot({
defaultLanguage: 'FR',
loader: {
provide: TranslateLoader,
useFactory: HttpLoaderFactory,
......@@ -61,7 +62,7 @@ export function HttpLoaderFactory(http: HttpClient): TranslateHttpLoader {
provide: MissingTranslationHandler,
useClass: MyMissingTranslationHandler,
},
useDefaultLang: false,
useDefaultLang: true,
}),
],
providers: [Title, TranslateService],
......
<footer class="footer">
<div class="content has-text-centered">
<p>
Framadate - libérez vos sondages.
<i class="fa fa-copyleft"></i> Logiciel libre sous licence AGPL v3.
<img class="app-logo logo" *ngIf="env.appLogo" src="{{ env.appLogo }}" alt="{{ env.appTitle }}" />
{{ env.appTitle }} - {{ env.appVersion }} - libérez vos sondages. <i class="fa fa-copyleft"></i> Logiciel
libre sous licence AGPL v3.
<app-theme-selector></app-theme-selector>
<a href="https://framagit.org/framasoft/framadate/funky-framadate-front">
<i class="fa fa-gitlab"></i> Sources</a
>
......
import { Component, OnInit } from '@angular/core';
import { environment } from '../../../../environments/environment';
@Component({
selector: 'app-footer',
......@@ -6,6 +7,7 @@ import { Component, OnInit } from '@angular/core';
styleUrls: ['./footer.component.scss'],
})
export class FooterComponent implements OnInit {
public env = environment;
constructor() {}
ngOnInit(): void {}
......
......@@ -3,10 +3,10 @@
<div class="navbar-brand">
<a class="navbar-item" routerLink="/">
<img class="app-logo logo" *ngIf="appLogo" src="{{ appLogo }}" alt="{{ appTitle }}" />
<span class="app-title title">
<span class="app-title title is-2">
{{ appTitle }}
</span>
<span class="dev-env" *ngIf="!env.production">
<span class="dev-env button has-background-success" *ngIf="!env.production">
<i>
(dev)
</i>
......@@ -19,6 +19,8 @@
aria-label="menu"
aria-expanded="false"
data-target="navbarBasicExample"
[ngClass]="{ 'has-background-primary': mobileMenuVisible }"
(click)="mobileMenuVisible = !mobileMenuVisible"
>
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
......@@ -29,15 +31,19 @@
<div id="navbarBasicExample" class="navbar-menu">
<div class="navbar-start">
<a class="navbar-item btn btn--primary" routerLink="administration" routerLinkActive="is-active">
<i class="fa fa-plus-circle"></i> {{ 'config.title' | translate }}
<i class="fa fa-plus-circle"></i>
<span>
{{ 'config.title' | translate }}
</span>
</a>
</div>
<div class="navbar-end">
<a class="navbar-item btn btn-primary" routerLink="user/polls" routerLinkActive="is-active">
<i class="fa fa-user"></i> {{ 'config.find_my_polls' | translate }}
</a>
<app-language-selector></app-language-selector>
</div>
</div>
<div class="mobile-menu" *ngIf="mobileMenuVisible">
menu mobile
</div>
</nav>
</header>
......@@ -2,6 +2,9 @@
header {
nav {
padding-right: 1em;
.fa {
margin-right: 1ch;
}
}
.container {
padding: 0;
......
......@@ -17,8 +17,9 @@ export class HeaderComponent implements OnInit {
public env = environment;
@Input() public appTitle: string = 'FramaDate Funky';
@Input() public appLogo: string;
mobileMenuVisible = false;
constructor(private userService: UserService, private modalService: ModalService) {}
constructor(private userService: UserService) {}
public ngOnInit(): void {}
}
......@@ -2,26 +2,68 @@
<div class="hero-body">
<div class="container">
<h1 class="title">
Bienvenue sur Framasondage
{{ 'home.title' | translate }}
{{ env.appTitle }}
</h1>
<div class="columns">
<div class="column">
<h2 class="subtitle">
Se consulter simplement pour s’organiser collectivement.
{{ 'home.subtitle' | translate }}
</h2>
<a role="button" class="button is-fullwidth is-primary" routerLink="administration">
Créer un nouveau sondage
</a>
</div>
<div class="column">
<h2 class="subtitle">
Où sont mes sondages?
{{ 'home.search_title' | translate }}
</h2>
</div>
</div>
<div class="columns">
<div class="column">
<a role="button" class="button is-fullwidth is-primary" routerLink="administration">
<i class="fa fa-plus-circle"></i>
{{ 'home.create_button' | translate }}
</a>
<img src="assets/img/kind/date.jpeg" alt="sondage date" />
</div>
<div class="column">
<a role="button" class="button is-fullwidth is-primary" routerLink="user/polls">
Mes sondages
<i class="fa fa-search"></i>
{{ 'home.search_button' | translate }}
</a>
<img src="assets/img/kind/classic.jpeg" alt="sondage date" />
</div>
</div>
<div class="column">
<img src="assets/img/undraw_group_selfie_ijc6.svg" alt="image WIP" />
<p>
{{
'SENTENCES.framadate-is-an-online-service-for-planning-an-appointment-or-making-a-decision-quickly-and-easily'
| translate
}}
{{ 'SENTENCES.here-is-how-it-works' | translate }}
{{ 'SENTENCES.send-the-poll-link-to-your-friends-or-colleagues' | translate }}
</p>
<p>
{{ 'SENTENCES.what-is-framadate' | translate }}
{{ 'SENTENCES.view-an-example' | translate }}
{{ 'SENTENCES.framadate-is-licensed-under-the' | translate }}
<span class="licence">
GNU Affero v3 Licence
</span>
</p>
<p>
{{ 'SENTENCES.grow-your-own' | translate }}
{{
'SENTENCES.if-you-want-to-install-the-software-for-your-own-use-and-thus-increase-your-independence-we-can-help'
| translate
}}
{{
'SENTENCES.to-participate-in-the-software-development-suggest-improvements-or-simply-download-it-please-visit'
| translate
}}
{{ 'SENTENCES.the-development-site' | translate }}
</p>
</div>
</div>
</div>
</section>
:host {
text-align: center;
a .fa {
margin-right: 1ch;
}
}
import { Component, OnInit } from '@angular/core';
import { Component } from '@angular/core';
import { environment } from '../../../../environments/environment';
@Component({
selector: 'app-home',
templateUrl: './home.component.html',
styleUrls: ['./home.component.scss'],
})
export class HomeComponent implements OnInit {
constructor() {}
ngOnInit(): void {}
export class HomeComponent {
public env = environment;
}
......@@ -2,9 +2,6 @@
<div class="navbar-item has-dropdown is-hoverable">
<a class="navbar-link"> Tous les sondages </a>
<div class="navbar-dropdown">
<a class="navbar-item" routerLink="/poll/inexistentPoll/consultation" routerLinkActive="is-active">
« inexistentPoll »
</a>
<a
class="navbar-item"
*ngFor="let poll of _pollsAvailables | async"
......@@ -18,7 +15,7 @@
<hr />
<div class="navbar-item has-dropdown is-hoverable">
<div class="navbar-item has-dropdown is-hoverable is-warning" *ngIf="devModeEnabled">
<a class="navbar-link"> Modules </a>
<div class="navbar-dropdown">
<a class="navbar-item" routerLink="oldstuff" routerLinkActive="is-active">
......@@ -34,28 +31,32 @@
Participation
</a>
</div>
</div>
<hr />
<hr />
<a class="navbar-item" routerLink="/poll/inexistentPoll/consultation" routerLinkActive="is-active">
« inexistentPoll »
</a>
<hr />
<a class="button is-block" routerLink="oldstuff/step/creation" routerLinkActive="active"> Création </a>
<a class="button is-block" routerLink="oldstuff/step/date" routerLinkActive="active"> Les Dates </a>
<a class="button is-block" routerLink="oldstuff/step/answers" routerLinkActive="active"> Réponses </a>
<a class="button is-block" routerLink="oldstuff/step/visibility" routerLinkActive="active"> Visibilité </a>
<a class="button is-block" routerLink="oldstuff/step/resume" routerLinkActive="active"> Résumé </a>
<a class="button is-block" routerLink="oldstuff/step/end" routerLinkActive="active"> Confirmation </a>
<a class="button is-block" routerLink="oldstuff/step/admin"> Administration </a>
<a class="button is-block" routerLink="oldstuff/step/home" routerLinkActive="active">
<i class="fa fa-home" aria-hidden="true"></i> Accueil
</a>
<a class="button is-block" routerLink="oldstuff/step/creation" routerLinkActive="active"> Création </a>
<a class="button is-block" routerLink="oldstuff/step/date" routerLinkActive="active"> Les Dates </a>
<a class="button is-block" routerLink="oldstuff/step/answers" routerLinkActive="active"> Réponses </a>
<a class="button is-block" routerLink="oldstuff/step/visibility" routerLinkActive="active"> Visibilité </a>
<a class="button is-block" routerLink="oldstuff/step/resume" routerLinkActive="active"> Résumé </a>
<a class="button is-block" routerLink="oldstuff/step/end" routerLinkActive="active"> Confirmation </a>
<a class="button is-block" routerLink="oldstuff/step/admin"> Administration </a>
<hr />
<hr />
<a class="button is-block" routerLink="oldstuff/step/kind" routerLinkActive="active"> Page démo </a>
<a class="button is-block" routerLink="oldstuff/vote/poll/id/1" routerLinkActive="active"> Sondage 1 </a>
<a class="button is-block" routerLink="oldstuff/vote/poll/id/2" routerLinkActive="active"> Sondage 2 </a>
<a class="button is-block" routerLink="oldstuff/vote/poll/id/3" routerLinkActive="active">
Sondage 3 (dessins animés)
</a>
<a class="button is-block" routerLink="oldstuff/graphic/toto" routerLinkActive="active"> Graphique </a>
</div>
<a class="button is-block" routerLink="oldstuff/step/kind" routerLinkActive="active"> Page démo </a>
<a class="button is-block" routerLink="oldstuff/vote/poll/id/1" routerLinkActive="active"> Sondage 1 </a>
<a class="button is-block" routerLink="oldstuff/vote/poll/id/2" routerLinkActive="active"> Sondage 2 </a>
<a class="button is-block" routerLink="oldstuff/vote/poll/id/3" routerLinkActive="active">
Sondage 3 (dessins animés)
<a class="button is-block" routerLink="oldstuff/step/home" routerLinkActive="active">
<i class="fa fa-home" aria-hidden="true"></i> Accueil
</a>
<a class="button is-block" routerLink="oldstuff/graphic/toto" routerLinkActive="active"> Graphique </a>
</nav>
......@@ -3,6 +3,7 @@ import { Observable } from 'rxjs';
import { Poll } from '../../../models/poll.model';
import { MockingService } from '../../../services/mocking.service';
import { environment } from '../../../../../environments/environment';
@Component({
selector: 'app-navigation',
......@@ -11,6 +12,7 @@ import { MockingService } from '../../../services/mocking.service';
})
export class NavigationComponent implements OnInit {
public _pollsAvailables: Observable<Poll[]> = this.mockingService.pollsAvailables;
public devModeEnabled = !environment.production;
constructor(private mockingService: MockingService) {}
......
......@@ -10,10 +10,11 @@ import { HomeComponent } from './components/home/home.component';
import { LogoComponent } from './components/logo/logo.component';
import { NavigationComponent } from './components/sibebar/navigation/navigation.component';
import { throwIfAlreadyLoaded } from './guards/module-import.guard';
import { SharedModule } from '../shared/shared.module';
@NgModule({
declarations: [FooterComponent, HeaderComponent, HomeComponent, LogoComponent, NavigationComponent],
imports: [CommonModule, FormsModule, RouterModule, TranslateModule],
imports: [CommonModule, FormsModule, RouterModule, TranslateModule, SharedModule],
exports: [HeaderComponent, FooterComponent, NavigationComponent, LogoComponent],
})
export class CoreModule {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment