From 2c9ea2cd34a1dd782e165b163899d7ba1ec1f41c Mon Sep 17 00:00:00 2001 From: pete Date: Tue, 9 Mar 2010 18:17:16 +0000 Subject: Blogs updated to new UI (needs Brett to look over first) git-svn-id: http://code.elgg.org/elgg/trunk@5335 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/blog/views/default/blog/archive.php | 22 ++ mod/blog/views/default/blog/categorylist.php | 26 +- mod/blog/views/default/blog/css.php | 217 ++++++++++------- mod/blog/views/default/blog/forms/edit.php | 339 ++++++++++++++++----------- mod/blog/views/default/blog/gallery.php | 52 ++-- mod/blog/views/default/blog/listing.php | 85 +++++-- mod/blog/views/default/blog/menu.php | 24 +- mod/blog/views/default/blog/notfound.php | 32 +-- mod/blog/views/default/blog/previewpane.php | 10 +- mod/blog/views/default/blog/stats.php | 13 + mod/blog/views/default/blog/view.php | 41 ++-- mod/blog/views/default/object/blog.php | 311 ++++++++++++------------ 12 files changed, 668 insertions(+), 504 deletions(-) create mode 100644 mod/blog/views/default/blog/archive.php create mode 100644 mod/blog/views/default/blog/stats.php (limited to 'mod/blog/views') diff --git a/mod/blog/views/default/blog/archive.php b/mod/blog/views/default/blog/archive.php new file mode 100644 index 000000000..76ae16696 --- /dev/null +++ b/mod/blog/views/default/blog/archive.php @@ -0,0 +1,22 @@ +"; + echo "

" . elgg_echo('blog:archive') ."

