Skip to content

Commit d2eb9d1

Browse files
authored
Merge pull request Hardhat-Enterprises#401 from ys2426/main
UI Fixes: Language Dropdown/Recently Viewed Button Issue; Internship Expand Behavior & Scrollable; Path Finder Top Spacing
2 parents 33fb4f1 + 27248b2 commit d2eb9d1

7 files changed

Lines changed: 33 additions & 31 deletions

File tree

custom_static/css/hardhat.css

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27369,15 +27369,20 @@ blockquote {
2736927369

2737027370
.recently-viewed-sidebar {
2737127371
position: fixed;
27372-
top: 150px; /* Adjust based on where you want it */
27372+
top: 150px; /* Adjusted to sit below language dropdown */
2737327373
right: 20px;
27374-
z-index: 1000;
27374+
z-index: 10;
2737527375
background-color: #1c2540;
2737627376
padding: 10px;
2737727377
border-radius: 5px;
2737827378
box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.2);
2737927379
}
2738027380

27381+
.recently-viewed-sidebar .dropdown-menu,
27382+
.recently-viewed-sidebar .dropdown-toggle {
27383+
z-index: 10;
27384+
}
27385+
2738127386
.recently-viewed-sidebar .dropdown-toggle {
2738227387
background-color: #1c2540; /* Matches the site's dark theme */
2738327388
color: #ffc107; /* Gold text color */

home/forms.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,10 @@ class CaptchaForm(forms.Form):
457457

458458

459459
class UserBlogPageForm(ModelForm):
460+
image_url = forms.URLField(required=False, widget=forms.URLInput(attrs={
461+
'class': 'form-control',
462+
'placeholder': _('Image URL (Dropbox/shared link, optional)')
463+
}))
460464
def clean_name(self):
461465
return clean_text(self.cleaned_data.get('name', ''))
462466

@@ -473,6 +477,7 @@ class Meta:
473477
'name': forms.TextInput(attrs={'class': 'form-control', 'placeholder': _('Your name')}),
474478
'title': forms.Textarea(attrs={'class': 'form-control', 'placeholder': _('Your title'), 'rows': 2}),
475479
'description': forms.Textarea(attrs={'class': 'form-control', 'placeholder': _('Your description')}),
480+
'file': forms.ClearableFileInput(attrs={'class': 'form-control', 'accept': 'image/*'})
476481
}
477482

478483

home/templates/careers/internships.html

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@
188188
background: #ffffff;
189189
border-radius: 12px;
190190
padding: 1.5rem;
191+
/* Removed fixed max-height and scroll to make content expand naturally */
191192
margin-top: 1.5rem;
192193
box-shadow: 0 4px 16px rgba(0,0,0,0.1);
193194
border: 2px solid #ffd700;
@@ -708,15 +709,6 @@ <h4><i class="fas fa-handshake text-info"></i> Career Development</h4>
708709
const detailsPanel = card.querySelector('.role-details-panel');
709710
const isExpanded = detailsPanel.classList.contains('show');
710711

711-
// Close all other panels first
712-
document.querySelectorAll('.role-details-panel').forEach(panel => {
713-
panel.classList.remove('show');
714-
});
715-
716-
document.querySelectorAll('.view-details-btn').forEach(btn => {
717-
btn.classList.remove('expanded');
718-
});
719-
720712
// Toggle current panel
721713
if (!isExpanded) {
722714
detailsPanel.classList.add('show');
@@ -735,18 +727,7 @@ <h4><i class="fas fa-handshake text-info"></i> Career Development</h4>
735727
}
736728
}
737729

738-
// Close details when clicking outside
739-
document.addEventListener('click', function(event) {
740-
if (!event.target.closest('.internship-card')) {
741-
document.querySelectorAll('.role-details-panel').forEach(panel => {
742-
panel.classList.remove('show');
743-
});
744-
745-
document.querySelectorAll('.view-details-btn').forEach(btn => {
746-
btn.classList.remove('expanded');
747-
});
748-
}
749-
});
730+
// Keep details open unless toggled via the View Details button
750731
</script>
751732

