Ignore:
Timestamp:
2023-08-08T23:30:38+12:00 (10 months ago)
Author:
davidb
Message:

Search by all field implemented; additional footer content

Location:
gs3-installations/thewillow/trunk/interfaces/thewillow
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • gs3-installations/thewillow/trunk/interfaces/thewillow/js/thewillow-extra.js

    r37904 r37906  
     1function twFormToggleAllFields()
     2{
     3    var $obtype_all = $('#obtype-all');
     4    var $individual_obtype_fields = $('#individual-obtype-fields div');
     5   
     6    if ($obtype_all.is(':checked')) {
     7    $individual_obtype_fields.children().prop('disabled',true);
     8    }
     9    else {
     10    $individual_obtype_fields.children().prop('disabled',false);
     11    }
     12
     13}
    114
    215function twFormToGSQuery()
     
    417    var ft_query_term = $('#fulltext-search-terms').val();
    518
    6     if (ft_query_term.match(/^\s*$/)) {
    7     alert("empty");
     19    var num_terms = 0;
     20    if (!ft_query_term.match(/^\s*$/)) {
     21    num_terms++;
    822
    9     return false;
     23    var $ftq_input = $('#QueryForm input.fulltext-query-term');
     24    $ftq_input.val(ft_query_term); 
    1025    }
    1126
     27    var $ftq_ob_field_input = $('#QueryForm input.objecttype-query-term');
     28   
     29    // Check for 'all fields'
    1230
    13     var $ftq_input = $('#QueryForm input.fulltext-query-term');
     31    if ($('#obtype-all').is(':checked')) {
     32    num_terms++;
     33   
     34    var $ob_field_checked = $(".obtype-field");
    1435
    15     $ftq_input.val(ft_query_term);
     36    var ftq_ob_field_val = "";
     37    $ob_field_checked.each(function(index,value) {
     38        ftq_ob_field_val += " " + $(this).val();
     39    });
     40   
     41    $ftq_ob_field_input.val(ftq_ob_field_val.trim());
     42    }
     43    else {
     44   
     45    var $ob_field_checked = $(".obtype-field:checked");
    1646
    17 
    18     var $ftq_ob_field_input = $('#QueryForm input.objecttype-query-term');
    19 
    20     var $ob_field_checked = $(".obtype-field:checked");
    21 
    22     var ftq_ob_field_val = "";
    23     $ob_field_checked.each(function(index,value) {
    24     console.log("*** " + $(this).val());
    25     ftq_ob_field_val += " " + $(this).val();
    26     });
    27 
     47    var ftq_ob_field_val = "";
     48    $ob_field_checked.each(function(index,value) {
     49        num_terms++;
     50        ftq_ob_field_val += " " + $(this).val();
     51    });
     52    }
     53   
     54    if (num_terms == 0) {
     55    // No actual query input
     56        return false;
     57    }
     58   
    2859    $ftq_ob_field_input.val(ftq_ob_field_val.trim());
    2960   
     61    // go ahead with search/query
    3062    return true;
    3163}
  • gs3-installations/thewillow/trunk/interfaces/thewillow/style/core-extra.css

    r37904 r37906  
    210210    /* The following should probably be moved over to default interface css */
    211211    text-align: left;
    212     padding-left: 6px;
    213    
     212    /*padding-left: 6px; */
     213    padding: 0.5rem 0.4rem 0.3rem 0.6rem;
     214
     215    font-size: 110%;
    214216}
    215217
  • gs3-installations/thewillow/trunk/interfaces/thewillow/transform/layouts/main.xsl

    r37889 r37906  
    164164      <div style="clear:both;"><xsl:text> </xsl:text></div>
    165165    </div>
    166    
     166
     167    <div style="width: 100%; border-top: solid #E7D821 6px; margin-top: 1.0rem; padding-top: 1.0rem;">
     168      <div>This activity is part of the University of York's Street Lefe project funded by the Higher Education Innovation Fund (HEIF)</div>
     169      <div>Copyright @ StreetLife Project 2023</div>
     170    </div>
    167171      </div>
    168172    </xsl:template>
  • gs3-installations/thewillow/trunk/interfaces/thewillow/transform/pages/query.xsl

    r37904 r37906  
    7474          float: left;
    7575          width: 33%;
    76           padding-bottom: 0.8rem;
     76          padding-bottom: 1.0rem;
     77        }
     78
     79        .query-buttons {
     80          color: #ffffff;
     81          background-color: #000000;
     82          font-size: 105%;
     83          width: 8rem;
     84          height: 2.5rem;
    7785        }
    7886      </style>
     
    107115          <input type="hidden" name="s1.fqv" value="" class="objecttype-query-term"/>
    108116
     117          <div id="individual-obtype-fields">
     118        <div class="objecttype-checkbox">
     119          <input type="checkbox" class="obtype-field" id="obtype-articles"   name="obtype-articles"    value="Article"/>
     120          <label for="obtype-articles">Articles</label>             
     121        </div>
     122        <div class="objecttype-checkbox">
     123          <input type="checkbox" class="obtype-field" id="obtype-interviews" name="objtype-interviews" value="Interview"/>
     124          <label for="obtype-interviews">Interviews</label>
     125        </div>       
     126        <div class="objecttype-checkbox">
     127          <input type="checkbox" class="obtype-field"  id="obtype-listings"  name="obtype-listings"    value="Listing"/>
     128          <label for="obtype-listings">Listings</label>
     129        </div>
     130       
     131        <div class="objecttype-checkbox">
     132          <input type="checkbox" class="obtype-field" id="obtype-newspapers"  name="obtype-newspapers"  value="Newspaper"/>
     133          <label for="obtype-newspapers">Newspapers</label>             
     134        </div>
     135        <div class="objecttype-checkbox">
     136          <input type="checkbox" class="obtype-field" id="obtype-photographs" name="objtype-photographs" value="Photograph"/>
     137          <label for="obtype-photographs">Photographs</label>
     138        </div>       
     139        <div class="objecttype-checkbox">
     140          <input type="checkbox" class="obtype-field"  id="obtype-videos"     name="obtype-videos"       value="Video"/>
     141          <label for="obtype-videos">Videos</label>
     142        </div>
     143          </div>
     144
    109145          <div class="objecttype-checkbox">
    110         <input type="checkbox" class="obtype-field" id="obtype-articles"   name="obtype-articles"    value="Article"/>
    111         <label for="obtype-articles">Articles</label>               
     146        <input type="checkbox" class="obtype-field-all" onclick="twFormToggleAllFields()" id="obtype-all"   name="obtype-all"    value="All"/>
     147        <label for="obtype-all">All Fields</label>             
    112148          </div>
    113           <div class="objecttype-checkbox">
    114         <input type="checkbox" class="obtype-field" id="obtype-interviews" name="objtype-interviews" value="Interview"/>
    115         <label for="obtype-interviews">Interviews</label>
    116           </div>         
    117           <div class="objecttype-checkbox">
    118         <input type="checkbox" class="obtype-field"  id="obtype-listings"  name="obtype-listings"    value="Listing"/>
    119         <label for="obtype-listings">Listings</label>
    120           </div>
    121 
    122           <div class="objecttype-checkbox">
    123         <input type="checkbox" class="obtype-field" id="obtype-newspapers"   name="obtype-newspapers"    value="Newspaper"/>
    124         <label for="obtype-newspapers">Newspapers</label>               
    125           </div>
    126           <div class="objecttype-checkbox">
    127         <input type="checkbox" class="obtype-field" id="obtype-photographs" name="objtype-photographs" value="Photograph"/>
    128         <label for="obtype-photographs">Photographs</label>
    129           </div>         
    130           <div class="objecttype-checkbox">
    131         <input type="checkbox" class="obtype-field"  id="obtype-videos"  name="obtype-videos"    value="Video"/>
    132         <label for="obtype-videos">Videos</label>
    133           </div>
    134          
    135          
     149
    136150        </div>
    137151      </div>
     
    170184        <div style="width: 100%;">
    171185          <div style="float: right;">
    172         <input type="reset">
    173           <xsl:attribute name="value">
    174           Reset
    175           </xsl:attribute>
    176         </input>
    177          
    178         <input type="submit">
    179           <xsl:attribute name="value">
    180             Search
    181           </xsl:attribute>
    182         </input>
     186        <input class="query-buttons" type="reset"  value="Reset" />       
     187        <input class="query-buttons" type="submit" value="Search" />
    183188          </div>
    184189        </div>
Note: See TracChangeset for help on using the changeset viewer.