added dynamic css
This commit is contained in:
@ -7,7 +7,7 @@ plugins {
|
||||
apply plugin: 'io.spring.dependency-management'
|
||||
|
||||
group = 'de.jottyfan'
|
||||
version = '1.4.6'
|
||||
version = '1.4.7'
|
||||
|
||||
description = """timetrack"""
|
||||
|
||||
@ -23,7 +23,7 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'de.jottyfan:timetrackjooq:20240105'
|
||||
implementation 'de.jottyfan:timetrackjooq:20240109'
|
||||
|
||||
implementation 'org.apache.logging.log4j:log4j-api:latest.release'
|
||||
implementation 'org.apache.logging.log4j:log4j-core:latest.release'
|
||||
|
@ -0,0 +1,29 @@
|
||||
package de.jottyfan.timetrack.modules.style;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import de.jottyfan.timetrack.component.OAuth2Provider;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jotty
|
||||
*
|
||||
*/
|
||||
@RestController
|
||||
public class DynamicStyleController {
|
||||
|
||||
@Autowired
|
||||
private DynamicStyleService service;
|
||||
|
||||
@Autowired
|
||||
private OAuth2Provider provider;
|
||||
|
||||
@GetMapping(value = "/public/dynamicstyle.css", produces = "text/css")
|
||||
public @ResponseBody String getDynamicCss(HttpServletRequest request) {
|
||||
return service.getDynamicCssOf(provider.getName());
|
||||
}
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
package de.jottyfan.timetrack.modules.style;
|
||||
|
||||
import static de.jottyfan.timetrack.db.profile.Tables.T_PROFILE;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.jooq.DSLContext;
|
||||
import org.jooq.Record1;
|
||||
import org.jooq.SelectConditionStep;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jotty
|
||||
*
|
||||
*/
|
||||
@Repository
|
||||
public class DynamicStyleRepository {
|
||||
private static final Logger LOGGER = LogManager.getLogger(DynamicStyleRepository.class);
|
||||
|
||||
@Autowired
|
||||
private DSLContext jooq;
|
||||
|
||||
public String getDynamicStyle(String name) {
|
||||
SelectConditionStep<Record1<String>> sql = jooq
|
||||
// @formatter:off
|
||||
.select(T_PROFILE.DYNAMIC_CSS)
|
||||
.from(T_PROFILE)
|
||||
.where(T_PROFILE.USERNAME.eq(name));
|
||||
// @formatter:on
|
||||
LOGGER.trace(sql);
|
||||
String result = sql.fetchOne(T_PROFILE.DYNAMIC_CSS);
|
||||
return result == null ? "" : result;
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package de.jottyfan.timetrack.modules.style;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jotty
|
||||
*
|
||||
*/
|
||||
@Service
|
||||
public class DynamicStyleService {
|
||||
|
||||
@Autowired
|
||||
private DynamicStyleRepository repository;
|
||||
|
||||
public String getDynamicCssOf(String name) {
|
||||
return name == null ? "" : repository.getDynamicStyle(name);
|
||||
}
|
||||
}
|
@ -118,15 +118,10 @@
|
||||
<span class="boldtext" th:text="${done.activity?.name}"></span>
|
||||
</a></td>
|
||||
<td><span th:text="${done.billing.shortcut}" th:class="'billing ' + ${done.billing.csskey}" th:if="${done.billing != null}"></span></td>
|
||||
<td><a class="btn-list" th:href="@{/done/copy/{id}(id=${done.pk})}" title="Aufgabe neu beginnen">
|
||||
<i class="fa fa-copy"></i>
|
||||
</a> <a class="btn-list" th:href="@{/done/edit/{id}(id=${done.pk})}" title="Eintrag bearbeiten">
|
||||
<i class="fa fa-edit"></i>
|
||||
</a> <a class="btn-list" th:href="@{/done/favorize/{id}(id=${done.pk})}" title="als Favorit speichern" th:if="${!done.isFavorite}">
|
||||
<i class="far fa-star golden"></i>
|
||||
</a> <a class="btn-list" th:href="@{/done/unfavorize/{id}(id=${done.pk})}" title="Favoritenstatus entfernen" th:if="${done.isFavorite}">
|
||||
<i class="fas fa-star golden"></i>
|
||||
</a></td>
|
||||
<td><a class="btn-list" th:href="@{/done/copy/{id}(id=${done.pk})}" title="Aufgabe neu beginnen"><i class="fa fa-copy"></i></a>
|
||||
<a class="btn-list" th:href="@{/done/edit/{id}(id=${done.pk})}" title="Eintrag bearbeiten"><i class="fa fa-edit"></i></a>
|
||||
<a class="btn-list" th:href="@{/done/favorize/{id}(id=${done.pk})}" title="als Favorit speichern" th:if="${!done.isFavorite}"><i class="far fa-star golden"></i></a>
|
||||
<a class="btn-list" th:href="@{/done/unfavorize/{id}(id=${done.pk})}" title="Favoritenstatus entfernen" th:if="${done.isFavorite}"><i class="fas fa-star golden"></i></a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
@ -288,11 +283,9 @@
|
||||
<div class="row row-weekday">
|
||||
<div class="col slot_badge" th:each="o : ${slotOffset}"></div>
|
||||
<div class="col slot_badge" th:each="s : ${slots}">
|
||||
<span class="slot_badge_left" th:text="${#temporals.format(s.day, 'dd.MM.')}"> </span>
|
||||
<a th:href="@{/done/slot/{id}(id=${s.id})}" class="slot_badge_middle" th:if="${s.id}">
|
||||
<span class="slot_badge_left" th:text="${#temporals.format(s.day, 'dd.MM.')}"></span><a th:href="@{/done/slot/{id}(id=${s.id})}" class="slot_badge_middle" th:if="${s.id}">
|
||||
<i class="fas fa-pencil"></i>
|
||||
</a>
|
||||
<a th:href="@{/done/slot/add?day={d}(d=${s.day})}" class="slot_badge_middle" th:unless="${s.id}">
|
||||
</a><a th:href="@{/done/slot/add?day={d}(d=${s.day})}" class="slot_badge_middle" th:unless="${s.id}">
|
||||
<i class="fas fa-plus"></i>
|
||||
</a>
|
||||
<span class="slot_badge_middle slot_reason" th:if="${s.reason}" th:text="${s.reason}"></span><span th:class="${s.reason != null ? 'slot_badge_right' : 'slot_badge_right boldy'}"
|
||||
|
@ -10,6 +10,7 @@
|
||||
<link rel="stylesheet" type="text/css" th:href="@{/webjars/font-awesome/6.4.2/css/all.min.css}" />
|
||||
<link rel="stylesheet" type="text/css" th:href="@{/webjars/fullcalendar/5.11.3/main.css}" />
|
||||
<link rel="stylesheet" type="text/css" th:href="@{/css/style.css}">
|
||||
<link rel="stylesheet" type="text/css" th:href="@{/public/dynamicstyle.css}">
|
||||
<link rel="icon" type="image/png" sizes="32x32" th:href="@{/png/favicon/favicon-32x32.png}" />
|
||||
<link rel="icon" type="image/png" sizes="16x16" th:href="@{/png/favicon/favicon-16x16.png}" />
|
||||
|
||||
|
Reference in New Issue
Block a user