Unindent album card macro.
This commit is contained in:
		
							parent
							
								
									fcf7a460b2
								
							
						
					
					
						commit
						41058ccc9e
					
				
					 1 changed files with 38 additions and 38 deletions
				
			
		|  | @ -1,44 +1,44 @@ | ||||||
| {% macro create_album_card(album, view="grid", unlink_parent=none) %} | {% macro create_album_card(album, view="grid", unlink_parent=none) %} | ||||||
| {% set view = (view if view in ("list", "grid") else "grid") %} | {% set view = (view if view in ("list", "grid") else "grid") %} | ||||||
| {% set viewparam = "?view=list" if view == "list" else "" %} | {% set viewparam = "?view=list" if view == "list" else "" %} | ||||||
|     <div class="album_card album_card_{{view}}" data-id="{{album.id}}"> | <div class="album_card album_card_{{view}}" data-id="{{album.id}}"> | ||||||
|         {% if album == "root" %} |     {% if album == "root" %} | ||||||
|         <a class="album_card_thumbnail" href="/albums{{viewparam}}"></a> |     <a class="album_card_thumbnail" href="/albums{{viewparam}}"></a> | ||||||
|         {% else %} |     {% else %} | ||||||
|         <a class="album_card_thumbnail" href="/album/{{album.id}}{{viewparam}}"></a> |     <a class="album_card_thumbnail" href="/album/{{album.id}}{{viewparam}}"></a> | ||||||
|  |     {% endif %} | ||||||
|  | 
 | ||||||
|  |     <div class="album_card_tools"> | ||||||
|  |         {% if unlink_parent is not none %} | ||||||
|  |         <button | ||||||
|  |         class="remove_child_button button_with_confirm red_button" | ||||||
|  |         data-onclick="api.albums.remove_child('{{unlink_parent.id}}', '{{album.id}}', common.refresh)" | ||||||
|  |         data-prompt="Remove child?" | ||||||
|  |         data-holder-class="remove_child_button" | ||||||
|  |         data-confirm-class="red_button" | ||||||
|  |         data-cancel-class="gray_button" | ||||||
|  |         >Unlink | ||||||
|  |         </button> | ||||||
|         {% endif %} |         {% endif %} | ||||||
| 
 |  | ||||||
|         <div class="album_card_tools"> |  | ||||||
|             {% if unlink_parent is not none %} |  | ||||||
|             <button |  | ||||||
|             class="remove_child_button button_with_confirm red_button" |  | ||||||
|             data-onclick="api.albums.remove_child('{{unlink_parent.id}}', '{{album.id}}', common.refresh)" |  | ||||||
|             data-prompt="Remove child?" |  | ||||||
|             data-holder-class="remove_child_button" |  | ||||||
|             data-confirm-class="red_button" |  | ||||||
|             data-cancel-class="gray_button" |  | ||||||
|             >Unlink |  | ||||||
|             </button> |  | ||||||
|             {% endif %} |  | ||||||
|         </div> |  | ||||||
| 
 |  | ||||||
|         <div class="album_card_title"> |  | ||||||
|             {% if album == "root" %} |  | ||||||
|             <a href="/albums{{viewparam}}">Albums</a> |  | ||||||
|             {% else %} |  | ||||||
|             <a href="/album/{{album.id}}{{viewparam}}">{{album.display_name}}</a> |  | ||||||
|             {% endif %} |  | ||||||
|         </div> |  | ||||||
| 
 |  | ||||||
|         <div class="album_card_metadata"> |  | ||||||
|             {% if album == "root" %} |  | ||||||
|             {% else %} |  | ||||||
|             {% set child_count = album.get_children()|length %} |  | ||||||
|             {% set photo_count = album.sum_photos(recurse=False) %} |  | ||||||
|             <span class="album_card_child_count" title="{{child_count}} children">{{child_count}}</span> |  | ||||||
|             {{-' | '-}} |  | ||||||
|             <span class="album_card_photo_count" title="{{photo_count}} photos">{{photo_count}}</span> |  | ||||||
|             {% endif %} |  | ||||||
|         </div> |  | ||||||
|     </div> |     </div> | ||||||
|  | 
 | ||||||
|  |     <div class="album_card_title"> | ||||||
|  |         {% if album == "root" %} | ||||||
|  |         <a href="/albums{{viewparam}}">Albums</a> | ||||||
|  |         {% else %} | ||||||
|  |         <a href="/album/{{album.id}}{{viewparam}}">{{album.display_name}}</a> | ||||||
|  |         {% endif %} | ||||||
|  |     </div> | ||||||
|  | 
 | ||||||
|  |     <div class="album_card_metadata"> | ||||||
|  |         {% if album == "root" %} | ||||||
|  |         {% else %} | ||||||
|  |         {% set child_count = album.get_children()|length %} | ||||||
|  |         {% set photo_count = album.sum_photos(recurse=False) %} | ||||||
|  |         <span class="album_card_child_count" title="{{child_count}} children">{{child_count}}</span> | ||||||
|  |         {{-' | '-}} | ||||||
|  |         <span class="album_card_photo_count" title="{{photo_count}} photos">{{photo_count}}</span> | ||||||
|  |         {% endif %} | ||||||
|  |     </div> | ||||||
|  | </div> | ||||||
| {% endmacro %} | {% endmacro %} | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue