Skip to content
This repository was archived by the owner on Apr 2, 2019. It is now read-only.

Commit 1c9fcc2

Browse files
authored
Merge pull request #23 from UdashFramework/layout-update
Layout update
2 parents 65ea426 + 79c7653 commit 1c9fcc2

File tree

102 files changed

+1097
-704
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+1097
-704
lines changed
Lines changed: 9 additions & 0 deletions
Loading

commons/src/main/scala/io/udash/web/commons/components/Footer.scala

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,29 @@ import scalacss.ScalatagsCss._
1010
import scalatags.JsDom.all._
1111

1212
object Footer {
13-
private lazy val template = footer(FooterStyles.footer)(
13+
private val styles = FooterStyles.get
14+
private lazy val template = footer(styles.footer)(
1415
div(GlobalStyles.body)(
15-
div(FooterStyles.footerInner)(
16-
a(FooterStyles.footerLogo, href := ExternalUrls.homepage)(
16+
div(styles.footerInner)(
17+
a(styles.footerLogo, href := ExternalUrls.homepage)(
1718
Image("udash_logo.png", "Udash Framework", GlobalStyles.block)
1819
),
19-
div(FooterStyles.footerLinks)(
20-
p(FooterStyles.footerMore)("See more"),
20+
div(styles.footerLinks)(
21+
p(styles.footerMore)("See more"),
2122
ul(
22-
li(FooterStyles.navItem)(
23+
li(styles.navItem)(
2324
a(href := ExternalUrls.udashDemos, target := "_blank", GlobalStyles.underlineLink)("Github demo")
2425
),
2526
// TODO: unccoment
2627
/*li(UdashGuideStyles.linkWrapper)(
2728
a(href := ExternalUrls.todoMvc, target := "_blank", UdashGuideStyles.link)("Todomvc.com demo")
2829
),*/
29-
li(FooterStyles.navItem)(
30+
li(styles.navItem)(
3031
a(href := ExternalUrls.stackoverflow, target := "_blank", GlobalStyles.underlineLink)("StackOverflow questions")
3132
)
3233
)
3334
),
34-
p(FooterStyles.footerCopyrights)("Proudly made by ", a(FooterStyles.footerAvsystemLink, href := ExternalUrls.avsystem, target := "_blank")("AVSystem"))
35+
p(styles.footerCopyrights)("Proudly made by ", a(styles.footerAvsystemLink, href := ExternalUrls.avsystem, target := "_blank")("AVSystem"))
3536
)
3637
)
3738
).render

commons/src/main/scala/io/udash/web/commons/components/HeaderButtons.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ trait HeaderButtons {
1313
def buttons = {
1414
div(buttonStyles.headerRight)(
1515
ul(buttonStyles.headerSocial)(
16+
li(buttonStyles.headerSocialItem)(
17+
a(href := ExternalUrls.udashGitter, buttonStyles.headerSocialLink, target := "_blank")(
18+
SVG("gitter.svg#gitter", Size(124, 127))
19+
)
20+
),
21+
1622
li(buttonStyles.headerSocialItem)(
1723
a(href := ExternalUrls.udashGithub, buttonStyles.headerSocialLink, target := "_blank")(
1824
SVG("github.svg#github", Size(33, 32))

commons/src/main/scala/io/udash/web/commons/components/HeaderNav.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ trait HeaderNav {
1616

1717
def navigation(items: Seq[NavItem]): Element =
1818
nav(navStyles.headerNav)(
19-
ul(
19+
ul(navStyles.headerLinkList)(
2020
items.map(item =>
2121
li(navStyles.headerLinkWrapper)(
2222
a(href := item.url, navStyles.headerLink)(item.title)

commons/src/main/scala/io/udash/web/commons/config/ExternalUrls.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ package io.udash.web.commons.config
44
* Created by malchik on 2016-04-07.
55
*/
66
object ExternalUrls {
7+
val udashGitter = "https://gitter.im/UdashFramework/udash-core?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge"
78
val udashGithub = "https://github.com/UdashFramework/"
89
val udashDemos = "https://github.com/UdashFramework/udash-demos"
910
val stackoverflow = "http://stackoverflow.com/questions/tagged/udash"
@@ -13,5 +14,5 @@ object ExternalUrls {
1314
val scalajs = "https://www.scala-js.org/"
1415

1516
val releases = "https://github.com/UdashFramework/udash-core/releases"
16-
val license = "https://guide.udash.io/#/license"
17+
val license = "http://guide.udash.io/#/license"
1718
}

commons/src/main/scala/io/udash/web/commons/styles/GlobalStyles.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import scala.language.postfixOps
77
import scalacss.Attr
88
import scalacss.Defaults._
99

10-
object GlobalStyles extends StyleSheet.Inline {
10+
object GlobalStyles extends UdashStylesheet {
1111
import dsl._
1212

1313
val clearfix = style(
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package io.udash.web.commons.styles
2+
3+
import io.udash.wrappers.jquery.jQ
4+
5+
import scala.collection.mutable
6+
import scalacss.Defaults._
7+
import scalacss.mutable.StyleSheet.{Inline => ISS}
8+
import scalatags.JsDom.all._
9+
import scalatags.JsDom.tags2.style
10+
11+
/**
12+
* Created by malchik on 2015-12-10.
13+
*/
14+
object StyleRegistry {
15+
val styleSheet = style(`type` := "text/css").render
16+
17+
private val jqStyleSheet = jQ(styleSheet)
18+
private val registrations: mutable.HashSet[ISS] = mutable.HashSet[ISS]()
19+
20+
private[styles] def register(ss: ISS*): Unit = {
21+
ss.foreach( s => {
22+
registrations += s
23+
jqStyleSheet.append(s.render[String])
24+
})
25+
}
26+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package io.udash.web.commons.styles
2+
3+
import scalacss.Defaults._
4+
5+
/**
6+
* Created by malchik on 2016-04-29.
7+
*/
8+
9+
/**
10+
* Use "get" to register and get static styles object
11+
* Every stylesheet extends UMPStylesheet must override type member T
12+
*/
13+
trait UdashStylesheet extends StyleSheet.Inline {
14+
type T = this.type
15+
private lazy val styleSheet: T = {
16+
StyleRegistry.register(this)
17+
this
18+
}
19+
20+
/**
21+
* Dirty hack fixes the scala plugin bug
22+
* @return
23+
*/
24+
def get = styleSheet
25+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package io.udash.web.commons.styles.attributes
2+
3+
/**
4+
* Created by malchik on 2016-05-19.
5+
*/
6+
object Attributes {
7+
/**
8+
* States
9+
*/
10+
val Hidden = "hidden"
11+
12+
val Active = "active"
13+
14+
val Disabled = "disabled"
15+
16+
val Enabled = "enabled"
17+
18+
val Checked = "checked"
19+
20+
val Show = "show"
21+
22+
val Expanded = "expanded"
23+
24+
val State = "state"
25+
26+
val Pinned = "pinned"
27+
28+
/**
29+
* Generate attribute data-attr
30+
* @param attr name of attribute
31+
* @return attribute data-attr
32+
*/
33+
def data(attr: String) = s"data-$attr"
34+
}

commons/src/main/scala/io/udash/web/commons/styles/components/FooterStyles.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package io.udash.web.commons.styles.components
22

3-
import io.udash.web.commons.styles.GlobalStyles
3+
import io.udash.web.commons.styles.{GlobalStyles, UdashStylesheet}
44
import io.udash.web.commons.styles.utils._
55

66
import scala.language.postfixOps
@@ -9,7 +9,7 @@ import scalacss.Defaults._
99
/**
1010
* Created by malchik on 2016-04-04.
1111
*/
12-
object FooterStyles extends StyleSheet.Inline {
12+
object FooterStyles extends UdashStylesheet {
1313
import dsl._
1414

1515
val footer = style(

0 commit comments

Comments
 (0)