Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/site/app/views/editors/review.thtml
blob: f6547ee4000082df2839eb5249fe456fcbf9dff9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
<?php
/* ***** BEGIN LICENSE BLOCK *****
 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
 *
 * The contents of this file are subject to the Mozilla Public License Version
 * 1.1 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * The Original Code is addons.mozilla.org site.
 *
 * The Initial Developer of the Original Code is
 * Justin Scott <fligtar@gmail.com>.
 * Portions created by the Initial Developer are Copyright (C) 2006
 * the Initial Developer. All Rights Reserved.
 *
 * Contributor(s):
 *   Frederic Wenzel <fwenzel@mozilla.com>
 *   RJ Walsh <rwalsh@mozilla.com>
 *
 * Alternatively, the contents of this file may be used under the terms of
 * either the GNU General Public License Version 2 or later (the "GPL"), or
 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 * in which case the provisions of the GPL or the LGPL are applicable instead
 * of those above. If you wish to allow use of your version of this file only
 * under the terms of either the GPL or the LGPL, and not to allow others to
 * use your version of this file under the terms of the MPL, indicate your
 * decision by deleting the provisions above and replace them with the notice
 * and other provisions required by the GPL or the LGPL. If you do not delete
 * the provisions above, a recipient may use your version of this file under
 * the terms of any one of the MPL, the GPL or the LGPL.
 *
 * ***** END LICENSE BLOCK ***** */
?>
<div id="content">
  <div id="reviewheader">
    <?=$this->renderElement('developers/editorsmenu');?>

    <?php if ($queueRank): ?>
    <div class="reviewnav">
        <?php
            if ($filtered) {
                echo sprintf(___('<strong># %1$s</strong> of %2$s in queue (filtered)'), $queueRank, $filteredCount);
            } else {
                echo sprintf(___('<strong># %1$s</strong> of %2$s in queue'), $queueRank, $filteredCount);
            }
        ?><br/>
        <?php if ($queueRank > 1) echo $html->link(___('&laquo; prev'), "/editors/queue/{$reviewType}?num=".($queueRank-1)); ?>
        <?php if ($queueRank < $count[$reviewType]) echo $html->link(___('next &raquo;'), "/editors/queue/{$reviewType}?num=".($queueRank+1)); ?>
    </div>
    <?php endif; ?>
  </div>

  <?= $this->renderElement('developers/review_motd', array('message' => $motd)) ?>
<a name="top"></a>
<h3><?=sprintf(___('Review %s'), $addon['Translation']['name']['string'].' '.$version['Version']['version'])?></h3>
<?php
    if (!empty($errors['main'])) {
        echo '<div class="error">'.$errors['main'].'</div>';
    }
?>
<div id="headerbox">
    <div id="header1" class="headerboxes">
        <div>
            <span class="sectionTitle"><?=___('Authors:')?></span>
            <ul id="authors">
            <?php
                if (!empty($addon['User'])) {
                    foreach ($addon['User'] as $user) {
                        echo '<li>'.$html->linkUserFromModel($user).'</li>';
                    }
                }
            ?>
            </ul>
        </div>
    </div>
    <div id="header2" class="headerboxes">
        <div>
            <span class="sectionTitle"><?=___('Categories:')?></span>
            <ul id="categorylist">
            <?php
                if (!empty($addon['Categories'])) {
                    foreach ($addon['Categories'] as $category) {
                        echo '<li '.$category['Translation']['name']['locale_html'].'>'.$category['Translation']['name']['string'].'</li>';
                    }
                }
            ?>
            </ul>
        </div>
    </div>
    <div id="header3" class="headerboxes">
        <span class="sectionTitle"><?=___('Compatibility:')?></span>
        <ul id="compatibility">
        <?php
            if (!empty($addon['targetApps'])) {
                $apps = array('Firefox', 'Thunderbird', 'Mozilla', 'Sunbird');
                foreach ($addon['targetApps'] as $app => $val) {
                    echo '<li>';
                    if (in_array($app, $apps)) {
                        echo $html->image('developers/'.strtolower($app).'.png');
                    }
                    else {
                        echo $html->image('developers/spacer.png');
                    }
                    echo "{$app} {$val['min']} - {$val['max']}</li>";
                }
            }
        ?>
        </ul>
    </div>
