Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Do not merge] - training materials #9592

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions api/resources/translations/messages-en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1265,6 +1265,10 @@ training_cards.error.loading = Error loading training. Please contact your super
training_cards.error.save = Error saving training.
training_cards.form.saved = Training completed.
training_cards.modal.title = Important changes
training_materials.page.no_more_trainings = No more trainings
training_materials.page.no_selected = No training material selected
training_materials.page.no_trainings = No trainings found
training_materials.page.title = Training Materials
translation.add = Add new translation key
translation.key = Translation key
unique.id = Unique ID
Expand Down
4 changes: 4 additions & 0 deletions api/resources/translations/messages-es.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1265,6 +1265,10 @@ training_cards.error.loading = Hubo un error al cargar el entrenamiento. Por fav
training_cards.error.save = Hubo un error al guardar el entrenamiento.
training_cards.form.saved = Entrenamiento completado.
training_cards.modal.title = Cambios importantes
training_materials.page.no_more_trainings = No hay más entrenamientos
training_materials.page.no_selected = Ningún material de entrenamiento seleccionado
training_materials.page.no_trainings = No se encontraron entrenamientos
training_materials.page.title = Materiales de entrenamiento
translation.add = Agregar Traducción
translation.key = Clave de traducción
unique.id = Identificación única
Expand Down
4 changes: 4 additions & 0 deletions api/resources/translations/messages-fr.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1265,6 +1265,10 @@ training_cards.error.loading = Erreur lors du chargement de la formation. Veuill
training_cards.error.save = Erreur lors de l'enregistrement de la formation.
training_cards.form.saved = Formation terminée.
training_cards.modal.title = Changements importants
training_materials.page.no_more_trainings = Plus de formations
training_materials.page.no_selected = Aucun matériel de formation sélectionné
training_materials.page.no_trainings = Aucune formation trouvée
training_materials.page.title = Matériel de formation
translation.add = Ajouter une traduction
translation.key = Clé de traduction
unique.id = ID unique
Expand Down
4 changes: 4 additions & 0 deletions api/resources/translations/messages-hi.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1168,6 +1168,10 @@ training_cards.confirm.exit = यह प्रशिक्षण समाप्
training_cards.confirm.button.no = रद्द करें
training_cards.confirm.button.yes = बाहर निकलें
training_cards.confirm.title = प्रशिक्षण छोड़ें?
training_materials.page.no_more_trainings = और कोई प्रशिक्षण नहीं है
training_materials.page.no_selected = कोई प्रशिक्षण सामग्री नहीं चुनी गई।
training_materials.page.no_trainings = कोई प्रशिक्षण नहीं मिला
training_materials.page.title = प्रशिक्षण सामग्री
translation.add = अनुवाद दर्ज करें
translation.key = अनुवाद का गाइड
unique.id =
Expand Down
4 changes: 4 additions & 0 deletions api/resources/translations/messages-id.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1175,6 +1175,10 @@ training_cards.confirm.exit = Pelatihan ini belum selesai. Jika Anda keluar seka
training_cards.confirm.button.no = Batalkan
training_cards.confirm.button.yes = Keluar
training_cards.confirm.title = Keluar dari pelatihan?
training_materials.page.no_more_trainings = Tidak ada lagi pelatihan
training_materials.page.no_selected = Tidak ada materi pelatihan yang dipilih
training_materials.page.no_trainings = Tidak ditemukan pelatihan
training_materials.page.title = Materi Pelatihan
translation.add = Tambah terjemahan
translation.key = Kunci terjemahan
unique.id =
Expand Down
4 changes: 4 additions & 0 deletions api/resources/translations/messages-ne.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1265,6 +1265,10 @@ training_cards.error.loading = तालिम लोड गर्दा त्
training_cards.error.save = तालिम सेभ गर्न त्रुटि।
training_cards.form.saved = तालिम सम्पन्न भयो।
training_cards.modal.title = महत्वपुर्ण परिवर्तनहरु
training_materials.page.no_more_trainings = अब कुनै तालिम छैन
training_materials.page.no_selected = कुनै तालिम सामग्री छनोट गरिएको छैन।
training_materials.page.no_trainings = कुनै तालिम फेला परेन
training_materials.page.title = प्रशिक्षण सामग्री
translation.add = नयाँ अनुवाद कुञ्जी थप्नुहोस्
translation.key = अनुवाद कुञ्जी
unique.id = आईडी
Expand Down
4 changes: 4 additions & 0 deletions api/resources/translations/messages-sw.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1265,6 +1265,10 @@ training_cards.error.loading = Hitilafu katika kupakia mafunzo. Tafadhali wasili
training_cards.error.save = Hitilafu katika kuhifadhi mafunzo.
training_cards.form.saved = Mafunzo yamekamilika.
training_cards.modal.title = Mabadiliko muhimu
training_materials.page.no_more_trainings = Hakuna mafunzo mengine
training_materials.page.no_selected = Hakuna nyenzo za mafunzo zilizochaguliwa
training_materials.page.no_trainings = Hakuna mafunzo yaliyopatikana
training_materials.page.title = Vifaa vya Mafunzo
translation.add = Ongeza tafsiri
translation.key = Ufunguo wa tafsiri
unique.id = Kitambulisho cha kipekee
Expand Down
5 changes: 5 additions & 0 deletions webapp/src/css/inbox.less
Original file line number Diff line number Diff line change
Expand Up @@ -1368,6 +1368,11 @@ mm-sidebar-menu .mat-sidenav-container {
margin-right: 15px;
flex-shrink: 0;
}

