Skip to content

Commit

Permalink
Add repository detail view and update project templates for navigation (
Browse files Browse the repository at this point in the history
#3174)

* Add repository detail view and update project templates for navigation

* Add repository detail view and update project templates for navigation

* Add repository detail view and update project templates for navigation
  • Loading branch information
JisanAR03 authored Dec 31, 2024
1 parent 184eb94 commit 3eb33de
Show file tree
Hide file tree
Showing 5 changed files with 633 additions and 5 deletions.
2 changes: 2 additions & 0 deletions blt/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@
ProjectListView,
ProjectsDetailView,
ProjectView,
RepoDetailView,
blt_tomato,
create_project,
distribute_bacon,
Expand Down Expand Up @@ -591,6 +592,7 @@
re_path(r"^api/v1/contributors/$", contributors, name="api_contributor"),
path("project/<slug:slug>/", ProjectDetailView.as_view(), name="project_view"),
path("projects/<slug:slug>/badge/", ProjectBadgeView.as_view(), name="project-badge"),
path("repository/<slug:slug>/", RepoDetailView.as_view(), name="repo_detail"),
re_path(r"^report-ip/$", ReportIpView.as_view(), name="report_ip"),
re_path(r"^reported-ips/$", ReportedIpListView.as_view(), name="reported_ips_list"),
re_path(r"^feed/$", feed, name="feed"),
Expand Down
9 changes: 6 additions & 3 deletions website/templates/projects/project_detail.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{% extends "base.html" %}
{% load humanize %}
{% load static %}
{% block title %}{{ project.name }} - Project Details{% endblock %}
{% block title %}
{{ project.name }} - Project Details
{% endblock title %}
{% block content %}
{% include "includes/sidenav.html" %}
<div class="container mx-auto px-4 py-8 max-w-7xl">
Expand Down Expand Up @@ -164,14 +166,15 @@ <h2 class="text-2xl font-bold text-gray-900">Associated Repositories</h2>
{% for repo in repositories %}
<div class="bg-white rounded-xl border-2 border-gray-200 hover:border-red-500 transition-all duration-200 hover:shadow-lg">
<div class="p-6">
<div class="flex items-center justify-between mb-4">
<a href="{% url 'repo_detail' repo.slug %}"
class="flex items-center justify-between mb-4">
<h3 class="text-xl font-bold text-gray-800">{{ repo.name }}</h3>
{% if repo.is_main %}
<span class="px-3 py-1 bg-green-100 text-green-800 rounded-full text-sm font-medium">Main</span>
{% elif repo.is_wiki %}
<span class="px-3 py-1 bg-blue-100 text-blue-800 rounded-full text-sm font-medium">Wiki</span>
{% endif %}
</div>
</a>
{% if repo.description %}<p class="text-gray-600 text-base leading-relaxed mb-6">{{ repo.description }}</p>{% endif %}
<!-- Repository Stats -->
<div class="grid grid-cols-2 sm:grid-cols-4 gap-4 mb-6">
Expand Down
5 changes: 3 additions & 2 deletions website/templates/projects/project_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ <h2 class="text-3xl font-bold text-white mb-2 group-hover:underline">{{ project.
<div class="bg-white rounded-xl border-2 border-gray-200 hover:border-red-500 transition-all duration-200 hover:shadow-lg">
<div class="p-6">
<!-- Repository Header -->
<div class="flex items-center justify-between mb-4">
<a href="{% url 'repo_detail' repo.slug %}"
class="flex items-center justify-between mb-4">
<h3 class="text-xl font-bold text-gray-800">{{ repo.name }}</h3>
{% if repo.is_main %}
<span class="px-4 py-1.5 bg-green-100 text-green-800 rounded-full text-sm font-medium">Main</span>
Expand All @@ -186,7 +187,7 @@ <h3 class="text-xl font-bold text-gray-800">{{ repo.name }}</h3>
{% else %}
<span class="px-4 py-1.5 bg-gray-100 text-gray-800 rounded-full text-sm font-medium">Normal</span>
{% endif %}
</div>
</a>
<!-- Repository Description -->
<p class="text-gray-600 text-base leading-relaxed mb-6">
{{ repo.description|default:"No description available."|truncatechars:150 }}
Expand Down
Loading

0 comments on commit 3eb33de

Please sign in to comment.