Changeset 645


Ignore:
Timestamp:
Jun 5, 2005, 6:20:22 PM (17 years ago)
Author:
Dominic Hargreaves
Message:

Display number of linking nodes in wanted pages list (RT #9286).

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Changes

    r644 r645  
    2323        Replace <label> tags in display_metadata.tt with <span
    2424          class="metadata_label">.
     25        Wanted pages listing now displays, and sorts by, the number of nodes
     26        pointing to each node.
    2527
    26280.47    15 January 2005
  • trunk/README.CSS

    r644 r645  
    264264    Used in: node.tt
    265265    Purpose: A short message indicating that your reached a node via a redirect
     266
     267table#wanted_pages
     268    Used in:  wanted_pages.tt
     269    Purpose: A list of all unlinked nodes
  • trunk/templates/wanted_pages.tt

    r644 r645  
    88These are nodes which have been linked to but do not yet exist.
    99</p>
    10 <ul>
     10<table id="wanted_pages">
     11<tr><th>Node name</th><th>Number of backlinks</th><th>Action</th></tr>
    1112  [% FOREACH node = wanted %]
    12      <li>[% node.name %] ......
    13          [<a href="[% node.edit_link %]"><b>Create</b></a>]
    14          ......
    15          [<a href="[% node.backlink_link %]">Show nodes linking to this</a>]
    16      </li>
     13     <tr>
     14     <td>[% node.name %]</td>
     15     <td>[% node.backlinks_count %]</td>
     16     <td><a href="[% node.backlink_link %]">Show linking nodes</a>
     17         or <a href="[% node.edit_link %]">Create node</a>
     18     </td>
     19     </tr>
    1720  [% END %]
    18 </ul>
     21</table>
    1922
    2023</div>
  • trunk/wiki.cgi

    r644 r645  
    295295sub show_wanted_pages {
    296296    my @dangling = $wiki->list_dangling_links;
    297     @dangling = sort @dangling;
    298297    my @wanted;
     298    my %backlinks_count;
    299299    foreach my $node_name (@dangling) {
     300        $backlinks_count{$node_name} = scalar($wiki->list_backlinks( node => $node_name ));
     301    }
     302    foreach my $node_name (sort { $backlinks_count{$b} <=> $backlinks_count{$a} } @dangling) {
    300303        my $node_param =
    301304            uri_escape($formatter->node_name_to_node_param($node_name));
     
    305308                           . "?action=edit;id=$node_param",
    306309            backlink_link => $script_url . uri_escape($script_name)
    307                            . "?action=show_backlinks;id=$node_param"
     310                           . "?action=show_backlinks;id=$node_param",
     311            backlinks_count => $backlinks_count{$node_name}
    308312        };
    309313    }
Note: See TracChangeset for help on using the changeset viewer.