Add support for hashtag on user interface

Add migration to fix typo
Add support for linking hashtags with posts
Rework tag search page so it says a nicer message than page not found
when no post use that tag
Add new string to translation
This commit is contained in:
Trinity Pointard
2018-10-20 19:27:49 +02:00
parent 4fa3a0f6ee
commit 95ea248518
16 changed files with 96 additions and 28 deletions
+1 -1
View File
@@ -144,7 +144,7 @@ table! {
tags (id) {
id -> Int4,
tag -> Text,
is_hastag -> Bool,
is_hashtag -> Bool,
post_id -> Int4,
}
}
+3 -3
View File
@@ -9,7 +9,7 @@ use schema::tags;
pub struct Tag {
pub id: i32,
pub tag: String,
pub is_hastag: bool,
pub is_hashtag: bool,
pub post_id: i32
}
@@ -17,7 +17,7 @@ pub struct Tag {
#[table_name = "tags"]
pub struct NewTag {
pub tag: String,
pub is_hastag: bool,
pub is_hashtag: bool,
pub post_id: i32
}
@@ -40,7 +40,7 @@ impl Tag {
pub fn from_activity(conn: &Connection, tag: Hashtag, post: i32) -> Tag {
Tag::insert(conn, NewTag {
tag: tag.name_string().expect("Tag::from_activity: name error"),
is_hastag: false,
is_hashtag: false,
post_id: post
})
}