add ability to sort repo list by date
This commit is contained in:
@@ -15,6 +15,8 @@ fn first_line(msg: &[u8]) -> String {
|
|||||||
#[derive(Serialize, Default)]
|
#[derive(Serialize, Default)]
|
||||||
pub struct GitRepo {
|
pub struct GitRepo {
|
||||||
pub name: String,
|
pub name: String,
|
||||||
|
pub last_ts_utc: i64,
|
||||||
|
pub last_ts_offset: i64,
|
||||||
pub metadata: GitsyMetadata,
|
pub metadata: GitsyMetadata,
|
||||||
pub history: Vec<GitObject>,
|
pub history: Vec<GitObject>,
|
||||||
pub branches: Vec<GitObject>,
|
pub branches: Vec<GitObject>,
|
||||||
@@ -42,6 +44,8 @@ impl GitRepo {
|
|||||||
let all_files: Vec<GitFile> = self.all_files.iter().cloned().take(max_entries).collect();
|
let all_files: Vec<GitFile> = self.all_files.iter().cloned().take(max_entries).collect();
|
||||||
GitRepo {
|
GitRepo {
|
||||||
name: self.name.clone(),
|
name: self.name.clone(),
|
||||||
|
last_ts_utc: self.last_ts_utc,
|
||||||
|
last_ts_offset: self.last_ts_offset,
|
||||||
metadata: self.metadata.clone(),
|
metadata: self.metadata.clone(),
|
||||||
history: new_history,
|
history: new_history,
|
||||||
branches: self.branches.iter().cloned().take(max_entries).collect(),
|
branches: self.branches.iter().cloned().take(max_entries).collect(),
|
||||||
@@ -452,6 +456,8 @@ pub fn parse_repo(
|
|||||||
let commit_ids = commits.keys().cloned().collect();
|
let commit_ids = commits.keys().cloned().collect();
|
||||||
Ok(GitRepo {
|
Ok(GitRepo {
|
||||||
name: name.to_string(),
|
name: name.to_string(),
|
||||||
|
last_ts_utc: history.first().map(|x| x.ts_utc).unwrap_or(0),
|
||||||
|
last_ts_offset: history.first().map(|x| x.ts_offset).unwrap_or(0),
|
||||||
metadata,
|
metadata,
|
||||||
history,
|
history,
|
||||||
branches,
|
branches,
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
<th>Website</th>
|
<th>Website</th>
|
||||||
<th>Last Updated</th>
|
<th>Last Updated</th>
|
||||||
</tr>
|
</tr>
|
||||||
{% for repo in repos | sort(attribute="name") -%}
|
{% for repo in repos | sort(attribute="last_ts_utc") | reverse -%}
|
||||||
<tr>
|
<tr>
|
||||||
<td class="repo"><a href="{{repo.name}}/summary.html">{{ repo.name }}</a></td>
|
<td class="repo"><a href="{{repo.name}}/summary.html">{{ repo.name }}</a></td>
|
||||||
<td class="description nosmall">{{repo.metadata.description}}</td>
|
<td class="description nosmall">{{repo.metadata.description}}</td>
|
||||||
|
|||||||
+1
-1
@@ -128,7 +128,7 @@ table.summary-table tr:nth-child(even), table.repo-list tr:nth-child(even) {
|
|||||||
background-color: var(--offerwhite);
|
background-color: var(--offerwhite);
|
||||||
}
|
}
|
||||||
table.repo-list td {
|
table.repo-list td {
|
||||||
padding: 0.5em 0.3em 0.5em 0.3em;
|
padding: 0.3em 0.3em 0.3em 0.3em;
|
||||||
}
|
}
|
||||||
table.summary-table td, table.repo-list td {
|
table.summary-table td, table.repo-list td {
|
||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
|
|||||||
Reference in New Issue
Block a user