"; + echo "
"; +} \ No newline at end of file diff --git a/mod/blog/views/default/blog/categorylist.php b/mod/blog/views/default/blog/categorylist.php index 90403c550..799c837a7 100644 --- a/mod/blog/views/default/blog/categorylist.php +++ b/mod/blog/views/default/blog/categorylist.php @@ -1,14 +1,14 @@ - - -
- -
- - + +
+ +
+ + \ No newline at end of file diff --git a/mod/blog/views/default/blog/css.php b/mod/blog/views/default/blog/css.php index c9522c901..738aa9ef6 100644 --- a/mod/blog/views/default/blog/css.php +++ b/mod/blog/views/default/blog/css.php @@ -1,66 +1,127 @@ - * @copyright Curverider Ltd 2008-2010 - * @link http://elgg.com/ */ ?> #blogs .pagination { +/* margin:5px 10px 0 10px; padding:5px; display:block; -} -#blogs #two_column_left_sidebar_maincontent { - padding-bottom:10px; +*/ } .singleview { - margin-top:10px; + /* margin-top:10px !important; */ } -.blog_post_icon { - float:left; - margin:3px 0 0 0; - padding:0; +/* +we're partly using the #NewListStyle on blogs +ItemMetaData block only +*/ +#blogs .ContentWrapper.Welcome { + padding:10px 0 10px 0; +} +#blogs .search_listing .search_listing_info .ItemMetaData { + float:right; + margin-left:15px; + margin-top:0; + margin-right: 3px; + color:#AAAAAA; + text-align: right; + font-size:90%; +} +#blogs .search_listing .search_listing_info .ItemMetaData table { + width:200px; + /* float:right; removed for ie7 compatability */ +} +#blogs .search_listing .search_listing_info .ItemMetaData .EditItem a { + color:#AAAAAA; + margin:0 0 0 10px; +} +#blogs .search_listing .search_listing_info .ItemMetaData .EditItem a:hover { + color: #0054a7; + text-decoration: underline; } -.blog_post h3 { - font-size: 150%; - margin:0 0 10px 0; - padding:0; +#blogs .search_listing .search_listing_info .ItemMetaData td.FavouriteItem { + padding-top:0; } +/* IE7 */ +*:first-child+html #blogs .search_listing .search_listing_info .ItemMetaData td.FavouriteItem { width:auto; } -.blog_post h3 a { - text-decoration: none; + +/* BLOG TITLE IN LIST VIEWS */ +#blogs h2.blog_title { + line-height:1.1em; + margin-top:0; + font-size:1.4em; +} +#blogs h2.blog_title a { + color:#0054A7; +} +#blogs .search_listing_info p.blog_excerpt { + margin-top:3px; + padding-top:2px; + border-top:1px solid #cccccc; +} +#blogs .search_listing_info p.owner_timestamp { + margin-top:2px; } -.blog_post p { - margin: 0 0 5px 0; +.Page_Header_Options .cancel_button { + float:right; + margin:0 10px 0 0; +} + +.blog_post_icon { + float:left; + margin:0 0 0 0; + padding:0; +} +#blogs .search_listing_info { + margin-left:34px; } +.blog_post #content_area_user_title { + +} +.blog_post #content_area_user_title h2 { + margin:0 0 5px; + padding:0 0 5px; + border-bottom:1px solid #cccccc; +} .blog_post .strapline { - margin: 0 0 0 35px; + margin: 0 0 0 30px; padding:0; color: #aaa; - line-height:1em; + line-height:0.8em; +} +.blog_post .strapline .generic_access, +.blog_post .strapline .shared_collection, +.blog_post .strapline .group_open, +.blog_post .strapline .group_closed { + line-height:1.4em; + display:block; } .blog_post p.tags { - background:transparent url(_graphics/icon_tag.gif) no-repeat scroll left 2px; - margin:0 0 7px 35px; - padding:0pt 0pt 0pt 16px; + background:transparent url(_graphics/icon_tag.png) no-repeat scroll left 2px; + margin:0; + padding:0 0 0 16px; min-height:22px; } .blog_post .options { margin:0; padding:0; } - +.blog_post_body { + margin-top:2px; + padding-top:8px; + border-top:1px solid #cccccc; +} .blog_post_body img[align="left"] { margin: 10px 10px 10px 0; float:left; @@ -99,47 +160,9 @@ margin:5px 0 5px 0; } -/* New blog edit column */ -#blog_edit_page { - /* background: #bbdaf7; */ - margin-top:-10px; -} -#blog_edit_page #content_area_user_title h2 { - background: none; - border-top: none; - margin:0 0 10px 0px; - padding:0px 0 0 0; -} -#blog_edit_page #blog_edit_sidebar #content_area_user_title h2 { - background:none; - border-top:none; - margin:inherit; - padding:0 0 5px 5px; - font-size:1.25em; - line-height:1.2em; -} -#blog_edit_page #blog_edit_sidebar { - margin:0px 0 22px 0; - background: #dedede; - padding:5px; - -webkit-border-radius: 8px; - -moz-border-radius: 8px; - border-bottom:1px solid #cccccc; - border-right:1px solid #cccccc; -} -#blog_edit_page #two_column_left_sidebar_210 { - width:210px; - margin:0px 0 20px 0px; - min-height:360px; - float:left; - padding:0; -} -#blog_edit_page #two_column_left_sidebar_maincontent { - margin:0 0px 20px 20px; - padding:10px 20px 20px 20px; - width:670px; - background: #bbdaf7; -} + + + /* unsaved blog post preview */ .blog_previewpane { border:1px solid #D3322A; @@ -153,12 +176,12 @@ margin:0; } -#blog_edit_sidebar .publish_controls, -#blog_edit_sidebar .blog_access, -#blog_edit_sidebar .publish_options, -#blog_edit_sidebar .publish_blog, -#blog_edit_sidebar .allow_comments, -#blog_edit_sidebar .categories { +#blog_edit_page .publish_controls, +#blog_edit_page .blog_access, +#blog_edit_page .publish_options, +#blog_edit_page .publish_blog, +#blog_edit_page .allow_comments, +#blog_edit_page .categories { margin:0 5px 5px 5px; border-top:1px solid #cccccc; } @@ -170,9 +193,6 @@ #blog_edit_page p { margin:5px 0 5px 0; } -#blog_edit_page #two_column_left_sidebar_maincontent p { - margin:0 0 15px 0; -} #blog_edit_page .publish_blog input[type="submit"] { font-weight: bold; padding:2px; @@ -204,7 +224,46 @@ } +/* blog edit page */ +#blogPostForm .ContentWrapper { + margin-top:10px; +} +#blogPostForm .ContentWrapper #excerpt_editarea { + margin-top:15px; + margin-bottom:15px; +} +#excerpt_editarea .input-textarea { + height:80px; +} +#blogPostForm .current_access { + color:inherit; + font-size:inherit; + line-height:1.0em; + padding-top:0; +} - +/* blog widget on groups */ +.collapsable_box_content .ContentWrapper.blogs.more { + margin:0 10px; + padding:5px 10px; +} +.collapsable_box_content .ContentWrapper.blogs { + line-height:1.2em; + margin-bottom:5px; +} +.collapsable_box_content .ContentWrapper.blogs .river_object_blog_create { + background-position:left 2px; + min-height:17px; + padding:2px 0 2px 19px; + border-bottom:1px solid #DDDDDD; + line-height:1.1em; +} +.collapsable_box_content .ContentWrapper.blogs .river_object_blog_create:first-child { + border-top:1px solid #DDDDDD; +} +.collapsable_box_content .ContentWrapper.blogs .river_object_blog_create span { + font-size: 90%; + color:#666666; +} diff --git a/mod/blog/views/default/blog/forms/edit.php b/mod/blog/views/default/blog/forms/edit.php index d3f4d7e52..09389a8fb 100644 --- a/mod/blog/views/default/blog/forms/edit.php +++ b/mod/blog/views/default/blog/forms/edit.php @@ -1,169 +1,226 @@ + - * @copyright Curverider Ltd 2008-2010 - * @link http://elgg.com/ - * - * @uses $vars['object'] Optionally, the blog post to edit - */ - - // Set title, form destination - if (isset($vars['entity'])) { - $title = sprintf(elgg_echo("blog:editpost"),$object->title); - $action = "blog/edit"; - $title = $vars['entity']->title; - $body = $vars['entity']->description; - $tags = $vars['entity']->tags; - if ($vars['entity']->comments_on == 'Off') { - $comments_on = false; - } else { - $comments_on = true; - } - $access_id = $vars['entity']->access_id; - } else { - $title = elgg_echo("blog:addpost"); - $action = "blog/add"; - $tags = ""; - $title = ""; - $comments_on = true; - $description = ""; - if (defined('ACCESS_DEFAULT')) - $access_id = ACCESS_DEFAULT; - else - $access_id = 0; - - $container = $vars['container_guid'] ? elgg_view('input/hidden', array('internalname' => 'container_guid', 'value' => $vars['container_guid'])) : ""; - } +//access details +$loggedin_user_access = get_default_access(get_loggedin_user()); +$user_acl = get_readable_access_level($loggedin_user_access); - // Just in case we have some cached details - if (empty($body)) { - $body = $vars['user']->blogbody; - if (!empty($body)) { - $title = $vars['user']->blogtitle; - $tags = $vars['user']->blogtags; - } - } +//Populate the title, body and acction variables if it is an edit, declare them if it is a new post +if (isset($vars['entity'])) { + $title = sprintf(elgg_echo("blog:editpost"),$object->title); + $action = "blog/edit"; + $title = $vars['entity']->title; + $body = $vars['entity']->description; + $tags = $vars['entity']->tags; + if ($vars['entity']->comments_on == 'Off') + $comments_on = false; + else + $comments_on = true; + $access_id = $vars['entity']->access_id; + $show_excerpt = $vars['entity']->show_excerpt; + if($show_excerpt) + $excerpt = $vars['entity']->excerpt; + else + $excerpt = ""; + $page_title = elgg_view_title(elgg_echo('blog:editpost')); +}else{ + $title = elgg_echo("blog:addpost"); + $action = "blog/add"; + $tags = ""; + $title = ""; + $comments_on = true; + $description = ""; + $excerpt = ""; + $show_excerpt = ''; + $page_title = elgg_view_title(elgg_echo('blog:addpost')); + if(page_owner_entity() instanceof ElggGroup){ + //if in a group, set the access level to default to the group + $access_id = page_owner_entity()->group_acl; + }else{ + $access_id = $loggedin_user_access; + } + $container = $vars['container_guid'] ? elgg_view('input/hidden', array('internalname' => 'container_guid', 'value' => $vars['container_guid'])) : ""; +} - // set the required variables - - $title_label = elgg_echo('title'); - $title_textbox = elgg_view('input/text', array('internalname' => 'blogtitle', 'value' => $title)); - $text_label = elgg_echo('blog:text'); - $text_textarea = elgg_view('input/longtext', array('internalname' => 'blogbody', 'value' => $body)); - $tag_label = elgg_echo('tags'); - $tag_input = elgg_view('input/tags', array('internalname' => 'blogtags', 'value' => $tags)); - $access_label = elgg_echo('access'); - - //$comments_select = elgg_view('input/checkboxes', array('internalname' => 'comments_on', 'value' => '')); - if($comments_on) - $comments_on_switch = "checked=\"checked\""; - else - $comment_on_switch = ""; - - $access_input = elgg_view('input/access', array('internalname' => 'access_id', 'value' => $access_id)); - $submit_input = elgg_view('input/submit', array('internalname' => 'submit', 'value' => elgg_echo('publish'))); - $conversation = elgg_echo('Conversation'); - $publish = elgg_echo('publish'); - $cat = elgg_echo('categories'); - $preview = elgg_echo('blog:preview'); - $privacy = elgg_echo('access'); - $savedraft = elgg_echo('blog:draft:save'); - $draftsaved = elgg_echo('blog:draft:saved'); - $never = elgg_echo('blog:never'); - $allowcomments = elgg_echo('blog:comments:allow'); - - // INSERT EXTRAS HERE - $extras = elgg_view('categories',$vars); - if (!empty($extras)) $extras = '
' . $extras . '
'; +//Just in case we have some cached details +if (empty($body)) { + $body = $vars['user']->blogbody; + if (!empty($body)) { + $title = $vars['user']->blogtitle; + $tags = $vars['user']->blogtags; + } +} + +//set the required input fields +$title_label = elgg_echo('blog:title'); +$title_textbox = elgg_view('input/text', array('internalname' => 'blogtitle', 'value' => $title)); +$text_label = elgg_echo('blog:text'); +$text_textarea = elgg_view('input/longtext', array('internalname' => 'blogbody', 'value' => $body)); +$excerpt_label = elgg_echo('blog:excerpt'); +$excerpt_counter = "
"; +$excerpt_textarea = elgg_view('input/text', array('internalname' => 'blogexcerpt', 'internalid' => 'excerpt', 'class' => 'excerpt input-textarea', 'value' => $excerpt)); +$excerpt_desc = elgg_echo('blog:excerptdesc'); +$show_excerpt_field = elgg_view('input/hidden', array('internalname' => 'show_excerpt', 'value' => $show_excerpt)); +$tag_label = elgg_echo('tags'); +$tag_input = elgg_view('input/tags', array('internalname' => 'blogtags', 'value' => $tags)); +$access_label = elgg_echo('access'); +if($comments_on) + $comments_on_switch = "checked=\"checked\""; +else + $comment_on_switch = ""; +//if it is a group, pull out the group access view +if(page_owner_entity() instanceof ElggGroup){ + $options = group_access_options(page_owner_entity()); +}else{ + $options = ''; +} +$access_input = elgg_view('input/access', array('internalname' => 'access_id', 'value' => $access_id, 'options' => $options)); +$submit_input = elgg_view('input/submit', array('internalname' => 'submit', 'value' => elgg_echo('publish'))); +$conversation = elgg_echo('Conversation'); +$publish = elgg_echo('publish'); +$cat = elgg_echo('categories'); +$preview = elgg_echo('blog:preview'); +$privacy = elgg_echo('access'); +$savedraft = elgg_echo('blog:draft:save'); +$draftsaved = elgg_echo('blog:draft:saved'); +$never = elgg_echo('blog:never'); +$allowcomments = elgg_echo('blog:comments:allow'); +$user_default_access = elgg_echo('blog:defaultaccess'); +$ownerblock = elgg_view('blog/ownerblock', array('entity' => $vars['entity'])); +if($vars['entity']){ + $deletepage = elgg_view('output/confirmlink',array( + 'href' => $vars['url'] . "action/blog/delete?blogpost=" . $vars['entity']->getGUID(), + 'text' => elgg_echo("delete"), + 'confirm' => elgg_echo("blog:delete:confirm"), + 'class' => "Action_Button Disabled")); +}else{ + $deletepage = ""; +} + +//INSERT EXTRAS HERE +$extras = elgg_view('categories',$vars); +if (!empty($extras)) $extras = '
' .$cat .'
'. $extras . '
'; ?> + {$ownerblock} +
+

