Commits

Luke Plant committed 462e72a

Standardised names of URL function names and names in templates

All should end in 'Url'

  • Participants
  • Parent commits 02cb28b

Comments (0)

Files changed (3)

src/Blog/Links.hs

 feedsUrl          = Settings.root_url ++ "feeds/"
 loginUrl          = Settings.root_url ++ "login/"
 
-adminMenuUrl      = Settings.root_url ++ "admin/"
-adminCategories   = Settings.root_url ++ "admin/category/"
-adminPosts        = Settings.root_url ++ "admin/post/"
-adminEditPost p   = Settings.root_url ++ "admin/post/edit/" ++ (show $ P.uid p) ++ "/"
-adminNewPost      = Settings.root_url ++ "admin/post/new/"
+adminMenuUrl       = Settings.root_url ++ "admin/"
+adminCategoriesUrl = Settings.root_url ++ "admin/category/"
+adminPostsUrl      = Settings.root_url ++ "admin/post/"
+adminEditPostUrl p = Settings.root_url ++ "admin/post/edit/" ++ (show $ P.uid p) ++ "/"
+adminNewPostUrl    = Settings.root_url ++ "admin/post/new/"

src/Blog/Views.hs

   return $ Just $ standardResponseTT req $
          (renderf t
           ("pagetitle", "Blog admin - menu")
-          ("newPostLink", Links.adminNewPost)
-          ("postsLink", Links.adminPosts)
-          ("categoriesLink", Links.adminCategories)
+          ("adminNewPostUrl", Links.adminNewPostUrl)
+          ("adminPostsUrl", Links.adminPostsUrl)
+          ("adminCategoriesUrl", Links.adminCategoriesUrl)
          )
 
 adminPosts = undefined

src/templates/admin_menu.st

 $pagestart()$
 <h1>$pagetitle$</h1>
 
-<p><a href="$newPostLink$">Add post</a></p>
-<p><a href="$postsLink$">Edit posts</a></p>
-<p><a href="$categoriesLink$">Edit categories</a></p>
+<p><a href="$adminNewPostUrl$">Add post</a></p>
+<p><a href="$adminPostsUrl$">Edit posts</a></p>
+<p><a href="$adminCategoriesUrl$">Edit categories</a></p>
 
 $pageend()$