add maxPerPage
This commit is contained in:
		
							
								
								
									
										2
									
								
								app.py
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								app.py
									
									
									
									
									
								
							| @ -53,7 +53,7 @@ def index(): | ||||
|                 term.c += ' + ' if random.randint(0,1) else ' - ' | ||||
|                 term.c += str(random.randint(1,maxValue)) | ||||
|             zufall.append(term) | ||||
|         return render_template('arbeitsblatt.html',aufgaben=zufall) | ||||
|         return render_template('arbeitsblatt.html',aufgaben=zufall,maxPerPage=int(request.form.get('maxPerPage'))) | ||||
|     else: | ||||
|         return render_template('generator.html', reihen=rt_rechenreihen) | ||||
|  | ||||
|  | ||||
| @ -4,7 +4,7 @@ | ||||
| <div class="w3-responsive"> | ||||
|     {% for a in aufgaben %} | ||||
|             <table class="w3-left" width="auto"><tr><td class="w3-right-align" style="width: 7em">{{ a.a }} {% if a.t.typ == '*' %}·{% elif a.t.typ == '/'%}:{% else %}{{ a.t.typ }}{% endif %} {{ a.b }}{{ a.c }}</td><td> = </td><td class="w3-border-bottom" style="width: 5em; height: 2em"></td></tr></table> | ||||
|             {% if (loop.index % 60 == 0) and (not loop.last) %}  | ||||
|             {% if (loop.index % maxPerPage == 0) and (not loop.last) %}  | ||||
|             <div style="break-after: page; clear: both;"></div> | ||||
|             <div style="margin-bottom: 3em"></div> | ||||
|             {% endif %} | ||||
|  | ||||
| @ -29,10 +29,11 @@ | ||||
|         <label for="anzahl">max. Aufgaben: </label> | ||||
|         <select name="anzahl"> | ||||
|             <option value="">Alle</option> | ||||
|             <option value="80">80</option> | ||||
|             <option value="40">40</option> | ||||
|             <option value="20">20</option> | ||||
|         </select> | ||||
|             <option value="78">78</option> | ||||
|             <option value="39">39</option> | ||||
|         </select><br/> | ||||
|         <label for="maxPerPage">max. Aufgaben pro Seite</label> | ||||
|         <input name="maxPerPage" value="78"><br/> | ||||
|         <br/> | ||||
|         <input type="submit" value="zum Arbeitsblatt"> | ||||
|     </form> | ||||
|  | ||||
		Reference in New Issue
	
	Block a user