mirror of
				https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
				synced 2025-11-04 12:22:47 +00:00 
			
		
		
		
	Fix corpus follower on user page + optgroup models
This commit is contained in:
		@@ -23,8 +23,9 @@ class CorpusFollowerList extends ResourceList {
 | 
			
		||||
    });
 | 
			
		||||
    app.getUser(this.userId).then((user) => {
 | 
			
		||||
      let corpusFollowerAssociations = Object.values(user.corpora[this.corpusId].corpus_follower_associations);
 | 
			
		||||
      let filteredList = corpusFollowerAssociations.filter(association => association.follower.id != currentUserId);
 | 
			
		||||
      this.add(filteredList);
 | 
			
		||||
      // let filteredList = corpusFollowerAssociations.filter(association => association.follower.id != currentUserId);
 | 
			
		||||
      // this.add(filteredList);
 | 
			
		||||
      this.add(Object.values(user.corpora[this.corpusId].corpus_follower_associations));
 | 
			
		||||
      this.isInitialized = true;
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
@@ -42,7 +43,7 @@ class CorpusFollowerList extends ResourceList {
 | 
			
		||||
          </td>
 | 
			
		||||
          <td>
 | 
			
		||||
            <div class="input-field disable-on-click list-action-trigger" data-list-action="update-role">
 | 
			
		||||
              <select>
 | 
			
		||||
              <select ${values['user_id'] === currentUserId ? 'disabled' : ''}>
 | 
			
		||||
                <option value="Viewer" ${values['role-name'] === 'Viewer' ? 'selected' : ''}>Viewer</option>
 | 
			
		||||
                <option value="Contributor" ${values['role-name'] === 'Contributor' ? 'selected' : ''}>Contributor</option>
 | 
			
		||||
                <option value="Administrator" ${values['role-name'] === 'Administrator' ? 'selected' : ''}>Administrator</option>
 | 
			
		||||
 
 | 
			
		||||
@@ -2,14 +2,37 @@ class PublicCorpusList extends CorpusList {
 | 
			
		||||
  get item() {
 | 
			
		||||
    return `
 | 
			
		||||
      <tr class="list-item clickable hoverable">
 | 
			
		||||
        <td><a class="btn-floating disabled"><i class="material-icons service-color darken" data-service="corpus-analysis">book</i></a></td>
 | 
			
		||||
        <td><b class="title"></b><br><i class="description"></i></td>
 | 
			
		||||
        <td><span class="owner"></span></td>
 | 
			
		||||
        <td><span class="status badge new corpus-status-color corpus-status-text" data-badge-caption=""></span></td>
 | 
			
		||||
        <td class="right-align">
 | 
			
		||||
          <a class="list-action-trigger btn-floating service-color darken waves-effect waves-light" data-list-action="view" data-service="corpus-analysis"><i class="material-icons">send</i></a>
 | 
			
		||||
        </td>
 | 
			
		||||
      </tr>
 | 
			
		||||
    `.trim();
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  initListContainerElement() {
 | 
			
		||||
    if (!this.listContainerElement.hasAttribute('id')) {
 | 
			
		||||
      this.listContainerElement.id = Utils.generateElementId('corpus-list-');
 | 
			
		||||
    }
 | 
			
		||||
    let listSearchElementId = Utils.generateElementId(`${this.listContainerElement.id}-search-`);
 | 
			
		||||
    this.listContainerElement.innerHTML = `
 | 
			
		||||
      <div class="input-field">
 | 
			
		||||
        <i class="material-icons prefix">search</i>
 | 
			
		||||
        <input id="${listSearchElementId}" class="search" type="text"></input>
 | 
			
		||||
        <label for="${listSearchElementId}">Search Corpus</label>
 | 
			
		||||
      </div>
 | 
			
		||||
      <table>
 | 
			
		||||
        <thead>
 | 
			
		||||
          <tr>
 | 
			
		||||
            <th>Title and Description</th>
 | 
			
		||||
            <th>Owner</th>
 | 
			
		||||
            <th></th>
 | 
			
		||||
          </tr>
 | 
			
		||||
        </thead>
 | 
			
		||||
        <tbody class="list"></tbody>
 | 
			
		||||
      </table>
 | 
			
		||||
      <ul class="pagination"></ul>
 | 
			
		||||
    `.trim();
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user