"Fossies" - the Fresh Open Source Software Archive

Member "buku-4.4/bukuserver/templates/bukuserver/statistic.html" (15 Jun 2020, 10257 Bytes) of package /linux/privat/buku-4.4.tar.gz:


The requested HTML page contains a <FORM> tag that is unusable on "Fossies" in "automatic" (rendered) mode so that page is shown as HTML source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 {% extends "bukuserver/home.html" %}
    2 
    3 {% block body %}
    4 <div class="container">
    5   <form class="form-inline" action="{{url_for('statistic.index')}}" method="POST">
    6     Data created
    7     <span rel="tooltip" title="{{datetime}}">{{datetime_text}}</span>
    8     <button type="submit" class="btn btn-default btn-sm">refresh</button>
    9   </form>
   10   <h3>Netloc</h3>
   11 
   12   {% if most_common_netlocs %}
   13   <div class="col-md-6">
   14     <canvas id="mostCommonChart" width="500" height="500"></canvas>
   15   </div>
   16 
   17   <div class="col-md-6">
   18     {% if show_netloc_table %}
   19     <button type="button" class="btn btn-primary btn-xs" data-toggle="modal" data-target="#netlocModal">
   20       View all
   21     </button>
   22     {% endif %}
   23     <table class="table">
   24       <tr>
   25         <th>Rank</th>
   26         <th>Netloc</th>
   27         <th>Number</th>
   28       </tr>
   29       {% for item, number, _ in most_common_netlocs %}
   30       <tr>
   31         <td>{{loop.index}}</td>
   32         <td> <a href="{{url_for('bookmark.index_view', flt1_url_netloc_match=item)}}">{{item}}</a> </td>
   33         <td class="text-right">{{number}}</td>
   34       </tr>
   35       {% endfor %}
   36     </table>
   37   </div>
   38   {% else %}
   39   <span> No bookmark found.</span>
   40   {% endif %}
   41 
   42   {% if show_netloc_table %}
   43   <div class="modal fade" id="netlocModal" tabindex="-1" role="dialog">
   44     <div class="modal-dialog" role="document">
   45       <div class="modal-content">
   46         <div class="modal-header">
   47           <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
   48           <h4 class="modal-title" id="myModalLabel">Netloc ranking</h4>
   49         </div>
   50         <div class="modal-body">
   51           <table class="table table-condensed">
   52             <tr>
   53               <th>Rank</th>
   54               <th>Netloc</th>
   55               <th>Number</th>
   56             </tr>
   57             {% for item, number in netloc_counter.most_common() %}
   58               {% if number > 1 %}
   59               <tr>
   60                 <td>{{loop.index}}</td>
   61                 <td>
   62                   {% if item %}
   63                   <a href="{{url_for('bookmark.index_view', flt1_url_netloc_match=item)}}">{{item}}</a>
   64                   {% else %}
   65                   <span class="btn btn-default" disabled="disabled">(No Netloc)</span>
   66                   {% endif %}
   67                 </td>
   68                 <td class="text-right">{{number}}</td>
   69               </tr>
   70               {% endif %}
   71             {% endfor %}
   72           </table>
   73         </div>
   74       </div>
   75     </div>
   76   </div>
   77   {% endif %}
   78 
   79   <h3 class="col-md-12">Tag</h3>
   80 
   81   {% if most_common_tags %}
   82   <div class="col-md-6">
   83     <canvas id="mostCommonTagChart" width="500" height="500"></canvas>
   84   </div>
   85 
   86   <div class="col-md-6">
   87     {% if show_tag_rank_table %}
   88     <button type="button" class="btn btn-primary btn-xs" data-toggle="modal" data-target="#tagRankModal">
   89       View all
   90     </button>
   91     {% endif %}
   92     <table class="table">
   93       <tr>
   94         <th>Rank</th>
   95         <th>Tag</th>
   96         <th>Number</th>
   97       </tr>
   98       {% for item, number, _ in most_common_tags %}
   99       <tr>
  100         <td>{{loop.index}}</td>
  101         <td>
  102           <a href="{{url_for('bookmark.index_view', flt3_tags_contain=item)}}">{{item}}</a>
  103         </td>
  104         <td class="text-right">{{number}}</td>
  105       </tr>
  106       {% endfor %}
  107     </table>
  108   </div>
  109   {% else %}
  110   <span> No tag found.</span>
  111   {% endif %}
  112 
  113   {% if show_tag_rank_table %}
  114   <div class="modal fade" id="tagRankModal" tabindex="-1" role="dialog">
  115     <div class="modal-dialog" role="document">
  116       <div class="modal-content">
  117         <div class="modal-header">
  118           <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  119           <h4 class="modal-title" id="myModalLabel">Netloc ranking</h4>
  120         </div>
  121         <div class="modal-body">
  122           <table class="table table-condensed">
  123             <tr>
  124               <th>Rank</th>
  125               <th>Tag</th>
  126               <th>Number</th>
  127             </tr>
  128             {% for item, number in tag_counter.most_common() %}
  129               <tr>
  130                 <td>{{loop.index}}</td>
  131                 <td> <a href="{{url_for('bookmark.index_view', flt3_tags_contain=item)}}">{{item}}</a> </td>
  132                 <td class="text-right">{{number}}</td>
  133               </tr>
  134             {% endfor %}
  135           </table>
  136         </div>
  137       </div>
  138     </div>
  139   </div>
  140   {% endif %}
  141 
  142   <h3 class="col-md-12">Title</h3>
  143 
  144   {% if most_common_titles %}
  145   <div class="col-md-6">
  146     <canvas id="mostCommonTitleChart" width="500" height="500"></canvas>
  147   </div>
  148 
  149   <div class="col-md-6">
  150     {% if show_title_rank_table %}
  151     <button type="button" class="btn btn-primary btn-xs" data-toggle="modal" data-target="#titleModal">
  152       View all
  153     </button>
  154     {% endif %}
  155     <table class="table">
  156       <tr>
  157         <th>Rank</th>
  158         <th>Title</th>
  159         <th>Number</th>
  160       </tr>
  161       {% for item, number, _ in most_common_titles %}
  162       <tr>
  163         <td>{{loop.index}}</td>
  164         <td>
  165           {% if item %}
  166           <a href="{{url_for('bookmark.index_view', flt0_title_equals=item)}}">{{item}}</a>
  167           {% else %}
  168           (No Title)
  169           {% endif %}
  170         </td>
  171         <td class="text-right">{{number}}</td>
  172       </tr>
  173       {% endfor %}
  174     </table>
  175   </div>
  176   {% else %}
  177   <span> No Title found.</span>
  178   {% endif %}
  179 
  180   {% if show_title_rank_table %}
  181   <div class="modal fade" id="titleModal" tabindex="-1" role="dialog">
  182     <div class="modal-dialog" role="document">
  183       <div class="modal-content">
  184         <div class="modal-header">
  185           <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  186           <h4 class="modal-title" id="myModalLabel">Title ranking</h4>
  187         </div>
  188         <div class="modal-body">
  189           <table class="table table-condensed">
  190             <tr>
  191               <th>Rank</th>
  192               <th>Title</th>
  193               <th>Number</th>
  194             </tr>
  195             {% for item, number in title_counter.most_common() %}
  196               {% if number > 1 %}
  197               <tr>
  198                 <td>{{loop.index}}</td>
  199                 <td style="word-break:break-all;">
  200                   {% if item %}
  201                   <a href="{{url_for('bookmark.index_view', flt0_title_equals=item)}}">{{item}}</a>
  202                   {% else %}
  203                   <span class="btn btn-default" disabled="disabled">(No Title)</span>
  204                   {% endif %}
  205                 </td>
  206                 <td class="text-right">{{number}}</td>
  207               </tr>
  208               {% endif %}
  209             {% endfor %}
  210           </table>
  211         </div>
  212       </div>
  213     </div>
  214   </div>
  215   {% endif %}
  216 {% endblock %}
  217 
  218 {% block tail %}
  219   {{ super() }}
  220   <script src="{{url_for('static', filename='bukuserver/js/Chart.js')}}"></script>
  221   <script>
  222   var ctx = document.getElementById("mostCommonChart").getContext('2d');
  223   var netlocChart = new Chart(ctx, {
  224     type: 'pie',
  225     data: {
  226       datasets: [{
  227         data: [
  228           {% for val in most_common_netlocs %} {{val.1}}, {% endfor %}
  229         ],
  230         backgroundColor: [
  231           {% for val in most_common_netlocs %} "{{val.2}}", {% endfor %}
  232         ],
  233       }],
  234       // These labels appear in the legend and in the tooltips when hovering different arcs
  235       labels: [
  236         {% for val in most_common_netlocs %} "{{val.0}}", {% endfor %}
  237       ]
  238     },
  239     options: {
  240       'onClick' : function (evt, item) {
  241         var value = this.data.labels[item[0]._index];
  242         var form = $('<form></form>');
  243 
  244         form.attr("method", "get");
  245         form.attr("action", "{{url_for('bookmark.index_view')}}");
  246 
  247         var field = $('<input></input>');
  248 
  249         field.attr("type", "hidden");
  250         field.attr("name", "flt1_url_netloc_match");
  251         field.attr("value", value);
  252         form.append(field);
  253 
  254         // The form needs to be a part of the document in
  255         // order for us to be able to submit it.
  256         $(document.body).append(form);
  257         form.submit();
  258       }
  259     }
  260   });
  261 
  262   var tagRankCtx = document.getElementById("mostCommonTagChart").getContext('2d');
  263   var tagRankChart = new Chart(tagRankCtx, {
  264     type: 'pie',
  265     data: {
  266       datasets: [{
  267         data: [
  268           {% for val in most_common_tags %} {{val.1}}, {% endfor %}
  269         ],
  270         backgroundColor: [
  271           {% for val in most_common_tags %} "{{val.2}}", {% endfor %}
  272         ],
  273       }],
  274       // These labels appear in the legend and in the tooltips when hovering different arcs
  275       labels: [
  276         {% for val in most_common_tags %} "{{val.0}}", {% endfor %}
  277       ]
  278     },
  279     options: {
  280       'onClick' : function (evt, item) {
  281         var tagStr = this.data.labels[item[0]._index];
  282         var url = "{{url_for('bookmark.index_view')}}?flt3_tags_contain=" + tagStr;
  283         window.location.href = url;
  284       }
  285     }
  286   });
  287 
  288   var ctx = document.getElementById("mostCommonTitleChart").getContext('2d');
  289   var netlocChart = new Chart(ctx, {
  290     type: 'pie',
  291     data: {
  292       datasets: [{
  293         data: [
  294           {% for val in most_common_titles %} {{val.1}}, {% endfor %}
  295         ],
  296         backgroundColor: [
  297           {% for val in most_common_titles %} "{{val.2}}", {% endfor %}
  298         ],
  299       }],
  300       // These labels appear in the legend and in the tooltips when hovering different arcs
  301       labels: [
  302         {% for val in most_common_titles %} "{{val.0|trim}}", {% endfor %}
  303       ]
  304     },
  305     options: {
  306       'onClick' : function (evt, item) {
  307         var value = this.data.labels[item[0]._index];
  308         var form = $('<form></form>');
  309 
  310         form.attr("method", "get");
  311         form.attr("action", "{{url_for('bookmark.index_view')}}");
  312 
  313         var field = $('<input></input>');
  314 
  315         field.attr("type", "hidden");
  316         field.attr("name", "flt0_title_equals");
  317         field.attr("value", value);
  318         form.append(field);
  319 
  320         // The form needs to be a part of the document in
  321         // order for us to be able to submit it.
  322         $(document.body).append(form);
  323         form.submit();
  324       }
  325     }
  326   });
  327 
  328   netlocChart.canvas.parentNode.style.height = '128px';
  329   </script>
  330 
  331 </div>
  332 {% endblock %}