Compare commits
2 Commits
master
...
refactor/t
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4c91968582 | ||
|
|
8e49454b6f |
@@ -28,7 +28,6 @@
|
|||||||
background: linear-gradient(-77deg, #2e4653, #223a37);
|
background: linear-gradient(-77deg, #2e4653, #223a37);
|
||||||
box-shadow: 0rem 0rem 0.5rem #182125;
|
box-shadow: 0rem 0rem 0.5rem #182125;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
overflow: hidden;
|
|
||||||
z-index: 100;
|
z-index: 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
overflow-x: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
:global(html) {
|
:global(html) {
|
||||||
|
|||||||
@@ -110,19 +110,63 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Navbar>
|
<Navbar>
|
||||||
{#if session}
|
<div class="navActions">
|
||||||
<a href="/space/new/edit">
|
<div class="tagDisplay">
|
||||||
<img src={crossUrl} alt="new" class="new-space" />
|
{#each selectedTags as tagName (tagName)}
|
||||||
</a>
|
<button class="tag" onclick={deleteTag(tagName)} type="button">
|
||||||
{/if}
|
{tagName}
|
||||||
|
<img src={crossUrl} alt="delete" /></button
|
||||||
|
>
|
||||||
|
{/each}
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
name="tagInput"
|
||||||
|
class="tagInput"
|
||||||
|
bind:value={tagFilter}
|
||||||
|
bind:this={tagFilterElem}
|
||||||
|
onfocus={() => {
|
||||||
|
dropdownVisible = true;
|
||||||
|
}}
|
||||||
|
onblur={() => {
|
||||||
|
dropdownVisible = false;
|
||||||
|
}}
|
||||||
|
onkeypress={(event) => {
|
||||||
|
if (event.key === "Enter") {
|
||||||
|
event.preventDefault();
|
||||||
|
const tag = filteredTags[0];
|
||||||
|
if (tag) addTag(tag)();
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
placeholder="Search by tags..."
|
||||||
|
/>
|
||||||
|
{#if dropdownVisible}
|
||||||
|
<div class="tagDropdown">
|
||||||
|
{#each filteredTags as avaliableTag (avaliableTag)}
|
||||||
|
<button
|
||||||
|
class="avaliableTag"
|
||||||
|
onclick={addTag(avaliableTag)}
|
||||||
|
onmousedown={(e) => {
|
||||||
|
// Keep input focused
|
||||||
|
e.preventDefault();
|
||||||
|
e.stopPropagation();
|
||||||
|
}}
|
||||||
|
type="button"
|
||||||
|
>
|
||||||
|
{avaliableTag}
|
||||||
|
</button>
|
||||||
|
{/each}
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
|
{#if session}
|
||||||
|
<a href="/space/new/edit">
|
||||||
|
<img src={crossUrl} alt="new" class="new-space" />
|
||||||
|
</a>
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
</Navbar>
|
</Navbar>
|
||||||
|
|
||||||
<main>
|
<main>
|
||||||
{#if adminMode}
|
|
||||||
<div class="checkReports">
|
|
||||||
<Button href="/space/reports" type="link" style="red">Check Reports</Button>
|
|
||||||
</div>
|
|
||||||
{/if}
|
|
||||||
<div class="time-filter-container">
|
<div class="time-filter-container">
|
||||||
<label>
|
<label>
|
||||||
Open from:
|
Open from:
|
||||||
@@ -133,58 +177,11 @@
|
|||||||
<input type="time" bind:value={closingFilter} />
|
<input type="time" bind:value={closingFilter} />
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="tag-filter-container">
|
{#if adminMode}
|
||||||
<form>
|
<div class="checkReports">
|
||||||
<div class="tagDisplay">
|
<Button href="/space/reports" type="link" style="red">Check Reports</Button>
|
||||||
{#each selectedTags as tagName (tagName)}
|
</div>
|
||||||
<button class="tag" onclick={deleteTag(tagName)} type="button">
|
{/if}
|
||||||
{tagName}
|
|
||||||
<img src={crossUrl} alt="delete" /></button
|
|
||||||
>
|
|
||||||
{/each}
|
|
||||||
<input
|
|
||||||
type="text"
|
|
||||||
name="tagInput"
|
|
||||||
class="tagInput"
|
|
||||||
bind:value={tagFilter}
|
|
||||||
bind:this={tagFilterElem}
|
|
||||||
onfocus={() => {
|
|
||||||
dropdownVisible = true;
|
|
||||||
}}
|
|
||||||
onblur={() => {
|
|
||||||
dropdownVisible = false;
|
|
||||||
}}
|
|
||||||
onkeypress={(event) => {
|
|
||||||
if (event.key === "Enter") {
|
|
||||||
event.preventDefault();
|
|
||||||
const tag = filteredTags[0];
|
|
||||||
if (tag) addTag(tag)();
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
placeholder="Search by tags..."
|
|
||||||
/>
|
|
||||||
{#if dropdownVisible}
|
|
||||||
<div class="tagDropdown">
|
|
||||||
{#each filteredTags as avaliableTag (avaliableTag)}
|
|
||||||
<button
|
|
||||||
class="avaliableTag"
|
|
||||||
onclick={addTag(avaliableTag)}
|
|
||||||
onmousedown={(e) => {
|
|
||||||
// Keep input focused
|
|
||||||
e.preventDefault();
|
|
||||||
e.stopPropagation();
|
|
||||||
}}
|
|
||||||
type="button"
|
|
||||||
>
|
|
||||||
{avaliableTag}
|
|
||||||
</button>
|
|
||||||
{/each}
|
|
||||||
</div>
|
|
||||||
{/if}
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{#each filteredStudySpaces as studySpace (studySpace.id)}
|
{#each filteredStudySpaces as studySpace (studySpace.id)}
|
||||||
{@const imgUrl =
|
{@const imgUrl =
|
||||||
studySpace.study_space_images.length > 0
|
studySpace.study_space_images.length > 0
|
||||||
@@ -235,11 +232,14 @@
|
|||||||
transform: rotate(45deg);
|
transform: rotate(45deg);
|
||||||
}
|
}
|
||||||
|
|
||||||
.tag-filter-container {
|
.navActions {
|
||||||
grid-column: 1 / -1;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
height: 100%;
|
||||||
margin-bottom: 0.5rem;
|
width: 100%;
|
||||||
|
align-items: center;
|
||||||
|
padding-left: 2rem;
|
||||||
|
gap: 1rem;
|
||||||
|
z-index: 200;
|
||||||
}
|
}
|
||||||
|
|
||||||
.time-filter-container {
|
.time-filter-container {
|
||||||
@@ -264,13 +264,6 @@
|
|||||||
color: #eaffeb;
|
color: #eaffeb;
|
||||||
}
|
}
|
||||||
|
|
||||||
form {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 0.5rem;
|
|
||||||
max-width: 32rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tagDisplay {
|
.tagDisplay {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 0.4rem;
|
gap: 0.4rem;
|
||||||
@@ -330,6 +323,7 @@
|
|||||||
top: 100%;
|
top: 100%;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
transform: translateX(-50%);
|
transform: translateX(-50%);
|
||||||
|
z-index: 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
.avaliableTag {
|
.avaliableTag {
|
||||||
|
|||||||
Reference in New Issue
Block a user