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