Compare commits
	
		
			2 commits
		
	
	
		
			4d37ba56dc
			...
			24ae1a622c
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 24ae1a622c | |||
| f2b434983e | 
					 2 changed files with 52 additions and 30 deletions
				
			
		
							
								
								
									
										40
									
								
								setup.sh
									
										
									
									
									
								
							
							
						
						
									
										40
									
								
								setup.sh
									
										
									
									
									
								
							| 
						 | 
					@ -1679,7 +1679,7 @@ cat <<'HTML_END' > templates/index.html
 | 
				
			||||||
            <tr>
 | 
					            <tr>
 | 
				
			||||||
                <th>{{ _('Cover') }}</th>
 | 
					                <th>{{ _('Cover') }}</th>
 | 
				
			||||||
                <th>{{ _('Name') }}</th>
 | 
					                <th>{{ _('Name') }}</th>
 | 
				
			||||||
                <th class="key-col d-md-table-cell">{{ _('Key') }}</th>
 | 
					                <th class="key-col">{{ _('Key') }}</th>
 | 
				
			||||||
                <th>{{ _('Status') }}</th>
 | 
					                <th>{{ _('Status') }}</th>
 | 
				
			||||||
                <th>{{ _('Created') }}</th>
 | 
					                <th>{{ _('Created') }}</th>
 | 
				
			||||||
                <th>{{ _('Redeem by') }}</th>
 | 
					                <th>{{ _('Redeem by') }}</th>
 | 
				
			||||||
| 
						 | 
					@ -1712,7 +1712,7 @@ cat <<'HTML_END' > templates/index.html
 | 
				
			||||||
                  </a>
 | 
					                  </a>
 | 
				
			||||||
                </td>
 | 
					                </td>
 | 
				
			||||||
                <td>{{ game.name }}</td>
 | 
					                <td>{{ game.name }}</td>
 | 
				
			||||||
                <td class="font-monospace key-col d-none d-md-table-cell">{{ game.steam_key }}</td>
 | 
					                <td class="font-monospace key-col">{{ game.steam_key }}</td>
 | 
				
			||||||
                <td>
 | 
					                <td>
 | 
				
			||||||
                    {% if game.status == 'nicht eingelöst' %}
 | 
					                    {% if game.status == 'nicht eingelöst' %}
 | 
				
			||||||
                        <span class="badge bg-warning text-dark">{{ _('Not redeemed') }}</span>
 | 
					                        <span class="badge bg-warning text-dark">{{ _('Not redeemed') }}</span>
 | 
				
			||||||
