_page_listing.html (2133B)
1 {% from "_listing.html" import root_header, counts, toolbar, go_up, row_dir, row_file, empty_state %} 2 {% from "_icons.html" import icon %} 3 {% if skeleton %}<!--@root-header-->{% elif not path %} 4 {{ root_header() }} 5 {% endif %} 6 7 {% set visible_items = items | rejectattr("name", "equalto", ".gitattributes") | list %} 8 {% set file_count = visible_items | rejectattr("is_dir") | list | length %} 9 {% set dir_count = visible_items | selectattr("is_dir") | list | length %} 10 {% set parent_path = '/' %} 11 {% if path %} 12 {% set path_parts = path.split('/') %} 13 {% if path_parts|length > 1 %}{% set parent_path = '/' + path_parts[:-1]|join('/') %}{% endif %} 14 {% endif %} 15 <div class="input-group input-group--standalone" id="filter-group"> 16 <span class="input-group__icon">{{ icon('search', 16) }}</span> 17 <input type="text" id="filter-input" class="filter-input" placeholder="Search this folder... (press / to focus)" aria-label="Filter this folder" autocomplete="off" spellcheck="false"> 18 <button type="button" class="input-clear-btn" id="filter-clear" aria-label="Clear filter">{{ icon('close', 16, 2.5) }}</button> 19 </div> 20 {% if skeleton %}<!--@toolbar-->{% elif items %} 21 {{ toolbar(counts(dir_count, file_count), path) }} 22 {% endif %} 23 <div class="list-container"> 24 <div class="list-group"> 25 <div id="file-list"> 26 {% if skeleton %}<!--@list-->{% else %} 27 {% if path %} 28 {{ go_up(parent_path) }} 29 {% endif %} 30 31 {% for item in items %} 32 {% if item.name != '.gitattributes' %} 33 {% if item.is_dir %} 34 {{ row_dir(item.name, item.path) }} 35 {% else %} 36 {{ row_file(item.name, item.path, item.size_str) }} 37 {% endif %} 38 {% endif %} 39 {% endfor %} 40 41 {% if not visible_items %} 42 {{ empty_state() }} 43 {% endif %} 44 {% endif %} 45 </div> 46 </div> 47 </div>