752733
{% endblock %}

home/templates/careers/path_finder.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
{% block title %}Cybersecurity Career Path Finder | Hardhat Enterprises{% endblock %}
55

66
{% block content %}
7-
<div class="container my-4">
7+
<div class="container my-4" style="padding-top: 6rem;">
88

99
<style>
1010
.hh-card-dark{ background-color:#212529; color:#f1f3f5; }

home/templates/includes/navigation.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,7 @@
498498
margin-top: 0.5rem !important;
499499
min-width: auto !important;
500500
width: auto !important;
501+
z-index: 2001 !important;
501502
}
502503

503504
.dropdown-menu#lang_menu .dropdown-item {

home/templates/pages/blogpage.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ <h4>{% trans "User Blogs" %}</h4>
4848
</div>
4949
<br/>
5050
<div class="form-group">
51-
<label for="id_file">{% trans "Image Upload (optional):" %}</label>
51+
<label for="id_file">{% trans "Image Upload" %}</label>
5252
{{ form.file }}
5353
</div>
5454
<br/>
@@ -132,8 +132,8 @@ <h5 style="color: black;" id="editModalLabel">{% trans "Edit Blog" %}</h5>
132132
</div>
133133
<br/>
134134
<div class="form-group">
135-
<label for="editFile" style="color: black;">{% trans "Change Image (optional)" %}</label>
136-
<input style="color: black;" type="file" class="form-control-file" id="editFile" name="file">
135+
<label for="editFile" style="color: black;">{% trans "Change Image (from your computer, optional)" %}</label>
136+
<input style="color: black;" type="file" class="form-control-file" id="editFile" name="file" accept="image/*">
137137
</div>
138138
</div>
139139
<br/>

home/templates/pages/dashboard.html

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{% load static %}
33
{% block content %}
44

5-
<main class="pt-6">
5+
<main class="pt-5">
66
{% include 'includes/pre-loader.html' %}
77

88
<!-- Header -->
@@ -42,17 +42,17 @@ <h4 style="color: black; margin-bottom: 20px;">Skill Progress Overview</h4>
4242

4343
<!-- Overall Progress Bar -->
4444
<div class="mb-5">
45-
<label class="text-light">Total Progress: {{ percent }}%</label>
45+
<p class="text-dark">Total Progress: {{ percent }}%</p>
4646
<div class="progress" style="height: 16px;">
47-
<div class="progress-bar bg-success" role="progressbar" style="width: {{ percent }}%;" aria-valuenow="{{ percent }}" aria-valuemin="0" aria-valuemax="100"></div>
47+
<div class="progress-bar bg-success" role="progressbar" data-progress="{{ percent }}" aria-valuenow="{{ percent }}" aria-valuemin="0" aria-valuemax="100"></div>
4848
</div>
4949
</div>
5050

5151
<!-- Skill Cards -->
5252
<div class="row">
5353
{% for skill in skills %}
5454
<div class="col-md-6 mb-4">
55-
<div class="card bg-dark text-white shadow-sm rounded-4 transition transform hover:scale-105 hover:shadow-lg">
55+
<div class="card bg-dark text-white shadow-sm rounded-4">
5656
<div class="card-body">
5757
<h5 class="card-title text-warning">{{ skill.title }}</h5>
5858
<p>
@@ -123,4 +123,14 @@ <h5 class="card-title text-warning">{{ skill.title }}</h5>
123123
});
124124
</script>
125125

126+
<script>
127+
document.addEventListener('DOMContentLoaded', function() {
128+
document.querySelectorAll('.progress-bar[data-progress]').forEach(function(bar){
129+
var value = parseFloat(bar.getAttribute('data-progress')) || 0;
130+
value = Math.max(0, Math.min(100, value));
131+
bar.style.width = value + '%';
132+
});
133+
});
134+
</script>
135+
126136
{% endblock %}

0 commit comments

Comments
 (0)