home page reorder and statistics, todo component

This commit is contained in:
Tykayn 2021-02-04 18:34:06 +01:00 committed by tykayn
parent 2d9f1f7d40
commit 5bac37a790
13 changed files with 148 additions and 53 deletions

View File

@ -1,14 +1,9 @@
import {NgModule} from '@angular/core'; import { NgModule } from '@angular/core';
import {RouterModule} from '@angular/router'; import { RouterModule } from '@angular/router';
import {routes} from "./routes-framadate"; import { routes } from './routes-framadate';
@NgModule({ @NgModule({
imports: [ imports: [RouterModule.forRoot(routes)],
RouterModule.forRoot(routes, {
// enableTracing: true, // <-- debugging purposes only
}),
],
exports: [RouterModule], exports: [RouterModule],
}) })
export class AppRoutingModule {} export class AppRoutingModule {}

View File

@ -6,7 +6,6 @@ import { environment } from '../environments/environment';
import { Theme } from './core/enums/theme.enum'; import { Theme } from './core/enums/theme.enum';
import { LanguageService } from './core/services/language.service'; import { LanguageService } from './core/services/language.service';
import { ThemeService } from './core/services/theme.service'; import { ThemeService } from './core/services/theme.service';
import { MockingService } from './core/services/mocking.service';
@Component({ @Component({
selector: 'app-root', selector: 'app-root',

View File

@ -23,7 +23,6 @@ import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component'; import { AppComponent } from './app.component';
import { CoreModule } from './core/core.module'; import { CoreModule } from './core/core.module';
import { SharedModule } from './shared/shared.module'; import { SharedModule } from './shared/shared.module';
registerLocaleData(localeEn, 'en-EN'); registerLocaleData(localeEn, 'en-EN');
registerLocaleData(localeFr, 'fr-FR'); registerLocaleData(localeFr, 'fr-FR');

View File

@ -1,10 +1,20 @@
<section class="hero"> <section class="hero">
<div class="hero-body"> <div class="hero-body">
<div class="container"> <div class="container">
<h1 class="title"> <div class="column">
{{ 'home.title' | translate }} <blockquote class="notification is-info is-light content is-size-3 has-text-weight-light">
{{ env.appTitle }} <h1 class="title">
</h1> {{ 'home.title' | translate }}
{{ env.appTitle }}
</h1>
<i class="fa fa-poll"></i>
{{
'SENTENCES.framadate-is-an-online-service-for-planning-an-appointment-or-making-a-decision-quickly-and-easily'
| translate
}}
</blockquote>
<img src="assets/img/undraw_group_selfie_ijc6.svg" alt="image WIP" />
</div>
<div class="columns"> <div class="columns">
<div class="column"> <div class="column">
<h2 class="subtitle"> <h2 class="subtitle">
@ -19,34 +29,22 @@
</div> </div>
<div class="columns"> <div class="columns">
<div class="column"> <div class="column">
<a role="button" class="button is-fullwidth is-primary" routerLink="administration"> <a role="button" class="button is-fullwidth is-primary is-size-3" routerLink="administration">
<i class="fa fa-plus-circle"></i> <i class="fa fa-plus-circle"></i>
{{ 'home.create_button' | translate }} {{ 'home.create_button' | translate }}
</a> </a>
<img src="assets/img/kind/date.jpeg" alt="sondage date" /> <img src="assets/img/kind/date.jpeg" alt="sondage date" />
</div> </div>
<div class="column"> <div class="column">
<a role="button" class="button is-fullwidth is-primary" routerLink="user/polls"> <a role="button" class="button is-fullwidth is-info is-size-3" routerLink="user/polls">
<i class="fa fa-search"></i> <i class="fa fa-search"></i>
{{ 'home.search_button' | translate }} {{ 'home.search_button' | translate }}
</a> </a>
<img src="assets/img/kind/classic.jpeg" alt="sondage date" /> <img src="assets/img/kind/classic.jpeg" alt="sondage date" />
</div> </div>
</div> </div>
<div class="column"> <div class="column">
<blockquote class="notification is-info is-light content is-size-3 has-text-weight-medium">
<h2 class="title is-2">
{{ 'SENTENCES.what-is-framadate' | translate }}
</h2>
<i class="fa fa-poll"></i>
{{
'SENTENCES.framadate-is-an-online-service-for-planning-an-appointment-or-making-a-decision-quickly-and-easily'
| translate
}}
</blockquote>
</div>
<div class="column">
<img src="assets/img/undraw_group_selfie_ijc6.svg" alt="image WIP" />
<div class="columns"> <div class="columns">
<div class="column"> <div class="column">
<h2 class="title is-2"> <h2 class="title is-2">
@ -72,15 +70,9 @@
{{ 'SENTENCES.framadate-is-licensed-under-the' | translate }} {{ 'SENTENCES.framadate-is-licensed-under-the' | translate }}
<span class="licence has-text-weight-medium"> <span class="licence has-text-weight-medium">
<i class="fa fa-gnu"></i>
GNU Affero v3 Licence GNU Affero v3 Licence
</span> </span>
<a
class="btn btn-info"
href="https://framagit.org/framasoft/framadate/funky-framadate-front"
>
<i class="fa fa-feather"></i>
Sources
</a>
</p> </p>
</div> </div>
@ -103,6 +95,55 @@
</div> </div>
</div> </div>
</div> </div>
<!-- statistiques-->
<p class="title">Statistiques</p>
<app-wip-todo></app-wip-todo>
<div class="tile is-ancestor">
<div class="tile is-4 is-vertical is-parent">
<div class="tile is-child box">
<div class="title">
62 346
</div>
<p>sondages</p>
</div>
<div class="tile is-child box">
<div class="title">
223 124
</div>
<p>votes</p>
</div>
<div class="tile is-child box">
<div class="title">
123
</div>
<p>consensus parfaits</p>
</div>
<div class="tile is-child box">
<div class="title">
41 875
</div>
<p>commentaires</p>
</div>
</div>
<div class="tile is-parent">
<div class="tile is-child box">
<div class="title">
44 985
</div>
<p>sondages de type date</p>
</div>
<div class="tile is-child box">
<div class="title">
22 985
</div>
<p>sondages de type classique</p>
</div>
<div class="tile is-child box">
<p class="title">Mentions légales</p>
<p>Voir ici le détail des mentions légales, CGU, CPU, politique de confidentialité.</p>
</div>
</div>
</div>
</div> </div>
</div> </div>
</section> </section>

View File

@ -4,6 +4,19 @@
<h1>Mes sondages</h1> <h1>Mes sondages</h1>
</div> </div>
</div> </div>
<div class="columns">
<div class="column">
<form (submit)="sendRetrieveEmail()">
<input type="email" id="search_field" autofocus="autofocus" placeholder="contact@exemple.com" />
<button class="button is-primary">
envoyez-moi la liste par email
</button>
<label for="search_field" class="clickable padded">
<img src="assets/img/undraw_prototyping_process_rswj.svg" alt="image my polls" />
</label>
</form>
</div>
</div>
<div *ngIf="pollsAreLoaded"> <div *ngIf="pollsAreLoaded">
<div class="columns"> <div class="columns">
<div class="column"> <div class="column">
@ -23,17 +36,4 @@
</div> </div>
</div> </div>
</div> </div>
<div class="columns">
<div class="column">
<form (submit)="sendRetrieveEmail()">
<label for="search_field">
<img src="assets/img/undraw_prototyping_process_rswj.svg" alt="image my polls" />
<input type="email" id="search_field" autofocus="autofocus" placeholder="contact@exemple.com" />
</label>
<button class="button is-primary">
envoyez-moi la liste par email
</button>
</form>
</div>
</div>
</div> </div>

View File

@ -5,9 +5,16 @@ import { TranslateModule } from '@ngx-translate/core';
import { SharedModule } from '../../shared/shared.module'; import { SharedModule } from '../../shared/shared.module';
import { UserPollsComponent } from './user-polls/user-polls.component'; import { UserPollsComponent } from './user-polls/user-polls.component';
import { UserProfileRoutingModule } from './user-profile-routing.module'; import { UserProfileRoutingModule } from './user-profile-routing.module';
import { AppModule } from '../../app.module';
@NgModule({ @NgModule({
declarations: [UserPollsComponent], declarations: [UserPollsComponent],
imports: [CommonModule, UserProfileRoutingModule, SharedModule, TranslateModule.forChild({ extend: true })], imports: [
CommonModule,
UserProfileRoutingModule,
SharedModule,
TranslateModule.forChild({ extend: true }),
AppModule,
],
}) })
export class UserProfileModule {} export class UserProfileModule {}

View File

@ -3,6 +3,7 @@ import { HomeComponent } from './core/components/home/home.component';
import { PollService } from './core/services/poll.service'; import { PollService } from './core/services/poll.service';
import { PageNotFoundComponent } from './shared/components/page-not-found/page-not-found.component'; import { PageNotFoundComponent } from './shared/components/page-not-found/page-not-found.component';
import { SuccessComponent } from './features/administration/success/success.component'; import { SuccessComponent } from './features/administration/success/success.component';
import { WipTodoComponent } from './shared/components/ui/wip-todo/wip-todo.component';
export const routes: Routes = [ export const routes: Routes = [
{ path: '', component: HomeComponent }, { path: '', component: HomeComponent },
@ -40,6 +41,10 @@ export const routes: Routes = [
path: 'success', path: 'success',
component: SuccessComponent, component: SuccessComponent,
}, },
{
path: 'todo',
component: WipTodoComponent,
},
{ path: 'page-not-found', component: PageNotFoundComponent }, { path: 'page-not-found', component: PageNotFoundComponent },
{ path: '**', redirectTo: 'page-not-found', pathMatch: 'full' }, { path: '**', redirectTo: 'page-not-found', pathMatch: 'full' },
]; ];

View File

@ -0,0 +1,11 @@
<div class="notification is-info is-light">
<div class="columns">
<div class="column is-narrow">
<i class="fa fa-info-circle fa-2x"></i>
</div>
<div class="column">
Cette fonctionnalité est <strong>en cours de développement</strong>, vous pouvez contribuer à son
amélioration avec le bouton de feedback.
</div>
</div>
</div>

View File

@ -0,0 +1,24 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { WipTodoComponent } from './wip-todo.component';
describe('WipTodoComponent', () => {
let component: WipTodoComponent;
let fixture: ComponentFixture<WipTodoComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [WipTodoComponent],
}).compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(WipTodoComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,12 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-wip-todo',
templateUrl: './wip-todo.component.html',
styleUrls: ['./wip-todo.component.scss'],
})
export class WipTodoComponent implements OnInit {
constructor() {}
ngOnInit(): void {}
}

View File

@ -25,6 +25,7 @@ import { SettingsComponent } from './components/settings/settings.component';
import { SpinnerComponent } from './components/spinner/spinner.component'; import { SpinnerComponent } from './components/spinner/spinner.component';
import { CopyTextComponent } from './components/ui/copy-text/copy-text.component'; import { CopyTextComponent } from './components/ui/copy-text/copy-text.component';
import { ErasableInputComponent } from './components/ui/erasable-input/erasable-input.component'; import { ErasableInputComponent } from './components/ui/erasable-input/erasable-input.component';
import { WipTodoComponent } from './components/ui/wip-todo/wip-todo.component';
const COMPONENTS = [ const COMPONENTS = [
ChoiceDetailsComponent, ChoiceDetailsComponent,
@ -37,6 +38,7 @@ const COMPONENTS = [
ThemeSelectorComponent, ThemeSelectorComponent,
CopyTextComponent, CopyTextComponent,
ErasableInputComponent, ErasableInputComponent,
WipTodoComponent,
]; ];
const ANGULAR_MODULES = [CommonModule, ChartsModule, FormsModule, TranslateModule]; const ANGULAR_MODULES = [CommonModule, ChartsModule, FormsModule, TranslateModule];

View File

@ -4,10 +4,10 @@
const backendApiUrlsInDev = { const backendApiUrlsInDev = {
local: '/api/v1', local: '/api/v1',
remote: 'https://framadate-api.cipherbliss.com/api/v1', remote: 'http://localhost:8000/api/v1',
}; };
const apiV1 = { const apiV1 = {
baseHref: 'https://framadate-api.cipherbliss.com/api/v1', baseHref: 'http://localhost:8000/api/v1',
api_new_poll: '/poll/', api_new_poll: '/poll/',
api_get_poll: '/poll/{id}', api_get_poll: '/poll/{id}',
'api_test-mail-poll': '/api/v1/poll/mail/test-mail-poll/{emailChoice}', 'api_test-mail-poll': '/api/v1/poll/mail/test-mail-poll/{emailChoice}',