Index: trunk/extensions/PageTriage/SpecialPageTriage.php |
— | — | @@ -66,7 +66,59 @@ |
67 | 67 | // TODO: this should load with a spinner instead of "please wait" |
68 | 68 | $triageInterface .= "<div id='listView'>Please wait...</div>"; |
69 | 69 | $triageInterface .= "<div id='pageTriageFooter'></div>"; |
70 | | - $triageInterface .= "<div id='backboneTemplates'></div>"; |
| 70 | + |
| 71 | + // this template is repeated many times, once for each item in list view. |
| 72 | + $triageInterface .= <<<HTML |
| 73 | + <div id="backboneTemplates"> |
| 74 | + <script type="text/template" id="listItemTemplate"> |
| 75 | + <div class="mwe-pt-article-row"> |
| 76 | + <% if ( afd_status == "1" || blp_prod_status == "1" || csd_status == "1" || prod_status == "1" ) { %> |
| 77 | + <div class="mwe-pt-status-icon mwe-pt-status-icon-deleted"> |
| 78 | + [DEL] <!-- deleted --> |
| 79 | + </div> |
| 80 | + <% } else if ( patrol_status == "1" ) { %> |
| 81 | + <div class="mwe-pt-status-icon mwe-pt-status-icon-triaged"> |
| 82 | + [TRI] <!-- triaged --> |
| 83 | + </div> |
| 84 | + <% } else { %> |
| 85 | + <div class="mwe-pt-status-icon mwe-pt-status-icon-new"> |
| 86 | + [NEW] <!-- not patrolled --> |
| 87 | + </div> |
| 88 | + <% } %> |
| 89 | + </div> |
| 90 | + <div class="mwe-pt-info-pane"> |
| 91 | + <div class="mwe-pt-article"> |
| 92 | + <span class="mwe-pt-page-title"><a href="<%= partial_url %>"><%= title %></a></span> |
| 93 | + <span class="mwe-pt-histlink"> |
| 94 | + (<a href="<%= mw.config.get("wgScriptPath") + "/index.php?title=" + partial_url + "&action=history" %>"><%= gM( "pagetriage-hist" ) %></a>) |
| 95 | + </span> |
| 96 | + <span class="mwe-pt-metadata"> |
| 97 | + · |
| 98 | + <%= gM( "pagetriage-bytes", page_len ) %> |
| 99 | + · |
| 100 | + <%= gM( "pagetriage-edits", rev_count ) %> |
| 101 | + · |
| 102 | + <% if( category_count == "0" ) { %> |
| 103 | + <span class="mwe-pt-metadata-warning"><%= gM( "pagetriage-no-categories" ) %></span> |
| 104 | + <% } else { %> |
| 105 | + <%= gM( "pagetriage-categories", category_count ) %> |
| 106 | + <% } %> |
| 107 | + <% if( linkcount == "0" ) { %> |
| 108 | + · <span class="mwe-pt-metadata-warning"><%= gM("pagetriage-orphan") %></span> |
| 109 | + <% } %> |
| 110 | + </span> |
| 111 | + </div> |
| 112 | + <div class="mwe-pt-author"> |
| 113 | + </div> |
| 114 | + <div class="mwe-pt-snippet"> |
| 115 | + <%= snippet %> |
| 116 | + </div> |
| 117 | + </div> |
| 118 | + </div> |
| 119 | + <br/> |
| 120 | + </script> |
| 121 | + </div> |
| 122 | +HTML; |
71 | 123 | |
72 | 124 | // Get the list of articles |
73 | 125 | //$triageInterface .= $this->getFormattedTriageList(); |
Index: trunk/extensions/PageTriage/sql/PageTriageTags.sql |
— | — | @@ -26,4 +26,5 @@ |
27 | 27 | ('user_creation_date', 'User registration date'), |
28 | 28 | ('user_autoconfirmed', 'Check if user is autoconfirmed' ), |
29 | 29 | ('user_bot', 'Check if user is in bot group'), |
30 | | -('user_block_status', 'User block status'); |
| 30 | +('user_block_status', 'User block status'), |
| 31 | +('internal_url', 'Internal link fragment'); |
\ No newline at end of file |
Index: trunk/extensions/PageTriage/includes/ArticleMetadata.php |
— | — | @@ -321,6 +321,7 @@ |
322 | 322 | $metaData[$row->page_id]['creation_date'] = $row->creation_date; |
323 | 323 | $metaData[$row->page_id]['rev_count'] = $row->rev_count; |
324 | 324 | $metaData[$row->page_id]['title'] = $title->getPrefixedText(); |
| 325 | + $metaData[$row->page_id]['partial_url'] = $title->getPartialURL(); |
325 | 326 | $metaData[$row->page_id]['patrol_status'] = $row->ptrp_triaged; |
326 | 327 | } |
327 | 328 | // Remove any non-existing page_id from $this->mPageId |
Index: trunk/extensions/PageTriage/modules/ext.pageTriage.views/ext.pageTriage.articleListItem.js |
— | — | @@ -1,57 +1,10 @@ |
2 | 2 | $( function() { |
3 | 3 | // view for the article list |
4 | 4 | |
5 | | - |
6 | | - // TODO: find a way to insert these templates raw with RL instead of appending them to |
7 | | - // the DOM with javascript later (which is lame) |
8 | | - |
9 | | - // This template is repeated many times for each element in list view |
10 | | - // TODO there's some words in here which need to become wfMsg() calls |
11 | | - $( "#backboneTemplates" ).append('<script type="text/template" id="listItemTemplate"> \ |
12 | | - <div class="mwe-pt-article-row"> \ |
13 | | - <div class="mwe-pt-status-icon"> \ |
14 | | - <% if ( afd_status == "1" || blp_prod_status == "1" || csd_status == "1" || prod_status == "1" ) { %> \ |
15 | | - [DEL] <!-- deleted --> \ |
16 | | - <% } else if ( patrol_status == "1" ) { %> \ |
17 | | - [PTR] <!-- patrolled --> \ |
18 | | - <% } else { %> \ |
19 | | - [NEW] <!-- not patrolled --> \ |
20 | | - <% } %> \ |
21 | | - </div> \ |
22 | | - <div class="mwe-pt-info-pane"> \ |
23 | | - <div> \ |
24 | | - <span class="mwe-pt-page-title"><%= title %></span> \ |
25 | | - <span class="mwe-pt-histlink">(<%= gM( "pagetriage-hist" ) %>)</span> \ |
26 | | - <span class="mwe-pt-metadata"> \ |
27 | | - · \ |
28 | | - <%= gM( "pagetriage-bytes", page_len ) %> \ |
29 | | - · \ |
30 | | - <%= gM( "pagetriage-edits", rev_count ) %> \ |
31 | | - · \ |
32 | | - <% if( category_count == "0" ) { %> \ |
33 | | - <span class="mwe-pt-metadata-warning"><%= gM( "pagetriage-no-categories" ) %></span> \ |
34 | | - <% } else { %> \ |
35 | | - <%= gM( "pagetriage-categories", category_count ) %> \ |
36 | | - <% } %> \ |
37 | | - <% if( linkcount == "0" ) { %> \ |
38 | | - · <span class="mwe-pt-metadata-warning"><%= gM("pagetriage-orphan") %></span> \ |
39 | | - <% } %> \ |
40 | | - </span> \ |
41 | | - </div> \ |
42 | | - <div class="mwe-pt-snippet"> \ |
43 | | - <%= snippet %> \ |
44 | | - </div> \ |
45 | | - </div> \ |
46 | | - </div> \ |
47 | | - <br/> \ |
48 | | - </script>' |
49 | | - ); |
50 | | - |
51 | 5 | // instantiate the collection of articles |
52 | 6 | var articles = new mw.pageTriage.ArticleList; |
53 | 7 | |
54 | 8 | // single list item |
55 | | - // TODO: move this into its own file? |
56 | 9 | var ListItem = Backbone.View.extend( { |
57 | 10 | tagName: "div", |
58 | 11 | template: _.template( $( "#listItemTemplate" ).html() ), |
— | — | @@ -106,5 +59,6 @@ |
107 | 60 | |
108 | 61 | } ); |
109 | 62 | |
| 63 | + // create an instance of the list view, which makes everything go. |
110 | 64 | var list = new ListView(); |
111 | 65 | } ); |
Index: trunk/extensions/PageTriage/modules/ext.pageTriage.views/ext.pageTriage.articleListItem.css |
— | — | @@ -6,14 +6,31 @@ |
7 | 7 | .mwe-pt-status-icon { |
8 | 8 | float: left; |
9 | 9 | width: 50px; |
| 10 | + height: 100%; |
10 | 11 | } |
11 | 12 | |
| 13 | +.mwe-pt-status-icon-new { |
| 14 | + background-color: #f2b3b3; |
| 15 | +} |
| 16 | + |
| 17 | +.mwe-pt-status-icon-triaged { |
| 18 | + background-color: #c3ead7; |
| 19 | +} |
| 20 | + |
| 21 | +.mwe-pt-status-icon-deleted { |
| 22 | + background-color: #b3b3b3; |
| 23 | +} |
| 24 | + |
12 | 25 | .mwe-pt-info-pane { |
13 | 26 | margin-left: 50px; |
14 | 27 | } |
15 | 28 | |
| 29 | +/* info about the article */ |
| 30 | +.mwe-pt-article { |
| 31 | + font-size: 1.2em; |
| 32 | +} |
| 33 | + |
16 | 34 | .mwe-pt-page-title { |
17 | | - font-size: 1.2em; |
18 | 35 | font-weight: bold; |
19 | 36 | } |
20 | 37 | |
— | — | @@ -22,7 +39,6 @@ |
23 | 40 | } |
24 | 41 | |
25 | 42 | .mwe-pt-metadata { |
26 | | - font-size:1.2em; |
27 | 43 | } |
28 | 44 | |
29 | 45 | .mwe-pt-metadata-warning { |
— | — | @@ -30,7 +46,11 @@ |
31 | 47 | font-weight: bold; |
32 | 48 | } |
33 | 49 | |
| 50 | +/* info about the article's author */ |
| 51 | +.mwe-pt-author { |
| 52 | +} |
| 53 | + |
| 54 | +/* the article snippet */ |
34 | 55 | .mwe-pt-snippet { |
35 | 56 | color: #bebebe; |
36 | 57 | } |
37 | | - |