scollable tables for smaller screens
This commit is contained in:
parent
61b17bc586
commit
e58851cd3c
@ -360,6 +360,7 @@ defaultMenuLayout menu widget = do
|
|||||||
|
|
||||||
pc <- widgetToPageContent $ do
|
pc <- widgetToPageContent $ do
|
||||||
addStylesheetRemote "https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,800,900"
|
addStylesheetRemote "https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,800,900"
|
||||||
|
addScript $ StaticR js_featureChecker_js
|
||||||
addStylesheet $ StaticR css_fonts_css
|
addStylesheet $ StaticR css_fonts_css
|
||||||
addStylesheet $ StaticR css_icons_css
|
addStylesheet $ StaticR css_icons_css
|
||||||
$(widgetFile "default-layout")
|
$(widgetFile "default-layout")
|
||||||
|
|||||||
@ -77,7 +77,7 @@ getTermShowR = do
|
|||||||
}
|
}
|
||||||
defaultLayout $ do
|
defaultLayout $ do
|
||||||
setTitle "Freigeschaltete Semester"
|
setTitle "Freigeschaltete Semester"
|
||||||
table
|
$(widgetFile "terms")
|
||||||
|
|
||||||
getTermEditR :: Handler Html
|
getTermEditR :: Handler Html
|
||||||
getTermEditR = do
|
getTermEditR = do
|
||||||
|
|||||||
7
static/js/featureChecker.js
Normal file
7
static/js/featureChecker.js
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
window.addEventListener('touchstart', function onFirstTouch() {
|
||||||
|
// we could use a class
|
||||||
|
document.body.classList.add('touch-supported');
|
||||||
|
|
||||||
|
// we only need to know once that a human touched the screen, so we can stop listening now
|
||||||
|
window.removeEventListener('touchstart', onFirstTouch, false);
|
||||||
|
}, false);
|
||||||
@ -1,6 +1,7 @@
|
|||||||
<div .container>
|
<div .container>
|
||||||
<h1>Kursübersicht für Semester #{termToText $ unTermKey tidini}
|
<h1>Kursübersicht für Semester #{termToText $ unTermKey tidini}
|
||||||
^{coursesTable}
|
<div .scrolltable>
|
||||||
|
^{coursesTable}
|
||||||
|
|
||||||
<div .container>
|
<div .container>
|
||||||
<a href=@{CourseEditR}>Neuen Kurs anlegen
|
<a href=@{CourseEditR}>Neuen Kurs anlegen
|
||||||
|
|||||||
@ -97,8 +97,13 @@ h4 {
|
|||||||
}
|
}
|
||||||
table {
|
table {
|
||||||
margin: 21px 0;
|
margin: 21px 0;
|
||||||
/*width: 100%;*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.scrolltable {
|
||||||
|
width: 100%;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
|
||||||
th, td {
|
th, td {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
padding: 0 13px 0 7px;
|
padding: 0 13px 0 7px;
|
||||||
@ -115,17 +120,17 @@ th {
|
|||||||
/* LAYOUT */
|
/* LAYOUT */
|
||||||
.main {
|
.main {
|
||||||
display: flex;
|
display: flex;
|
||||||
padding-right: 5vw;
|
|
||||||
min-height: calc(100vh - var(--header-height));
|
min-height: calc(100vh - var(--header-height));
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.main__content {
|
.main__content {
|
||||||
position: relative;
|
position: relative;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
padding: 0 40px;
|
padding: 0 40px;
|
||||||
padding-right: 0;
|
|
||||||
flex: 1;
|
flex: 1;
|
||||||
z-index: 0;
|
z-index: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
> .container {
|
> .container {
|
||||||
margin: 20px 0;
|
margin: 20px 0;
|
||||||
|
|||||||
5
templates/terms.hamlet
Normal file
5
templates/terms.hamlet
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<div .container>
|
||||||
|
<h1>Semesterübersicht
|
||||||
|
|
||||||
|
<div .scrolltable>
|
||||||
|
^{table}
|
||||||
@ -62,8 +62,9 @@
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
aboveCollapsedNav = true;
|
aboveCollapsedNav = true;
|
||||||
|
console.log(event);
|
||||||
window.setTimeout(function() {
|
window.setTimeout(function() {
|
||||||
if (aboveCollapsedNav) {
|
if (aboveCollapsedNav && !document.body.classList.contains('touch-supported')) {
|
||||||
asideEl.classList.add('pseudo-hover');
|
asideEl.classList.add('pseudo-hover');
|
||||||
}
|
}
|
||||||
}, 430);
|
}, 430);
|
||||||
|
|||||||
@ -1,13 +1,12 @@
|
|||||||
.main__aside {
|
.main__aside {
|
||||||
flex-shrink: 0;
|
|
||||||
background-color: var(--darkbase);
|
background-color: var(--darkbase);
|
||||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
|
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
width: 300px;
|
flex: 0 0 300px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
.main__aside--transitioning {
|
.main__aside--transitioning {
|
||||||
transition: width .2s ease;
|
transition: flex-basis .2s ease;
|
||||||
}
|
}
|
||||||
.main__aside--transitioning .asidenav__box{
|
.main__aside--transitioning .asidenav__box{
|
||||||
transition: opacity .2s ease;
|
transition: opacity .2s ease;
|
||||||
@ -18,6 +17,7 @@
|
|||||||
}
|
}
|
||||||
.main__aside--collapsed {
|
.main__aside--collapsed {
|
||||||
width: 50px;
|
width: 50px;
|
||||||
|
flex-basis: 50px;
|
||||||
|
|
||||||
.asidenav__box-title {
|
.asidenav__box-title {
|
||||||
width: 50px;
|
width: 50px;
|
||||||
@ -72,6 +72,10 @@
|
|||||||
.asidenav__link-label {
|
.asidenav__link-label {
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.asidenav__link-triple {
|
||||||
|
transform: scale(1.2, 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.asidenav__list-item--active {
|
.asidenav__list-item--active {
|
||||||
@ -99,7 +103,7 @@
|
|||||||
|
|
||||||
.asidenav__link-triple {
|
.asidenav__link-triple {
|
||||||
background-color: var(--darkbase);
|
background-color: var(--darkbase);
|
||||||
color: white;
|
color: var(--whitebase);
|
||||||
height: 50px;
|
height: 50px;
|
||||||
width: 50px;
|
width: 50px;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
|||||||
Reference in New Issue
Block a user