</div>
<br class="clear">
<div id="flagsbox">
    <span id="flagsTitle"><?=___('Flags:')?></span>
    <ul id="flags">
    <?php
        if ($addon['Addon']['adminreview']) {
            echo '<li>'.$html->image('developers/admin_review.png', array('title' => ___('Admin Review', 'editors_review_admin_flag'))).'</li>';
        } else {
            echo '<li>' . ___('none', 'editors_review_list_none') . '</li>';
        }
    ?>
    </ul>
</div>
<?=$html->formTag('/editors/review/'.$version['Version']['id'], 'post')?>
<div id="filesbox">
    <span id="filesTitle"><?=___('Files:')?></span>
    <ul id="files">
    <?php
        if (!empty($version['File'])) {
            foreach ($version['File'] as $file) {
                // automatically check file if there's only one -- or if this is
                // a nomination review, in which case all files will be made
                // public on approval
                if ($version['pendingCount'] == 1 || $reviewType == 'nominated') {
                    $checked = 'checked';
                } else {
                    $checked = 'false';
                }

                echo '<li>';
                echo $html->checkbox('Approval/File][', null, array('value' => $file['id'], 'class' => 'fileCheckbox', 'checked' => $checked, 'disabled' => $file['disabled'], 'onClick' => 'selectedFile();'));
                echo '&nbsp;<b>'.$html->link($platforms[$file['platform_id']], '/downloads/file/'.$file['id'].'/'.$file['filename'], array('onClick' => $this->controller->Amo->installTrigger($addon['Addon']['addontype_id'], FULL_BASE_URL.$html->url('/downloads/file/'.$file['id'].'/'.$file['filename']), $addon['Translation']['name']['string'].' '.$version['Version']['version'], '', $file['hash']).' return false;')).'</b>';
                echo ' - '.$approval[$file['status']].' ('.$file['created'].')';
                echo ' - '.$html->link(___('View Contents'), '/files/browse/'.$file['id'].'/1');
                if ($has_public && $addontype != ADDON_SEARCH) {
		        //if (count($addon['Version']) > 1) {
                	echo ' - '.$html->link(___('Compare with public version'), '/files/diff/'.$file['id'].'/');
		        }
                echo '</li>';
            }
        }
    ?>
    </ul>
    <span id="multipleNotice" style="display: none;"><?=___('Notice: Only review more than one file if you have tested EVERY file you select.')?></span>
</div>
<br class="clear">
<div id="links">
    <span id="overview_link"><?=$html->link(___('Item Overview'), '/addon/'.$addon['Addon']['id'])?></span>
    <span id="history_link"><a href="#history"><?=___('Item History', 'editors_review_a_item_history')?></a></span>
    <span id="previews_link"><a href="#previews"><?=___('Previews', 'editors_review_a_previews')?></a></span>
    <?=(!empty($addon['Addon']['homepage'])) ? '<span id="homepage_link">'.$html->link(___('Item Homepage'), $addon['Addon']['homepage']).'</span>' : ''?>
    <?=($this->controller->SimpleAcl->actionAllowed('Admin', 'EditAnyAddon', $this->controller->Session->read('User'))) ? '<span id="edit_link">'.$html->link(___('Edit Item'), '/developers/edit/'.$addon['Addon']['id']).'</span>' : ''?>
    <span id="comments_link"><a href="#editorComments"><?=___('Editor Comments', 'editors_review_a_comments')?></a></span>
