Skip to content
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

Generate all the htmls with Freemarker #11

Open
dmitry-weirdo opened this issue Dec 16, 2020 · 0 comments
Open

Generate all the htmls with Freemarker #11

dmitry-weirdo opened this issue Dec 16, 2020 · 0 comments
Assignees

Comments

@dmitry-weirdo
Copy link
Collaborator

dmitry-weirdo commented Dec 16, 2020

  • Сделать инклюд заголовка (https://freemarker.apache.org/docs/ref_directive_include.html). Тогда его можно будет менять в одном а не нескольких файлах.
  • Все текущие страницы должны генериться аналогично новому топу.
  • Ссылка на css-файлы должна содержать параметр с таймстепом его изменения. Это позволит автообновлять файл на стороне юзеров, чтобы он не брался из кэша. См. http://klavogonki.ru/forum/software/59/page3/#post47.
  • Все имена файлов должны храниться в джава-коде и передавать в FTL.
  • Также нужно генерить файлы в подпапку с именем, соответствующим дате/времени выгрузки.
    • Таким образом, перезаписываться файлы не буде
  • Приватный внутренний класс Config нужно перенести в общий класс типа ParserContext, который будет использоваться для генерации всех страниц через FTL.
    • В том числе будут содержаться: время выгрузки (старт и стоп), мин/макс playerId, на котором запускалось, записей на странице в топе, записей в Топ-500, минимальный пробег для топа по лучшей скорости итд.
  • ❗ ❗ Подумать, а нужно ли грузить данные через JSON-файлы, ведь можно всю html-ку статически сгенерировать.
    • Для топов это так, а вот для статистики нужен именно JSON, так как его мы будем использовать в chart.js диаграммах.
  • ❗ ❗ ❗ Полная автоматическая генерация позволит не хранить кучу сгенерированные страницы в исходниках. Можно будет просто зиповать их под нужной датой (датой загрузки данных). А в скрипте аплоада в S3 просто раззиповывать и деплоить раззипованные.
@dmitry-weirdo dmitry-weirdo self-assigned this Dec 18, 2020
dmitry-weirdo added a commit that referenced this issue Dec 19, 2020
dmitry-weirdo added a commit that referenced this issue Dec 20, 2020
…nk charts and tables.

- Added profileLink, rank and rankDisplayName usability getters to PlayerEntity, profileLink to PlayerDto.
- Links to user profile changed to https:// instead of http://.
- Html of <td> with user rank color, login and info with profile link extracted to a FTL macro that is imported into page FTLs.
- Added an ExampleTemplate and example.ftl to be able to test FreeMarker quickly.
- Re-generated top by speed files are not yet added.
- Order of players in "Действующие пользователи, у которых падает /get-index-data" is random, since java Map is not sorted.
- Link to method on the index page fixed: /get-summary instead of /get-stats-overview.
dmitry-weirdo added a commit that referenced this issue Dec 20, 2020
…t to index page generation. Chart switcher is not yet implemented.

- Chart labels are filled according to the minTotalRacesCount.
- Added total sum to the tables in the charts.
- Added a percentage column to the tables in the charts.
dmitry-weirdo added a commit that referenced this issue Dec 22, 2020
- Fixed html layout (closing tags) in the ftl templates. Re-generated all pages.
- Old related garbage not yet removed.
dmitry-weirdo added a commit that referenced this issue Dec 22, 2020
…00 pages are now generated as plain HTML.
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

No branches or pull requests

1 participant