do
  mainButton <- case ?member of
                  Nothing -> return buyButton
                  Just m -> do
                    row <- $(queryTuple "SELECT page_no \
                                        \FROM member_reader \
                                        \INNER JOIN reader USING (reader_no) \
                                        \WHERE short_name = 'para-bailar' AND lang = 'es' AND member_no = {memberNumber m}") ?db
                    return $ case row of
                      Nothing -> buyButton
                      Just pageNo -> div ! class_ "button_buy" $ do
                                       a ! href (toValue $ "/reader/es/para-bailar/" ++ show (pageNo :: Int32)) ! class_ "gradient" ! title "Continue Reading" $ do
                                         span ! class_ "button_price" $ "Continue"
                                         span ! class_ "button_text" $ "Reading"
  stdPage ("Learn Spanish Through Fiction - Vocabulink") [] (do
    meta ! name "viewport" ! content "width=device-width, initial-scale=1.0, user-scalable=no"
    preEscapedToMarkup ("<link rel=\"stylesheet\" href=\"//s.vocabulink.com/css/off-the-shelf.css\" media=\"screen, projection\"> \
                        \<link href=\"//netdna.bootstrapcdn.com/font-awesome/3.2.0/css/font-awesome.css\" rel=\"stylesheet\">"::String)) $ do
      section ! id "banner" $ do
        div ! class_ "row" $ do
          div ! id "shelf" ! class_ "one_half" $ do
            img ! alt "book cover" ! width "331" ! height "497" ! src "//s.vocabulink.com/img/reader/es/para-bailar.jpg"
          div ! class_ "one_half last" $ do
            hgroup $ do
              h1 $ "Learn Spanish Through Fiction"
              h2 ! class_ "subheader" $ "Read real everyday Spanish. Learn new words in context. Designed for beginners, written for adults."
            p $ "Learning doesn't have to be boring. Stories have entertained and educated for centuries. This book is a collection of stories that will teach you some of the basics of Spanish."
            p $ "This isn't like any language reader you've seen before. We've designed it by mixing 4 modern accelerated language learning techniques."
            mainButton
      article $ do
        div ! id "main_content" $ do
          section ! id "features" $ do
            div ! class_ "row" $ do
              h2 ! class_ "section_title" $ do
                span $ "Accelerated Learning Features"
              ul $ do
                li ! class_ "one_half" $ do
                  i ! class_ "icon-road icon-4x" $ mempty
                  h4 "Gradual Progression"
                  p "Have you ever tried reading Spanish but just go frustrated and gave up? Our stories start with very simple sentences. Then, gradually over time we introduce new words and new grammar."
                li ! class_ "one_half last" $ do
                  i ! class_ "icon-magic icon-4x" $ mempty
                  h4 "Linkword Mnemonics"
                  p "Instead of staring at a list of vocabulary or writing words out 100 times, wouldn't it be nice to have a trick to remember each word by? We thought so too. That's why we've included mnemonics for each word we introduce you to."
                li ! class_ "one_half" $ do
                  i ! class_ "icon-sort-by-attributes-alt icon-4x" $ mempty
                  h4 "Words Selected by Frequency"
                  p "Why waste time learning words you're rarely, if ever, going to use? We analyzed how frequently words occur in written and spoken Spanish and use only words among the most common 3,000."
                li ! class_ "one_half last" $ do
                  i ! class_ "icon-bar-chart icon-4x" $ mempty
                  h4 "Spaced Repetition"
                  p "Flashcards are great, but we have better technology today. We use a special algorithm to schedule optimal times for you to review each word that you learn. This algorithm adapts to your memory and the difficulty of each word."
 where buyButton = div ! class_ "button_buy" $ do
                     a ! href "/reader/es/para-bailar/1" ! class_ "gradient" ! title "Preview for Free" $ do
                       span ! class_ "button_price" $ "Start"
                       span ! class_ "button_text" $ "Reading"