</div>
<div id="form">
    <?php
        echo $html->hidden('Approval/ActionField', array('id' => 'actionField'));
        echo $html->hidden('Approval/Type', array('value' => $reviewType));
    ?>
    <div id="actionbox">
        <span id="public" class="action_color" onClick="selectAction('public');"><?=$html->image('developers/public-bw.png', array('id' => 'publicIcon')).' '.___('Push to Public')?></span>
        <span id="sandbox" class="action_color" onClick="selectAction('sandbox');"><?=$html->image('developers/sandbox-bw.png', array('id' => 'sandboxIcon')).' '.___('Retain in Sandbox')?></span>
        <span id="info" class="action_color" onClick="selectAction('info');"><?=$html->image('developers/info-bw.png', array('id' => 'infoIcon')).' '.___('Request More Information')?></span>
        <span id="superreview" class="action_color"><img id="superreviewIcon"></span>
    </div>
    <div id="actiondetails">
    <?php
        if ($reviewType == 'pending') {
            echo '<div id="details-public" style="display: none;">';
            echo ___('This will approve a sandboxed version of a public add-on to appear on the public side.');
            echo '</div>';
            echo '<div id="details-sandbox" style="display: none;">';
            echo ___('This will cause a sandboxed version of a public add-on to remain in the sandbox.');
            echo '</div>';
        }
        elseif ($reviewType == 'nominated') {
            echo '<div id="details-public" style="display: none;">';
            echo ___('This will mark the add-on and its most recent version and files as public. Future versions will go into the sandbox until they are reviewed by an editor.');
            echo '</div>';
            echo '<div id="details-sandbox" style="display: none;">';
            echo ___('This will retain the add-on in the sandbox.');
            echo '</div>';
        }
    ?>
        <div id="details-info" style="display: none;">
        <?=___('Use this form to request more information from the author. They will receive an email and be able to answer here. You will be notified by email when they reply.')?>
        </div>
        <div id="details-superreview" style="display: none;">
        <?=___('If you have concerns about this add-on\'s security, copyright issues, or other concerns that an administrator should look into, enter your comments in the area below. They will be sent to administrators, not the author.');?>
        </div>
    </div>
    <div id="subform" style="display: none;">
        <div id="commentsbox">
            <?=___('Comments:')?>
            <?=$html->textarea('Approval/comments', array('cols' => '70', 'rows' => '5', 'id' => 'comments', 'class' => 'input'))?>
        </div>
        <?php
            if (!empty($cannedresponses)) {
                echo '<div id="canned">';
                echo ___('or select a canned response:').' ';
                echo $html->selectTag('Approval/CannedResponse', $cannedresponses, null, array("onChange" => "document.getElementById('comments').value = this.value;", 'class' => 'input'));
                echo '</div>';
            }
            if ($reviewType == 'pending') {
        ?>
        <?php
            }
        ?>
        <div id="finish">
            <?=$html->submit(___('Process Action'), array('id' => 'process', 'onClick' => 'return validateReview(\''.$reviewType.'\');'))?>
        </div>
    </div>
</div>
</form>
<div id="notes">
<?php
if (!empty($addon['Addon']['nominationmessage'])) {
    echo '<div class="highlighted">';
    echo '<h3>'.___('Nomination Message').'</h3>';
    echo '<div id="nominationMessage">';
        echo nl2br($addon['Addon']['nominationmessage']);
    echo '</div>';
    echo '</div>';
}
if (!empty($version['Version']['approvalnotes'])) {
    echo '<h3>'.___('Notes to Reviewer').'</h3>';
    echo '<div id="reviewNotes">';
        echo nl2br($version['Version']['approvalnotes']);
    echo '</div>';
}
if (!empty($addon['Translation']['summary']['string'])) {
    echo '<h3>'.___('Summary', 'editors_review_header_summary').'</h3>';
    echo '<div id="summary" '.$addon['Translation']['summary']['locale_html'].'>';
        echo nl2br($addon['Translation']['summary']['string']);
    echo '</div>';
}
if (!empty($addon['Translation']['description']['string'])) {
    echo '<h3>'.___('Description').'</h3>';
    echo '<div id="description" '.$addon['Translation']['description']['locale_html'].'>';
        echo nl2br($addon['Translation']['description']['string']);
    echo '</div>';
}
if (!empty($version['Translation']['releasenotes']['string'])) {
    echo '<h3>'.___('Version Notes').'</h3>';
    echo '<div id="versionNotes" '.$version['Translation']['releasenotes']['locale_html'].'>';
        echo nl2br($version['Translation']['releasenotes']['string']);
    echo '</div>';
}
if (!empty($addon['Translation']['eula']['string'])) {
    echo '<h3>'.___('EULA').'</h3>';
    echo '<div id="EULA" '.$addon['Translation']['eula']['locale_html'].'>';
        echo nl2br($addon['Translation']['eula']['string']);
    echo '</div>';
}
if (!empty($addon['Translation']['privacypolicy']['string'])) {
    echo '<h3>'.___('Privacy Policy', 'editors_review_header_privacy').'</h3>';
    echo '<div id="privacyPolicy" '.$addon['Translation']['privacypolicy']['locale_html'].'>';
        echo nl2br($addon['Translation']['privacypolicy']['string']);
    echo '</div>';
}
if (!empty($addon['Translation']['developercomments']['string'])) {
    echo '<h3>'.___('Developer Comments', 'editors_review_header_devcomments').'</h3>';
    echo '<div id="developerComments" '.$addon['Translation']['developercomments']['locale_html'].'>';
        echo nl2br($addon['Translation']['developercomments']['string']);
    echo '</div>';
}
?>
</div>
<br class="clear">
<div id="validation" class="validation">
    <div class="sectionHeader">
        <div class="name"><a name="validation"></a><?=___('Validation Results') . ' [' . $html->link(___('help', 'editors_review_header_validation_help'), '/pages/validation') . ']'?></div>
        <div class="top"><a href="#top"><?=___('Top')?></a></div>
    </div>
    <br class="clear">
    <?php foreach($version['File'] as $file) : ?>
        <h4><?= $html->link(sprintf(___('Validation results for %s'), $file['filename']), '/developers/versions/validate/' . $version['Version']['id'] . '#test-results-' . $file['id']) ?></h4>
        <?= $this->renderElement('developers/testresults_header', array('test_groups' => $file['groups'], 'all_groups' => $test_groups, 'file' => array('File' => $file), 'counts' => $file['counts'], 'external_link' => true)); ?>
    <?php endforeach; ?>
</div>
<br class="clear">
<div id="history">
    <div class="sectionHeader">
        <div class="name"><a name="history"></a><?=___('Item History', 'editors_review_a_item_history')?></div>
        <div class="top"><a href="#top"><?=___('Top')?></a></div>
    </div>
    <br class="clear">
    <table id="historyTable">
        <tr id="headerRow">
            <td><?=___('Version/File')?></td>
            <td><?=___('Date', 'editors_review_th_date')?></td>
            <td><?=___('Reviewer')?></td>
            <td><?=___('Action', 'editors_review_th_action')?></td>
            <td><?=___('Comments')?></td>
        </tr>
    <?php
        if (!empty($history)) {
            foreach ($history as &$hist) {
                echo $this->renderElement('developers/editors_review_history_item', array('hist'=>$hist));
            }
            unset($hist); // PHP bug 35106
        }
        else {
            echo '<tr><td id="notFound" colspan="5">'.___('No previous review entries could be found.').'</td></tr>';
        }
    ?>
    </table>
</div>
<br class="clear">
<div id="previews">
    <div class="sectionHeader">
        <div class="name"><a name="previews"></a><?=___('Previews', 'editors_review_a_previews')?></div>
        <div class="top"><a href="#top"><?=___('Top')?></a></div>
    </div>
    <br class="clear">
    <?php
        if (!empty($addon['Preview'])) {
            foreach ($addon['Preview'] as $preview) {
                $previewUrl = $this->controller->Image->getPreviewURL($preview['id']);
                echo '<img src="'.$previewUrl.'" border=0>&nbsp;&nbsp;';
            }
        } else {
            echo ___('No previews found.');
        }
    ?>
</div>
<br class="clear">
<div id="editorComments">
    <div class="sectionHeader">
        <div class="name"><a name="editorComments"></a><?=___('Editor Comments', 'editors_review_a_comments')?></div>
        <div class="top"><a href="#top"><?=___('Top')?></a></div>
    </div>
    <br class="clear">
    <?php foreach ($comments as $c): ?>
    <div id="editorComment<?=$c['Versioncomment']['id']?>" class="editorComment commentDepth<?=$c['depth']?><?=($c['Versioncomment']['reply_to'] ? " commentReply{$c['Versioncomment']['reply_to']}" : '')?>">
        <div class="commentHeader"><?=$c['Versioncomment']['subject']?></div>
        <div class="commentSubheader">
            <?="{$c['User']['firstname']} {$c['User']['lastname']} "?>
            <?=$html->link("({$c['User']['email']})", "mailto:{$c['User']['email']}")?>
            <?=(" - " . strftime(___('%B %e, %Y, %I:%M %p'), strtotime($c['Versioncomment']['created'])))?>
        <?php
            if (! $c['Versioncomment']['reply_to']) { // start of thread
                $params = array('comment_id' => $c['Versioncomment']['id'],
                              'is_subscribed' => in_array($c['Versioncomment']['id'], $subscriptions));
                echo $this->renderElement('developers/editors_comment_add_form', $params);
            }
        ?>
        </div>
        <div class="commentBody">
            <?=$c['Versioncomment']['comment']?>
            <div class="commentFooter"><a href="#editorComment<?=$c['Versioncomment']['id']?>" class="replyLink"><?=___('(Reply)')?></a></div>
        </div>
    </div>
    <?php endforeach; ?>

    <a href="#" class="newThreadLink"><?=___('(New Thread)')?></a>
    <?=$html->formTag('/editors/review/'.$version['Version']['id'].($queueRank ? "?num={$queueRank}" : ''), 'post', array('id'=>'editorCommentForm', 'class'=>'hidden'))?>
    <div>
        <?=$html->input('Versioncomment/subject', array('size'=>'50'))?>
        <label for="VersioncommentSubject"><?=___('Subject', 'editors_review_label_subject')?></label><br />

        <?=$html->textarea('Versioncomment/comment', array('cols'=>'70', 'rows'=>'10'))?><br />

        <?=$html->hidden('Versioncomment/reply_to', array('value'=>''))?>
        <input type="submit" value="<?=___('Post Comment')?>" />
        <input type="button" value="<?=___('Cancel', 'editors_review_input_cancel')?>" id="VersioncommentCancel" />
    </div>
    <div id="markitupHelp" class="hidden">
        <span id="markitupHelpClose"><?=$html->image('developers/cross.png', array('alt'=>___('Close', 'editors_review_help_close'), 'title'=>___('Close', 'editors_review_help_close')))?></span>

        <h1><?=___('Comment Help')?></h1>

        <h2><?=___('Supported markdown syntax')?></h2>
        <dl>
        <dt><?=___('Line Break')?></dt>
        <dd><?=___('End a line with two or more spaces.')?></dd>
        <dt><?=___('Italics')?></dt>
        <dd><?=___('Wrap text with *asterisks* or _underscores_.')?></dd>
        <dt><?=___('Bold')?></dt>
        <dd><?=___('Wrap text with **two asterisks** or __two underscores__.')?></dd>
        <dt><?=___('Unordered List')?></dt>
        <dd><?=___('Start a line with a single * or + character.')?></dd>
        <dt><?=___('Ordered List')?></dt>
        <dd><?=___('Start a line with a number followed by a period.')?></dd>
        <dt><?=___('Block Quote')?></dt>
        <dd><?=___('Start lines with a &gt;. Multiple &gt; characters may be used to create nested block quotes.')?></dd>
        <dt><?=___('Code Block')?></dt>
        <dd><?=___('Enclose code with three or more ~ tilde characters on separate lines.')?></dd>
        <dt><?=___('Syntax Highlighting')?></dt>
        <dd><?=___('Append {.syntax} to the opening line of code block ~ tildes, where syntax is one of: html, css, javascript, diff, or sql.')?></dd>
        </dl>

        <h2><?=___('Button Modifier Keys')?></h2>
        <dl>
        <dt><?=___('Ctrl + Click')?></dt>
        <dd><?=___('Insert markup and retain selection.')?></dd>
        <dt><?=___('Shift + Click')?></dt>
        <dd><?=___('Insert markup and retain selection plus added markup.')?></dd>
        <dt><?=___('Ctrl + Shift + Click:')?></dt>
        <dd><?=___('Insert markup on every line of selection instead of once on the whole selection.')?></dd>
        </dl>
    </div>
    </form>
</div>
<div id="helpBackground" class="hidden"></div>
<script type="text/javascript">
// <![CDATA[
    $(document).ready(function() {
        $.extend(editors_review, {
            subscribe_url: '<?=$html->url('/editors/threadsubscribe/ajax')?>',
            unsubscribe_url: '<?=$html->url('/editors/threadunsubscribe/ajax')?>',
            subscribe_text: '<?=___('(Subscribe)')?>',
            unsubscribe_text: '<?=___('(Unsubscribe)')?>',
        });

        editors_review.miuMarkdownConfig.previewParserPath = '<?=$html->url('/editors/markdown')?>';
        editors_review.miuMarkdownConfig.previewParserVar = $("input[name='sessionCheck']:first").serialize() + '&data[markdown]';

        editors_review.init();
    });
// ]]>
</script>