summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjelemux <jeremias.weber@protonmail.com>2021-02-18 18:10:55 +0100
committerjelemux <jeremias.weber@protonmail.com>2021-02-18 18:10:55 +0100
commite85c3283d4ea5d5d2f0bb7e6cdd6c48ddb9a786b (patch)
tree604d7494bb5a50a6128fda213e498b5cc8f97c31 /src
parent0030ec479a2a3152e22abe104ab0ee25dd36ebd5 (diff)
downloadwasm-card-e85c3283d4ea5d5d2f0bb7e6cdd6c48ddb9a786b.tar.gz
wasm-card-e85c3283d4ea5d5d2f0bb7e6cdd6c48ddb9a786b.tar.bz2
add option for more properties and groups
Diffstat (limited to 'src')
-rw-r--r--src/view/main.rs61
1 files changed, 58 insertions, 3 deletions
diff --git a/src/view/main.rs b/src/view/main.rs
index 360a527..d2d313a 100644
--- a/src/view/main.rs
+++ b/src/view/main.rs
@@ -1,4 +1,3 @@
-use uuid::Uuid;
use crate::model::property_groups::address::*;
use crate::model::property_groups::name::*;
use crate::model::property_groups::organizational::*;
@@ -16,6 +15,7 @@ use genpdf::Element as _;
use genpdf::{elements, fonts, style};
use qrcodegen::QrCode;
use qrcodegen::QrCodeEcc;
+use uuid::Uuid;
use vobject::parameters;
use vobject::vcard::VcardBuilder;
use yew::prelude::*;
@@ -49,7 +49,7 @@ pub enum Msg {
AddName,
AddAddress,
AddTelephone,
- AddDates,
+ AddOtherIdentification,
AddOrganizational,
ChangeDownloadOption(DownloadOption),
@@ -103,7 +103,7 @@ impl Component for MainView {
self.telephone_links.push(WeakComponentLink::default());
shouldrender = true;
}
- Msg::AddDates => {
+ Msg::AddOtherIdentification => {
self.other_identifications_links
.push(WeakComponentLink::default());
shouldrender = true;
@@ -490,6 +490,17 @@ impl Component for MainView {
{ self.render_error() }
+ <div class="level">
+ <div class="level-left">
+ <div class="level-item">
+ <h2 class="subtitle is-2">{ "Names" }</h2>
+ </div>
+ <div class="level-item">
+ <button onclick=self.link.callback(|_| Msg::AddName) class="button">{ "Add more" }</button>
+ </div>
+ </div>
+ </div>
+
{
for self.name_links.iter().map(|link|
html!{
@@ -503,6 +514,17 @@ impl Component for MainView {
)
}
+ <div class="level">
+ <div class="level-left">
+ <div class="level-item">
+ <h2 class="subtitle is-2">{ "Other Identification Properties" }</h2>
+ </div>
+ <div class="level-item">
+ <button onclick=self.link.callback(|_| Msg::AddOtherIdentification) class="button">{ "Add more" }</button>
+ </div>
+ </div>
+ </div>
+
{
for self.other_identifications_links.iter().map(|link|
html!{
@@ -516,6 +538,17 @@ impl Component for MainView {
)
}
+ <div class="level">
+ <div class="level-left">
+ <div class="level-item">
+ <h2 class="subtitle is-2">{ "Addresses" }</h2>
+ </div>
+ <div class="level-item">
+ <button onclick=self.link.callback(|_| Msg::AddAddress) class="button">{ "Add more" }</button>
+ </div>
+ </div>
+ </div>
+
{
for self.address_links.iter().map(|link|
html!{
@@ -529,6 +562,17 @@ impl Component for MainView {
)
}
+ <div class="level">
+ <div class="level-left">
+ <div class="level-item">
+ <h2 class="subtitle is-2">{ "Telephone Numbers" }</h2>
+ </div>
+ <div class="level-item">
+ <button onclick=self.link.callback(|_| Msg::AddTelephone) class="button">{ "Add more" }</button>
+ </div>
+ </div>
+ </div>
+
{
for self.telephone_links.iter().map(|link|
html!{
@@ -542,6 +586,17 @@ impl Component for MainView {
)
}
+ <div class="level">
+ <div class="level-left">
+ <div class="level-item">
+ <h2 class="subtitle is-2">{ "Organisations" }</h2>
+ </div>
+ <div class="level-item">
+ <button onclick=self.link.callback(|_| Msg::AddOrganizational) class="button">{ "Add more" }</button>
+ </div>
+ </div>
+ </div>
+
{
for self.organizational_links.iter().map(|link|
html!{