Skip to content

Commit

Permalink
fix: search result cards
Browse files Browse the repository at this point in the history
  • Loading branch information
adilmohak committed Oct 5, 2024
1 parent 1055e12 commit efdd08f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
6 changes: 3 additions & 3 deletions result/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from core.models import Session, Semester
from course.models import Course
from accounts.decorators import lecturer_required, student_required
from .models import TakenCourse, Result, FIRST, SECOND
from .models import TakenCourse, Result


cm = 2.54
Expand Down Expand Up @@ -583,7 +583,7 @@ def course_registration_form(request):

first_semester_unit = 0
for course in courses:
if course.course.semester == FIRST:
if course.course.semester == settings.FIRST:
first_semester_unit += int(course.course.credit)
data = [
(
Expand Down Expand Up @@ -672,7 +672,7 @@ def course_registration_form(request):

second_semester_unit = 0
for course in courses:
if course.course.semester == SECOND:
if course.course.semester == settings.SECOND:
second_semester_unit += int(course.course.credit)
data = [
(
Expand Down
18 changes: 6 additions & 12 deletions templates/search/search_view.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@
.class-item a{padding: 2px; color: #343a40; text-decoration: none; transition: .5s;}
.class-item:hover{
transform: translateX(15px);
background: #6cbd45;
}
.class-item:hover h4 a {
color: #fff; }
.class-item:hover p, .class-item:hover span {
color: rgb(158, 239, 119);
}
</style>

Expand All @@ -46,7 +40,7 @@ <h5 class="text-muted m-0">{{ count }} {% trans 'result' %}{{ count|pluralize }}
{% with object|class_name as klass %}
{% if klass == "Program" %}
<div class="session-wrapper">
<div class="session"><div class="info-text bg-orange">{% trans 'Program' %}</div></div>
<div class="session"><div class="info-text bg-secondary text-light px-2 rounded-pill">{% trans 'Program' %}</div></div>
</div>
<div class="col-12 class-item">
<!-- <p><b>Program of</b> {{ object }}</p> -->
Expand All @@ -56,7 +50,7 @@ <h4><a href="{{ object.get_absolute_url }}"><b>{{ object.title}}</b></a></h4>

{% elif klass == "Course" %}
<div class="session-wrapper">
<div class="session"><div class="info-text bg-orange">{% trans 'Course' %}</div></div>
<div class="session"><div class="info-text bg-secondary text-light px-2 rounded-pill">{% trans 'Course' %}</div></div>
</div>
<div class="col-12 class-item">
<p><b>{% trans 'Program of' %}</b> {{ object.program }}</p>
Expand All @@ -66,7 +60,7 @@ <h4><a href="{{ object.get_absolute_url }}"><b>{{ object }}</b></a></h4>

{% elif klass == "NewsAndEvents" %}
<div class="session-wrapper">
<div class="session"><div class="info-text bg-orange">{% trans 'News And Events' %}</div></div>
<div class="session"><div class="info-text bg-secondary text-light px-2 rounded-pill">{% trans 'News And Events' %}</div></div>
</div>
<div class="col-12 class-item">
<p><b>{% trans 'Date:' %} </b> {{ object.updated_date|timesince }} ago</p>
Expand All @@ -76,7 +70,7 @@ <h4><a href="{{ object.get_absolute_url }}"><b>{{ object.title }}</b></a></h4>

{% elif klass == "Quiz" %}
<div class="session-wrapper">
<div class="session"><div class="info-text bg-orange">{% trans 'Quiz' %}</div></div>
<div class="session"><div class="info-text bg-secondary text-light px-2 rounded-pill">{% trans 'Quiz' %}</div></div>
</div>
<div class="col-12 class-item">
<p>{{ object.category }} {% trans 'quiz' %}, <b>{% trans 'Course:' %}</b> {{ object.course }}</p>
Expand All @@ -86,7 +80,7 @@ <h4><a href="{{ object.get_absolute_url }}"><b>{{ object.title }}</b></a></h4>

{% else %}
<div class="session-wrapper">
<div class="session"><div class="info-text bg-orange">{% trans 'Program' %}</div></div>
<div class="session"><div class="info-text bg-secondary text-light px-2 rounded-pill">{% trans 'Program' %}</div></div>
</div>
<div class="col-12 col-lg-8 offset-lg-4">
<a href="{{ object.get_absolute_url }}" class="class-item d-flex">{{ object }} | {{ object|class_name }}</a>
Expand Down Expand Up @@ -123,7 +117,7 @@ <h5>{% trans 'Search by:' %}</h5>
<ul class="pl-3">
<li>{% trans 'Program' %} <span class="text-orange">&gt;</span> {% trans 'Title or Description' %}</li>
<li>{% trans 'Course' %} <span class="text-orange">&gt;</span>{% trans 'Title, Code or Description' %}</li>
<li>{% trans 'News And Events' %} <span class="text-orange">&gt;</span> {% trans 'Title, Description or just by typing "news" or "event %}li>
<li>{% trans 'News And Events' %} <span class="text-orange">&gt;</span> {% trans 'Title, Description or just by typing news or event' %}li>
<li>{% trans 'Quiz' %} <span class="text-orange">&gt;</span>{% trans 'Title, Description or Category(practice, assignment and exam)' %}</li>
</ul>
</div>
Expand Down

0 comments on commit efdd08f

Please sign in to comment.