frontPage = do
  mainButton <- case ?member of
                  Nothing -> return buyButton
                  Just m -> do
                    row <- $(queryTuple "SELECT page_no \
                                        \FROM member_reader \
                                        \INNER JOIN reader USING (reader_no) \
                                        \WHERE short_name = 'para-bailar' AND lang = 'es' AND member_no = {memberNumber m}") ?db
                    return $ case row of
                      Nothing -> buyButton
                      Just pageNo -> div ! class_ "button_buy" $ do
                                       a ! href (toValue $ "/reader/es/para-bailar/" ++ show (pageNo :: Int32)) ! class_ "gradient" ! title "Continue Reading" $ do
                                         span ! class_ "button_price" $ "Continue"
                                         span ! class_ "button_text" $ "Reading"
  stdPage ("Learn Spanish Through Fiction - Vocabulink") [] (do
    meta ! name "viewport" ! content "width=device-width, initial-scale=1.0, user-scalable=no"
    preEscapedToMarkup ("<link rel=\"stylesheet\" href=\"//s.vocabulink.com/css/off-the-shelf.css\" media=\"screen, projection\"> \
                        \<link href=\"//netdna.bootstrapcdn.com/font-awesome/3.2.0/css/font-awesome.css\" rel=\"stylesheet\">"::String)) $ do
      section ! id "banner" $ do
        div ! class_ "row" $ do
          div ! id "shelf" ! class_ "one_half" $ do
            img ! alt "book cover" ! width "331" ! height "497" ! src "//s.vocabulink.com/img/reader/es/para-bailar.jpg"
          div ! class_ "one_half last" $ do
            hgroup $ do
              h1 $ "Learn Spanish Through Fiction"
              h2 ! class_ "subheader" $ "Read real everyday Spanish. Learn new words in context. Designed for beginners, written for adults."
            p $ "Learning doesn't have to be boring. Stories have entertained and educated for centuries. This book is a collection of stories that will teach you some of the basics of Spanish."
            p $ "This isn't like any language reader you've seen before. We've designed it by mixing 4 modern accelerated language learning techniques."
            mainButton
      article $ do
        div ! id "main_content" $ do
          section ! id "features" $ do
            div ! class_ "row" $ do
              h2 ! class_ "section_title" $ do
                span $ "Accelerated Learning Features"
              ul $ do
                li ! class_ "one_half" $ do
                  i ! class_ "icon-road icon-4x" $ mempty
                  h4 "Gradual Progression"
                  p "Have you ever tried reading Spanish but just go frustrated and gave up? Our stories start with very simple sentences. Then, gradually over time we introduce new words and new grammar."
                li ! class_ "one_half last" $ do
                  i ! class_ "icon-magic icon-4x" $ mempty
                  h4 "Linkword Mnemonics"
                  p "Instead of staring at a list of vocabulary or writing words out 100 times, wouldn't it be nice to have a trick to remember each word by? We thought so too. That's why we've included mnemonics for each word we introduce you to."
                li ! class_ "one_half" $ do
                  i ! class_ "icon-sort-by-attributes-alt icon-4x" $ mempty
                  h4 "Words Selected by Frequency"
                  p "Why waste time learning words you're rarely, if ever, going to use? We analyzed how frequently words occur in written and spoken Spanish and use only words among the most common 3,000."
                li ! class_ "one_half last" $ do
                  i ! class_ "icon-bar-chart icon-4x" $ mempty
                  h4 "Spaced Repetition"
                  p "Flashcards are great, but we have better technology today. We use a special algorithm to schedule optimal times for you to review each word that you learn. This algorithm adapts to your memory and the difficulty of each word."
 where buyButton = div ! class_ "button_buy" $ do
                     a ! href "/reader/es/para-bailar/1" ! class_ "gradient" ! title "Preview for Free" $ do
                       span ! class_ "button_price" $ "Start"
                       span ! class_ "button_text" $ "Reading"
