added qr-code on the tags page
This commit is contained in:
parent
7ff45bfb6d
commit
dd1b382d54
3 changed files with 7 additions and 13 deletions
|
@ -69,7 +69,6 @@ fn rocket() -> _ {
|
|||
"/account",
|
||||
routes![
|
||||
account::index,
|
||||
account::show_qr_for_profile,
|
||||
account::qr_profile,
|
||||
account::show_settings,
|
||||
account::change_settings,
|
||||
|
|
|
@ -23,7 +23,7 @@ use crate::{
|
|||
pages::CommonTemplateState,
|
||||
};
|
||||
|
||||
use super::error_handlers::{PageResponse, PageResult, RawResult};
|
||||
use super::error_handlers::{PageResult, RawResult};
|
||||
|
||||
#[get("/")]
|
||||
pub async fn index(mut db: DollTagsDb, user: User, meta: CommonTemplateState) -> PageResult {
|
||||
|
@ -42,16 +42,6 @@ pub async fn index(mut db: DollTagsDb, user: User, meta: CommonTemplateState) ->
|
|||
.into())
|
||||
}
|
||||
|
||||
#[get("/qr/<id>")]
|
||||
pub fn show_qr_for_profile(
|
||||
mut db: DollTagsDb,
|
||||
id: &str,
|
||||
_user: User,
|
||||
meta: CommonTemplateState,
|
||||
) -> PageResult {
|
||||
todo!("woof");
|
||||
}
|
||||
|
||||
#[get("/qr-png/<id>")]
|
||||
pub fn qr_profile(id: &str, _user: User, config: &State<Config>) -> PageResult {
|
||||
let public_uri = Absolute::parse(&config.public_url)?;
|
||||
|
|
|
@ -35,6 +35,11 @@
|
|||
<a href="/account/edit_tag/{{profile.id}}">Edit</a>
|
||||
<a href="/account/delete/{{profile.id}}">Delete</a>
|
||||
</div>
|
||||
<details>
|
||||
<summary>show the QR code</summary>
|
||||
|
||||
<img loading="lazy" src="/account/qr-png/{{profile.id}}" alt="A QrCode containing a direct link to the profile" />
|
||||
</details>
|
||||
</article>
|
||||
{% endfor %}
|
||||
</section>
|
||||
|
@ -52,4 +57,4 @@
|
|||
</ul>
|
||||
</section>
|
||||
{% endif %}
|
||||
{% endblock main %}
|
||||
{% endblock main %}
|
||||
|
|
Loading…
Add table
Reference in a new issue