Skip to content

Commit dfc2e22

Browse files
committed
Highlight open source jobs
Closes #166 Signed-off-by: Cintia Sánchez García <[email protected]>
1 parent 0f0e8e6 commit dfc2e22

File tree

3 files changed

+23
-8
lines changed

3 files changed

+23
-8
lines changed

gitjobs-server/static/styles/index.css

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
:root {
22
--primary-color: #fd4d12;
3+
--secondary-color: #2a71ff;
34
}
45

56
.bg-jobboard {
@@ -445,6 +446,10 @@
445446
box-shadow: 0 0 0 var(--primary-color);
446447
}
447448

449+
.box-animated-secondary {
450+
box-shadow: 0 0 0 var(--secondary-color);
451+
}
452+
448453
@-webkit-keyframes pulse-shadow {
449454
0% {
450455
-webkit-box-shadow: 0 0 0 0 inherit;

gitjobs-server/templates/base.html

+13
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,19 @@
136136
'900': '#7e1b10',
137137
'950': '#440906',
138138
},
139+
secondary: {
140+
'50': '#eef5ff',
141+
'100': '#d8e8ff',
142+
'200': '#b9d6ff',
143+
'300': '#89bdff',
144+
'400': '#5299ff',
145+
'500': '#2a71ff',
146+
'600': '#124dfd',
147+
'700': '#0c38e9',
148+
'800': '#112ebc',
149+
'900': '#142d94',
150+
'950': '#111d5a',
151+
},
139152
},
140153
fontSize: {
141154
filterTitle: '0.8rem',

gitjobs-server/templates/jobboard/jobs/results_section.html

+5-8
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,15 @@
2525
{% else %}
2626
{# Cards -#}
2727
{% for job in jobs %}
28+
{% let open_source = job.open_source.unwrap_or_default() %}
2829
<button id="job-preview-{{ job.job_id }}"
2930
data-preview-job="true"
3031
data-job-id="{{ job.job_id }}"
3132
hx-get="/section/jobs/{{ job.job_id }}"
3233
hx-target="#preview-content"
3334
hx-trigger="click,open-modal"
3435
hx-indicator="#spinner-{{ job.job_id }}"
35-
class="relative mx-5 md:mx-7 text-start enabled:cursor-pointer border rounded-lg enabled:hover:outline enabled:hover:-outline-offset-1 p-5 md:p-7 {%- if let Some(member) = job.employer.member %} border-primary-400 bg-primary-50/20 enabled:hover:outline-primary-500{%- else %} enabled:hover:outline-gray-400{%- endif -%}"
36+
class="relative mx-5 md:mx-7 text-start enabled:cursor-pointer border border-2 rounded-lg enabled:hover:outline enabled:hover:-outline-offset-1 p-5 md:p-7 {%- if open_source > 0 %} border-primary-400 bg-primary-50/20 enabled:hover:outline-primary-500{%- else if let Some(member) = job.employer.member %} border-secondary-400 bg-secondary-50/20 enabled:hover:outline-secondary-500{%- else %} enabled:hover:outline-gray-400{%- endif -%}"
3637
hx-disabled-elt="[data-preview-job]"
3738
hx-boost="true">
3839
{# Job title #}
@@ -148,12 +149,8 @@
148149

149150
{# Open source #}
150151
<div class="flex space-x-1 items-center justify-center">
151-
{% if let Some(open_source) = job.open_source %}
152-
{% if open_source + 0 > 0 %}
153-
<div class="svg-icon size-3 icon-check bg-green-500"></div>
154-
{% else %}
155-
<div class="svg-icon size-3.5 icon-close bg-red-500"></div>
156-
{% endif %}
152+
{% if open_source > 0 %}
153+
<div class="svg-icon size-3 icon-check bg-green-500"></div>
157154
{% else %}
158155
<div class="svg-icon size-3.5 icon-close bg-red-500"></div>
159156
{% endif %}
@@ -197,7 +194,7 @@
197194

198195
{# Spinner #}
199196
<div id="spinner-{{ job.job_id }}"
200-
class="hx-spinner absolute rounded-lg top-0 left-0 h-full w-full rounded-lg box-animated {%- if let Some(member) = job.employer.member %} box-animated-primary{%- endif -%}">
197+
class="hx-spinner absolute rounded-lg top-0 left-0 h-full w-full rounded-lg box-animated {%- if open_source > 0 %} box-animated-primary{%- else if let Some(member) = job.employer.member %} box-animated-secondary{%- endif -%}">
201198
</div>
202199
{# End spinner #}
203200
</button>

0 commit comments

Comments
 (0)