1
1
{% extends base or 'layout.html' %}
2
- {#{% from 'icons.html' import icon as get_icon %}#}
3
- {% macro get_icon(name,lib='glyphicon') %}
4
- < span class ="{{lib}} {{lib}}-{{name}} "> </ span >
5
- {% endmacro %}
2
+ {% from 'icons.html' import icon as get_icon %}
6
3
{% macro file_type(file_pth) %}
7
4
{%- if file_pth.endswith('.py') -%}
8
5
{%- set _type = 'python' -%}
131
128
132
129
{% macro render_grid_filelist(files) %}
133
130
< div class ="filelist hidden " id ="grid-filelist ">
134
- < div class =" list-group inline " >
131
+ < div class =row >
135
132
{% for name,link in files %}
136
- {% if loop.index % 4 == 0 %}
133
+ {% if loop.first %}
134
+ < div class =col-md-3 >
135
+ < div class ="list-group inline ">
136
+ {% elif loop.index % 4 == 0 and not loop.last %}
137
+ </ div >
138
+ </ div >
139
+ < div class =col-md-3 >
140
+ < div class ="list-group inline ">
141
+ {% elif loop.last %}
142
+ </ div >
137
143
</ div >
138
- < div class ="list-group inline ">
139
144
{% endif %}
140
145
{% call get_url_link(link,class_='list-group-item inline') %}
141
146
{{name}}
251
256
margin-bottom : -25px ;
252
257
}
253
258
.filelist table td {
254
-
255
-
259
+ cursor : pointer;
256
260
}
257
261
258
262
.CodeMirror-fullscreen {
@@ -495,6 +499,15 @@ <h4 class="modal-title" id="myModalLabel"></h4>
495
499
$ ( "#myModal" ) . modal ( ) ;
496
500
} ) ;
497
501
} ) ;
502
+ $ ( document ) . on ( "click" , "td.show-file.info" , function ( ) {
503
+ var path = $ ( this ) . parent ( ) . attr ( "data-path" ) ;
504
+ console . log ( path . split ( '/' ) ) ;
505
+ var content = $ . get ( SCRIPT_ROOT + "view_files/file/" + path ) . success ( function ( r ) {
506
+ $ ( ".modal-body" ) . empty ( ) . html ( r [ 'content' ] ) ;
507
+ $ ( "#myModalLabel" ) . empty ( ) . text ( "/" + path ) ;
508
+ $ ( "#myModal" ) . modal ( ) ;
509
+ } ) ;
510
+ } ) ;
498
511
$ ( document ) . on ( "click" , ".prev_next" , function ( ) {
499
512
if ( $ ( this ) . hasClass ( "disabled" ) ) {
500
513
$ ( this ) . removeClass ( "disabled" ) ;
@@ -518,4 +531,4 @@ <h4 class="modal-title" id="myModalLabel"></h4>
518
531
} ) ;
519
532
} ) ;
520
533
</ script >
521
- {% endblock %}
534
+ {% endblock %}
0 commit comments