Added feed aggregation module.

Redesigned the CMS_BLOCK system,
   - added condition attribute. It can be set via configuration file
     with
     [blocks]
      {blockid}.region={region_name}
      {blockid}.conditions[]=is_front
      {blockid}.conditions[]=path:location-path/foo/bar
   - For backward compatibility, the CMS will check only conditions for block name prefixed by "?".
Improved the configuration library to support list and table properties.
Updated theme for now, to include the feed examples.
Added "cache" classes, to ease caching of html output for instance. (TODO: improve by providing a cache manager).
This commit is contained in:
2015-10-08 13:56:31 +02:00
parent abebd00a4f
commit 463105f29f
32 changed files with 1504 additions and 108 deletions

View File

@@ -93,7 +93,7 @@ feature -- Hooks
block_list: ITERABLE [like {CMS_BLOCK}.name]
do
Result := <<"demo-info">>
Result := <<"?demo-info">>
end
get_block_view (a_block_id: READABLE_STRING_8; a_response: CMS_RESPONSE)
@@ -103,8 +103,8 @@ feature -- Hooks
m: CMS_MENU
lnk: CMS_LOCAL_LINK
do
if a_block_id.is_case_insensitive_equal_general ("demo-info") then
if a_response.request.request_uri.starts_with ("/demo/") then
if a_block_id.same_string ("demo-info") then
if a_response.location.starts_with_general ("demo/") then
create m.make_with_title (a_block_id, "Demo", 2)
create lnk.make ("demo: abc", "demo/abc")
m.extend (lnk)

View File

@@ -20,7 +20,7 @@ smtp=localhost:25
# Default is "on"
# for each module, this can be overwritten with
# module_name= on or off
*=off
*=all
admin=on
auth=on
basic_auth=on
@@ -33,9 +33,17 @@ openid=on
[blocks]
#navigation.region=sidebar_first
feed__bertrandmeyer.region=content
feed__eiffelroom.region=content
feed__bertrandmeyer.condition=is_front
feed.eiffel.region=feed_eiffel
feed.eiffel.condition=is_front
feed.forum.region=feed_forum
feed.forum.condition=is_front
feed.stackoverflow.region=feed_stackoverflow
feed.stackoverflow.condition=is_front
#management.condition=is_front
#navigation.condition=is_front
[admin]
# CMS Installation, are accessible by "all", "none" or uppon "permission". (default is none)

View File

@@ -0,0 +1,25 @@
{
"ids": ["eiffel", "forum", "stackoverflow"],
"feeds": {
"eiffel": {
"title": "Eiffel related posts.",
"expiration": "21600",
"locations": [
"https://bertrandmeyer.com/feed/",
"https://room.eiffel.com/blog/feed"
]
, "categories": ["Eiffel"]
,"option_description": "disabled"
},
"forum": {
"title": "Eiffel Users Group",
"expiration": "43200",
"location": "https://groups.google.com/forum/feed/eiffel-users/msgs/atom.xml?num=15"
},
"stackoverflow": {
"title": "Test",
"expiration": "3600",
"location": "http://stackoverflow.com/feeds/tag?tagnames=eiffel&sort=newest"
}
}
}

View File

@@ -0,0 +1,49 @@
div.feed ul {
list-style: none;
position: relative;
width: 99%;
}
div.feed li {
/* border-top: solid 1px #ddd; */
margin-bottom: 5px;
}
div.feed li a {
font-weight: bold;
}
div.feed li .date {
font-weight: bold;
font-size: small;
}
div.feed li .category {
margin-left: 20px;
font-size: 8px;
height: 9px;
overflow: hidden;
color: #999;
}
div.feed li .description {
margin-left: 20px;
font-size: small;
height: 18px;
overflow: hidden;
color: #999;
}
div.feed li:hover {
margin-bottom: 23px;
}
div.feed li:hover .description {
position: absolute;
height: auto;
overflow-y: scroll;
overflow-x: scroll;
color: #000;
background-color: #fff;
border: solid 1px #000;
z-index: 10;
}
div.feed li:hover:last-child {
margin-bottom: 28px;
}
div.feed li .description::after {
content: "...";
}

View File

@@ -0,0 +1,50 @@
div.feed {
ul {
list-style: none;
position: relative;
width: 99%;
}
li {
/* border-top: solid 1px #ddd; */
margin-bottom: 5px;
a {
font-weight: bold;
}
.date {
font-weight: bold;
font-size: small;
}
.category {
margin-left: 20px;
font-size: 8px;
height: 9px;
overflow: hidden;
color: #999;
}
.description {
margin-left: 20px;
font-size: small;
height: 18px;
overflow: hidden;
color: #999;
}
&:hover {
margin-bottom: 23px;
.description {
position: absolute;
height: auto;
overflow-y: scroll;
overflow-x: scroll;
color: #000;
background-color: #fff;
border: solid 1px #000;
z-index: 10;
}
&:last-child {
margin-bottom: 28px;
}
}
.description::after { content: "..."; }
}
}

View File

@@ -62,9 +62,18 @@
<!-- Main Content Section -->
{unless isempty="$page_title"}<h1 class="page-title">{$page_title/}</h1>{/unless}
{$page.region_content/}
{if condition="$page.is_front"}
{if isset="$page.region_feed_eiffel"}
<div class="column" style="width: 32%; float: left">{$page.region_feed_eiffel_users/}</div>
{/if}
{if isset="$page.region_feed_forum"}
<div class="column" style="width: 32%; float: left">{$page.region_feed_forum/}</div>
{/if}
{if isset="$page.region_feed_stackoverflow"}
<div class="column" style="width: 32%; float: left">{$page.region_feed_stackoverflow/}</div>
{/if}
{/if}
</div>
</div>
</div>