Skip to content

Commit

Permalink
Merge pull request #4 from victoriajury/2-add-function-to-update-resu…
Browse files Browse the repository at this point in the history
…me-sections

refactor resume, add models and migrations
  • Loading branch information
victoriajury authored Oct 15, 2024
2 parents d4ed01c + 6270eff commit df31fee
Show file tree
Hide file tree
Showing 27 changed files with 235 additions and 156 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,5 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

uploads/
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ name = "pypi"

[packages]
django = "*"
django-email-obfuscator = "*"

[dev-packages]
black = "*"
Expand Down
9 changes: 8 additions & 1 deletion Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 23 additions & 2 deletions pages/admin.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
from django.contrib import admin # noqa # pylint: disable=unused-import
from django.contrib import admin
from pages.models import ResumeEducation, ResumeExperience, ResumeSkill, ResumeSummary

# Register your models here.

class ResumeAdminSummary(admin.ModelAdmin):
list_display = ["name", "address"]


class ResumeAdminEducation(admin.ModelAdmin):
list_display = ["location", "date_attended"]


class ResumeAdminSkills(admin.ModelAdmin):
list_display = ["skill", "category"]


class ResumeAdminExperience(admin.ModelAdmin):
list_display = ["role", "date_attended", "location"]


admin.site.register(ResumeSummary, ResumeAdminSummary)
admin.site.register(ResumeEducation, ResumeAdminEducation)
admin.site.register(ResumeSkill, ResumeAdminSkills)
admin.site.register(ResumeExperience, ResumeAdminExperience)
83 changes: 83 additions & 0 deletions pages/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Generated by Django 5.1.2 on 2024-10-15 06:33

from django.db import migrations, models


class Migration(migrations.Migration):

initial = True

dependencies: list[tuple] = []

operations = [
migrations.CreateModel(
name="ResumeEducation",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("location", models.CharField(max_length=100)),
("date_attended", models.CharField(max_length=50)),
("study_details", models.TextField()),
],
),
migrations.CreateModel(
name="ResumeExperience",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("role", models.CharField(max_length=100)),
("date_attended", models.CharField(max_length=50)),
("location", models.CharField(max_length=100)),
("role_details", models.TextField()),
],
),
migrations.CreateModel(
name="ResumeSkill",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("category", models.CharField(max_length=100)),
("skill", models.CharField(max_length=50)),
],
),
migrations.CreateModel(
name="ResumeSummary",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("name", models.CharField(max_length=100)),
("bio", models.CharField(max_length=100)),
("address", models.CharField(max_length=100)),
("telephone", models.CharField(max_length=50)),
("email", models.CharField(max_length=100)),
],
),
]
28 changes: 26 additions & 2 deletions pages/models.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
from django.db import models # noqa # pylint: disable=unused-import
from django.db import models

# Create your models here.

class ResumeSummary(models.Model):
name = models.CharField(max_length=100)
bio = models.CharField(max_length=100)
address = models.CharField(max_length=100)
telephone = models.CharField(max_length=50)
email = models.CharField(max_length=100)


class ResumeEducation(models.Model):
location = models.CharField(max_length=100)
date_attended = models.CharField(max_length=50)
study_details = models.TextField()


class ResumeSkill(models.Model):
category = models.CharField(max_length=100)
skill = models.CharField(max_length=50)


class ResumeExperience(models.Model):
role = models.CharField(max_length=100)
date_attended = models.CharField(max_length=50)
location = models.CharField(max_length=100)
role_details = models.TextField()
74 changes: 74 additions & 0 deletions pages/templates/pages/resume.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{% extends "base.html" %}
{% load static %}
{% load email_obfuscator %}
{% block resume_page_content %}

<!-- ======= Resume Section ======= -->
<section id="resume" class="resume">
<div class="container">

<div class="section-title">
<h2>Resume</h2>
<p>Work Experience</p>
</div>

<div class="row">
<div class="col-lg-6">
<h3 class="resume-title">Summary</h3>
<div class="resume-item pb-0">
<h4>{{ summary.name }}</h4>
<p><em>{{ summary.bio }}</em></p>
<ul>
<li>{{ summary.address }}</li>
<li>{{ summary.telephone }}</li>
<li>
{{ summary.email|obfuscate_mailto }}
</li>
</ul>
</div>

<h3 class="resume-title">Education</h3>

{% for edu in education %}
<div class="resume-item">
<h4>{{ edu.location }}</h4>
<h5>{{ edu.date_attended}}</h5>
{{ edu.study_details|safe }}
</div>
{% endfor %}

<h3 class="resume-title">Skills</h3>
<div class="resume-item pb-0">
<h4>Technical Skills</h4>
<ul>
{% for s in technical_skills %}
<li>{{ s.skill }}</li>
{% endfor %}
</ul>
</div>
<div class="resume-item pb-0">
<h4>Languages</h4>
<ul>
{% for s in language_skills %}
<li>{{ s.skill }}</li>
{% endfor %}
</ul>
</div>
</div>
<div class="col-lg-6">
<h3 class="resume-title">Professional Experience</h3>
{% for exp in experience %}
<div class="resume-item">
<h4>{{ exp.role }}</h4>
<h5>{{ exp.date_attended }}</h5>
<p><em>{{ exp.location }}</em></p>
{{ exp.role_details|safe }}
</div>
{% endfor %}
</div>
</div>

</div>
</section><!-- End Resume Section -->

{% endblock resume_page_content %}
15 changes: 14 additions & 1 deletion pages/views.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
from django.shortcuts import render
from pages.models import ResumeEducation, ResumeExperience, ResumeSkill, ResumeSummary


def home(request):
return render(request, "pages/home.html", {})
resume_summary = ResumeSummary.objects.first()
resume_education = ResumeEducation.objects.all()
technical_skills = ResumeSkill.objects.filter(category="Technical Skills")
languages = ResumeSkill.objects.filter(category="Languages")
resume_experience = ResumeExperience.objects.all()
context = {
"summary": resume_summary,
"education": resume_education,
"technical_skills": technical_skills,
"language_skills": languages,
"experience": resume_experience,
}
return render(request, "pages/resume.html", context)
1 change: 1 addition & 0 deletions personal_portfolio/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.staticfiles",
"email_obfuscator",
# local apps
"pages.apps.PagesConfig",
"projects.apps.ProjectsConfig",
Expand Down
6 changes: 3 additions & 3 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ <h2>I'm a passionate <span>software engineer</span> and web developer</h2>

<nav id="navbar" class="navbar">
<ul>
<li><a class="nav-link {% if 'projects' not in request.path %} active{% endif %}" href="/#header">Home</a></li>
<li><a class="nav-link" href="#resume">Resume</a></li>
<li><a class="nav-link {% if 'projects' not in request.path %} active{% endif %}" href="/">Home</a></li>
<li><a class="nav-link" href="/#resume">Resume</a></li>
<li><a class="nav-link {% if 'projects' in request.path %} active{% endif %}" href="/projects">Portfolio</a></li>
</ul>
<i class="bi bi-list mobile-nav-toggle"></i>
Expand All @@ -66,7 +66,7 @@ <h2>I'm a passionate <span>software engineer</span> and web developer</h2>
</header><!-- End Header -->


{% include 'resume.html' %}
{% block resume_page_content %}{% endblock resume_page_content %}

{% block page_content %}{% endblock page_content %}

Expand Down
Loading

0 comments on commit df31fee

Please sign in to comment.