{$publish}

- $form_body = << +
-
-
- -

{$publish}

-
-

- {$savedraft} -

+
+

{$privacy}: {$access_input}

-
- -

{$draftsaved}: {$never}

+
{$user_default_access}
{$user_acl}
+
+ +
+
+
-
-

{$privacy}: {$access_input} -

+
+ +
+
+
+ {$draftsaved}: {$never} + {$savedraft} +
+ {$submit_input}
+
-
-

{$conversation}

-
-

-
-
+ {$extras} + {$container} +
- {$extras} - - $container + +
+ + +
+
- -
+ + + +
EOT; -?> +if (isset($vars['entity'])) + $entity_hidden = elgg_view('input/hidden', array('internalname' => 'blogpost', 'value' => $vars['entity']->getGUID())); +else + $entity_hidden = ''; - 'blogpost', 'value' => $vars['entity']->getGUID())); - } else { - $entity_hidden = ''; - } - - $form_body .= << -
- $title_textbox -

-

-
- $text_textarea -

-

-
- $tag_input -

- -

- $entity_hidden - -

-
+$form_body .= <<
$title_textbox

+

+ $text_textarea +

+
+
$excerpt_desc $excerpt_counter
+ $excerpt_textarea +
+


$tag_input

+

$entity_hidden

+ $show_excerpt_field +
+
+
EOT; - echo elgg_view('input/form', array('action' => "{$vars['url']}action/$action", 'body' => $form_body, 'internalid' => 'blogPostForm')); +//display the form +echo elgg_view('input/form', array('action' => "{$vars['url']}action/$action", 'body' => $form_body, 'internalid' => 'blogPostForm')); ?>