| 
						 | 
					@ -1840,22 +1840,34 @@ document.querySelectorAll('.generate-redeem').forEach(btn => {
 | 
				
			||||||
</script>
 | 
					</script>
 | 
				
			||||||
<script>
 | 
					<script>
 | 
				
			||||||
document.addEventListener('DOMContentLoaded', function() {
 | 
					document.addEventListener('DOMContentLoaded', function() {
 | 
				
			||||||
  console.log("DOM ist geladen!"); // Überprüfe, ob DOMContentLoaded überhaupt ausgeführt wird
 | 
					  const KEY_STORAGE = 'showKeys';
 | 
				
			||||||
  const toggleKeysButton = document.getElementById('toggle-keys');
 | 
					  const toggleBtn = document.getElementById('toggle-keys');
 | 
				
			||||||
  if (toggleKeysButton) {
 | 
					
 | 
				
			||||||
    console.log("Button with ID 'toggle-keys' found!");
 | 
					  function toggleKeys(visible) {
 | 
				
			||||||
    toggleKeysButton.addEventListener('click', function() {
 | 
					    document.querySelectorAll('.key-col').forEach(el => {
 | 
				
			||||||
      console.log("Button clicked!");
 | 
					      visible ? el.classList.remove('d-none') : el.classList.add('d-none');
 | 
				
			||||||
      const keyCols = document.querySelectorAll('.key-col');
 | 
					    });
 | 
				
			||||||
      keyCols.forEach(function(el) {
 | 
					  }
 | 
				
			||||||
        el.classList.toggle('hidden');
 | 
					
 | 
				
			||||||
      });
 | 
					  const savedState = localStorage.getItem(KEY_STORAGE);
 | 
				
			||||||
 | 
					  const initialVisibility = savedState ? JSON.parse(savedState) : true;
 | 
				
			||||||
 | 
					  toggleKeys(initialVisibility);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  if (toggleBtn) {
 | 
				
			||||||
 | 
					    let isVisible = initialVisibility;
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    toggleBtn.addEventListener('click', () => {
 | 
				
			||||||
 | 
					      isVisible = !isVisible;
 | 
				
			||||||
 | 
					      toggleKeys(isVisible);
 | 
				
			||||||
 | 
					      localStorage.setItem(KEY_STORAGE, JSON.stringify(isVisible));
 | 
				
			||||||
 | 
					      
 | 
				
			||||||
 | 
					      console.log(`Keys sind jetzt: ${isVisible ? 'sichtbar' : 'versteckt'}`);
 | 
				
			||||||
 | 
					      console.log(`LocalStorage-Wert: ${localStorage.getItem(KEY_STORAGE)}`);
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
  } else {
 | 
					 | 
				
			||||||
    console.log("Button with ID 'toggle-keys' not found!");
 | 
					 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
</script>
 | 
					</script>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{% else %}
 | 
					{% else %}
 | 
				
			||||||
<div class="alert alert-info">{{ _('No games yet') }}</div>
 | 
					<div class="alert alert-info">{{ _('No games yet') }}</div>
 | 
				
			||||||
{% endif %}
 | 
					{% endif %}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -8,7 +8,7 @@
 | 
				
			||||||
            <tr>
 | 
					            <tr>
 | 
				
			||||||
                <th>{{ _('Cover') }}</th>
 | 
					                <th>{{ _('Cover') }}</th>
 | 
				
			||||||
                <th>{{ _('Name') }}</th>
 | 
					                <th>{{ _('Name') }}</th>
 | 
				
			||||||
                <th class="key-col d-md-table-cell">{{ _('Key') }}</th>
 | 
					                <th class="key-col">{{ _('Key') }}</th>
 | 
				
			||||||
                <th>{{ _('Status') }}</th>
 | 
					                <th>{{ _('Status') }}</th>
 | 
				
			||||||
                <th>{{ _('Created') }}</th>
 | 
					                <th>{{ _('Created') }}</th>
 | 
				
			||||||
                <th>{{ _('Redeem by') }}</th>
 | 
					                <th>{{ _('Redeem by') }}</th>
 | 
				
			||||||
| 
						 | 
					@ -41,7 +41,7 @@
 | 
				
			||||||
                  </a>
 | 
					                  </a>
 | 
				
			||||||
                </td>
 | 
					                </td>
 | 
				
			||||||
                <td>{{ game.name }}</td>
 | 
					                <td>{{ game.name }}</td>
 | 
				
			||||||
                <td class="font-monospace key-col d-none d-md-table-cell">{{ game.steam_key }}</td>
 | 
					                <td class="font-monospace key-col">{{ game.steam_key }}</td>
 | 
				
			||||||
                <td>
 | 
					                <td>
 | 
				
			||||||
                    {% if game.status == 'nicht eingelöst' %}
 | 
					                    {% if game.status == 'nicht eingelöst' %}
 | 
				
			||||||
                        <span class="badge bg-warning text-dark">{{ _('Not redeemed') }}</span>
 | 
					                        <span class="badge bg-warning text-dark">{{ _('Not redeemed') }}</span>
 | 
				
			||||||
| 
						 | 
					@ -169,19 +169,30 @@ document.querySelectorAll('.generate-redeem').forEach(btn => {
 | 
				
			||||||
</script>
 | 
					</script>
 | 
				
			||||||
<script>
 | 
					<script>
 | 
				
			||||||
document.addEventListener('DOMContentLoaded', function() {
 | 
					document.addEventListener('DOMContentLoaded', function() {
 | 
				
			||||||
  console.log("DOM ist geladen!"); // Überprüfe, ob DOMContentLoaded überhaupt ausgeführt wird
 | 
					  const KEY_STORAGE = 'showKeys';
 | 
				
			||||||
  const toggleKeysButton = document.getElementById('toggle-keys');
 | 
					  const toggleBtn = document.getElementById('toggle-keys');
 | 
				
			||||||
  if (toggleKeysButton) {
 | 
					
 | 
				
			||||||
    console.log("Button with ID 'toggle-keys' found!");
 | 
					  function toggleKeys(visible) {
 | 
				
			||||||
    toggleKeysButton.addEventListener('click', function() {
 | 
					    document.querySelectorAll('.key-col').forEach(el => {
 | 
				
			||||||
      console.log("Button clicked!");
 | 
					      visible ? el.classList.remove('d-none') : el.classList.add('d-none');
 | 
				
			||||||
      const keyCols = document.querySelectorAll('.key-col');
 | 
					    });
 | 
				
			||||||
      keyCols.forEach(function(el) {
 | 
					  }
 | 
				
			||||||
        el.classList.toggle('hidden');
 | 
					
 | 
				
			||||||
      });
 | 
					  const savedState = localStorage.getItem(KEY_STORAGE);
 | 
				
			||||||
 | 
					  const initialVisibility = savedState ? JSON.parse(savedState) : true;
 | 
				
			||||||
 | 
					  toggleKeys(initialVisibility);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  if (toggleBtn) {
 | 
				
			||||||
 | 
					    let isVisible = initialVisibility;
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    toggleBtn.addEventListener('click', () => {
 | 
				
			||||||
 | 
					      isVisible = !isVisible;
 | 
				
			||||||
 | 
					      toggleKeys(isVisible);
 | 
				
			||||||
 | 
					      localStorage.setItem(KEY_STORAGE, JSON.stringify(isVisible));
 | 
				
			||||||
 | 
					      
 | 
				
			||||||
 | 
					      console.log(`Keys sind jetzt: ${isVisible ? 'sichtbar' : 'versteckt'}`);
 | 
				
			||||||
 | 
					      console.log(`LocalStorage-Wert: ${localStorage.getItem(KEY_STORAGE)}`);
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
  } else {
 | 
					 | 
				
			||||||
    console.log("Button with ID 'toggle-keys' not found!");
 | 
					 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
</script>
 | 
					</script>
 | 
				
			||||||
| 
						 | 
					@ -189,4 +200,3 @@ document.addEventListener('DOMContentLoaded', function() {
 | 
				
			||||||
<div class="alert alert-info">{{ _('No games yet') }}</div>
 | 
					<div class="alert alert-info">{{ _('No games yet') }}</div>
 | 
				
			||||||
{% endif %}
 | 
					{% endif %}
 | 
				
			||||||
{% endblock %}
 | 
					{% endblock %}
 | 
				
			||||||
 | 
					 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue