Skip to content

Conversation

ADI-projects30
Copy link
Contributor

@ADI-projects30 ADI-projects30 commented Feb 9, 2021

  1. When press on button "event details" the event view will be load into day view.
  2. When press on plus icon , redirect to create event

Copy link
Member

@yammesicka yammesicka left a 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 :)

}

.event-btn {
font-size: 10px;
Copy link
Member

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

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 :)

}


var ev = document.getElementById("event.id");
Copy link
Member

Choose a reason for hiding this comment

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

Prefer using let/const

Copy link
Member

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.

ev.addEventListener("click", displayEvent);
}

function displayEvent(wantedevent) {
Copy link
Member

Choose a reason for hiding this comment

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

Nice!

return response.text();
})
.then(function(body) {
document.querySelector('#here').innerHTML = body;
Copy link
Member

Choose a reason for hiding this comment

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

Prefer innerText if possible :)

Copy link
Contributor Author

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

{% 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>
Copy link
Member

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

<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>
Copy link
Member

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.

{% endfor %}
</div>
</div>
<div id="here" style="height:100%"></div>
Copy link
Member

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.

}

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 :)

Comment on lines 56 to 58
<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 :)

Comment on lines 66 to 67
<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.

?

@codecov-io
Copy link

Codecov Report

Merging #248 (fdaec00) into develop (372421f) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           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.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 372421f...f827d1b. Read the comment docs.

@yammesicka yammesicka merged commit cff596e into PythonFreeCourse:develop Feb 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants