-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
343 additions
and
338 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,23 @@ | ||
import { createElement } from '../render.js'; | ||
|
||
const createPointListTemplate = () => { | ||
return ( | ||
`<ul class="trip-events__list"><ul>` | ||
); | ||
function createPointListTemplate () { | ||
return '<ul class="trip-events__list"></ul>'; | ||
} | ||
|
||
export default class PointListView { | ||
getTemplate() { | ||
return createPointListTemplate(); | ||
} | ||
|
||
getElement() { | ||
if (!this.element) { | ||
this.element = createElement(this.getTemplate()); | ||
} | ||
|
||
return this.element; | ||
} | ||
|
||
removeElement() { | ||
this.element = null; | ||
getTemplate() { | ||
return createPointListTemplate(); | ||
} | ||
|
||
getElement() { | ||
if (!this.element) { | ||
this.element = createElement(this.getTemplate()); | ||
} | ||
|
||
return this.element; | ||
} | ||
|
||
removeElement() { | ||
this.element = null; | ||
} | ||
} | ||
Check failure on line 23 in src/view/point-list-view.js GitHub Actions / Check
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,61 @@ | ||
import { createElement } from '../render.js'; | ||
|
||
const createPointTemplate = () => { | ||
return ( | ||
`<li class="trip-events__item"> | ||
<div class="event"> | ||
<time class="event__date" datetime="2019-03-18">MAR 18</time> | ||
<div class="event__type"> | ||
<img class="event__type-icon" width="42" height="42" src="img/icons/taxi.png" alt="Event type icon"> | ||
</div> | ||
<h3 class="event__title">Taxi Amsterdam</h3> | ||
<div class="event__schedule"> | ||
<p class="event__time"> | ||
<time class="event__start-time" datetime="2019-03-18T10:30">10:30</time> | ||
— | ||
<time class="event__end-time" datetime="2019-03-18T11:00">11:00</time> | ||
</p> | ||
<p class="event__duration">30M</p> | ||
</div> | ||
<p class="event__price"> | ||
€ <span class="event__price-value">20</span> | ||
</p> | ||
<h4 class="visually-hidden">Offers:</h4> | ||
<ul class="event__selected-offers"> | ||
<li class="event__offer"> | ||
<span class="event__offer-title">Order Uber</span> | ||
+€ | ||
<span class="event__offer-price">20</span> | ||
</li> | ||
</ul> | ||
<button class="event__favorite-btn event__favorite-btn--active" type="button"> | ||
<span class="visually-hidden">Add to favorite</span> | ||
<svg class="event__favorite-icon" width="28" height="28" viewBox="0 0 28 28"> | ||
<path d="M14 21l-8.22899 4.3262 1.57159-9.1631L.685209 9.67376 9.8855 8.33688 14 0l4.1145 8.33688 9.2003 1.33688-6.6574 6.48934 1.5716 9.1631L14 21z"/> | ||
</svg> | ||
</button> | ||
<button class="event__rollup-btn" type="button"> | ||
<span class="visually-hidden">Open event</span> | ||
</button> | ||
</div> | ||
</li>` | ||
); | ||
function createPointTemplate () { | ||
return (` | ||
<li class="trip-events__item"> | ||
<div class="event"> | ||
<time class="event__date" datetime="2019-03-18">MAR 18</time> | ||
<div class="event__type"> | ||
<img class="event__type-icon" width="42" height="42" src="img/icons/taxi.png" alt="Event type icon"> | ||
</div> | ||
<h3 class="event__title">Taxi Amsterdam</h3> | ||
<div class="event__schedule"> | ||
<p class="event__time"> | ||
<time class="event__start-time" datetime="2019-03-18T10:30">10:30</time> | ||
— | ||
<time class="event__end-time" datetime="2019-03-18T11:00">11:00</time> | ||
</p> | ||
<p class="event__duration">30M</p> | ||
</div> | ||
<p class="event__price"> | ||
€ <span class="event__price-value">20</span> | ||
</p> | ||
<h4 class="visually-hidden">Offers:</h4> | ||
<ul class="event__selected-offers"> | ||
<li class="event__offer"> | ||
<span class="event__offer-title">Order Uber</span> | ||
+€ | ||
<span class="event__offer-price">20</span> | ||
</li> | ||
</ul> | ||
<button class="event__favorite-btn event__favorite-btn--active" type="button"> | ||
<span class="visually-hidden">Add to favorite</span> | ||
<svg class="event__favorite-icon" width="28" height="28" viewBox="0 0 28 28"> | ||
<path d="M14 21l-8.22899 4.3262 1.57159-9.1631L.685209 9.67376 9.8855 8.33688 14 0l4.1145 8.33688 9.2003 1.33688-6.6574 6.48934 1.5716 9.1631L14 21z"/> | ||
</svg> | ||
</button> | ||
<button class="event__rollup-btn" type="button"> | ||
<span class="visually-hidden">Open event</span> | ||
</button> | ||
</div> | ||
</li> | ||
`); | ||
} | ||
|
||
export default class PointView { | ||
getTemplate() { | ||
return createPointTemplate(); | ||
} | ||
|
||
getElement() { | ||
if (!this.element) { | ||
this.element = createElement(this.getTemplate()); | ||
} | ||
|
||
return this.element; | ||
} | ||
|
||
removeElement() { | ||
this.element = null; | ||
getTemplate() { | ||
return createPointTemplate(); | ||
} | ||
|
||
getElement() { | ||
if (!this.element) { | ||
this.element = createElement(this.getTemplate()); | ||
} | ||
|
||
return this.element; | ||
} | ||
|
||
removeElement() { | ||
this.element = null; | ||
} | ||
} | ||
Check failure on line 61 in src/view/point-view.js GitHub Actions / Check
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,50 @@ | ||
import { createElement } from '../render.js'; | ||
|
||
const createSortTemplate = () => { | ||
return ( | ||
`<form class="trip-events__trip-sort trip-sort" action="#" method="get"> | ||
function createSortTemplate () { | ||
return (` | ||
<form class="trip-events__trip-sort trip-sort" action="#" method="get"> | ||
<div class="trip-sort__item trip-sort__item--day"> | ||
<input id="sort-day" class="trip-sort__input visually-hidden" type="radio" name="trip-sort" value="sort-day"> | ||
<label class="trip-sort__btn" for="sort-day">Day</label> | ||
<input id="sort-day" class="trip-sort__input visually-hidden" type="radio" name="trip-sort" value="sort-day"> | ||
<label class="trip-sort__btn" for="sort-day">Day</label> | ||
</div> | ||
<div class="trip-sort__item trip-sort__item--event"> | ||
<input id="sort-event" class="trip-sort__input visually-hidden" type="radio" name="trip-sort" value="sort-event" disabled> | ||
<label class="trip-sort__btn" for="sort-event">Event</label> | ||
<input id="sort-event" class="trip-sort__input visually-hidden" type="radio" name="trip-sort" value="sort-event" disabled> | ||
<label class="trip-sort__btn" for="sort-event">Event</label> | ||
</div> | ||
<div class="trip-sort__item trip-sort__item--time"> | ||
<input id="sort-time" class="trip-sort__input visually-hidden" type="radio" name="trip-sort" value="sort-time"> | ||
<label class="trip-sort__btn" for="sort-time">Time</label> | ||
<input id="sort-time" class="trip-sort__input visually-hidden" type="radio" name="trip-sort" value="sort-time"> | ||
<label class="trip-sort__btn" for="sort-time">Time</label> | ||
</div> | ||
<div class="trip-sort__item trip-sort__item--price"> | ||
<input id="sort-price" class="trip-sort__input visually-hidden" type="radio" name="trip-sort" value="sort-price" checked> | ||
<label class="trip-sort__btn" for="sort-price">Price</label> | ||
<input id="sort-price" class="trip-sort__input visually-hidden" type="radio" name="trip-sort" value="sort-price" checked> | ||
<label class="trip-sort__btn" for="sort-price">Price</label> | ||
</div> | ||
<div class="trip-sort__item trip-sort__item--offer"> | ||
<input id="sort-offer" class="trip-sort__input visually-hidden" type="radio" name="trip-sort" value="sort-offer" disabled> | ||
<label class="trip-sort__btn" for="sort-offer">Offers</label> | ||
<input id="sort-offer" class="trip-sort__input visually-hidden" type="radio" name="trip-sort" value="sort-offer" disabled> | ||
<label class="trip-sort__btn" for="sort-offer">Offers</label> | ||
</div> | ||
</form>` | ||
); | ||
</form> | ||
`); | ||
} | ||
|
||
export default class SortView { | ||
getTemplate() { | ||
return createSortTemplate(); | ||
} | ||
|
||
getElement() { | ||
if (!this.element) { | ||
this.element = createElement(this.getTemplate()); | ||
} | ||
|
||
return this.element; | ||
} | ||
|
||
removeElement() { | ||
this.element = null; | ||
getTemplate() { | ||
return createSortTemplate(); | ||
} | ||
|
||
getElement() { | ||
if (!this.element) { | ||
this.element = createElement(this.getTemplate()); | ||
} | ||
|
||
return this.element; | ||
} | ||
|
||
removeElement() { | ||
this.element = null; | ||
} | ||
} | ||
Check failure on line 50 in src/view/sort-view.js GitHub Actions / Check
|
Oops, something went wrong.