mirror of
				https://github.com/ae-utbm/sith.git
				synced 2025-10-31 00:53:08 +00:00 
			
		
		
		
	Apply some review comments
This commit is contained in:
		| @@ -1,6 +1,6 @@ | ||||
| {% extends "core/base.jinja" %} | ||||
| {% from 'core/macros.jinja' import paginate_alpine %} | ||||
| {% from "sas/download_pictures.jinja" import download_button %} | ||||
| {% from "sas/macros.jinja" import download_button %} | ||||
|  | ||||
| {%- block additional_css -%} | ||||
|   <link rel="stylesheet" href="{{ static('sas/css/album.scss') }}"> | ||||
| @@ -73,7 +73,7 @@ | ||||
|  | ||||
|     <h4>{% trans %}Pictures{% endtrans %}</h4> | ||||
|     <div class="photos" :aria-busy="loading"> | ||||
|       <template x-for="picture in pictures.slice((page - 1) * config.maxPageSize, config.maxPageSize * page)"> | ||||
|       <template x-for="picture in getPage(page)"> | ||||
|         <a :href="picture.sas_url"> | ||||
|           <div | ||||
|             class="photo" | ||||
|   | ||||
| @@ -1,30 +0,0 @@ | ||||
| {# Helper macro to create a download button for a | ||||
|   record of albums with alpine | ||||
|  | ||||
|   This needs to be used inside an alpine environment. | ||||
|   Downloaded pictures will be `pictures` from the  | ||||
|   parent data store. | ||||
|  | ||||
|   Note: | ||||
|     This requires importing `bundled/sas/pictures-download-index.ts` | ||||
|  | ||||
|   Parameters: | ||||
|     name (str): name displayed on the button | ||||
|  #} | ||||
| {% macro download_button(name) %} | ||||
|   <div x-data="pictures_download"> | ||||
|     <div x-show="pictures.length > 0" x-cloak> | ||||
|       <button | ||||
|         :disabled="isDownloading" | ||||
|         class="btn btn-blue" | ||||
|         @click="downloadZip()" | ||||
|       > | ||||
|         <i class="fa fa-download"></i> | ||||
|         {%- if name != "" -%} | ||||
|           {{ name }} | ||||
|         {%- endif -%} | ||||
|       </button> | ||||
|       <progress x-ref="progress" x-show="isDownloading"></progress> | ||||
|     </div> | ||||
|   </div> | ||||
| {% endmacro %} | ||||
| @@ -33,4 +33,32 @@ | ||||
|     {{ print_path(file.parent) }} | ||||
|     <a href="{{ url('sas:album', album_id=file.id) }}">{{ file.get_display_name() }}</a> / | ||||
|   {% endif %} | ||||
| {% endmacro %} | ||||
| {% endmacro %} | ||||
|  | ||||
| {# Helper macro to create a download button for a | ||||
|   record of albums with alpine | ||||
|  | ||||
|   This needs to be used inside an alpine environment. | ||||
|   Downloaded pictures will be `pictures` from the  | ||||
|   parent data store. | ||||
|  | ||||
|   Note: | ||||
|     This requires importing `bundled/sas/pictures-download-index.ts` | ||||
|  | ||||
|   Parameters: | ||||
|     name (str): name displayed on the button | ||||
|  #} | ||||
| {% macro download_button(name) %} | ||||
|   <div x-data="pictures_download"> | ||||
|     <div x-show="pictures.length > 0" x-cloak> | ||||
|       <button | ||||
|         :disabled="isDownloading" | ||||
|         class="btn btn-blue" | ||||
|         @click="downloadZip()" | ||||
|       > | ||||
|         <i class="fa fa-download"></i>{{ name }} | ||||
|       </button> | ||||
|       <progress x-ref="progress" x-show="isDownloading"></progress> | ||||
|     </div> | ||||
|   </div> | ||||
| {% endmacro %} | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| {% extends "core/base.jinja" %} | ||||
| {% from "sas/download_pictures.jinja" import download_button %} | ||||
| {% from "sas/macros.jinja" import download_button %} | ||||
|  | ||||
| {%- block additional_css -%} | ||||
|   <link rel="stylesheet" href="{{ static('sas/css/album.scss') }}"> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user