Commits

John Lenz  committed 5c14b72

Update navbar to display folders in a menu. Also, move search box into
the responsive dropdown and add links to folders in the pager.

Fixes #1

  • Participants
  • Parent commits 9a4abd2

Comments (0)

Files changed (3)

File messages/en.msg

 Compose: Compose
 Raw: Raw Command
 Password: Password
+Folders: Folders
 Login: Login
 Logout: Logout
 Date: Date
 Send: Send
 ExtraHeader: Extra Email Headers
 Sent: Message Sent
+InPager folder@Text: #{folder} in Pager
 ViewInPager: View search results in pager

File src/Foundation.hs

 import NotmuchCmd (ThreadID, MessageID)
 import Control.Applicative
 import Blaze.ByteString.Builder.Char.Utf8 (fromText)
+import Data.Text (Text)
 import qualified Crypto.PasswordStore as PS
 import qualified Data.ByteString as B
 import qualified Data.Text as T

File templates/default-layout.hamlet

   <div .navbar-inner>
     <div .container>
       <a .brand href=@{HomeR}>Notmuch
-      <ul .nav>
-        <li>
-          <form .navbar-search method=post action="@{SearchPostR}">
-            <input type=text .search-query name=q placeholder=Search>
       <a .btn .btn-navbar data-toggle="collapse" data-target=".nav-collapse">
           <span .icon-bar>
           <span .icon-bar>
           <span .icon-bar>
       <div .nav-collapse .collapse>
           <ul .nav>
-              $forall folder <- folders
-                <li>
-                  <a href=@{SearchR (snd folder)}>#{fst folder}
+              <li>
+                  <form .navbar-search method=post action="@{SearchPostR}">
+                      <input type=text .search-query name=q placeholder=Search>
+              <li .dropdown>
+                  <a .dropdown-toggle data-toggle="dropdown" data-target="#">_{MsgFolders}
+                      <b .caret>
+                  <ul .dropdown-menu>
+                      $forall folder <- folders
+                          $if not (snd folder == snd (head folders))
+                              <li .divider>
+                          <li>
+                              <a href=@{SearchR (snd folder)}>#{fst folder}
+                          <li>
+                              <a href=@{ThreadPagerR (snd folder)}>_{MsgInPager (fst folder)}
           <ul .nav .pull-right>
             <li>
               <a href=@{ComposeR}>_{MsgCompose}