-
Notifications
You must be signed in to change notification settings - Fork 52
feature/show_event_day_view #248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature/show_event_day_view #248
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job! I've added few of my insights, please take a look :)
app/static/dayview.css
Outdated
} | ||
|
||
.event-btn { | ||
font-size: 10px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer setting the font-size using rem
There was a problem hiding this comment.
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 :)
app/static/eventdisplay.js
Outdated
} | ||
|
||
|
||
var ev = document.getElementById("event.id"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer using let
/const
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should wait for the entire page to load before using getElementById
.
app/static/eventdisplay.js
Outdated
ev.addEventListener("click", displayEvent); | ||
} | ||
|
||
function displayEvent(wantedevent) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
app/static/eventdisplay.js
Outdated
return response.text(); | ||
}) | ||
.then(function(body) { | ||
document.querySelector('#here').innerHTML = body; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer innerText
if possible :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tried to do it with innerText but it didn't work, so i stayed with innerHTML
app/templates/dayview.html
Outdated
{% 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="/event/edit" title="Edit event" class="action-icon"><img class="pb-1" src="{{ url_for('static', path='/images/icons/pencil.svg')}}" width="15em" height="15em"></a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
width/height should be in the CSS
app/templates/dayview.html
Outdated
<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="/event/edit" 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> | ||
<button class="event-btn" title="See full event" onclick="displayEvent('{{event.id}}')">event details</button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer creating onclick using addEventListener
in the JavaScript file.
Avoid adding such logic using the HTML.
app/templates/dayview.html
Outdated
{% endfor %} | ||
</div> | ||
</div> | ||
<div id="here" style="height:100%"></div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid using style
- add styling using CSS files.
app/static/eventdisplay.js
Outdated
} | ||
|
||
document.addEventListener('DOMContentLoaded', () => { | ||
let chosen_button = document.getElementsByClassName('event-btn'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be const
There was a problem hiding this comment.
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 :)
app/templates/dayview.html
Outdated
<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> |
There was a problem hiding this comment.
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 :)
app/templates/dayview.html
Outdated
<div id="here"></div> | ||
<div id="nice">Have a nice day</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
Codecov Report
@@ Coverage Diff @@
## develop #248 +/- ##
========================================
Coverage 98.73% 98.73%
========================================
Files 60 60
Lines 2687 2687
========================================
Hits 2653 2653
Misses 34 34 Continue to review full report at Codecov.
|
Uh oh!
There was an error while loading. Please reload this page.