|
|
Activity DashboardFrom $1
Table of contentsNo headers<link href="/skins/common/templates/activitydashboard.css" rel="stylesheet" type="text/css" />
try {
// set page-level user details
var ActivityUser = page.namespaceuser;
var userDetails = wiki.api(ActivityUser.api);
} catch {
<span class="error-dekiscript">wiki.localize('MindTouch.Templates.UserProfile.error.initialization');</span>
web.showerror(__error);
return;
};
<div id="deki-activity-dashboard">
<div id="col-left">
/*
* User Profile Information Box
*/
<div id="deki-profile" class="deki-dashboard-group">
try {
<div class="dashboard-title">
<div class="profile-name">
#ActivityUser.fullname > 0 ? ActivityUser.fullname : ActivityUser.name;
var status = xml.text(userDetails, 'status');
status == 'active' ? '' : ' (' .. wiki.localize('MindTouch.Templates.UserProfile.status.disabled') .. ')';
</div>
</div>
<div class="profile-image">
ActivityUser.Gravatar
</div>
<dl class="profile-details">
var loginDate = date.parse(xml.text(userDetails, 'date.lastlogin'));
<dt>wiki.localize('MindTouch.Templates.UserProfile.label.lastlogin') .. ': ';</dt>
<dd class="dashboard-lastlogin">Template('MindTouch/Controls/DateTime', {date:loginDate, format:'datetime'});</dd>
<dt>
wiki.localize('MindTouch.Templates.UserProfile.label.joined') .. ': '
</dt>
<dd class="profile-joined">
var joinDate = date.parse(xml.text(userDetails, 'date.created'));
Template('MindTouch/Controls/DateTime', {date:joinDate, format:'date'})
</dd>
<dt>
wiki.localize('MindTouch.Templates.UserProfile.label.timezone') .. ': ';
</dt>
<dd class="profile-timezone">
ActivityUser.timezone;
</dd>
if (#ActivityUser.language > 0 && ActivityUser.language != site.language) {
<dt>
wiki.localize('MindTouch.Templates.UserProfile.label.language') .. ': '
</dt>
<dd class="profile-language">
ActivityUser.language;
</dd>
}
var groups = userDetails['groups/group'];
if (#groups > 0) {
<dt>
wiki.localize('MindTouch.Templates.UserProfile.label.groups') .. ': '
</dt>
<dd class="profile-groups">
string.join(list.sort([ xml.text(g["groupname"]) foreach var g in groups ]), ", ");
</dd>
}
</dl>
<div class="clear" />
} catch {
<span class="error-dekiscript">wiki.localize('MindTouch.Templates.UserProfile.error.profile');</span>
web.showerror(__error);
};
</div> // end deki-profile
/*
* Recent Comments Dashboard Box
*/
<div id="deki-recent-comments" class="deki-dashboard-group">
try {
<div class="dashboard-title">wiki.localize('MindTouch.Templates.UserProfile.label.comments', ['@' .. ActivityUser.name]);</div>
var dependencies = Template("MindTouch/Controls/DependencyErrors", {
components:[
{name: "activitystream", sid: "sid://mindtouch.com/std/2009/04/activitystream"}
]
});
if (!#dependencies["//div"]) {
var activities = activitystream.timeline(ActivityUser.name, 10);
if (#activities > 0) {
foreach (var a in activities) {
<div class="activity-comment">
<div class="activity-avatar">
<img src=(a.user.gravatar) height="30px" />
</div>
<div class="activity-meta">
<div class="activity-from">
<span class="activity-name">a.user.name</span>
<span class="activity-page">
' ' .. wiki.localize('MindTouch.Templates.UserProfile.comment.on') .. ' ';
a.page.uri ? web.link(a.page.uri, a.page.title) : wiki.localize('MindTouch.Templates.UserProfile.empty.page');
</span>
<div class="activity-date">Template('MindTouch/Controls/DateTime', {date:a.time, format:'datetime'})</div>
</div>
<div class="activity-text"> a.content </div>
</div> // end meta
</div> // end comment
} // end foreach
} // end if
else {
<div class="dashboard-message">
wiki.localize('MindTouch.Templates.UserProfile.empty.comments');
</div>
}
}
else {
if (#dependencies["//a[contains(@rel, 'component-missing')]"]) {
dependencies;
} else {
<div class="dashboard-commercial-text">
<div class="dashboard-commercial-message">
var link = web.link('http://mindtouch.com/redir/activity-stream/', wiki.localize('MindTouch.Templates.UserProfile.error.commercial.link'));
wiki.localize('MindTouch.Templates.UserProfile.error.commercial', [link]);
</div>
</div>
}
}
} catch {
<span class="error-dekiscript">wiki.localize('MindTouch.Templates.UserProfile.error.comments');</span>
web.showerror(__error);
};
</div> // end recent-comments
</div> // end col-left
<div id="col-right">
/*
* Recent User Activities
*/
<div id="deki-recent-changes" class="deki-dashboard-group">
try {
<div class="dashboard-title">wiki.localize('MindTouch.Templates.UserProfile.label.changes')</div>
var feedUri = ActivityUser.api & 'feed' & {limit: 10, format: 'raw'};
var changes = wiki.api(feedUri)['change'];
if (#changes > 0) {
<ul>
foreach (var c in changes) {
var pageId = xml.num(c, 'rc_cur_id');
var page = wiki.getPage(pageId);
var changeDate = date.parse(xml.text(c, 'rc_timestamp'), 'yyyyMMddHHmmss');
var pageExists = xml.num(c, 'rc_page_exists');
var pageTitle = xml.text(c, 'rc_title');
<li>
pageExists ? web.link(page.uri, page.title) : pageTitle;
<div class="recentchanges-date">Template('MindTouch/Controls/DateTime', {date:changeDate, format:'date'})</div>
<div class="recentchanges-details">
<span class="dashboard-change">xml.text(c, 'rc_comment');</span>
</div>
</li>
}
</ul>
<div class="deki-dashboard-group-footer">
web.link('/Special:Contributions?target=' .. ActivityUser.name,
wiki.localize('MindTouch.Templates.UserProfile.label.allchanges', [ActivityUser.name]));
</div>
}
else {
<div class="dashboard-message">
wiki.localize('MindTouch.Templates.UserProfile.empty.changes');
</div>
}
} catch {
<span class="error-dekiscript">wiki.localize('MindTouch.Templates.UserProfile.error.changes');</span>
web.showerror(__error);
};
</div> // end deki-recent-changes
</div> // end col-right
</div> // end deki-activity-dashboard
Tags: (Edit tags)
|
Powered by MindTouch Core |
Disclaimer: Vespa Labs contains information that is VERY likely to wreck your scooter and possibly yourself both intentionally (i.e. gaining more peformance while sacrificing reliability + safety) and unintentionally (i.e. misleading or incorrect information). Vespa Labs is only a wiki and intended as a dumping ground for information and not as a properly reviewed source. The same disclaimers that wikipedia.org use apply to Vespa Labs. The short version is use information at your own risk, both information on the main wiki and in the user areas are intended to be used only as "thought provoking" for someone that knows what they are doing. If you try to implement a "thought" Vespa Labs is not reponsible and if something goes wrong we hope that you live and update the offending information with corrections to warn others.
Vespa Labs is an international site and therefore may contain information that is not road legal in some countries/states and may also invalidate insurance policies. Treat all information as experimental and for "race use only" (i.e. not for road use - even if it is implied or explicitly stated). Refer to and adhere to your local road and legal rules, as well as the manufacturers recommendations.