Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add repository detail view and update project templates for navigation #3174

Merged
merged 3 commits into from
Dec 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading