|
12 | 12 | <table class="table table-sm table-borderless"> |
13 | 13 | {% for item in news %} |
14 | 14 | <tr> |
15 | | - <th scope="row">{{ item.date | date: "%m/%d/%y" }}</th> |
| 15 | + <td style="font-weight: bold;">{{ item.date | date: "%m/%d/%y" }}</td> |
16 | 16 | <td> |
17 | 17 | {% assign tt = item.tags %} |
18 | 18 | {% if tt[0] == "event" %} |
|
24 | 24 | {% else %} |
25 | 25 | <i class="fa fa-file" style="margin-right: 4px" title="{{tt[0]}}"></i> |
26 | 26 | {% endif %} |
| 27 | + </td> |
| 28 | + |
| 29 | + <td> |
| 30 | + {% if item.image %} |
| 31 | + {% assign full_url = "/images/" | append: item.image %} |
| 32 | + <div style="width: 250px; height:187px;overflow: hidden;"> |
| 33 | + <a class="news-title zoom" href="{{ item.url | relative_url }}"> |
| 34 | + <img src="{{ full_url }}" alt="{{ item.title }}" style="width: 100%; height: 100%; object-fit: cover;" |
| 35 | + class="img-fluid img-thumbnail rounded z-depth-1"/> |
| 36 | + </a> |
| 37 | + </div> |
| 38 | + {% else %} |
| 39 | + <div style="width: 250px; height:187px;overflow: hidden;"> |
| 40 | + <a class="news-title zoom" href="{{ item.url | relative_url }}"> |
| 41 | + <img src="{{ 'assets/img/new-logo-small-480.webp' | relative_url }}" alt="{{ item.title }}" style="width: 100%; height: 100%; object-fit: cover;" |
| 42 | + class="img-fluid img-thumbnail rounded z-depth-1"/> |
| 43 | + </a> |
| 44 | + </div> |
| 45 | + {% endif %} |
| 46 | + </td> |
| 47 | + |
| 48 | + <td> |
27 | 49 | {% if item.inline %} |
28 | 50 | {{ item.content | remove: '<p>' | remove: '</p>' | emojify }} |
29 | 51 | {% else %} |
|
44 | 66 | {% comment %} |
45 | 67 | No numeric limit passed, so group by year for the news page. |
46 | 68 | {% endcomment %} |
47 | | - <div id="filter-buttons" class="mb-3"> |
48 | | - |
49 | | - <button data-tag="all" class="filter-button"> |
50 | | - <i class="fa fa-list mr-1"></i> All </button> |
51 | | - <button data-tag="event" class="filter-button"> |
52 | | - <i class="fa fa-calendar-days mr-1"></i> Events </button> |
53 | | - <button data-tag="paper" class="filter-button"> |
54 | | - <i class="fa fa-file-pdf mr-1"></i> Papers </button> |
55 | | - <button data-tag="research" class="filter-button"> |
56 | | - <i class="fa fa-lightbulb mr-1"></i> Research </button> |
57 | | - <button data-tag="art" class="filter-button"> |
58 | | - <i class="fa fa-palette mr-1"></i> Art </button> |
59 | 69 |
|
| 70 | + <div class="row"> |
| 71 | + |
| 72 | + <!-- Sticky left menu --> |
| 73 | + <div class="col-md-2 d-none d-md-block"> |
| 74 | + <div class="sticky-top" style="top: 100px;"> |
| 75 | + <ul class="list-unstyled"> |
| 76 | + <li><a data-tag="all" class="filter-link news_selected" style="color: var(--global-theme-color);">all</a></li> |
| 77 | + <li><a data-tag="event" class="filter-link" style="color: var(--global-theme-color);">events</a></li> |
| 78 | + <li><a data-tag="paper" class="filter-link" style="color: var(--global-theme-color);">papers</a></li> |
| 79 | + <li><a data-tag="research" class="filter-link" style="color: var(--global-theme-color);">research</a></li> |
| 80 | + <li><a data-tag="art" class="filter-link" style="color: var(--global-theme-color);">art</a></li> |
| 81 | + </ul> |
| 82 | + </div> |
60 | 83 | </div> |
| 84 | + |
| 85 | + |
| 86 | + <!-- Main content --> |
| 87 | + <div class="col-md-10"> |
61 | 88 | {% assign grouped_by_year = news | group_by_exp:"item", "item.date | date: '%Y'" %} |
62 | 89 | <div class="table-responsive"> |
63 | 90 | <table class="table table-sm table-borderless"> |
| 91 | + <tbody> |
64 | 92 | {% for year_group in grouped_by_year %} |
| 93 | + {% assign post_year = year_group.name | plus: 0 %} |
65 | 94 | <!-- Year divider row --> |
66 | | - <tr class="year-divider"> |
67 | | - <th colspan="2">{{ year_group.name }}</th> |
| 95 | + <tr> |
| 96 | + <td colspan="4" style="padding-top: 0;"><h2 class="year-divider">{{ year_group.name }}</h2></td> |
68 | 97 | </tr> |
| 98 | + |
69 | 99 | {% for item in year_group.items %} |
70 | | - <tr class="news-item" data-tags="{{ item.tags | join: ' ' }}"> |
71 | | - <th scope="row">{{ item.date | date: "%m/%d/%y" }}</th> |
| 100 | + <tr class="news-item" data-tags="{{ item.tags | join: ' ' }}" style="padding-bottom: 4px;"> |
| 101 | + <td style="font-weight: bold;">{{ item.date | date: "%m/%d/%y" }}</td> |
72 | 102 | <td> |
73 | 103 | {% assign tt = item.tags %} |
74 | 104 | {% if tt[0] == "event" %} |
|
80 | 110 | {% else %} |
81 | 111 | <i class="fa fa-file" style="margin-right: 4px" title="{{tt[0]}}"></i> |
82 | 112 | {% endif %} |
| 113 | + </td> |
| 114 | + |
| 115 | + <td> |
| 116 | +{% comment %} |
| 117 | + {% if item.image %} |
| 118 | + {% assign full_url = "/images/" | append: item.image %} |
| 119 | + <div style="width: 300px; height:200px;overflow: hidden;"> |
| 120 | + <a class="news-title" href="{{ item.url | relative_url }}"> |
| 121 | + <img src="{{ full_url }}" alt="{{ item.title }}" style="width: 100%; height: 100%; object-fit: cover;"/> |
| 122 | + </a> |
| 123 | + </div> |
| 124 | + {% else %} |
| 125 | + <div style="width: 300px; height:200px;overflow: hidden;"> |
| 126 | + <a class="news-title" href="{{ item.url | relative_url }}"> |
| 127 | + <img src="{{ 'assets/img/new-logo-small-480.webp' | relative_url }}" alt="{{ item.title }}" style="width: 100%; height: 100%; object-fit: cover;" /> |
| 128 | + </a> |
| 129 | + </div> |
| 130 | + {% endif %} |
| 131 | +{% endcomment %} |
| 132 | + </td> |
| 133 | + |
| 134 | + <td> |
83 | 135 | {% if item.inline %} |
84 | 136 | {{ item.content | remove: '<p>' | remove: '</p>' | emojify }} |
85 | 137 | {% else %} |
|
89 | 141 | </tr> |
90 | 142 | {% endfor %} |
91 | 143 | {% endfor %} |
| 144 | + </tbody> |
92 | 145 | </table> |
93 | 146 | </div> |
| 147 | + </div> |
| 148 | + |
94 | 149 | {% endif %} |
| 150 | + </div> |
95 | 151 | {% else %} |
96 | 152 | <p>No news so far...</p> |
97 | 153 | {% endif %} |
98 | 154 | </div> |
99 | 155 |
|
100 | 156 |
|
101 | 157 | <script> |
102 | | - const buttons = document.querySelectorAll('.filter-button'); |
| 158 | + const buttons = document.querySelectorAll('.filter-link'); |
103 | 159 | const newsItems = document.querySelectorAll('.news-item'); |
104 | 160 |
|
105 | 161 | buttons.forEach(button => { |
106 | 162 | button.addEventListener('click', () => { |
107 | 163 | const tag = button.getAttribute('data-tag'); |
108 | 164 |
|
109 | 165 | // Update active button style |
110 | | - buttons.forEach(btn => btn.classList.remove('active')); |
111 | | - button.classList.add('active'); |
| 166 | + buttons.forEach((btn) => { |
| 167 | + btn.classList.remove('news_selected'); |
| 168 | + }); |
| 169 | + button.classList.add('news_selected'); |
112 | 170 |
|
113 | 171 | // Filter news |
114 | 172 | newsItems.forEach(item => { |
|
0 commit comments