Skip to content

Commit

Permalink
🎁 Add favorites of wishlists which can be managed by the user
Browse files Browse the repository at this point in the history
  • Loading branch information
edmw committed Sep 13, 2019
1 parent 5077ffa commit c12f7db
Show file tree
Hide file tree
Showing 49 changed files with 11,309 additions and 10,594 deletions.
28 changes: 14 additions & 14 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"repositoryURL": "https://github.com/vapor/auth.git",
"state": {
"branch": null,
"revision": "ed402783942af1d40b5c9e537e956aea51618f0e",
"version": "2.0.3"
"revision": "e6f61b403727ec124214beb3e57deff579f31d00",
"version": "2.0.4"
}
},
{
Expand All @@ -24,8 +24,8 @@
"repositoryURL": "https://github.com/vapor/core.git",
"state": {
"branch": null,
"revision": "2731f8ba0cf274a61c9bd6ab43550f692ffaf879",
"version": "3.9.0"
"revision": "c64f63cb21631010952f7abfef719d376ab6a441",
"version": "3.9.1"
}
},
{
Expand Down Expand Up @@ -78,17 +78,17 @@
"repositoryURL": "https://github.com/vapor/http.git",
"state": {
"branch": null,
"revision": "254a0a0cbf22a02b697a075a0d2ddbb448bb7c87",
"version": "3.2.0"
"revision": "3808ed0401379b6e9f4a053f03090ea9d658caa9",
"version": "3.2.1"
}
},
{
"package": "Imperial",
"repositoryURL": "https://github.com/vapor-community/Imperial.git",
"state": {
"branch": null,
"revision": "a73e3274032d295b406b4e9700e8a571a5fea041",
"version": "0.12.0"
"revision": "1ad6a9b6ac6a1f6c41c386e8fc0f62715235bb5a",
"version": "0.13.1"
}
},
{
Expand Down Expand Up @@ -132,17 +132,17 @@
"repositoryURL": "https://github.com/vapor/mysql.git",
"state": {
"branch": null,
"revision": "d1561ae722220cafe0ef4b51549f87aebc70ddb1",
"version": "3.2.4"
"revision": "6e86ff53e18f02faf26c2cbea1c1fb466bff6866",
"version": "3.2.6"
}
},
{
"package": "Routing",
"repositoryURL": "https://github.com/vapor/routing.git",
"state": {
"branch": null,
"revision": "626190ddd2bd9f967743b60ba6adaf90bbd2651c",
"version": "3.0.2"
"revision": "d76f339c9716785e5079af9d7075d28ff7da3d92",
"version": "3.1.0"
}
},
{
Expand Down Expand Up @@ -222,8 +222,8 @@
"repositoryURL": "https://github.com/vapor/template-kit.git",
"state": {
"branch": null,
"revision": "4b1073d74be9f5c6a5bc63a07a84e83efec26229",
"version": "1.1.2"
"revision": "51405c83e95e8adb09565278a5e9b959c605e56c",
"version": "1.4.0"
}
},
{
Expand Down
80 changes: 62 additions & 18 deletions Public/styles/wishlist.css
Original file line number Diff line number Diff line change
Expand Up @@ -152,23 +152,28 @@ main .content {
margin: 0 auto;
padding: 0 20px;
}
main .content > h2 {
main .content > .h2 {
display: flex;
justify-content: space-between;
align-items: center;
}
main .content > h2, main .content > .h2 > h2 {
font-family: 'Open Sans', sans-serif;
font-size: 1.8rem;
font-weight: 800;
text-transform: uppercase;
}
main .content > h2::first-letter {
main .content > h2::first-letter, main .content > .h2 > h2::first-letter {
font-size: 2.25rem;
}
main .content > h3 {
font-size: 1.5rem;
}
@media (min-width: 768px) {
main .content > h2 {
main .content > h2, main .content > .h2 > h2 {
font-size: 2.5rem;
}
main .content > h2::first-letter {
main .content > h2::first-letter, main .content > .h2 > h2::first-letter {
font-size: 3.125rem;
}
main .content > h3 {
Expand All @@ -189,17 +194,17 @@ span.title::first-letter {
}

/* table of lists */
table.wl-lists {
table-layout: fixed;
}
table.wl-lists th {
text-align: left;
}
table.wl-lists td.wl-info {
width: 1%;
}
table.wl-lists td.wl-visibility {
white-space: nowrap;
}
table.wl-lists td.wl-actions {
width: 1%;
text-align: right;
}

/* list form */
Expand All @@ -221,7 +226,7 @@ div.wl-item {
div.wl-item div.wl-item-card {
position: relative;
width: 100%;
background: white;
background: transparent;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
transform-style: preserve-3d;
-webkit-transform-style: preserve-3d;
Expand All @@ -234,6 +239,8 @@ div.wl-item > div.flipped {
}
div.wl-item img {
width: 100%;
backface-visibility: hidden;
-webkit-backface-visibility: hidden;
}
div.wl-item img.placeholder {
opacity: 0.1;
Expand All @@ -244,29 +251,41 @@ div.wl-item .inner {
left: 0;
right: 0;
bottom: 0;
z-index: 1;
background-color: transparent;
background-size: cover;
backface-visibility: hidden;
-webkit-backface-visibility: hidden;
}
div.wl-item .inner > * {
z-index: 2;
}
div.wl-item .inner .btn-group a {
backface-visibility: hidden;
-webkit-backface-visibility: hidden;
}
div.wl-item .back {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 20;
z-index: 3;
backface-visibility: hidden;
-webkit-backface-visibility: hidden;
transform: rotateY(180deg);
-webkit-transform: rotateY(180deg);
}
div.wl-item .back > * {
z-index: 4;
}
div.wl-item .back .text {
height: 100%;
overflow-x: hidden;
overflow-y: auto;
overflow-y: scroll;
}
div.wl-item .cover {
display: flex;
display: block;
position: absolute;
top: 0;
left: 0;
Expand Down Expand Up @@ -351,11 +370,14 @@ div.wl-item .btn-group a {
table.wl-items th {
text-align: left;
}
table.wl-items td.wl-info {
width: 1%;
table.wl-items td {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
table.wl-items td.wl-actions {
width: 1%;
table.wl-items td.wl-description {
width: 100%;
max-width: 0;
}

/* item form */
Expand Down Expand Up @@ -395,7 +417,7 @@ ul#signin #netid-signin {
}

/* bootstrap: headings */
h2, h3, h4 {
h2, .h2, h3, h4 {
line-height: 1.5;
}

Expand All @@ -404,10 +426,21 @@ h2, h3, h4 {
border: none;
border-radius: 50vh;
font-family: 'Open Sans', sans-serif;
font-size: 1rem;
font-size: 1.0rem;
font-weight: 400;
letter-spacing: 0.5px;
}
.btn-link .btn-label {
font-size: 1.0rem;
font-weight: 400;
text-transform: initial;
}
.btn-link .btn-label + svg {
margin-left: 0.5ex;
}
.btn-link svg + .btn-label {
margin-left: 0.5ex;
}
/* btn inside table */
.table .btn {
padding: 0;
Expand Down Expand Up @@ -442,3 +475,14 @@ h2, h3, h4 {
stroke-linejoin: round;
fill: none;
}

/* icons: feather */
.feather-large {
width: 32px;
height: 32px;
stroke: currentColor;
stroke-width: 2;
stroke-linecap: round;
stroke-linejoin: round;
fill: none;
}
12 changes: 11 additions & 1 deletion Resources/Localizations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"cancel": "Abbrechen",
"back": "Zurück",
"none": "Keine",
"edit": "Bearbeiten",

"profile": "Profil",
"nick-name": "Kurzname",
Expand All @@ -45,7 +46,7 @@
"edit-profile": "Profil bearbeiten",
"profile-editing": "Profil bearbeiten",
"profile-field-nickname-placeholder": "Kurzname eingeben",
"profile-field-nickname-invalid": "Ein eindeutiger Name wird benötigt. Gültige Namen sind mindestens 4 und maximal 100 Zeichen lang und enthalten nur alphanumerische Zeichen.",
"profile-field-nickname-invalid": "Ein eindeutiger Name wird benötigt. Gültige Namen sind mindestens 3 und maximal 100 Zeichen lang und enthalten nur alphanumerische Zeichen.",
"profile-field-nickname-duplicate": "Der gewählte Kurzname existiert bereits.",
"profile-field-nickname-hint": "Dein Kurzname wird für andere Nutzer sichtbar sein.",

Expand Down Expand Up @@ -76,6 +77,7 @@
"lists": "Wunschzettel",
"list-name": "Name",
"list-items": "Wünsche",
"list-owner": "Besitzer",
"visibility": "Sichtbarkeit",
"visibility-public": "Öffentlich",
"visibility-private": "nur Du",
Expand All @@ -101,11 +103,19 @@
"list-import-choose": "Bitte wähle eine Datei für den Import aus",
"list-import-error": "Importfehler",
"message-list-import-error": "Die ausgewählte Datei kann leider nicht in einen neuen Wunschzettel umgewandelt werden.",
"edit-list-wishes": "Wünsche bearbeiten",
"list-your-favorites": "Deine Favoriten",
"add-favorite": "Favorit hinzufügen",
"to-add-favorite": ".... den Zettel <strong>%{value1}</strong> zu deinen Favoriten hinzufügen?",
"remove-favorite": "Favorit entfernen",
"to-remove-favorite": ".... daß du den Zettel <strong>%{value1}</strong> aus deinen Favoriten <span class='text-danger'>entfernen</span> möchtest?",

"//": "Item pages",

"items": "Wünsche",
"item-name": "Name",
"item-description": "Beschreibung",
"item-preference": "Präferenz",
"item-preference-0": "Nicht so wichtig",
"item-preference-1": "Bin mir nicht sicher",
"item-preference-2": "Würde mich sehr freuen",
Expand Down
8 changes: 4 additions & 4 deletions Resources/Views/Protected/Wishlist.leaf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ you're viewing <strong>#(page.ownerName)'s #(page.listName) Wishlist</strong>. Y
}
</div>
}}
<h2>#(page.listName)</h2>
<div class="h2"><h2 class="d-flex align-items-baseline"><span class="title">#(page.listName)</span>#if(page.userID && page.userID == page.ownerID){<a class="btn btn-link d-flex float-right" href="/user/#(page.userID)/list/#(page.listID)/items#if(location){?p=#(location)}" title="#L10N("edit-list"){Edit list}"><span class="btn-label">#L10N("edit"){Edit}</span><svg class="feather"><use xlink:href="/icons/feather.svg#edit-2"/></svg></a>}</h2>#if(features.favorList.enabled && page.userID != nil) {#if(page.userFavorsList){★}else{<a class="btn-xlg btn-link nav-link" href="/user/#(page.userID)/favorites/create?listid=#(page.listID)#if(location){&p=#(location)}" title="#L10N("add-favorite"){Add list to favorites}">☆</a>}}</div>
#if(request.parameter.m == "WAR") {
<div class="alert alert-danger" role="alert">
#L10N("wishlist-message-war"){The selected wish is already reserved by someone else. May be you would like to choose another gift?}
Expand All @@ -27,9 +27,9 @@ you're viewing <strong>#(page.ownerName)'s #(page.listName) Wishlist</strong>. Y
<div id="wl-item-#(item.id)" class="wl-item p-2">
<div id="wl-item-card-#(item.id)" class="wl-item-card">
#if(item.imageURL) {
<img src="/images/items/#(item.imageURL)">
<img src="/images/items/#(item.imageURL)">
} else {
<img src="/images/gift.svg" class="placeholder">
<img src="/images/gift.svg" class="placeholder">
}
<div class="inner p-2">
<div class="wl-label m-0">
Expand All @@ -44,7 +44,7 @@ you're viewing <strong>#(page.ownerName)'s #(page.listName) Wishlist</strong>. Y
</div>
</div>
<div class="back bg-dark p-2">
<div class="pb-5">
<div class="text pb-5">
<h5 class="wl-label text-light m-0 px-1">#(item.name)</h5>
<p class="text-light m-0 px-1"><small><em>#L10N("item-preference-#(item.preference + 2)"){}</em></small></p>
<p class="text-light mt-2">#(item.text)</p>
Expand Down
15 changes: 15 additions & 0 deletions Resources/Views/User/FavoriteCreation.leaf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#set("title") {#L10N("add-favorite"){Add a Favorite}}
#//
#set("content") {
<h2>#L10N("want-to"){Do you want ...}</h2>
<h3>#L10N("to-add-favorite","#(page.list.name)"){... to add the wish list named <strong>#(page.list.name)</strong> to your favorite wish lists?}</h3>
<form method="POST" action="/user/#(page.userID)/favorites#if(request.parameter.p){?p=#(request.parameter.p)}" accept-charset="UTF-8" class="mt-4">
<input type="hidden" name="listID" value="#(page.list.id)">
<div class="form-group form-row">
<button type="submit" class="btn btn-primary">#L10N("confirm"){Confirm}</button>
<a class="nav-link btn btn-link ml-3" href="#if(request.parameter.p){#(request.parameter.p)}else{/}">#L10N("cancel"){Cancel}</a>
</div>
</form>
}
#//
#embed("Wishlist")
16 changes: 16 additions & 0 deletions Resources/Views/User/FavoriteDeletion.leaf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#set("title") {#L10N("remove-favorite"){Remove a Favorite}}
#//
#set("content") {
<h2>#L10N("sure-to"){Are you sure ...}</h2>
<h3>#L10N("to-remove-favorite","#(page.list.name)"){... you want to remove the wish list named <strong>#(page.list.name)</strong> from your favorite wish lists?}</h3>
<form method="POST" action="/user/#(page.userID)/favorites/delete#if(request.parameter.p){?p=#(request.parameter.p)}" accept-charset="UTF-8" class="mt-4">
<input type="hidden" name="__method" value="DELETE">
<input type="hidden" name="listID" value="#(page.list.id)">
<div class="form-group form-row">
<button type="submit" class="btn btn-primary">#L10N("confirm"){Confirm}</button>
<a class="nav-link btn btn-link ml-3" href="#if(request.parameter.p){#(request.parameter.p)}else{/}">#L10N("cancel"){Cancel}</a>
</div>
</form>
}
#//
#embed("Wishlist")
4 changes: 4 additions & 0 deletions Resources/Views/User/Favorites-Section.leaf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<section>
<h3>#L10N("list-your-favorites"){Your Favorites} <small class="text-muted">(#count(page.favorites)/#(page.maximumNumberOfFavorites))</small></h3>
#embed("User/Favorites-Table")
</section>
Loading

0 comments on commit c12f7db

Please sign in to comment.