diff --git a/i18n/en/cosmicding.ftl b/i18n/en/cosmicding.ftl index 07f3fbc..486bf04 100644 --- a/i18n/en/cosmicding.ftl +++ b/i18n/en/cosmicding.ftl @@ -40,7 +40,7 @@ no-bookmarks = No bookmarks no-bookmarks-found-for-account = No bookmarks found for account {$acc} notes = Notes open-accounts-page = Open Accounts Page -open-instance = Open instance +open-instance = Open Instance provided-url-is-not-valid = Provided URL is not valid quit = Quit refresh = Refresh @@ -58,6 +58,7 @@ setting-managed-externally = This setting can only be managed from Linkding web settings = Settings shared = Shared shared-disabled = Shared (Disabled) +snapshot = Snapshot successful = successful tags = Tags tags-subtext = Enter any number of tags separated by space. diff --git a/src/pages/bookmarks.rs b/src/pages/bookmarks.rs index f4b02cb..75c0b45 100644 --- a/src/pages/bookmarks.rs +++ b/src/pages/bookmarks.rs @@ -2,6 +2,7 @@ use crate::app::Message; use crate::fl; use crate::models::account::Account; use crate::models::bookmarks::Bookmark; +use chrono::{DateTime, Local}; use cosmic::iced::Length; use cosmic::{ app::command::Task, @@ -72,6 +73,8 @@ impl PageBookmarksView { .iter() .find(|&account| account.id == item.user_account_id) .unwrap(); + let date_added: DateTime = + item.date_added.clone().unwrap().parse().expect(""); let mut columns = Vec::new(); // Mandatory first row - title columns.push( @@ -168,6 +171,19 @@ impl PageBookmarksView { .on_press(AppBookmarksMessage::ViewNotes(item.clone())), ); } + if !item.web_archive_snapshot_url.is_empty() { + actions_row = actions_row.push( + widget::button::link(fl!("snapshot")) + .spacing(spacing.space_xxxs) + .trailing_icon(true) + .font_size(12) + .icon_size(11) + .tooltip(item.web_archive_snapshot_url.clone()) + .on_press(AppBookmarksMessage::OpenExternalURL( + item.web_archive_snapshot_url.clone(), + )), + ); + } columns.push( actions_row .padding([ @@ -180,6 +196,9 @@ impl PageBookmarksView { ); // Mandatory fifth row - details let mut details_row = widget::row::with_capacity(1).spacing(spacing.space_xxs); + details_row = details_row + .push(widget::icon::from_name("accessories-clock-symbolic").size(12)) + .push(widget::text(date_added.to_rfc2822()).size(12)); if item.is_archived { details_row = details_row .push(widget::icon::from_name("mail-archive-symbolic").size(12))