Brak opisu

table.html 4.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <html>
  2. <!-- empieza los includes -->
  3. <head>
  4. <title>Draft</title>
  5. <meta name="viewport" content="width=device-width, initial-scale=1">
  6. <meta charset="UTF-8">
  7. <link rel="icon" href="/../Icon.ico" sizes="32x32">
  8. <!-- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"> -->
  9. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
  10. <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
  11. <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
  12. <!-- <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script> -->
  13. <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
  14. <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
  15. <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular-sanitize.js"></script>
  16. <!-- el .css -->
  17. <link rel="stylesheet" href="{{ url_for('static', filename='estilo.css') }}" />
  18. <!-- los .js que quiero usar -->
  19. <script type="text/javascript" src="{{ url_for('static', filename=jscript) }}"></script>
  20. <script>
  21. // la variable 'pagina' la usa el javascript para que el run.py sepa cual python file abrir.
  22. // este python file se encarga de comunicarse con la base de datos.
  23. table.value("pagina", "{{pagina}}")
  24. </script>
  25. {% raw %}
  26. <!-- {{headers}} -->
  27. <!-- {{tabla}} -->
  28. <!-- {{info}} -->
  29. <!-- {{modal}} -->
  30. <!-- {{modal_content}} -->
  31. {% endraw %}
  32. </head>
  33. <!-- termina los includes -->
  34. <body ng-app="table" ng-controller="tableController">
  35. <nav class="navbar navbar-dark bg-dark navbar-expand">
  36. {% raw %}
  37. <a class="navbar-brand" href="{{info.dash_link}}">{{info.dash_name}}</a>
  38. {% endraw %}
  39. </nav>
  40. <div class="container-fluid col-12">
  41. <div class="container-fluid col-12">
  42. <h1 class="col">
  43. {% raw %}
  44. {{info.dash_sub_name}}
  45. {% endraw %}
  46. </h1>
  47. <div class="col" >
  48. {% raw %}
  49. <a class="btn button boton mr-4" href="{{info.add_link}}">{{info.add}}</a>
  50. {% endraw %}
  51. </div>
  52. </div>
  53. <table>
  54. <tr>
  55. {% raw %}
  56. <th ng-repeat="header in headers" class="header2">{{header.nombre}}</th>
  57. {% endraw %}
  58. </tr>
  59. <tr ng-repeat="row in tabla">
  60. {% raw %}
  61. <!-- la proxima linea asume que las entradas en la tabla tienen un id unico con -->
  62. <!-- el mismo nombre de identificador a traves de los javascript, json, etc. -->
  63. <td ng-repeat="stat in row" ng-if="stat != row.user_id">
  64. <div ng-bind-html="stat"></div>
  65. </td>
  66. <td><button type="button" class="btn2 boton mr-4" name="button" data-toggle="modal" data-target="#myModalv{{row.user_id}}">Ver mas</button></td>
  67. <td><a type="button" class="btn2 boton mr-4" href="{{info.dir2}}{{row.user_id}}">Editar</a></td>
  68. {% endraw %}
  69. </tr>
  70. </table>
  71. </div>
  72. </body>
  73. <!-- comienza modal -->
  74. {% raw %}
  75. <div ng-repeat="row in modal_content" id="myModalv{{row.user_id}}" class="modal fade">
  76. <div class="modal-dialog">
  77. <!-- Modal content-->
  78. <div class="modal-content">
  79. <div class="modal-header bg2">
  80. <button type="button" class="close" data-dismiss="modal">&times;</button>
  81. <h4 class="modal-title">{{modal.infoName}}</h4>
  82. </div>
  83. <div class="modal-body bg1">
  84. <!-- <div ng-bind-html="stat"></div> -->
  85. <form action="#">
  86. <div ng-repeat="(key, value) in row" ng-if="value != row.user_id">
  87. <label for="{{key}}">{{key}}:</label><br>
  88. <input type="text" id="{{key}}" name="{{key}}" value="{{value}}" readonly><br>
  89. </div>
  90. </form>
  91. </div>
  92. <div class="modal-footer bg2">
  93. <button type="button" class="btn btn-default boton" data-dismiss="modal">Close</button>
  94. </div>
  95. </div>
  96. </div>
  97. </div>
  98. {% endraw %}
  99. <!-- termina modal -->
  100. </html>