Compare commits
	
		
			No commits in common. "24ae1a622cad8aef73ca5102155363ca35b8ed74" and "4d37ba56dceba9a64af8a6c1e36c4ff41392fa86" have entirely different histories.
		
	
	
		
			24ae1a622c
			...
			4d37ba56dc
		
	
		
					 2 changed files with 30 additions and 52 deletions
				
			
		
							
								
								
									
										38
									
								
								setup.sh
									
										
									
									
									
								
							
							
						
						
									
										38
									
								
								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">{{ _('Key') }}</th>
 | 
					                <th class="key-col d-md-table-cell">{{ _('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">{{ game.steam_key }}</td>
 | 
					                <td class="font-monospace key-col d-none d-md-table-cell">{{ 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,34 +1840,22 @@ document.querySelectorAll('.generate-redeem').forEach(btn => {
 | 
				
			||||||
</script>
 | 
					</script>
 | 
				
			||||||
<script>
 | 
					<script>
 | 
				
			||||||
document.addEventListener('DOMContentLoaded', function() {
 | 
					document.addEventListener('DOMContentLoaded', function() {
 | 
				
			||||||
  const KEY_STORAGE = 'showKeys';
 | 
					  console.log("DOM ist geladen!"); // Überprüfe, ob DOMContentLoaded überhaupt ausgeführt wird
 | 
				
			||||||
  const toggleBtn = document.getElementById('toggle-keys');
 | 
					  const toggleKeysButton = document.getElementById('toggle-keys');
 | 
				
			||||||
 | 
					  if (toggleKeysButton) {
 | 
				
			||||||
  function toggleKeys(visible) {
 | 
					    console.log("Button with ID 'toggle-keys' found!");
 | 
				
			||||||
    document.querySelectorAll('.key-col').forEach(el => {
 | 
					    toggleKeysButton.addEventListener('click', function() {
 | 
				
			||||||
      visible ? el.classList.remove('d-none') : el.classList.add('d-none');
 | 
					      console.log("Button clicked!");
 | 
				
			||||||
 | 
					      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">{{ _('Key') }}</th>
 | 
					                <th class="key-col d-md-table-cell">{{ _('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">{{ game.steam_key }}</td>
 | 
					                <td class="font-monospace key-col d-none d-md-table-cell">{{ 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,30 +169,19 @@ document.querySelectorAll('.generate-redeem').forEach(btn => {
 | 
				
			||||||
</script>
 | 
					</script>
 | 
				
			||||||
<script>
 | 
					<script>
 | 
				
			||||||
document.addEventListener('DOMContentLoaded', function() {
 | 
					document.addEventListener('DOMContentLoaded', function() {
 | 
				
			||||||
  const KEY_STORAGE = 'showKeys';
 | 
					  console.log("DOM ist geladen!"); // Überprüfe, ob DOMContentLoaded überhaupt ausgeführt wird
 | 
				
			||||||
  const toggleBtn = document.getElementById('toggle-keys');
 | 
					  const toggleKeysButton = document.getElementById('toggle-keys');
 | 
				
			||||||
 | 
					  if (toggleKeysButton) {
 | 
				
			||||||
  function toggleKeys(visible) {
 | 
					    console.log("Button with ID 'toggle-keys' found!");
 | 
				
			||||||
    document.querySelectorAll('.key-col').forEach(el => {
 | 
					    toggleKeysButton.addEventListener('click', function() {
 | 
				
			||||||
      visible ? el.classList.remove('d-none') : el.classList.add('d-none');
 | 
					      console.log("Button clicked!");
 | 
				
			||||||
 | 
					      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>
 | 
				
			||||||
| 
						 | 
					@ -200,3 +189,4 @@ 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