Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions app/static/dayview.css
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,27 @@ html {
background-color: var(--borders-variant);
border-radius: 50px;
box-shadow: 1px 1px 2px #999;
}

.event-btn {
font-size: 0.625rem;
text-align: center;
color: #fff;
background-color:#30465D;
border-radius: 0.938rem;
border: 0.063rem solid #30465D;
}

.add-event-icon {
display: inline-block;
}

.plus_image {
width: 3rem;
height: 3rem;
}

.pb-1 {
width: 1.2rem;
height: 1.2rem;
}
24 changes: 24 additions & 0 deletions app/static/eventdisplay.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
function scrollTo(element) {
window.scroll({
behavior: 'smooth',
left: 0,
top: element.offsetTop
});
}

document.addEventListener('DOMContentLoaded', () => {
let chosen_button = document.getElementsByClassName('event-btn');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be const

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed all of the notes:, waiting for merge :)

for (let i = 0; i < chosen_button.length; i++) {
chosen_button[i].addEventListener("click", function(e) {
let clickedElem = e.target.id
fetch('/event/' + clickedElem)
.then(function(response) {
return response.text();
})
.then(function(body) {
document.querySelector('#here').innerHTML = body;
scrollTo(document.getElementById("here"));
});
});
}
});
1 change: 1 addition & 0 deletions app/static/images/icons/plus.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 9 additions & 2 deletions app/templates/dayview.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,19 @@

{% for event, attr in events %}
<div class="d-flex flex-row justify-content-around align-items-end action-continer" style="grid-row: {{attr.grid_position}};">
<a href="/edit/{{event.id}}" title="Edit event" class="action-icon"><img class="pb-1" src="{{ url_for('static', path='/images/icons/pencil.svg')}}" width="15em" height="15em"></a>
<a href="/delete/{{event.id}}" title="Delete event" class="action-icon"><img class="pb-1" src="{{ url_for('static', path='/images/icons/trash-can.svg')}}" width="15em" height="15em"></a>
<a href="/edit/{{event.id}}" title="Edit event" class="action-icon"><img class="pb-1" src="{{ url_for('static', path='/images/icons/pencil.svg')}}"></a>
<a href="/delete/{{event.id}}" title="Delete event" class="action-icon"><img class="pb-1" src="{{ url_for('static', path='/images/icons/trash-can.svg')}}"></a>
<button class="event-btn" title="See full event" id="{{event.id}}">event details</button>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should be the other way around - the a should be a button, and the "See full event" should be a link :)

</div>
{% endfor %}
</div>
</div>
<div>
<a href="/event/edit" title="Add Event" class="add-event-icon"><img class="plus_image" src="{{ url_for('static', path='/images/icons/plus.svg')}}"></a>
</div>
<div id="here"></div>
<div id="nice">Have a nice day</div>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/js/bootstrap.bundle.min.js" integrity="sha384-ygbV9kiqUc6oa4msXn9868pTtWMgiQaeYH7/t7LECLbyPA2x65Kgf80OJFdroafW" crossorigin="anonymous"></script>
<script type="text/javascript" src="{{ url_for('static', path='/eventdisplay.js') }}"></script>
</body>
</html>