started advanced search
This commit is contained in:
		@@ -45,13 +45,32 @@ class MaterioSapiSearchForm extends FormBase {
 | 
				
			|||||||
        "v-model" => "autocomplete"
 | 
					        "v-model" => "autocomplete"
 | 
				
			||||||
      ],
 | 
					      ],
 | 
				
			||||||
    ];
 | 
					    ];
 | 
				
			||||||
    // $form['submit'] = [
 | 
					
 | 
				
			||||||
    //   '#type' => 'submit',
 | 
					    $form['filters'] = [
 | 
				
			||||||
    //   '#value' => $this->t('Search'),
 | 
					      '#type' => 'container'
 | 
				
			||||||
    //   '#attributes' => [
 | 
					    ];
 | 
				
			||||||
    //     '@click.prevent' => "submit",
 | 
					
 | 
				
			||||||
    //   ]
 | 
					    $query = \Drupal::entityQuery('taxonomy_term');
 | 
				
			||||||
    // ];
 | 
					    $query->condition('vid', "assisted_research");
 | 
				
			||||||
 | 
					    $tids = $query->execute();
 | 
				
			||||||
 | 
					    $terms = \Drupal\taxonomy\Entity\Term::loadMultiple($tids);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    foreach ($terms as $tid => $term) {
 | 
				
			||||||
 | 
					      $childs = $term->get('field_terms')->getValue();
 | 
				
			||||||
 | 
					      $options = array($term->getName());
 | 
				
			||||||
 | 
					      foreach ($childs as $child) {
 | 
				
			||||||
 | 
					        $child_term = \Drupal\taxonomy\Entity\Term::load($child['target_id']);
 | 
				
			||||||
 | 
					        $options[$child_term->id()] = $child_term->getName();
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					      $form['filters']['filter-'.$tid] = array(
 | 
				
			||||||
 | 
					        '#type' => 'select',
 | 
				
			||||||
 | 
					        // '#title' => $term->getName(),
 | 
				
			||||||
 | 
					        // '#multiple' => true,
 | 
				
			||||||
 | 
					        '#options' => $options
 | 
				
			||||||
 | 
					      );
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    $form['submit'] = array(
 | 
					    $form['submit'] = array(
 | 
				
			||||||
        '#type'   => 'button',
 | 
					        '#type'   => 'button',
 | 
				
			||||||
        // '#src'    => '',//drupal_get_path('module', 'materio_search_api') . '/images/search.png',
 | 
					        // '#src'    => '',//drupal_get_path('module', 'materio_search_api') . '/images/search.png',
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -19751,12 +19751,27 @@ header[role="banner"] {
 | 
				
			|||||||
  header[role="banner"] #block-materiosapisearchblock {
 | 
					  header[role="banner"] #block-materiosapisearchblock {
 | 
				
			||||||
    padding: 0; }
 | 
					    padding: 0; }
 | 
				
			||||||
    header[role="banner"] #block-materiosapisearchblock #materio-sapi-search-form .form-item, header[role="banner"] #block-materiosapisearchblock #materio-sapi-search-form input.button {
 | 
					    header[role="banner"] #block-materiosapisearchblock #materio-sapi-search-form .form-item, header[role="banner"] #block-materiosapisearchblock #materio-sapi-search-form input.button {
 | 
				
			||||||
      display: inline-block; }
 | 
					      display: inline-block;
 | 
				
			||||||
 | 
					      margin: 0; }
 | 
				
			||||||
    header[role="banner"] #block-materiosapisearchblock #materio-sapi-search-form #edit-search {
 | 
					    header[role="banner"] #block-materiosapisearchblock #materio-sapi-search-form #edit-search {
 | 
				
			||||||
      border: 1px #BBB solid;
 | 
					      border: 1px #BBB solid;
 | 
				
			||||||
      border-radius: 14px;
 | 
					      border-radius: 14px;
 | 
				
			||||||
      padding: 0.3em;
 | 
					      padding: 0.3em;
 | 
				
			||||||
      color: #666; }
 | 
					      color: #666; }
 | 
				
			||||||
 | 
					    header[role="banner"] #block-materiosapisearchblock #materio-sapi-search-form #edit-filters select.form-select {
 | 
				
			||||||
 | 
					      -webkit-appearance: none;
 | 
				
			||||||
 | 
					      -moz-appearance: none;
 | 
				
			||||||
 | 
					      appearance: none;
 | 
				
			||||||
 | 
					      display: inline-block;
 | 
				
			||||||
 | 
					      background-color: #e3e3e3;
 | 
				
			||||||
 | 
					      padding: 0;
 | 
				
			||||||
 | 
					      border-radius: 10px;
 | 
				
			||||||
 | 
					      font-size: 0.756em;
 | 
				
			||||||
 | 
					      border: none; }
 | 
				
			||||||
 | 
					      header[role="banner"] #block-materiosapisearchblock #materio-sapi-search-form #edit-filters select.form-select::-ms-expand {
 | 
				
			||||||
 | 
					        display: none; }
 | 
				
			||||||
 | 
					      header[role="banner"] #block-materiosapisearchblock #materio-sapi-search-form #edit-filters select.form-select option {
 | 
				
			||||||
 | 
					        width: 5em; }
 | 
				
			||||||
    header[role="banner"] #block-materiosapisearchblock #materio-sapi-search-form .button.form-submit {
 | 
					    header[role="banner"] #block-materiosapisearchblock #materio-sapi-search-form .button.form-submit {
 | 
				
			||||||
      border: 0;
 | 
					      border: 0;
 | 
				
			||||||
      text-indent: 50px;
 | 
					      text-indent: 50px;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -576,6 +576,7 @@ header[role="banner"]{
 | 
				
			|||||||
    #materio-sapi-search-form{
 | 
					    #materio-sapi-search-form{
 | 
				
			||||||
      .form-item, input.button{
 | 
					      .form-item, input.button{
 | 
				
			||||||
        display: inline-block;
 | 
					        display: inline-block;
 | 
				
			||||||
 | 
									margin: 0;
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      #edit-search{
 | 
					      #edit-search{
 | 
				
			||||||
@@ -585,6 +586,27 @@ header[role="banner"]{
 | 
				
			|||||||
        color:#666;
 | 
					        color:#666;
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								#edit-filters{
 | 
				
			||||||
 | 
									select.form-select{
 | 
				
			||||||
 | 
										-webkit-appearance: none;
 | 
				
			||||||
 | 
									  -moz-appearance: none;
 | 
				
			||||||
 | 
									  appearance: none;
 | 
				
			||||||
 | 
										&::-ms-expand {
 | 
				
			||||||
 | 
											display: none;
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
 | 
										display: inline-block;
 | 
				
			||||||
 | 
										background-color: #e3e3e3;
 | 
				
			||||||
 | 
										padding:0;
 | 
				
			||||||
 | 
										border-radius: 10px;
 | 
				
			||||||
 | 
										font-size: 0.756em;
 | 
				
			||||||
 | 
										border: none;
 | 
				
			||||||
 | 
										// background: url(../images/caret-down.svg) no-repeat 98% 64% #bbb;
 | 
				
			||||||
 | 
										option{
 | 
				
			||||||
 | 
											width:5em;
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      .button.form-submit{
 | 
					      .button.form-submit{
 | 
				
			||||||
        border:0;
 | 
					        border:0;
 | 
				
			||||||
        text-indent: 50px;
 | 
					        text-indent: 50px;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user