Permalink
Browse files

Refactor db search templates

Signed-off-by: Leonardo Strozzi <laps15@inf.ufpr.br>
  • Loading branch information...
laps15 committed Jun 19, 2018
1 parent 3516f4d commit 99506813b62354b77a2bfd3f1e217b3dfd92ebb8
View
@@ -68,10 +68,4 @@
}
// Display the search form
$response->addHTML($db_search->getSelectionForm());
$response->addHTML('<div id="searchresults"></div>');
$response->addHTML(
'<div id="togglesearchresultsdiv"><a id="togglesearchresultlink"></a></div>'
);
$response->addHTML('<br class="clearfloat" />');
$response->addHTML($db_search->getResultDivs());
$response->addHTML($db_search->getMainHtml());
@@ -317,7 +317,7 @@ public function getSearchResults()
*
* @return string HTML for selection form
*/
public function getSelectionForm()
public function getMainHtml()
{
$choices = [
'1' => $this->searchTypes[1] . ' '
@@ -332,7 +332,7 @@ public function getSelectionForm()
'4' => $this->searchTypes[4],
'5' => $this->searchTypes[5] . ' ' . Util::showMySQLDocu('Regexp')
];
return $this->template->render('database/search/selection_form', [
return $this->template->render('database/search/main', [
'db' => $this->db,
'choices' => $choices,
'criteria_search_string' => $this->criteriaSearchString,
@@ -343,14 +343,4 @@ public function getSelectionForm()
? $this->criteriaColumnName : null,
]);
}
/**
* Provides div tags for browsing search results and sql query form.
*
* @return string div tags
*/
public function getResultDivs()
{
return $this->template->render('database/search/result_divs');
}
}
@@ -61,3 +61,19 @@
<div id="togglesearchformdiv">
<a id="togglesearchformlink"></a>
</div>
<div id="searchresults"></div>
<div id="togglesearchresultsdiv"><a id="togglesearchresultlink"></a></div>
<br class="clearfloat" />
{# These two table-image and table-link elements display the table name in browse search results #}
<div id="table-info">
<a id="table-link" class="item"></a>
</div>
{# Div for browsing results #}
<div id="browse-results">
{# This browse-results div is used to load the browse and delete results in the db search #}
</div>
<div id="sqlqueryform" class="clearfloat">
{# This sqlqueryform div is used to load the delete form in the db search #}
</div>
{# Toggle query box link #}
<a id="togglequerybox"></a>

This file was deleted.

Oops, something went wrong.
@@ -1,9 +1,9 @@
<table class="data">
<caption class="tblHeaders">
{{ 'Search results for "<em>%s</em>" %s:'|format(
{{ 'Search results for "<em>%s</em>" %s:' | format(
criteria_search_string,
search_type_description
)|raw }}
) | raw }}
</caption>
{% for row in rows %}
<tr class="noclick">
@@ -15,7 +15,7 @@
%1$s matches in <strong>%2$s</strong>
{% endtrans %}
{% endset %}
{{ result_message|format(row.result_count, row.table)|raw }}
{{ result_message | format(row.result_count, row.table) | raw }}
</td>
{% if row.result_count > 0 %}
{% set url_params = {
@@ -51,7 +51,7 @@
{% endfor %}
</table>
{% if criteria_tables|length > 1 %}
{% if criteria_tables | length > 1 %}
<p>
{% trans %}
<strong>Total:</strong> <em>{{ count }}</em> match

0 comments on commit 9950681

Please sign in to comment.