aboutsummaryrefslogtreecommitdiff
path: root/webgui
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2016-02-24 15:33:15 +0000
committerGregor Kleen <gkleen@yggdrasil.li>2016-02-24 15:33:15 +0000
commitd687710cb8f5a5ceb605d9859cd8ba76fb2c45a0 (patch)
tree4e3245ad820c769187615ae95b9f177d24bfc9dc /webgui
parentc09c2786d0654f144dab103292c47411ff1afa9a (diff)
downloadthermoprint-d687710cb8f5a5ceb605d9859cd8ba76fb2c45a0.tar
thermoprint-d687710cb8f5a5ceb605d9859cd8ba76fb2c45a0.tar.gz
thermoprint-d687710cb8f5a5ceb605d9859cd8ba76fb2c45a0.tar.bz2
thermoprint-d687710cb8f5a5ceb605d9859cd8ba76fb2c45a0.tar.xz
thermoprint-d687710cb8f5a5ceb605d9859cd8ba76fb2c45a0.zip
Style tweaks
Diffstat (limited to 'webgui')
-rw-r--r--webgui/data/index.html63
-rw-r--r--webgui/data/style.css8
-rw-r--r--webgui/src/Main.hs4
3 files changed, 35 insertions, 40 deletions
diff --git a/webgui/data/index.html b/webgui/data/index.html
index af780bd..79e7bc2 100644
--- a/webgui/data/index.html
+++ b/webgui/data/index.html
@@ -17,54 +17,45 @@
17 <div class="tabs"> 17 <div class="tabs">
18 <ul class="tab-links"> 18 <ul class="tab-links">
19 <li class="active"><a href="#editor">Editor</a></li> 19 <li class="active"><a href="#editor">Editor</a></li>
20 <li><a href="#drafts">Drafts</a></li>
20 <li><a href="#queue">Queue</a></li> 21 <li><a href="#queue">Queue</a></li>
21 <li id="errors-tab" style="display:none;"><a href="#errors">Errors</a></li> 22 <li id="errors-tab" style="display:none;"><a href="#errors">Errors</a></li>
22 </ul> 23 </ul>
23 24
24 <div class="tab-content"> 25 <div class="tab-content">
25 <div class="tab active" id="editor"> 26 <div class="tab active" id="editor">
26 <div class="table" style="width:100%"> 27 <!-- <label id="titleLabel" for="editorTitle">Title</label> -->
28 <input id="editorTitle" />
29 <textarea id="editorText"></textarea>
30 <span id="bbcodeStatus"></span>
31 <span id="editorStatus">Not connected to server</span>
32 <div class="table">
27 <div class="tr"> 33 <div class="tr">
28 <h1 class="tc">Current Draft</h1> 34 <div class="editorButtonContainer tc">
29 <h1 class="tc">Saved Drafts</h1> 35 <button class="editorButton" id="saveButton">Save</button>
30 </div>
31 <div class="tr">
32 <div id="currentDraft" class="tc">
33 <!-- <label id="titleLabel" for="editorTitle">Title</label> -->
34 <input id="editorTitle" />
35 <textarea id="editorText"></textarea>
36 <span id="bbcodeStatus"></span>
37 <span id="editorStatus">Not connected to server</span>
38 <div class="table">
39 <div class="tr">
40 <div class="editorButtonContainer tc">
41 <button class="editorButton" id="saveButton">Save</button>
42 </div>
43 <div class="editorButtonContainer tc">
44 <button class="editorButton" id="printButton">Print</button>
45 </div>
46 <div class="editorButtonContainer tc">
47 <button class="editorButton" id="discardButton">Discard</button>
48 </div>
49 </div>
50 </div>
51 </div> 36 </div>
52 <div class="tc" style="text-align:center;"> 37 <div class="editorButtonContainer tc">
53 <input id="allowDeletion" type="checkbox" /><label for="allowDeletion">Allow Deletion</label> 38 <button class="editorButton" id="printButton">Print</button>
54 <table id="draftList"> 39 </div>
55 <thead> 40 <div class="editorButtonContainer tc">
56 <tr> 41 <button class="editorButton" id="discardButton">Discard</button>
57 <td>Id</td>
58 <td>Title</td>
59 <td>Actions</td>
60 </tr>
61 </thead>
62 <tbody id="draftListBody"></tbody>
63 </table>
64 </div> 42 </div>
65 </div> 43 </div>
66 </div> 44 </div>
67 </div> 45 </div>
46 <div class="tab" id="drafts" style="text-align:center;">
47 <table style="width:100%;" id="draftList">
48 <thead>
49 <tr>
50 <td style="width:5em;">Id</td>
51 <td>Title</td>
52 <td style="width:12em;">Actions</td>
53 </tr>
54 </thead>
55 <tbody id="draftListBody"></tbody>
56 </table>
57 <input id="allowDeletion" type="checkbox" /><label for="allowDeletion">Allow Deletion</label>
58 </div>
68 59
69 <div class="tab" id="queue"> 60 <div class="tab" id="queue">
70 Blub. 61 Blub.
diff --git a/webgui/data/style.css b/webgui/data/style.css
index 53ddb7a..7520e42 100644
--- a/webgui/data/style.css
+++ b/webgui/data/style.css
@@ -30,10 +30,10 @@ thead td {
30 text-align:center; 30 text-align:center;
31} 31}
32 32
33thead tr:last-child { 33thead tr:last-child td {
34 margin:0 0 0.125em 0;
34 padding-bottom:0.125em; 35 padding-bottom:0.125em;
35 border-bottom:1px solid #ddd; 36 border-bottom:1px solid #ddd;
36 margin-bottom:0.125em;
37} 37}
38 38
39.editorButtonContainer { 39.editorButtonContainer {
@@ -79,6 +79,10 @@ thead tr:last-child {
79 color:#c00000; 79 color:#c00000;
80} 80}
81 81
82#draftListBody button {
83 width:6em;
84}
85
82/*----- Tabs -----*/ 86/*----- Tabs -----*/
83.tabs { 87.tabs {
84 display:block; 88 display:block;
diff --git a/webgui/src/Main.hs b/webgui/src/Main.hs
index 44bcb88..537dcf1 100644
--- a/webgui/src/Main.hs
+++ b/webgui/src/Main.hs
@@ -154,7 +154,7 @@ setup Config{..} window (split -> (socketErr, dataUpdate)) = void $ do
154 on UI.valueChange text $ \str -> modifyStatus (\x -> x { ePrintout = bbcode $ T.pack str }) 154 on UI.valueChange text $ \str -> modifyStatus (\x -> x { ePrintout = bbcode $ T.pack str })
155 155
156 return title # sink UI.value (fromMaybe "" . eTitle <$> editorStatus) 156 return title # sink UI.value (fromMaybe "" . eTitle <$> editorStatus)
157 return text # sink UI.text (eText <$> editorStatus) 157 return text # sink UI.value (eText <$> editorStatus)
158 return status # sink TP.text (toStatusString <$> editorStatus) 158 return status # sink TP.text (toStatusString <$> editorStatus)
159 return bbcodeStatus # sink TP.text (toStatusString' . ePrintout <$> editorStatus) 159 return bbcodeStatus # sink TP.text (toStatusString' . ePrintout <$> editorStatus)
160 160
@@ -209,7 +209,7 @@ setup Config{..} window (split -> (socketErr, dataUpdate)) = void $ do
209 toTable :: Map DraftId (Maybe DraftTitle) -> UI [Element] 209 toTable :: Map DraftId (Maybe DraftTitle) -> UI [Element]
210 toTable = mapM toLine . Map.toList 210 toTable = mapM toLine . Map.toList
211 211
212 toLine (id@(show -> tId), fromMaybe "" . fmap T.unpack -> title) = do 212 toLine (id@(DraftId (show -> tId)), fromMaybe "" . fmap T.unpack -> title) = do
213 id' <- UI.td # set TP.text tId 213 id' <- UI.td # set TP.text tId
214 title' <- UI.td # set TP.text title 214 title' <- UI.td # set TP.text title
215 delete <- UI.button 215 delete <- UI.button