Skip to content

Commit

Permalink
List of logged in user's resumes
Browse files Browse the repository at this point in the history
  • Loading branch information
manjurulhoque committed Nov 3, 2024
1 parent 357289b commit ab9ee68
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 19 deletions.
3 changes: 1 addition & 2 deletions accounts/urls.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
from django.conf import settings
from django.conf.urls.static import static
from django.urls import include, path
from django.urls import path

from jobsapp.views import EditProfileView, EmployerProfileEditView

from .views import *

app_name = "accounts"
Expand Down
Binary file modified db.sqlite3
Binary file not shown.
3 changes: 2 additions & 1 deletion resume_cv/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
TemplateListView,
ResumeCVCreateView,
resume_builder,
load_builder,
UserResumeListView,
)

app_name = "resume_cv"
Expand All @@ -13,4 +13,5 @@
path("templates", TemplateListView.as_view(), name="templates"),
path("resume-cv/create", ResumeCVCreateView.as_view(), name="create"),
path("templates/builder/<code>", resume_builder, name="builder"),
path("resumes/", UserResumeListView.as_view(), name="resumes"),
]
9 changes: 9 additions & 0 deletions resume_cv/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,12 @@ def load_builder(request, id):
},
safe=True,
)


class UserResumeListView(ListView):
model = ResumeCv
template_name = "resumes/user_resumes.html"
context_object_name = "resumes"

def get_queryset(self):
return self.model.objects.filter(user_id=self.request.user.id).order_by("-id")
4 changes: 2 additions & 2 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@
>
Edit Profile
</a>
<a href="{% url 'resume_cv:resumes' %}" class="dropdown-item">My resumes</a>
<a href="{% url 'accounts:logout' %}" class="dropdown-item">Logout</a>
</div>
</li>
Expand Down Expand Up @@ -171,15 +172,14 @@
</header>
<div>
{% if messages %}

{% for message in messages %}
<div class="alert alert-{{ message.tags }} alert-dismissible fade show" role="alert">
{{ message }}
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
{# <li{% if message.tags %} class="alert alert-{{ message.tags }}"{% endif %}>{{ message }}</li>#}
{#<li{% if message.tags %} class="alert alert-{{ message.tags }}"{% endif %}>{{ message }}</li>#}
{% endfor %}

{% endif %}
Expand Down
28 changes: 14 additions & 14 deletions templates/resumes/builder.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% load static %}
<!doctype html>
<html>
<html lang="en">

<head>
<meta charset="UTF-8">
Expand Down Expand Up @@ -32,7 +32,7 @@
<div id="mobileAlert">
<div class="message">
<h3>Builder doesn't work on mobile</h3>
<a href="#">Back</a>
<a href="{% url 'resume_cv:templates' %}">Back</a>
</div>
</div>
<!-- The Modal -->
Expand Down Expand Up @@ -69,26 +69,26 @@ <h4><b>{{ template.name }}</b></h4>
<div id="gjs"></div>

<script type="text/javascript">
var _token = '{{ token }}';
var upload_Image = 'uploadimage_url';
var url_load_template = "";
var url_default_css_template = '{% static 'css/font-awesome.css' %}';
var urlStore = '{% url 'resume-cv.update.builder' resume.id %}';
var urlLoad = '{% url 'resume-cv.load.builder' resume.id %}';
var back_button_url = "{% url 'resume_cv:templates' %}";
var exportPDF_url = "";
let _token = '{{ token }}';
let upload_Image = 'uploadimage_url';
let url_load_template = "";
let url_default_css_template = '{% static 'css/font-awesome.css' %}';
let urlStore = '{% url 'resume-cv.update.builder' resume.id %}';
let urlLoad = '{% url 'resume-cv.load.builder' resume.id %}';
let back_button_url = "{% url 'resume_cv:templates' %}";
let exportPDF_url = "";

var images_url = ['{% static 'img/1875187.jpg' %}'];
var all_fonts = ['Arial', 'Verdana', 'Helvetica', 'Tahoma', 'Trebuchet MS', 'Times New Roman', 'Georgia', 'Garamond', 'Courier New', 'Brush Script MT'];
var langs = {
let images_url = ['{% static 'img/1875187.jpg' %}'];
let all_fonts = ['Arial', 'Verdana', 'Helvetica', 'Tahoma', 'Trebuchet MS', 'Times New Roman', 'Georgia', 'Garamond', 'Courier New', 'Brush Script MT'];
let langs = {
"fontFamily": "FONT FAMILY",
"changeTemplates": "Change Templates",
"exportPdf": "Download PDF",
};
var config = {
all_icons: ["fab fa-500px", "fab fa-accessible-icon", "fab fa-accusoft", "fab fa-acquisitions-incorporated", "fas fa-ad", "fas fa-address-book", "far fa-address-book", "fas fa-address-card"],
};
var all_icons = ["fab fa-500px", "fab fa-accessible-icon", "fab fa-accusoft", "fab fa-acquisitions-incorporated", "fas fa-ad", "fas fa-address-book", "far fa-address-book", "fas fa-address-card"];
let all_icons = ["fab fa-500px", "fab fa-accessible-icon", "fab fa-accusoft", "fab fa-acquisitions-incorporated", "fas fa-ad", "fas fa-address-book", "far fa-address-book", "fas fa-address-card"];

</script>
<script src="{% static 'js/builder.js' %}"></script>
Expand Down
32 changes: 32 additions & 0 deletions templates/resumes/user_resumes.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{% extends 'base.html' %}

{% load static %}

{% block title %}
My resumes
{% endblock %}

{% block content %}
<div class="container">
<div class="row mt-2 mb-2">
<div class="col-md-12">
<h1>Your Resumes</h1>
<a href="{% url 'resume_cv:templates' %}" class="btn btn-primary">Create New Resume</a>
</div>
</div>
<div class="row">
{% for resume in resumes %}
<div class="col-md-4 mb-2">
<div class="card">
<img src="https://images.pexels.com/photos/590044/pexels-photo-590044.jpeg?auto=compress&cs=tinysrgb&w=600" class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">{{ resume.name }}</h5>
<a href="" class="btn btn-primary">Edit</a>
<a href="" class="btn btn-danger">Delete</a>
</div>
</div>
</div>
{% endfor %}
</div>
</div>
{% endblock %}

0 comments on commit ab9ee68

Please sign in to comment.