Add a dashboard widget for subscriptions

(DBOINCP-41)
This commit is contained in:
Tristan Olive 2015-06-12 10:59:33 -04:00
parent a33c666b23
commit b000c0944f
4 changed files with 487 additions and 15 deletions

View File

@ -134,6 +134,26 @@ function boinc_standard_default_page_manager_pages() {
$display->panels['content'][0] = 'new-1';
$pane = new stdClass;
$pane->pid = 'new-2';
$pane->panel = 'content';
$pane->type = 'views_panes';
$pane->subtype = 'subscriptions-panel_pane_1';
$pane->shown = TRUE;
$pane->access = array();
$pane->configuration = array();
$pane->cache = array();
$pane->style = array(
'settings' => NULL,
);
$pane->css = array(
'css_id' => '',
'css_class' => 'panel-primary container shadow',
);
$pane->extras = array();
$pane->position = 1;
$display->content['new-2'] = $pane;
$display->panels['content'][1] = 'new-2';
$pane = new stdClass;
$pane->pid = 'new-3';
$pane->panel = 'sidebar_first';
$pane->type = 'custom';
$pane->subtype = 'custom';
@ -167,10 +187,10 @@ function boinc_standard_default_page_manager_pages() {
);
$pane->extras = array();
$pane->position = 0;
$display->content['new-2'] = $pane;
$display->panels['sidebar_first'][0] = 'new-2';
$display->content['new-3'] = $pane;
$display->panels['sidebar_first'][0] = 'new-3';
$pane = new stdClass;
$pane->pid = 'new-3';
$pane->pid = 'new-4';
$pane->panel = 'sidebar_first';
$pane->type = 'panels_mini';
$pane->subtype = 'user_mail_summary';
@ -190,10 +210,10 @@ function boinc_standard_default_page_manager_pages() {
);
$pane->extras = array();
$pane->position = 1;
$display->content['new-3'] = $pane;
$display->panels['sidebar_first'][1] = 'new-3';
$display->content['new-4'] = $pane;
$display->panels['sidebar_first'][1] = 'new-4';
$pane = new stdClass;
$pane->pid = 'new-4';
$pane->pid = 'new-5';
$pane->panel = 'sidebar_first';
$pane->type = 'custom';
$pane->subtype = 'custom';
@ -220,10 +240,10 @@ if (module_exists(\'boincteam\')) {
);
$pane->extras = array();
$pane->position = 2;
$display->content['new-4'] = $pane;
$display->panels['sidebar_first'][2] = 'new-4';
$display->content['new-5'] = $pane;
$display->panels['sidebar_first'][2] = 'new-5';
$pane = new stdClass;
$pane->pid = 'new-5';
$pane->pid = 'new-6';
$pane->panel = 'sidebar_first';
$pane->type = 'custom';
$pane->subtype = 'custom';
@ -254,10 +274,10 @@ echo \'<div class="item-count-wrapper"><div class="item-count">\' . $account->po
);
$pane->extras = array();
$pane->position = 3;
$display->content['new-5'] = $pane;
$display->panels['sidebar_first'][3] = 'new-5';
$display->content['new-6'] = $pane;
$display->panels['sidebar_first'][3] = 'new-6';
$pane = new stdClass;
$pane->pid = 'new-6';
$pane->pid = 'new-7';
$pane->panel = 'sidebar_first';
$pane->type = 'views';
$pane->subtype = 'boinc_friends';
@ -292,8 +312,8 @@ echo \'<div class="item-count-wrapper"><div class="item-count">\' . $account->po
);
$pane->extras = array();
$pane->position = 4;
$display->content['new-6'] = $pane;
$display->panels['sidebar_first'][4] = 'new-6';
$display->content['new-7'] = $pane;
$display->panels['sidebar_first'][4] = 'new-7';
$display->hide_title = PANELS_TITLE_NONE;
$display->title_pane = '0';
$handler->conf['display'] = $display;

View File

