Skip to content
Snippets Groups Projects
candidate-lists.js 1.03 KiB
Newer Older
  • Learn to ignore specific revisions
  • // Imports
    import * as Auth from "/services/auth/auth.js";
    
    // DOM elements
    
    // local variables
    let current_user;
    
    export async function mount(where, parent) {
      const candidateListComponent = new CandidateList(parent);
      await candidateListComponent.mount(where);
      return candidateListComponent;
    }
    
    class CandidateList {
      constructor(parent) {
        this.method = null;
        this.parent = parent;
      }
    
      async mount(where) {
        const mountpoint = where;
        document.getElementById(mountpoint).innerHTML = /* HTML */ `
          <header class="card-header">
            <p class="card-header-title">
              Liste des candidats
            </p>
    
    Alexis POYEN's avatar
    Alexis POYEN committed
            <button id="candidate-list-new" class="button is-success" disabled>
    
              <span class="icon is-small">
                <i class="fas fa-plus"></i>
              </span>
            </button>
          </header>
          <div class="card-content">
            <div id="candidate-lists-list" class="content">
              Liste des listes de candidats
            </div>
          </div>
        `;
        current_user = await Auth.GetUser();
      }
    }