Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/site/app/views/developers/addon_status.thtml
blob: 7763ea153eba4f348ed65b2339f64e43f70ae464 (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
<?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
 * The Mozilla Foundation.
 * Portions created by the Initial Developer are Copyright (C) 2008
 * the Initial Developer. All Rights Reserved.
 *
 * Contributor(s):
 *      Justin Scott <fligtar@mozilla.com> (Original Author)
 *
 * 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">
    <?=$this->renderElement('developers/sidebar', array('addons' => $all_addons, 'extra' => 'developers/editbox'));?>

    <div id="content-main" class="<?=($author_role >= AUTHOR_ROLE_DEV ? 'privs' : 'no-privs')?>">
        <?=$this->renderElement('developers/addonheader', array('title' => "{$addon_name} Status", 'addon_id' => $addon_id));?>
        <?php
        if (!empty($success)) {
            echo '<div class="notice-success rounded"><span>Your changes have been saved.</span><br />Please note that some changes may take several hours to appear in all areas of the website.</div>';
        }
        if (!empty($errors)) {
            echo '<div class="notice-error rounded"><span>One or more of your changes couldn\'t be saved.</span><br />Please look for the errors below. The rest of your changes were successfully saved.</div>';
        }
        ?>
        <?=$this->renderElement('noscript')?>
        <?=$this->renderElement('developers/rolecheck')?>
        <form id="status-form" action="" method="post" enctype="multipart/form-data">
        <?=$html->hiddenSession();?>
        
        <div class="field graybox rounded spaced">
            <h4 class="status">Add-on Status: <span class="status-<?=$addon['Addon']['status']?>"><?=$statuses[$addon['Addon']['status']]?></span></h4>
            <p>
                <?php
                    // Add-on Status
                    switch ($addon['Addon']['status']) {
                        case STATUS_NULL:
                            echo 'Your add-on is currently <span class="status-0">Incomplete</span>. This means your add-on is not showing up on any portion of the site or update check service. You may come to this page to complete your add-on after it meets the criteria below for completion and transfer to the <span class="status-1">Sandbox</span>.';
                            break;
                        
                        case STATUS_SANDBOX:
                            echo 'Your add-on is in the <span class="status-1">Sandbox</span>, which means it will show up in listings and searches, but users must log in to download it. Updates are <b>not</b> being provided to your add-on through the update check service.';
                            break;
                        
                        case STATUS_NOMINATED:
                            echo 'Your add-on is in the <span class="status-1">Sandbox</span>, which means it will show up in listings and searches, but users must log in to download it. Updates are <b>not</b> being provided to your add-on through the update check service.';
                        
                            echo '</p><p>';
                            echo 'Your add-on is currently nominated to become <span class="status-4">Public</span> and is awaiting editor review. There are currently '.$nominationCount.' other add-ons in the nomination queue.';
                            break;
                        
                        case STATUS_PENDING:
                            echo 'Your add-on is pending. This shouldn\'t have happened. Please e-mail amo-editors@mozilla.org with your add-on ID and state this error.';
                            break;
                        
                        case STATUS_PUBLIC:
                            echo 'Your add-on is <span class="status-4">Public</span>, which means it will show up in all listings and searches and can be downloaded without restriction. Updates are being provided to your add-on through the update check service.';
                            break;
                        
                        case STATUS_DISABLED:
                            echo 'Your add-on was <span class="status-5">disabled</span> by an administrator and cannot be used. If you have any questions, please e-mail '.ADMIN_EMAIL.'.';
                            break;
                    }
                ?>
            </p>
            
            <?php
            if ($addon['Addon']['status'] == STATUS_NULL) {
                echo '<h5>Add-on Completion Criteria</h5>';
                echo '<ul class="criteria">';
                echo '<li class="'.($criteria['name'] ? 'pass' : 'fail').'">Add-on Name required</li>';
                echo '<li class="'.($criteria['summary'] ? 'pass' : 'fail').'">Add-on Summary required</li>';
                echo '<li class="'.($criteria['description'] ? 'pass' : 'fail').'">Add-on Description required</li>';
                echo '<li class="'.($criteria['category'] ? 'pass' : 'fail').'">At least one category selected</li>';
                echo '</ul>';
                
                $completionEnabled = false;
                if ($criteria['name'] && $criteria['summary'] && $criteria['description'] && $criteria['category']) {
                    $completionEnabled = true;
                    echo '<p>You may now complete your add-on and move it to the <span class="status-1">Sandbox</span> by clicking the button below.</p>';
                }
                else {
                    echo '<p>Please fulfill the criteria above before you can complete your add-on and move it to the <span class="status-1">Sandbox</span>.</p>';
                }
            }
            
            $nominationEnabled = false;
            if ($addon['Addon']['status'] == STATUS_SANDBOX && $addon['Addon']['higheststatus'] < STATUS_PUBLIC) {
                echo '<h5>Public Nomination Criteria</h5>';
                echo '<ul class="criteria">';
                echo '<li class="'.($criteria['previews'] ? 'pass' : 'fail').'">At least one preview image required for extensions and themes.</li>';
                echo '<li class="'.($criteria['reviews'] ? 'pass' : 'meh').'">Several user reviews of the add-on (may be external reviews).</li>';
                echo '<li class="'.($criteria['prerelease'] ? 'pass' : 'fail').'">Add-on is not marked as pre-release.</li>';
                echo '</ul>';
                
                if ((!in_array($addon['Addon']['addontype_id'], array(ADDON_EXTENSION, ADDON_THEME)) || $criteria['previews']) && $criteria['prerelease']) {
                    $nominationEnabled = true;
                    echo '<p>You may now nominate your add-on for <span class="status-4">Public</span> by clicking the button below.</p>';
                }
                else {
                    echo '<p>Please fulfill the criteria above before nominating your add-on to become <span class="status-4">Public</span>.</p>';
                }
            }
            
            // Actions
            $actions = '';
            if ($addon['Addon']['status'] == STATUS_NULL && $completionEnabled === true) {
                $actions .= '<tr><td class="action"><a href="'.$html->url("/developers/addon/status/{$addon_id}/complete").'" class="complete add-button rounded">Complete Add-on</a></td>';
                $actions .= '<td class="description">Complete your add-on and move to the Sandbox</td></tr>';
            }
            if ($addon['Addon']['status'] == STATUS_SANDBOX && $nominationEnabled === true) {
                $actions .= '<tr><td class="action"><a href="'.$html->url("/developers/addon/status/{$addon_id}/nominate").'" class="nominate add-button rounded">Nominate for Public</a></td>';
                $actions .= '<td class="description">Nominate your add-on to become Public</td></tr>';
            }
            if ($addon['Addon']['status'] == STATUS_PUBLIC) {
                $actions .= '<tr><td class="action"><a href="'.$html->url("/developers/addon/status/{$addon_id}/sandbox").'" class="to-sandbox add-button rounded">Move to Sandbox</a></td>';
                $actions .= '<td class="description">Move your add-on back to the Sandbox. This is reversible.</td></tr>';
            }
            if ($addon['Addon']['status'] == STATUS_SANDBOX && $addon['Addon']['higheststatus'] == STATUS_PUBLIC) {
                $actions .= '<tr><td class="action"><a href="'.$html->url("/developers/addon/status/{$addon_id}/public").'" class="to-public add-button rounded">Make Public</a></td>';
                $actions .= '<td class="description">Make your add-on Public again.</td></tr>';
            }
            
            if (!empty($actions)) {
                echo '<h5>Available Actions</h5>';
                echo '<table class="actions"><tbody>';
                echo $actions;
                echo '</tbody></table>';
            }
            ?>
        </div>
        
        <div class="field graybox rounded spaced">
            <h4 class="status">Active Status: <span class="inactive-<?=($addon['Addon']['inactive'] == 1 ? '1">Inactive' : '0">Active')?></span></h4>
            <p>
            <?php
            if ($addon['Addon']['inactive'] == 1) {
            echo 'Your add-on is <span class="inactive-1">Inactive</span>. This means your add-on will not show up in any listing, regardless of its status above. Updates are <b>not</b> being provided to your add-on through the update check service.';
            }
            else {
                echo 'Your add-on is <span class="inactive-0">Active</span>. This means your add-on is showing up in all available listings appropriate for its status above.';
            }
            ?>
            </p>
            <h5>Available Actions</h5>
            <table class="actions"><tbody>
            <?php
            if ($addon['Addon']['inactive'] == 1) {
                echo '<tr><td class="action"><a href="'.$html->url("/developers/addon/status/{$addon_id}/active").'" class="make-active add-button rounded">Make Active</a></td>';
                echo '<td class="description">Make your add-on active for it to show up in public listings and enable the update check service.</td></tr>';
            }
            else {
                echo '<tr><td class="action"><a href="'.$html->url("/developers/addon/status/{$addon_id}/inactive").'" class="make-inactive add-button rounded">Make Inactive</a></td>';
                echo '<td class="description">Make your add-on inactive to hide it from all public listings and disable the update check service.</td></tr>';
            }
            ?>
            </tbody></table>
        </div>
        
        <?php if ($addon['Addon']['trusted'] == 1): ?>
            <div class="field graybox rounded spaced">
                <h4 class="status">Trusted Status: <span class="status-4">Trusted</span></h4>
                
                <p>Your add-on is <span class="status-4">Trusted</span>. This means you can submit updates to your add-on without editor review.</p>
            </div>
        <?php endif; ?>
        </form>
    </div>
</div>