src/Ox/HoardBundle/Resources/views/reference/list.html.twig line 1

Open in your IDE?
  1. {% extends '@OxHoardBundle/layout.html.twig' %}
  2. {% block title %}References{% endblock %}
  3. {% block body %}
  4.     <div class="marginTop clearfix"></div>
  5.     
  6.     <div id="content" class="container">
  7.         <div class="row marginTop">
  8.             <div class="hoardlistview-6col col-md-12">
  9.                 {% if is_authenticated %}
  10.                 <div class="edit-btn"><a href="{{ path('reference_new') }}"><h2>Add a new Reference   <span class="fa fa-plus"></span></h2></a></div>
  11.                 {% endif %}
  12.                 <h1>List of References</h1>
  13.                 <div style="padding: 10px"></div>
  14.                 <form id="reference-search-form" method="get" action="">
  15.                     <div id="tabs" class="tabs">
  16.                         <ul>
  17.                             <li><a href="#tabs-1">Search</a></li>
  18.                             <li><a href="#tabs-2">Advanced Search</a></li>
  19.                         </ul>
  20.                         <div id="tabs-1">
  21.                             <input name="search" type="text"
  22.                                 {% if search_term %}
  23.                                 value="{{ search_term }}"
  24.                                 {% else %}    
  25.                                 placeholder="Search" 
  26.                                 {% endif %}
  27.                             />
  28.                         </div>
  29.                         <div id="tabs-2">
  30.                             <div>
  31.                                 <div class="datalabel">
  32.                                     <label>Author</label>
  33.                                 </div>
  34.                                 <div class="data">
  35.                                     <input name="author" type="text"
  36.                                         {% if author %}
  37.                                         value="{{ author }}"
  38.                                         {% else %}    
  39.                                         placeholder="Author" 
  40.                                         {% endif %}
  41.                                         />
  42.                                 </div>
  43.                             </div>
  44.                             {% if is_authenticated %}
  45.                                 <div class="datalabel">
  46.                                     <label>Abbreviation</label>
  47.                                 </div>
  48.                                 <div class="data">
  49.                                     <input name="abbreviation" type="text"
  50.                                         {% if abbreviation %}
  51.                                         value="{{ abbreviation }}"
  52.                                         {% else %}    
  53.                                         placeholder="Abbreviation" 
  54.                                         {% endif %}
  55.                                     />
  56.                                 </div>
  57.                             {% endif %}
  58.                             <div>
  59.                                 <div class="datalabel">
  60.                                     <label>Title</label>
  61.                                 </div>
  62.                                 <div class="data">
  63.                                     <input name="title" type="text"
  64.                                         {% if title %}
  65.                                         value="{{ title }}"
  66.                                         {% else %}    
  67.                                         placeholder="Title" 
  68.                                         {% endif %}
  69.                                         />
  70.                                 </div>
  71.                             </div>
  72.                             <div>
  73.                                 <div class="datalabel">
  74.                                     <label>Title (journal, series)</label>
  75.                                 </div>
  76.                                 <div class="data">
  77.                                     <input name="title-edition" type="text"
  78.                                         {% if title_edition %}
  79.                                         value="{{ title_edition }}"
  80.                                         {% else %}    
  81.                                         placeholder="Title (journal, series)" 
  82.                                         {% endif %}
  83.                                         />
  84.                                 </div>
  85.                             </div>
  86.                             <div>
  87.                                 <div class="datalabel">
  88.                                     <label>Volume</label>
  89.                                 </div>
  90.                                 <div class="data">
  91.                                     <input name="volume" type="text"
  92.                                         {% if volume %}
  93.                                         value="{{ volume }}"
  94.                                         {% else %}    
  95.                                         placeholder="Volume" 
  96.                                         {% endif %}
  97.                                         />
  98.                                 </div>
  99.                             </div>
  100.                             <div>
  101.                                 <div class="datalabel">
  102.                                     <label>Year</label>
  103.                                 </div>
  104.                                 <div class="data">
  105.                                     <input name="year-from" type="text"
  106.                                         {% if year_from %}
  107.                                         value="{{ year_from }}"
  108.                                         {% else %}    
  109.                                         placeholder="From year" 
  110.                                         {% endif %}
  111.                                     />
  112.                                     <input name="year-to" type="text"
  113.                                         {% if year_to %}
  114.                                         value="{{ year_to }}"
  115.                                         {% else %}    
  116.                                         placeholder="To year" 
  117.                                         {% endif %}
  118.                                     />
  119.                                 </div>
  120.                             </div>
  121.                             <div>
  122.                                 <div class="datalabel">
  123.                                     <label>Type</label>
  124.                                 </div>
  125.                                 <div class="data">
  126.                                     <select name="reference-type" class="select2-choice form-control">
  127.                                         <option value=""></option>
  128.                                         {% for ref_type in reference_types %}
  129.                                             <option value="{{ref_type.id}}" 
  130.                                             {% if ref_type.id == reference_type %} selected {% endif %}
  131.                                             >{{ref_type}}</option>
  132.                                         {% endfor %}
  133.                                     </select>
  134.                                 </div>
  135.                             </div>
  136.                             {% if is_authenticated %}
  137.                                 <div>
  138.                                     <div class="datalabel">
  139.                                         <label>Internal note</label>
  140.                                     </div>
  141.                                     <div class="data">
  142.                                         <input name="internal-note" type="text"
  143.                                             {% if internalNote %}
  144.                                             value="{{ internalNote }}"
  145.                                             {% else %}    
  146.                                             placeholder="Internal note" 
  147.                                             {% endif %}
  148.                                             />
  149.                                     </div>
  150.                                 </div>
  151.                             {% endif %}
  152.                         </div>
  153.                     </div>
  154.                     <input class='hidden' id="active-tab" name='active-tab' type="text" value="{{active_tab}}"/>
  155.                 <input type="submit" value="Submit" /></form>
  156.                 {% embed '@OxHoardBundle/flash.html.twig' %}{% endembed %}
  157.                 <h4>
  158.                     {% set direction = pagination.getDirection() %}
  159.                     {% for field in sort_fields %}
  160.                         {% if pagination.isSorted(field.key) %}Sorted by {{field.label}} {{direction}} {% endif %}
  161.                     {% endfor %}
  162.                 </h4>
  163.                 <div class="btn-group sort-results">
  164.                     <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  165.                         Sort By:
  166.                         <span class="caret"></span>
  167.                     </button>
  168.                     <ul class="dropdown-menu">
  169.                         {% for field in sort_fields %}
  170.                             <li>{{ knp_pagination_sortable(pagination, field.label, field.key, {'defaultDirection' : field.defaultDirection}) }}</li>
  171.                         {% endfor %}
  172.                     </ul>
  173.                 </div>
  174.                 <div class="navigation">
  175.                     {{ knp_pagination_render(pagination) }}
  176.                 </div>
  177.                 {% if pagination is empty %}
  178.                     <h2>Your query did not return any results.</h2>
  179.                 {% endif %}
  180.                 {% for reference in pagination %}
  181.                     <h2>
  182.                         <a href="{{ path('reference_show', { 'id':reference.id }) }}">{{ reference }}</a> -
  183.                     </h2>
  184.                     {% if is_authenticated %}
  185.                         <a class="btn btn-default pull-right list-edit-button" href="{{ path('reference_edit', { 'id':reference.id }) }}">Edit</a>
  186.                     {% endif %}    
  187.                     <div class="datalabel">Title (journal, series): </div><div class="data">{{ reference.titleEdition }}</div>
  188.                     <div class="datalabel">Abbreviation: </div><div class="data">{{ reference.abbreviation }}</div>
  189.                     <div class="datalabel">Year: </div><div class="data">{{ reference.year }}</div>
  190.                     <div class="datalabel">Type: </div><div class="data">{{ reference.referenceType }}</div>
  191.                     {% if is_authenticated %}
  192.                         {% if reference.sortValue != 0 %}
  193.                             <div class="datalabel">Sort Value: </div><div class="data">{{ reference.sortValue }}</div>
  194.                         {% endif %}
  195.                     {% endif %}
  196.                     {% if is_admin and reference.hasOwnColumn %}
  197.                         <div class="datalabel">Has own column</div><div class="data"><i class="fa fa-check"></i></div>
  198.                     {% endif %}
  199.                 {% endfor %}
  200.             </div>
  201.         </div>
  202.         <div class="navigation">
  203.             {{ knp_pagination_render(pagination) }}
  204.         </div>
  205.         
  206.     </div>
  207. {% endblock %}
  208. {% block javascripts %}
  209.     {{parent()}}
  210.     {% embed 'import-libs/select2.js.html.twig' %}{% endembed %}
  211.     <script>
  212.     $( function() {
  213.         $('.select2-choice').select2()
  214.         $( ".tabs" ).tabs({
  215.             active: $('#tabs>div').index($('{{active_tab}}')),
  216.             activate: function( ev, ui ) {
  217.                 $("#active-tab").val(ui.newTab.children()[0].hash)
  218.             }
  219.         })
  220.     } );
  221.     </script>
  222. {% endblock %}
  223. {% block stylesheets %}
  224.     {{ parent() }}
  225.     {% embed 'import-libs/select2.css.html.twig' %}{% endembed %}
  226. {% endblock %}