Skip to content

Commit 36a8058

Browse files
Resolve merge conflicts with dev
2 parents c0a2f93 + 8c935ac commit 36a8058

File tree

3 files changed

+58
-33
lines changed

3 files changed

+58
-33
lines changed

src/jsMain/kotlin/com/github/stephenhamiltonc/timecard_web/page/credits/CreditCard.kt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ import io.kvision.html.link
88
import io.kvision.panel.SimplePanel
99

1010
// Heheh, like the play on words?
11-
class CreditCard(project: String, author: String? = null, license: String, website: String) : SimplePanel() {
11+
class CreditCard(data: CreditData) : SimplePanel() {
1212
init {
13-
card(title = project) {
14-
if(author != null) {
15-
+"Written by $author"
13+
card(title = data.project) {
14+
if(data.author != null) {
15+
+"Written by ${data.author}"
1616
br()
1717
}
1818

19-
+"Protected under the $license license"
19+
+"Protected under the ${data.license} license"
2020
br()
21-
link(label = "Source Code", url = website, className = "btn btn-outline-primary") {
21+
link(label = "Source Code", url = data.website, className = "btn btn-outline-primary") {
2222
target = "_blank"
2323
setAttribute("rel", "noopener noreferrer")
2424

@@ -28,6 +28,6 @@ class CreditCard(project: String, author: String? = null, license: String, websi
2828
}
2929
}
3030

31-
fun Container.creditCard(project: String, author: String? = null, license: String, website: String): CreditCard {
32-
return CreditCard(project, author, license, website).also { add(it) }
31+
fun Container.creditCard(data: CreditData): CreditCard {
32+
return CreditCard(data).also { add(it) }
3333
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package com.github.stephenhamiltonc.timecard_web.page.credits
2+
3+
data class CreditData(
4+
val project: String,
5+
val author: String? = null,
6+
val license: String,
7+
val website: String
8+
)

src/jsMain/kotlin/com/github/stephenhamiltonc/timecard_web/page/credits/CreditsPage.kt

Lines changed: 42 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,48 @@ class CreditsPage : SimplePanel() {
88
init {
99
marginTop = 12.px
1010

11-
creditCard(
12-
project = "timecard-web",
13-
author = "Stephen Hamilton",
14-
license = "GPL-3.0",
15-
website = "https://github.com/Stephen-Hamilton-C/timecard-web",
16-
)
17-
div(className = "mt-3")
18-
creditCard(
19-
project = "timecard-lib",
20-
author = "Stephen Hamilton",
21-
license = "GPL-3.0",
22-
website = "https://github.com/Stephen-Hamilton-C/timecard-lib",
23-
)
24-
div(className = "mt-3")
25-
creditCard(
26-
project = "kotlinx.serialization",
27-
license = "Apache-2.0",
28-
website = "https://github.com/Kotlin/kotlinx.serialization"
29-
)
30-
div(className = "mt-3")
31-
creditCard(
32-
project = "KVision",
33-
author = "Robert Jaros",
34-
license = "MIT",
35-
website = "https://github.com/rjaros/kvision"
11+
val credits = listOf(
12+
CreditData(
13+
project = "timecard-web",
14+
author = "Stephen Hamilton",
15+
license = "GPL-3.0",
16+
website = "https://github.com/Stephen-Hamilton-C/timecard-web",
17+
),
18+
CreditData(
19+
project = "timecard-lib",
20+
author = "Stephen Hamilton",
21+
license = "GPL-3.0",
22+
website = "https://github.com/Stephen-Hamilton-C/timecard-lib",
23+
),
24+
CreditData(
25+
project = "kotlinx.serialization",
26+
author = "Jetbrains",
27+
license = "Apache-2.0",
28+
website = "https://github.com/Kotlin/kotlinx.serialization",
29+
),
30+
CreditData(
31+
project = "KVision",
32+
author = "Robert Jaros",
33+
license = "MIT",
34+
website = "https://github.com/rjaros/kvision",
35+
),
36+
CreditData(
37+
project = "Bootswatch Darkly",
38+
author = "Thomas Park",
39+
license = "MIT",
40+
website = "https://github.com/thomaspark/bootswatch/",
41+
),
42+
CreditData(
43+
project = "Bootswatch Flatly",
44+
author = "Thomas Park",
45+
license = "MIT",
46+
website = "https://github.com/thomaspark/bootswatch/"
47+
),
3648
)
49+
50+
credits.forEach { data ->
51+
creditCard(data)
52+
div(className = "mt-3")
53+
}
3754
}
3855
}

0 commit comments

Comments
 (0)