@ -8,7 +8,10 @@ dependencies[] = "comment"
dependencies[] = "features"
dependencies[] = "flag"
dependencies[] = "menu"
dependencies[] = "taxonomy"
dependencies[] = "views"
dependencies[] = "views_content"
dependencies[] = "views_customfield"
features[menu_links][] = "primary-links:account/prefs"
features[views][] = "subscriptions"
features[views_api][] = "api:2"

View File

@ -36,6 +36,11 @@ function user_preferences_views_default_views() {
'field' => 'flag_count_rel',
'relationship' => 'none',
),
'vid' => array(
'id' => 'vid',
'table' => 'term_node',
'field' => 'vid',
),
));
$handler->override_option('fields', array(
'title' => array(
@ -202,6 +207,449 @@ function user_preferences_views_default_views() {
'weight' => 0,
'name' => 'navigation',
));
$handler = $view->new_display('panel_pane', 'Content pane', 'panel_pane_1');
$handler->override_option('fields', array(
'title' => array(
'label' => 'Page',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'absolute' => 0,
'link_class' => '',
'alt' => '',
'rel' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'html' => 0,
'strip_tags' => 0,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'hide_alter_empty' => 1,
'link_to_node' => 1,
'exclude' => 1,
'id' => 'title',
'table' => 'node',
'field' => 'title',
'relationship' => 'none',
'override' => array(
'button' => 'Use default',
),
),
'type' => array(
'label' => 'Type',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'absolute' => 0,
'link_class' => '',
'alt' => '',
'rel' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'html' => 0,
'strip_tags' => 0,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'hide_alter_empty' => 1,
'link_to_node' => 0,
'machine_name' => 0,
'exclude' => 1,
'id' => 'type',
'table' => 'node',
'field' => 'type',
'override' => array(
'button' => 'Use default',
),
'relationship' => 'none',
),
'ops' => array(
'label' => '',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'absolute' => 0,
'link_class' => '',
'alt' => '',
'rel' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'html' => 0,
'strip_tags' => 0,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'hide_alter_empty' => 1,
'link_type' => '',
'exclude' => 1,
'id' => 'ops',
'table' => 'flag_content',
'field' => 'ops',
'relationship' => 'flag_content_rel',
'override' => array(
'button' => 'Use default',
),
),
'timestamp' => array(
'label' => 'Has new content',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'absolute' => 0,
'link_class' => '',
'alt' => '',
'rel' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'html' => 0,
'strip_tags' => 0,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'hide_alter_empty' => 1,
'link_to_node' => 0,
'comments' => 1,
'exclude' => 1,
'id' => 'timestamp',
'table' => 'history_user',
'field' => 'timestamp',
'relationship' => 'none',
'override' => array(
'button' => 'Use default',
),
),
'new_comments' => array(
'label' => 'New comments',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'absolute' => 0,
'link_class' => '',
'alt' => '',
'rel' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'html' => 0,
'strip_tags' => 0,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'hide_alter_empty' => 1,
'set_precision' => FALSE,
'precision' => 0,
'decimal' => '.',
'separator' => ',',
'format_plural' => 0,
'format_plural_singular' => '1',
'format_plural_plural' => '@count',
'prefix' => '',
'suffix' => '',
'link_to_comment' => 1,
'exclude' => 1,
'id' => 'new_comments',
'table' => 'node',
'field' => 'new_comments',
'relationship' => 'none',
'override' => array(
'button' => 'Use default',
),
),
'name' => array(
'label' => 'Term',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'absolute' => 0,
'link_class' => '',
'alt' => '',
'rel' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'html' => 0,
'strip_tags' => 0,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'hide_alter_empty' => 1,
'link_to_taxonomy' => 0,
'exclude' => 1,
'id' => 'name',
'table' => 'term_data',
'field' => 'name',
'override' => array(
'button' => 'Use default',
),
'relationship' => 'none',
),
'name_1' => array(
'label' => 'Vocabulary name',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'absolute' => 0,
'link_class' => '',
'alt' => '',
'rel' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'html' => 0,
'strip_tags' => 0,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'hide_alter_empty' => 1,
'exclude' => 1,
'id' => 'name_1',
'table' => 'vocabulary',
'field' => 'name',
'override' => array(
'button' => 'Use default',
),
'relationship' => 'none',
),
'phpcode' => array(
'label' => 'Page',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'absolute' => 0,
'link_class' => '',
'alt' => '',
'rel' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'html' => 0,
'strip_tags' => 0,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'hide_alter_empty' => 1,
'value' => '<?php
$updated = ($data->node_comment_statistics_last_updated > $data->history_user_timestamp) ? TRUE : FALSE;
print \'<span class="title \' . ($updated ? \'updated\' : \'\') . \'">\';
print l($data->node_title, "node/{$data->nid}");
print \'</span>\';
?>',
'exclude' => 0,
'id' => 'phpcode',
'table' => 'customfield',
'field' => 'phpcode',
'override' => array(
'button' => 'Use default',
),
'relationship' => 'none',
),
'phpcode_1' => array(
'label' => '',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'absolute' => 0,
'link_class' => '',
'alt' => '',
'rel' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'html' => 0,
'strip_tags' => 0,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'hide_alter_empty' => 1,
'value' => '<?php
if ($data->node_type == \'forum\') {
print $data->vocabulary_name . \' &rsaquo; \' . $data->term_data_name;
}
elseif ($data->node_type == \'news\') {
print bts(\'News\');
}
?>',
'exclude' => 0,
'id' => 'phpcode_1',
'table' => 'customfield',
'field' => 'phpcode',
'override' => array(
'button' => 'Use default',
),
'relationship' => 'none',
),
'last_updated' => array(
'label' => 'Updated',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'absolute' => 0,
'link_class' => '',
'alt' => '',
'rel' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'html' => 0,
'strip_tags' => 0,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'hide_alter_empty' => 1,
'date_format' => 'time ago',
'custom_date_format' => '',
'exclude' => 0,
'id' => 'last_updated',
'table' => 'node_comment_statistics',
'field' => 'last_updated',
'override' => array(
'button' => 'Use default',
),
'relationship' => 'none',
),
));
$handler->override_option('title', 'Subscriptions');
$handler->override_option('items_per_page', 5);
$handler->override_option('use_pager', '0');
$handler->override_option('use_more', 1);
$handler->override_option('use_more_always', 1);
$handler->override_option('style_plugin', 'table');
$handler->override_option('style_options', array(
'grouping' => '',
'override' => 1,
'sticky' => 0,
'order' => 'desc',
'summary' => '',
'columns' => array(
'title' => 'title',
'type' => 'type',
'ops' => 'ops',
'last_updated' => 'last_updated',
),
'info' => array(
'title' => array(
'sortable' => 0,
'separator' => '',
),
'type' => array(
'sortable' => 0,
'separator' => '',
),
'ops' => array(
'separator' => '',
),
'last_updated' => array(
'sortable' => 0,
'separator' => '',
),
),
'default' => 'last_updated',
));
$handler->override_option('pane_title', '');
$handler->override_option('pane_description', '');
$handler->override_option('pane_category', array(
'name' => 'View panes',
'weight' => 0,
));
$handler->override_option('allow', array(
'use_pager' => FALSE,
'items_per_page' => FALSE,
'offset' => FALSE,
'link_to_view' => FALSE,
'more_link' => FALSE,
'path_override' => FALSE,
'title_override' => FALSE,
'exposed_form' => FALSE,
'fields_override' => FALSE,
));
$handler->override_option('argument_input', array());
$handler->override_option('link_to_view', 0);
$handler->override_option('inherit_panels_path', 0);
$views[$view->name] = $view;

View File

@ -844,7 +844,8 @@ table.user-projects {
#forum .subscriptions {
margin: 32px 5px;
}
#forum .topic.updated .title {
#forum .topic.updated .title,
.view-subscriptions .title.updated {
font-weight: bold;
}
.forum-topic-navigation {