created blog.scss, added link to blogs/{user}

Later we will list all posts of a user under the route blogs/{user}
This commit is contained in:
Dario Bösch
2015-05-22 14:04:00 +02:00
parent 261aeca300
commit db77c4024d
7 changed files with 87 additions and 50 deletions

View File

@@ -119,7 +119,7 @@ configure_web (a_api: CMS_API; a_node_api: CMS_BLOG_API; a_router: WSF_ROUTER)
a_router.map_with_request_methods (l_uri_mapping, a_router.methods_get)
-- We can add a page number after /blogs/ to get older posts
a_router.handle_with_request_methods ("/blogs/{page}", l_blog_handler, a_router.methods_get)
a_router.handle_with_request_methods ("/blogs/page/{page}", l_blog_handler, a_router.methods_get)
end

View File

@@ -102,7 +102,7 @@ feature -- HTTP Methods
if attached node_api.blogs_order_created_desc_limited (entries_per_page, (page_number-1) * entries_per_page) as lst then
-- List all posts of the blog
s.append ("<ul class=%"cms-blog-nodes%">%N")
s.append ("<ul class=%"cms_blog_nodes%">%N")
across
lst as ic
loop
@@ -120,11 +120,13 @@ feature -- HTTP Methods
-- Output the author of the post
if attached n.author as l_author then
s.append ("by ")
s.append (l_author.name)
s.append ("<a class=%"blog_user_link%" href=%"/blog/user/" + l_author.id.out + "%">" + l_author.name + "</a>")
end
-- Output the title of the post as a link (to the detail page)
s.append ("<span class=%"blog_title%">")
s.append (l_page.link (lnk.title, lnk.location, Void))
s.append ("</span>")
-- Output the summary of the post and a more link to the detail page
if attached n.summary as l_summary then
@@ -151,7 +153,7 @@ feature -- HTTP Methods
-- If exist older posts show link to next page
if page_number < pages then
tmp := page_number + 1
s.append (" <a class=%"older_posts%" href=%"/blogs/" + tmp.out + "%"><< Older Posts</a> ")
s.append (" <a class=%"blog_older_posts%" href=%"/blogs/page/" + tmp.out + "%"><< Older Posts</a> ")
end
-- Delmiter
@@ -162,7 +164,7 @@ feature -- HTTP Methods
-- If exist newer posts show link to previous page
if page_number > 1 then
tmp := page_number -1
s.append (" <a class=%"newer_posts%" href=%"/blogs/" + tmp.out + "%">Newer Posts >></a> ")
s.append (" <a class=%"blog_newer_posts%" href=%"/blogs/page/" + tmp.out + "%">Newer Posts >></a> ")
end
s.append ("</div>")

View File

@@ -0,0 +1,25 @@
ul.cms_blog_nodes {
padding: 0;
margin: 0;
}
ul.cms_blog_nodes li.cms_type_blog {
list-style: none;
display: block;
margin-top: 20px;
padding-bottom: 20px;
border-bottom: 1px dotted black;
}
ul.cms_blog_nodes li.cms_type_blog .blog_title a {
color: black;
font-size: 18px;
text-decoration: none;
display: block;
margin: 6px 0;
}
ul.cms_blog_nodes li.cms_type_blog .blog_title a:hover {
color: #999;
}
ul.cms_blog_nodes li.cms_type_blog .blog_list_summary a {
margin-top: 20px;
display: block;
}

View File

@@ -3,49 +3,15 @@ ul.cms-nodes {
padding: 3px 3px 3px 3px;
border: solid 1px #ccc;
}
.cms-nodes li.cms_type_page, .cms-nodes li.cms_type_blog {
ul.cms-nodes li {
border-top: dotted 1px #ccc;
}
li.cms_type_page a::before {
content: "[page] ";
}
.cms-nodes li.cms_type_blog a::before {
content: "[blog] ";
}
ul.cms-nodes li:first-child {
border-top: none;
}
.summary{
margin-top:20px;
font-weight:bold;
ul.cms-nodes li.cms_type_page a::before {
content: "[page] ";
}
.cms-blog-nodes{
padding:0;
margin:0;
}
.cms-blog-nodes li{
list-style: none;
display: block;
margin-top:20px;
padding-bottom:20px;
border-bottom:1px dotted black;
}
.cms-blog-nodes li > a{
color:black;
font-size:18px;
text-decoration: none;
display:block;
margin:6px 0;
}
.cms-blog-nodes li > a:hover{
color:#999;
}
.blog_list_summary a{
margin-top:20px;
display:block;
ul.cms-nodes li.cms_type_blog a::before {
content: "[blog] ";
}

View File

@@ -0,0 +1,30 @@
ul.cms_blog_nodes{
padding:0;
margin:0;
li.cms_type_blog{
list-style: none;
display: block;
margin-top:20px;
padding-bottom:20px;
border-bottom:1px dotted black;
.blog_title a{
color:black;
font-size:18px;
text-decoration: none;
display:block;
margin:6px 0;
&:hover{
color:#999;
}
}
.blog_list_summary a{
margin-top:20px;
display:block;
}
}
}

View File

@@ -1,14 +1,24 @@
ul.cms-nodes {
list-style-type: none;
padding: 3px 3px 3px 3px;
border: solid 1px #ccc;
}
li.cms_type_page {
a::before {
li{
border-top: dotted 1px #ccc;
&:first-child {
border-top: none;
}
}
li.cms_type_page a::before {
content: "[page] ";
}
border-top: dotted 1px #ccc;
&:first-child {
border-top: none;
li.cms_type_blog a::before {
content: "[blog] ";
}
}

View File

@@ -6,6 +6,10 @@
<!-- EWF CMS -->
<link rel="stylesheet" href="{$site_url/}/theme/css/style.css">
<link rel="stylesheet" href="{$site_url/}/theme/css/node.css">
<!-- CMS Blog Module -->
<link rel="stylesheet" href="{$site_url/}/theme/css/blog.css">
<script src="{$site_url/}/theme/js/jquery-1.10.2.min.js"></script>
<script src="{$site_url/}/theme/js/roc_auth.js"></script>