mat-icon.fa-graduation-cap:before {
font-size: @font-medium;
vertical-align: middle;
}
}

.nav-item:not(:not(.hidden) ~ .nav-item) { // The first element without .hidden class, compatible with Chrome +90
Expand Down
5 changes: 5 additions & 0 deletions webapp/src/ts/actions/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export const Actions = {
setLoadingContent: createSingleValueAction('SET_LOADING_CONTENT', 'loadingContent'),
setShowContent: createSingleValueAction('SET_SHOW_CONTENT', 'showContent'),
setForms: createSingleValueAction('SET_FORMS', 'forms'),
setTrainingMaterials: createSingleValueAction('SET_TRAINING_MATERIALS', 'trainingMaterials'),
clearFilters: createSingleValueAction('CLEAR_FILTERS', 'skip'),
setFilter: createSingleValueAction('SET_FILTER', 'filter'),
setSidebarFilter: createSingleValueAction('SET_SIDEBAR_FILTER', 'sidebarFilter'),
Expand Down Expand Up @@ -71,6 +72,10 @@ export class GlobalActions {
return this.store.dispatch(Actions.setForms(forms));
}

setTrainingMaterials(trainingMaterials) {
return this.store.dispatch(Actions.setTrainingMaterials(trainingMaterials));
}

setShowContent(showContent) {
return this.store.dispatch(Actions.setShowContent(showContent));
}
Expand Down
2 changes: 2 additions & 0 deletions webapp/src/ts/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { routes as messagesRoutes } from '@mm-modules/messages/messages.routes';
import { routes as contactsRoutes } from '@mm-modules/contacts/contacts.routes';
import { routes as privacyPolicyRoutes } from '@mm-modules/privacy-policy/privacy-policy.routes';
import { routes as tasksRoutes } from '@mm-modules/tasks/tasks.routes';
import { routes as trainingRoutes } from '@mm-modules/trainings/trainings.routes';
import { routes as testingRoutes } from '@mm-modules/testing/testing.routes';

const routes: Routes = [
Expand All @@ -23,6 +24,7 @@ const routes: Routes = [
...contactsRoutes,
...privacyPolicyRoutes,
...tasksRoutes,
...trainingRoutes,
...testingRoutes,
...errorRoutes,
];
Expand Down
6 changes: 6 additions & 0 deletions webapp/src/ts/components/header/header.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@

<li role="separator" class="divider" *ngIf="!replicationStatus.disabled"></li>

<li role="presentation">
<a routerLink="trainings" role="menuitem" tabindex="-1">
<i class="fa fa-fw fa-graduation-cap"></i>
<span>{{'training_materials.page.title' | translate}}</span>
</a>
</li>
<li role="presentation">
<a routerLink="about" role="menuitem" tabindex="-1">
<i class="fa fa-fw fa-question"></i>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,12 @@ export class SidebarMenuComponent implements OnInit, OnDestroy {

private setSecondaryOptions(showPrivacyPolicy = false) {
this.secondaryOptions = [
{
routerLink: 'trainings',
icon: 'fa-graduation-cap',
translationKey: 'training_materials.page.title',
canDisplay: true,
},
{
routerLink: 'about',
icon: 'fa-question',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
[titleKey]="showConfirmExit ? 'training_cards.confirm.title' : modalTitleKey | translate"
(onCancel)="confirmExit(true)"
[hideFooter]="hideModalFooter"
[hasEnketoForm]="true"
>
[hasEnketoForm]="true">

<div class="item-content empty-selection" *ngIf="loadingContent">
<div><div class="loader"></div></div>
Expand Down
6 changes: 6 additions & 0 deletions webapp/src/ts/modules/modules.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ import { AnalyticsTargetAggregatesSidebarFilterComponent }
import {
AnalyticsTargetAggregatesDetailComponent
} from '@mm-modules/analytics/analytics-target-aggregates-detail.component';
import { TrainingsComponent } from '@mm-modules/trainings/trainings.component';
import { TrainingsContentComponent } from '@mm-modules/trainings/training-content.component';
import { TasksComponent } from '@mm-modules/tasks/tasks.component';
import { TasksContentComponent } from '@mm-modules/tasks/tasks-content.component';
import { TasksGroupComponent } from '@mm-modules/tasks/tasks-group.component';
Expand Down Expand Up @@ -74,6 +76,8 @@ import { DirectivesModule } from '@mm-directives/directives.module';
AnalyticsTargetAggregatesComponent,
AnalyticsTargetAggregatesDetailComponent,
AnalyticsTargetAggregatesSidebarFilterComponent,
TrainingsComponent,
TrainingsContentComponent,
TasksComponent,
TasksContentComponent,
TasksGroupComponent,
Expand Down Expand Up @@ -104,6 +108,8 @@ import { DirectivesModule } from '@mm-directives/directives.module';
ReportsComponent,
MessagesComponent,
ContactsComponent,
TrainingsComponent,
TrainingsContentComponent,
PrivacyPolicyComponent,
TasksComponent,
]
Expand Down
8 changes: 4 additions & 4 deletions webapp/src/ts/modules/tasks/tasks.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
<div id="tasks-list" class="col-sm-4 inbox-items left-pane">
<ul *ngIf="!errorStack && hasTasks">
<li *ngFor="let task of tasksList; trackBy: listTrackBy"
[attr.data-record-id]="task._id"
[class.selected] = "task.selected"
[class.overdue]="task.overdue"
class="content-row">
[attr.data-record-id]="task._id"
[class.selected]="task.selected"
[class.overdue]="task.overdue"
class="content-row">
<a [routerLink]="['/', 'tasks', task._id]" [state]="{ tab: 'tasks', id: task._id }">
<div *ngIf="task.icon" class="icon" [innerHTML]="task.icon | resourceIcon"></div>
<div class="content">
Expand Down
20 changes: 20 additions & 0 deletions webapp/src/ts/modules/trainings/training-content.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<div [class.content-pane]="isEmbedded" [class.right-pane]="isEmbedded">

<div class="item-content empty-selection" [class.col-sm-8]="isEmbedded">
<div *ngIf="loadingContent"><div class="loader"></div></div>
<div *ngIf="!loadingContent && contentError">{{ errorTranslationKey | translate }}</div>
<div *ngIf="isEmbedded && !this.trainingCardFormId && !loadingContent">{{ 'training_materials.page.no_selected' | translate }}</div>
</div>

<div [hidden]="showConfirmExit || loadingContent || contentError" class="item-content" [class.form-no-title]="formNoTitle" [class.col-sm-8]="isEmbedded">
<div class="body">
<mm-enketo
[formId]="FORM_WRAPPER_ID"
[status]="enketoStatus"
(onSubmit)="saveForm()"
(onCancel)="confirmExit(true)">
</mm-enketo>
</div>
</div>

</div>
Loading
Loading