Commits

John Lenz committed cd64ff7

Add a check new form button to the navbar (fixes #3)

  • Participants
  • Parent commits 5c14b72

Comments (0)

Files changed (4)

File messages/en.msg

 Sent: Message Sent
 InPager folder@Text: #{folder} in Pager
 ViewInPager: View search results in pager
+CheckNew: Check New

File src/Foundation.hs

                           addStylesheet $ StaticR css_bootstrap_responsive_min_css
                           addScript $ StaticR js_jquery_1_9_1_min_js
                           addScript $ StaticR js_bootstrap_min_js
+
+                          let newFrm extra = do (_,x) <- mreq hiddenField "" $ Just ("new" :: String)
+                                                return (FormMissing, [whamlet|#{extra} ^{fvInput x}|])
+                          (newWidget,newEnctype) <- lift $ generateFormPost newFrm
+
                           $(widgetFile "default-layout")
 
                   hamletToRepHtml $(hamletFile "templates/default-layout-wrapper.hamlet")

File templates/default-layout.cassius

 footer
     text-align: center
     font-size: small
+#checknewbutton
+    color: rgb(153, 153, 153)
+    text-decoration: none
+    text-shadow: 0px -1px 0px rgba(0,0,0,0.25)
+#checknewbutton:hover
+    color: rgb(242, 242, 242)

File templates/default-layout.hamlet

                               <a href=@{ThreadPagerR (snd folder)}>_{MsgInPager (fst folder)}
           <ul .nav .pull-right>
             <li>
-              <a href=@{ComposeR}>_{MsgCompose}
+                <a href=@{ComposeR}>_{MsgCompose}
             <li>
-              <a href=@{RawCommandR}>_{MsgRaw}
+                <form .navbar-form method=post enctype=#{newEnctype} action=@{RawCommandR}>
+                    ^{newWidget}
+                    <button type=submit .btn .btn-link #checknewbutton>_{MsgCheckNew}
             <li>
-              <a href=@{AuthR LogoutR}>_{MsgLogout}
+                <a href=@{RawCommandR}>_{MsgRaw}
+            <li>
+                <a href=@{AuthR LogoutR}>_{MsgLogout}
 
 <div .container>
   $maybe msg <- mmsg