Merge branch 'master' of github.com:Plume-org/Plume
This commit is contained in:
commit
94beaaca76
@ -191,7 +191,7 @@ impl IntoId for Post {
|
|||||||
|
|
||||||
impl Object for Post {
|
impl Object for Post {
|
||||||
fn compute_id(&self, conn: &PgConnection) -> String {
|
fn compute_id(&self, conn: &PgConnection) -> String {
|
||||||
ap_url(format!("{}/~/{}/{}", BASE_URL.as_str(), self.get_blog(conn).actor_id, self.slug))
|
ap_url(format!("{}/~/{}/{}/", BASE_URL.as_str(), self.get_blog(conn).actor_id, self.slug))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn serialize(&self, conn: &PgConnection) -> serde_json::Value {
|
fn serialize(&self, conn: &PgConnection) -> serde_json::Value {
|
||||||
|
@ -77,7 +77,7 @@ fn create(conn: DbConn, data: Form<NewBlogForm>, user: User) -> Redirect {
|
|||||||
is_owner: true
|
is_owner: true
|
||||||
});
|
});
|
||||||
|
|
||||||
Redirect::to(format!("/~/{}", slug).as_str())
|
Redirect::to(format!("/~/{}/", slug).as_str())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[get("/~/<name>/outbox")]
|
#[get("/~/<name>/outbox")]
|
||||||
|
@ -98,5 +98,5 @@ fn create(blog_name: String, data: Form<NewPostForm>, user: User, conn: DbConn)
|
|||||||
let act = post.create_activity(&*conn);
|
let act = post.create_activity(&*conn);
|
||||||
broadcast(&*conn, &user, act, user.get_followers(&*conn));
|
broadcast(&*conn, &user, act, user.get_followers(&*conn));
|
||||||
|
|
||||||
Redirect::to(format!("/~/{}/{}", blog_name, slug).as_str())
|
Redirect::to(format!("/~/{}/{}/", blog_name, slug).as_str())
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ use models::{
|
|||||||
|
|
||||||
#[get("/me")]
|
#[get("/me")]
|
||||||
fn me(user: User) -> Redirect {
|
fn me(user: User) -> Redirect {
|
||||||
Redirect::to(format!("/@/{}", user.username).as_ref())
|
Redirect::to(format!("/@/{}/", user.username).as_ref())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[get("/@/<name>", rank = 2)]
|
#[get("/@/<name>", rank = 2)]
|
||||||
@ -64,7 +64,7 @@ fn follow(name: String, conn: DbConn, user: User) -> Redirect {
|
|||||||
act.set_object_object(user.into_activity(&*conn)).unwrap();
|
act.set_object_object(user.into_activity(&*conn)).unwrap();
|
||||||
act.object_props.set_id_string(format!("{}/follow/{}", user.ap_url, target.ap_url)).unwrap();
|
act.object_props.set_id_string(format!("{}/follow/{}", user.ap_url, target.ap_url)).unwrap();
|
||||||
broadcast(&*conn, &user, act, vec![target]);
|
broadcast(&*conn, &user, act, vec![target]);
|
||||||
Redirect::to(format!("/@/{}", name).as_ref())
|
Redirect::to(format!("/@/{}/", name).as_ref())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[get("/@/<name>/followers", rank = 2)]
|
#[get("/@/<name>/followers", rank = 2)]
|
||||||
@ -155,7 +155,7 @@ fn create(conn: DbConn, data: Form<NewUserForm>) -> Result<Redirect, String> {
|
|||||||
User::hash_pass(form.password.to_string()),
|
User::hash_pass(form.password.to_string()),
|
||||||
inst.id
|
inst.id
|
||||||
)).update_boxes(&*conn);
|
)).update_boxes(&*conn);
|
||||||
Ok(Redirect::to(format!("/@/{}", data.get().username).as_str()))
|
Ok(Redirect::to(format!("/@/{}/", data.get().username).as_str()))
|
||||||
} else {
|
} else {
|
||||||
Err(String::from("Passwords don't match"))
|
Err(String::from("Passwords don't match"))
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ Notifications
|
|||||||
<div class="list">
|
<div class="list">
|
||||||
{% for notification in notifications %}
|
{% for notification in notifications %}
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<h3><a href="{% if notification.link %}{{ notification.link }}{% else %}#{% endif %}">{{ notification.title }}</h3>
|
<h3><a href="{% if notification.link %}{{ notification.link }}/{% else %}#{% endif %}">{{ notification.title }}</h3>
|
||||||
{% if notification.content %}
|
{% if notification.content %}
|
||||||
<p>{{ notification.content }}</p>
|
<p>{{ notification.content }}</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
<div class="cards">
|
<div class="cards">
|
||||||
{% for follower in followers %}
|
{% for follower in followers %}
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<h3><a href="{{ follower.ap_url }}">{{ follower.display_name }}</a> — @{{ follower.fqn }}</h3>
|
<h3><a href="{{ follower.ap_url }}/">{{ follower.display_name }}</a> — @{{ follower.fqn }}</h3>
|
||||||
<main><p>{{ follower.summary }}</p></main>
|
<main><p>{{ follower.summary }}</p></main>
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
Loading…
Reference in New Issue
Block a user