Project

General

Profile

Revision b18d70f6

IDb18d70f667520ea1abe78debd68e868d7c964763
Parent 5195ddf2
Child 0b494565

Added by Andreas Kohlbecker about 2 years ago

ref #7835 adding registration search block combining filter and taxongraph search

View differences:

modules/cdm_dataportal/cdm_dataportal.css
1
@import "./css/jquery_ui.css";
1 2
/**
2 3
 * ======= General styles =======
3 4
 *
......
104 105
}
105 106

  
106 107
.fa-icon {
107
    font-family: 'FontAwesome';
108
    font-family: 'FontAwesome' !important;
108 109
}
109 110

  
110 111
/*
......
153 154
    background-color: #eeeeee;
154 155
}
155 156

  
156
.search-filter .form-item{
157
.search-filter .form-item {
157 158
    display: inline-block;
158 159
    vertical-align: top;
159 160
    margin-bottom: 0;
160 161
}
161 162

  
163
#accordion .search-filter .form-item {
164
    display: block;
165
}
166

  
162 167
.search-filter .form-submit {
163 168
    display: inline-block;
164 169
    margin-top: 1.5em; /* same as for .form-item */
165 170
    margin-bottom: 4px;
166 171
    vertical-align: bottom;
167 172
}
173

  
174
#accordion .search-filter .form-submit {
175
    float: right;
176
    margin-top: .5em;
177
}
178

  
168 179
/*
169 180
 * ======= Search-Results =======
170 181
 */
modules/cdm_dataportal/cdm_dataportal.module
322 322
    );
323 323
  }
324 324

  
325
  function _add_js_ui_accordion(){
326
    _add_jquery_ui();
327
    drupal_add_js('jQuery(document).ready(function() {
328
        jQuery( "#accordion" ).accordion();
329
      });',
330
      array('type' => 'inline')
331
    );
332
  }
333

  
325 334
  /**
326 335
   * Provides the markup for an font awesome icon.
327 336
   *
......
865 874
      'pages' => "cdm_dataportal/taxon/*", // multiple page paths separated by "\n"!!!
866 875
    );
867 876
  $block['registrations_search_filter'] =  array(
868
    'title' => 'Search registrations',
877
    'title' => 'Filter registrations',
869 878
    'info' => t('CDM - Registrations search filter'),
870 879
    'cache' => DRUPAL_CACHE_PER_PAGE,
871 880
    'visibility' => BLOCK_VISIBILITY_NOTLISTED,
872
    'pages' => "cdm_dataportal/search-registration\ncdm_dataportal/search-registration/*", // multiple page paths separated by "\n"!!!
881
    'pages' => "cdm_dataportal/registration-search\ncdm_dataportal/registration-search/*", // multiple page paths separated by "\n"!!!
873 882
  );
874 883
  $block['registrations_search_taxongraph'] =  array(
875 884
    'title' => 'Taxonomic registration search',
876 885
    'info' => t('CDM - Registrations search by taxon graph'),
877 886
    'cache' => DRUPAL_CACHE_PER_PAGE,
878 887
    'visibility' => BLOCK_VISIBILITY_NOTLISTED,
879
    'pages' => "cdm_dataportal/search-registration\ncdm_dataportal/search-registration/*", // multiple page paths separated by "\n"!!!
888
    'pages' => "cdm_dataportal/registration-search\ncdm_dataportal/registration-search/*", // multiple page paths separated by "\n"!!!
889
  );
890
  $block['registrations_search'] =  array(
891
    'title' => 'Search',
892
    'info' => t('CDM - Registrations search combining filter and taxon graph search' ),
893
    'cache' => DRUPAL_CACHE_PER_PAGE,
894
    'visibility' => BLOCK_VISIBILITY_NOTLISTED,
895
    'pages' => "cdm_dataportal/registration-search\ncdm_dataportal/registration-search/*", // multiple page paths separated by "\n"!!!
880 896
  );
881 897
  return $block;
882 898
}
......
943 959
      $block['subject'] = '<none>';
944 960
      $block['content'] = drupal_get_form('cdm_dataportal_search_registration_taxongraph_form'); // see cdm_dataportal_search_registration_taxongraph_form($form, &$form_state)
945 961
      return $block;
962
    case 'registrations_search':
963
      _add_js_ui_accordion();
964
      _add_font_awesome_font();
965
      $block['subject'] = '<none>';
966
      $filter_form = drupal_get_form('cdm_dataportal_search_registration_filter_form');
967
      $filter_form['#prefix'] = '<div>';
968
      $filter_form['#suffix'] = '</div>';
969
      $taxongraph_form = drupal_get_form('cdm_dataportal_search_registration_taxongraph_form');
970
      $taxongraph_form['#prefix'] = '<div>';
971
      $taxongraph_form['#suffix'] = '</div>';
972
      $block['content'] = array(
973
        'accordion' => array(
974
          '#markup' => '',
975
          '#prefix' => '<div id="accordion">',
976
          '#suffix' => '</div>',
977
          'content' => array(
978
            array('#markup' => '<h3>Filter</h3>'),
979
            $filter_form,
980
            array('#markup' => '<h3>Taxon graph</h3>'),
981
            $taxongraph_form,
982
          )
983
        )
984
    );
985
       return $block;
946 986
    default:
947 987
      return null;
948 988
  }
modules/cdm_dataportal/css/jquery_ui.css
1
/**
2
 * Overrides jQuery_ui presets
3
 */
4

  
5

  
6
#page .block #accordion .ui-state-default, #page .block #accordion  .ui-state-active {
7
    background: #cdcdcd;
8
}
9
#page .block #accordion .ui-accordion-header {
10
    border: none;
11
    padding-left: .5em;
12
    line-height: 2em;
13
}
14
#page .block #accordion .ui-accordion-header .ui-icon {
15
    left: auto;
16
    right: .5em;
17
}
18

  
19
#page .block #accordion .ui-accordion-content, #page .block #accordion .ui-widget-content {
20
    padding-left: .5em;
21
    padding-right: .5em;
22
    padding-top: 0;
23
    padding-bottom: 0;
24
    border: none;
25
    background: #e9e9e9;
26
}
27
#page .block #accordion .ui-accordion-content form {
28
    background: #e9e9e9;
29
}
30

  
31

  

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)