4 Commits

Author SHA1 Message Date
3cdb4cbd67 Merge pull request 'feat(#14): Add packager to details page' (#21) from dev-0.1.4 into master
All checks were successful
Docker Image CI / build (push) Successful in 12m20s
Reviewed-on: #21
Reviewed-by: nikolar <nikolar@artixlinux.org>
2024-06-24 21:50:00 +02:00
7cfa02ecbd chore: add comment for format_packager function
All checks were successful
Docker Image CI / build (pull_request) Successful in 7m1s
2024-06-20 17:37:42 -05:00
31e4580c91 feat(#14): Add packager to details page
All checks were successful
Docker Image CI / build (pull_request) Successful in 8m18s
2024-06-20 17:33:53 -05:00
5dac79b54a Back to development: 0.1.4 2024-06-20 17:30:50 -05:00
6 changed files with 20 additions and 8 deletions

6
Cargo.lock generated
View File

@@ -410,7 +410,7 @@ dependencies = [
[[package]]
name = "artix-gitea"
version = "0.1.3"
version = "0.1.4"
dependencies = [
"actix-web",
"awc",
@@ -420,7 +420,7 @@ dependencies = [
[[package]]
name = "artix-pkglib"
version = "0.1.3"
version = "0.1.4"
dependencies = [
"alpm",
"alpm-utils",
@@ -430,7 +430,7 @@ dependencies = [
[[package]]
name = "artixweb_packages"
version = "0.1.3"
version = "0.1.4"
dependencies = [
"actix-files",
"actix-identity",

View File

@@ -8,7 +8,7 @@ homepage = "https://packages.artixlinux.org"
keywords = ["artix", "packages", "gitea"]
license = "MIT OR Apache-2.0"
edition = "2021"
version = "0.1.3"
version = "0.1.4"
[lib]
name = "artix_gitea"

View File

@@ -8,7 +8,7 @@ homepage = "https://packages.artixlinux.org"
keywords = ["artix", "packages"]
license = "MIT OR Apache-2.0"
edition = "2021"
version = "0.1.3"
version = "0.1.4"
[lib]
name = "artix_pkglib"

View File

@@ -7,7 +7,7 @@ repository = "gitea.artixlinux.org/artix/artixweb_packages"
keywords = ["artix", "packages"]
license = "MIT OR Apache-2.0"
edition = "2021"
version = "0.1.3"
version = "0.1.4"
[[bin]]
name = "artixweb_packages"
@@ -15,8 +15,8 @@ test = false
bench = false
[dependencies]
artix-gitea = { path = "../artix-gitea", version = "=0.1.3" }
artix-pkglib = { path = "../artix-pkglib", version = "=0.1.3" }
artix-gitea = { path = "../artix-gitea", version = "=0.1.4" }
artix-pkglib = { path = "../artix-pkglib", version = "=0.1.4" }
actix-files = "0.6.0"
actix-identity = "0.4"

View File

@@ -110,6 +110,7 @@ pub(crate) struct ResponseDetail {
pub required_by: Vec<String>,
pub contents: Vec<String>,
pub maintainers: Vec<String>,
pub packaged_by: String,
pub flagged: bool,
pub flagged_on: i64,
pub flagged_by: Vec<String>,
@@ -506,6 +507,7 @@ pub(crate) async fn get_packages_details_inner(
pkg.replaces(),
&DependencyKind::Misc,
),
packaged_by: format_packager(pkg.packager().unwrap_or("").to_string()),
flagged: false,
flagged_on: 0,
flagged_by: Vec::new(),
@@ -565,6 +567,14 @@ pub(crate) async fn get_packages_details_inner(
Err(ArtixWebPackageError::NotFound)
}
// removes email address from the packager string
fn format_packager(mut input: String) -> String {
if let Some(pos) = input.find('<') {
input.truncate(pos - 1);
}
input
}
// adds package metadata into the local postgres database
fn add_package_metadata(metadata: &PackageMeta, pool: &web::Data<Pool>) {
use crate::schema::packages::dsl::packages;

View File

@@ -72,6 +72,8 @@
<section role="value">{{ pkg.installed_size|human_readable }} MB</section>
<section role="key">Build Date:</section>
<section role="value">{{ pkg.build_date|show_date }}</section>
<section role="key">Packaged By:</section>
<section role="value">{{ pkg.packaged_by }}</section>
{% if pkg.flagged && !pkg.flagged_by.is_empty() %}
<section role="key">Flagged By:</section>
<section role="value">{{ pkg.flagged_by|join(", ") }}</section>