frontPage = do
  mainButton <- case ?member of
                  Nothing -> return buyButton
                  Just m -> do
                    row <- $(queryTuple "SELECT page_no \
                                        \FROM member_reader \
                                        \INNER JOIN reader USING (reader_no) \
                                        \WHERE short_name = 'para-bailar' AND lang = 'es' AND member_no = {memberNumber m}") ?db
                    return $ case row of
                      Nothing -> buyButton
                      Just pageNo -> div ! class_ "button_buy" $ do
                                       a ! href (toValue $ "/reader/es/para-bailar/" ++ show (pageNo :: Int32)) ! class_ "gradient" ! title "Continue Reading" $ do
                                         span ! class_ "button_price" $ "Continue"
                                         span ! class_ "button_text" $ "Reading"
  stdPage ("Learn Spanish Through Fiction - Vocabulink") [] (do
    meta ! name "viewport" ! content "width=device-width, initial-scale=1.0, user-scalable=no"
    preEscapedToMarkup ("<link rel=\"stylesheet\" href=\"//s.vocabulink.com/css/off-the-shelf.css\" media=\"screen, projection\"> \
                        \<link href=\"//netdna.bootstrapcdn.com/font-awesome/3.2.0/css/font-awesome.css\" rel=\"stylesheet\">"::String)) $ do
      section ! id "banner" $ do
        div ! class_ "row" $ do
          div ! id "shelf" ! class_ "one_half" $ do
            img ! alt "book cover" ! width "331" ! height "497" ! src "//s.vocabulink.com/img/reader/es/para-bailar.jpg"
          div ! class_ "one_half last" $ do
            hgroup $ do
              h1 $ "Learn Spanish Through Fiction"
              h2 ! class_ "subheader" $ "Read real everyday Spanish. Learn new words in context. Designed for beginners, written for adults."
            p $ "Learning doesn't have to be boring. Stories have entertained and educated for centuries. This book is a collection of stories that will teach you some of the basics of Spanish."
            p $ "This isn't like any language reader you've seen before. We've designed it by mixing 4 modern accelerated language learning techniques."
            mainButton
      article $ do
        div ! id "main_content" $ do
          section ! id "features" $ do
            div ! class_ "row" $ do
              h2 ! class_ "section_title" $ do
                span $ "Accelerated Learning Features"
              ul $ do
                li ! class_ "one_half" $ do
                  i ! class_ "icon-road icon-4x" $ mempty
                  h4 "Gradual Progression"
                  p "Have you ever tried reading Spanish but just go frustrated and gave up? Our stories start with very simple sentences. Then, gradually over time we introduce new words and new grammar."
                li ! class_ "one_half last" $ do
                  i ! class_ "icon-magic icon-4x" $ mempty
                  h4 "Linkword Mnemonics"
                  p "Instead of staring at a list of vocabulary or writing words out 100 times, wouldn't it be nice to have a trick to remember each word by? We thought so too. That's why we've included mnemonics for each word we introduce you to."
                li ! class_ "one_half" $ do
                  i ! class_ "icon-sort-by-attributes-alt icon-4x" $ mempty
                  h4 "Words Selected by Frequency"
                  p "Why waste time learning words you're rarely, if ever, going to use? We analyzed how frequently words occur in written and spoken Spanish and use only words among the most common 3,000."
                li ! class_ "one_half last" $ do
                  i ! class_ "icon-bar-chart icon-4x" $ mempty
                  h4 "Spaced Repetition"
                  p "Flashcards are great, but we have better technology today. We use a special algorithm to schedule optimal times for you to review each word that you learn. This algorithm adapts to your memory and the difficulty of each word."
 where buyButton = div ! class_ "button_buy" $ do
                     a ! href "/reader/es/para-bailar/1" ! class_ "gradient" ! title "Preview for Free" $ do
                       span ! class_ "button_price" $ "Start"
                       span ! class_ "button_text" $ "Reading"