This page contains templates specifically tailored to showing the current status of a MindTouch release.  The templates are specific to MindTouch Deki, because of the reliance on the non-standard Release field (consider using Mantis' built-in Version field instead).

    Each template follows the same pattern.  The section title is the full name of the template.  The code is shown in the Code sub-section.  The code needs to be copied as-is without formatting and pasted into a DekiScript formatted <pre> block.  Make sure there no occurrences of <p>&nbsp;</p> in source mode as these will interfere with the layout produced by the template.

    The templates rely on a MySql extension configured for accessing the Mantis database in read-only mode.  This MySql extension must be configured to use the 'bugs' namespace.

    Template:ReleaseStatus

    This template show the completion status of a given release.

    Example

    ReleaseStatus.png

    Usage

    {{ ReleaseStatus('9.02.3') }}

    Code

    /***
        USAGE:
    
        ReleaseStatus(release)
            show status for a given MindTouch release
    ***/
    
    var release = $0 ?? $release ?? "";
    
    var issues = bugs.recordlist(
        "select bug_id, category, summary, username, mantis_bug_table.status as status
        from mantis_bug_table 
        left join mantis_user_table on handler_id=mantis_user_table.id
        join mantis_project_table on project_id=mantis_project_table.id
        join mantis_custom_field_string_table on mantis_bug_table.id=bug_id
        where name='MindTouch Deki'
        and field_id=2 
        and value='$release'" % { release: string.sqlescape(release) }
    );
    
    var groups = list.groupby(issues, '($status >= 80) ? 80 : 50');
    var active = groups[50];
    var closed = groups[80];
    // show status table
    <table class="progress" width="600px" border="1">
        <tr>
            <td class="closed" style=("width: $width; background-color: $color" % { color: "rgb(204, 255, 204)", width: web.size(num.min(0.999, #closed / #issues)) }) >
                var info = { count: #closed, total: #issues };
                <a rel="bug" href=(site.uri) title=("$count out of $total issues closed" % info) >
                    "$count out of $total issues closed" % info;
                </a>
            </td>
            <td class="active" style=("width: $width; background-color: $color" % { color: "rgb(255, 255, 255)", width: web.size(num.min(0.999, #active / #issues)) }) >
                var info = { count: #active, total: #issues };
                <a rel="bug" href=(site.uri) title=("$count out of $total issues active" % { count: #active, total: #issues }) >
                    "$count out of $total issues active" % info;
                </a>
            </td>
        </tr>
    </table>
    
    // show status summary
    <span>
        "Active issues: "; #active; ", ";
        "Closed issues: "; #closed; ", ";
        "Total issues: "; #issues; " ";
        <strong> "("; num.format(#closed / #issues * 100, "#0"); "% completed)"; </strong> 
    </span>

    Template:ReleaseOpenIssuesByDeveloper

    This template shows all open issues for a given release by developer.

    Example

    ReleaseOpenIssuesByDeveloper.png

    Usage

    {{ ReleaseOpenIssuesByDeveloper('9.02.3') }}

    Code

    /***
        USAGE:
    
        ReleaseOpenIssuesbyDeveloper(release)
            show list of open issues by developer for a given MindTouch release
    ***/
    
    var release = $0 ?? $release ?? "";
    var href = "http://bugs.developer.mindtouch.com/view.php";
    
    var issues = bugs.recordlist(
        "select bug_id as id, category, summary, username
        from mantis_bug_table 
        left join mantis_user_table on handler_id=mantis_user_table.id
        join mantis_project_table on project_id=mantis_project_table.id
        join mantis_custom_field_string_table on mantis_bug_table.id=bug_id
        where name='MindTouch Deki'
        and field_id=2 
        and mantis_bug_table.status < 80
        and value='$release'" % { release: string.sqlescape(release) }
    );
    
    var groups = list.sort([ { dev: group, bugs: values } foreach var group : values in list.groupby(issues, '$username ?? "(unassigned)"') ], 'dev');
    foreach(var item in groups) {
        <h5> item.dev; " "; "("; #item.bugs; " issues)" </h5>
        <ul>
            foreach(var bug in list.sort(item.bugs, 'id')) {
                <li> <a href=(href & { id: bug.id })> bug.id; ": "; bug.summary; </a></li>
            }
        </ul>
    }

    Template:DeveloperOpenIssuesByRelease

    This template shows all open issues assigned to a developer for a given release.

    Example

    DeveloperOpenIssuesByRelease.png

    Usage

    {{ DeveloperOpenIssuesByRelease('SteveB') }}

    Code

    /***
        USAGE:
    
        DeveloperOpenIssuesByRelease(developer)
            show list of open issues by MindTouch release for a given developer
    ***/
    
    var developer = $0 ?? $developer ?? "";
    var href = "http://bugs.developer.mindtouch.com/view.php";
    
    var issues = bugs.recordlist(
        "select bug_id as id, category, summary, `value` as `release`
        from mantis_bug_table 
        left join mantis_user_table on handler_id=mantis_user_table.id
        join mantis_project_table on project_id=mantis_project_table.id
        join mantis_custom_field_string_table on mantis_bug_table.id=bug_id
        where name = 'MindTouch Deki'
        and field_id=2 
        and mantis_bug_table.status < 80
        and username='$developer'" % { developer: string.sqlescape(developer) }
    );
    
    var groups = list.sort([ { release: group, bugs: values } foreach var group : values in list.groupby(issues, '$release ?? "(unassigned)"') ], 'release');
    foreach(var item in groups) {
        <h5> item.release; " ("; #item.bugs; " issues)" </h5>
        <ul>
            foreach(var bug in list.sort(item.bugs, 'id')) {
                <li> <a href=(href & { id: bug.id })> bug.id; ": "; bug.summary; </a></li>
            }
        </ul>
    }

     

    Tag page

    Files 3

    FileVersionSizeModified 
    You must login to post a comment.

    Copyright © 2011 MindTouch, Inc. Powered by