Merge pull request #269 from pateljannat/search-generic

This commit is contained in:
Jannat Patel
2021-11-26 11:44:23 +05:30
committed by GitHub
3 changed files with 34 additions and 3 deletions

View File

@@ -10,7 +10,10 @@
"email_sender",
"mentor_request_section",
"mentor_request_creation",
"mentor_request_status_update"
"mentor_request_status_update",
"search_settings_section",
"show_search",
"search_placeholder"
],
"fields": [
{
@@ -45,12 +48,29 @@
{
"fieldname": "column_break_2",
"fieldtype": "Column Break"
},
{
"fieldname": "search_settings_section",
"fieldtype": "Section Break",
"label": "Search Settings"
},
{
"default": "0",
"fieldname": "show_search",
"fieldtype": "Check",
"label": "Show Search on Website"
},
{
"depends_on": "show_search",
"fieldname": "search_placeholder",
"fieldtype": "Data",
"label": "Search Field Placeholder"
}
],
"index_web_pages_for_search": 1,
"issingle": 1,
"links": [],
"modified": "2021-04-29 17:14:43.589700",
"modified": "2021-11-25 14:12:21.514922",
"modified_by": "Administrator",
"module": "LMS",
"name": "LMS Settings",

View File

@@ -1387,6 +1387,8 @@ pre {
background-repeat: no-repeat;
text-indent: 1.5rem;
background-position: 1rem 0.65rem;
float: right;
width: 25%;
}
.section-heading {
@@ -1481,3 +1483,7 @@ pre {
text-decoration: none;
color: #000;
}
.live-courses .course-home-headings {
margin-bottom: 1.5rem;
}

View File

@@ -1,4 +1,8 @@
<input class="search-course w-25 float-right" placeholder="{{ _("Try `Manufacturing` or `Accounting`") }}">
{% set show_search = frappe.db.get_single_value("LMS Settings", "show_search") %}
{% set search_placeholder = frappe.db.get_single_value("LMS Settings", "search_placeholder") %}
{% if show_search %}
<input class="search-course" placeholder="{{ _(search_placeholder) }}">
<div id="" class="alert alert-dismissible empty-state search-empty-state hide">
<a href="#" class="close-search-empty-state" aria-label="close">&times;</a>
@@ -8,3 +12,4 @@
</div>
<script> {% include "school/templates/search_course/search_course.js" %} </script>
{% endif %}