Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/site/app/views/developers/uploader.thtml
blob: 7a16fc2787a15f8a7828d6fbb3ca03722e79d29b (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
<?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">
    <?php
    $params = array('addons' => $all_addons);
    if ($type != 'new') {
        $params['extra'] = 'developers/editbox';
    }
    echo $this->renderElement('developers/sidebar', $params);

    echo '<div id="content-main" class="'.($type != 'new' && $author_role < AUTHOR_ROLE_DEV ? 'no-privs' : 'privs').'">';
    
    if ($type == 'new') {
        $title = 'Submit New Add-on';
        $addon_id = 0;
    }
    elseif ($type == 'update') {
        $title = sprintf('Update %s', $addon_name);
    }
    elseif ($type == 'file') {
        $title = sprintf('Add File to %s', "{$addon_name} {$version}");
    }
    echo $this->renderElement('developers/addonheader', array('title' => $title, 'addon_id' => $addon_id));
    ?>
    <?=$this->renderElement('noscript')?>
    <?=$this->renderElement('developers/rolecheck')?>
    <div id="submission-area" class="rounded graybox">
    <?php if ($type == 'new'): ?>
        <div id="step-intro">
            <h3>How does it all work?</h3>
            <p>Thanks for your interest in submitting your add-on to <?=SITE_NAME?>. Hosting your add-on on <?=SITE_NAME?> is the easiest way to handle distribution of your add-on. Here's what you'll get:</p>
            <ul>
                <li>Each add-on will have a public display page with information you provide, such as a brief summary of the add-on's functionality, an optional longer description, and a showcase of preview screenshots of your add-on.</li>
                <li>Your add-on will appear in search and browse listings across the site, and even in the Add-ons Manager of Firefox 3.</li>
                <li>We'll take care of hosting all of your downloads and providing automatic updates to users when you upload a new version.</li>
                <li>You'll have access to a statistics dashboard with detailed information about your user base.</li>
            </ul>
            <p>Add-ons hosted on the site must be reviewed by a <?=SITE_NAME?> Editor before they will have all of the features listed above. If you're ready to start the process and have your add-on package ready for upload, just click on "Get Started" below!</p>
            <div style="text-align: center;"><a href="#" onclick="upload.showAgreement(); return false;" class="action-button rounded">Get Started</a></div>
        </div> <!-- /#step-intro -->
        <div id="step-agreement">
            <p><?=_('devcp_review_agreement_please')?></p>
            <div class="agreement-text rounded">
                <?=$localization->includeLocalPage('developer_agreement')?>
                <div class="agreement-buttons">
                    <input type="button" value="<?=_('devcp_submit_decline_dev_agreement')?>" onclick="upload.hideAgreement();" />
                    <input type="button" value="<?=_('devcp_submit_accept_dev_agreement')?>" onclick="upload.acceptAgreement();"/>
                </div>
            </div>
        </div> <!-- /#step-agreement -->
    <?php endif; ?>
    
        <div id="file-upload"<?=($type == 'new' ? ' style="display: none;"' : '')?>>
            <h3>Upload Your File</h3>
            <p>Upload your add-on file using the form below. If you have multiple, platform-specific files to upload, choose a single file and then upload the others using the Versions and Files Manager.</p>
            <br />
            <form id="upload-form" method="post" enctype="multipart/form-data" action="<?=$html->url('/developers/json/fileupload/'.$type)?>" target="upload-frame" onsubmit="return upload.uploadFile();">
            <?=$html->hiddenSession();?>
            <?=(!empty($addon_id) ? '<input type="hidden" name="data[Addon][id]" value="'.$addon_id.'" />' : '')?>
            <?=(!empty($version_id) ? '<input type="hidden" name="data[Version][id]" value="'.$version_id.'" />' : '')?>
            <label>Add-on File: <input id="upload-field" type="file" name="file" /></label><br />
            Supported Platforms:&nbsp;&nbsp;<label><input type="radio" name="platformtype" onclick="upload.platformAll();" checked />&nbsp;All</label>&nbsp;&nbsp;
            <label><input type="radio" name="platformtype" onclick="upload.platformSpecific();" />&nbsp;Specific:</label>
            <?php
            $platforms = $this->controller->Platform->getNames();
            foreach ($platforms as $platform_id => $platform_name) {
                if ($platform_id == PLATFORM_ALL) continue;
                echo '&nbsp;&nbsp;<label class="specific-platforms disabled"><input type="checkbox" name="data[File][platform_id][]" value="'.$platform_id.'" disabled="disabled" />'.$platform_name.'</label>';
            }
            ?>
            <div class="submit">
                <input type="submit" value="Upload File" class="require-privs" />
            </div>
            <div id="upload-loading"><?=$html->image('ajax_loading.gif')?>&nbsp;Uploading file...</div>
            </form>
            <div id="upload-error" class="redbox-tr"><div class="redbox-tl">
                <div id="upload-error-content">
                    <h4>Oops! There seems to be a problem with this file...</h4>
                    <p id="upload-error-text" class="smallmargin"></p>
                    <p class="smallmargin">Please correct this problem and upload your file again.</p>
                </div>
                <div class="redbox-br"><div class="redbox-bl"></div></div>
            </div></div>
        </div><!-- /#file-upload -->
        
    </div><!-- /#submission-area -->
    
    <div id="upload-success" class="greenbox-tr"><div class="greenbox-tl">
    <?php if ($type == 'new'): ?>
        <div id="addon-created-content">
            <h3>Add-on Created!</h3>
            <div id="created-results">
                <p>Your add-on listing has been successfully created. The basic information obtained from your uploaded file has been stored, but there's a lot more to your listing that can be customized.</p>
                <p>Your add-on is currently marked as <strong>Incomplete</strong>. In order to complete your add-on, you'll need to make sure it has an accurate name, summary, and description, as well as at least one selected category. You can edit your add-on's information using the link below and check the status of your add-on at any time on the <a id="status-link" href="<?=$html->url('/developers/addon/status/')?>">status page</a>.</p>
                
                <div class="action-button-container centered"><a id="complete-link" href="<?=$html->url('/developers/addon/edit/')?>" class="action-button rounded">Edit My Add-on</a></div>
                <div style="text-align: center;"><a href="<?=$html->url('/developers')?>">I'll complete my add-on later.</a></div>
            </div>
        </div><!-- /#addon-created-content -->
    <?php elseif ($type == 'update'): ?>
        <div id="version-created-content">
            <h3>Version <span id="new-version-number"></span> Created!</h3>
            <div id="created-results">
                <p>Your new version has been created and is currently marked as <span id="new-file-status"></span>.</p>
                <p id="pending-message">The new version will be available to the public as soon as an editor is able to review it. There are currently <span id="queue-count"></span> other add-ons in the queue. Want to be reviewed faster? Consider <a href="http://wiki.sugarlabs.org/go/ActivityTeam/aslo">becoming an editor</a>.</p>
                <p>View your new version in the <a id="version-link" href="<?=$html->url('/developers/versions/edit/')?>">Versions and Files page</a>, check out your add-on's <a href="<?=$html->url('/developers/addon/status/'.$addon_id)?>">current status</a>, or <b>add release notes</b> by clicking the button below (highly recommended).</p>
                
                <div class="action-button-container centered"><a id="complete-link" href="<?=$html->url('/developers/versions/edit/')?>" class="action-button rounded">Add Release Notes</a></div>
            </div>
        </div><!-- /#version-created-content -->
    <?php elseif ($type == 'file'): ?>
        <div id="file-created-content">
            <h3>File Added!</h3>
            <div id="created-results">
                <p>Your new file has been added to version <?=$version?> and is currently marked as <span id="new-file-status"></span>.</p>
                <p id="pending-message">The new version will be available to the public as soon as an editor is able to review it. There are currently <span id="queue-count"></span> other add-ons in the queue. Want to be reviewed faster? Consider <a href="http://wiki.sugarlabs.org/go/ActivityTeam/aslo">becoming an editor</a>.</p>
                <p>View your new file in the <a href="<?=$html->url('/developers/versions/edit/'.$version_id)?>">Versions and Files page</a>, or check out your add-on's <a href="<?=$html->url('/developers/addon/status/'.$addon_id)?>">current status</a>.</p>
            </div>
        </div><!-- /#file-created-content -->
    <?php endif; ?>
        <div class="greenbox-br"><div class="greenbox-bl"></div></div>
    </div></div><!-- /#addon-created -->
</div><!-- /#content-main -->
</div><!-- /#content -->

<iframe id="upload-frame" name="upload-frame" src="" onload="iframeLoaded();" style="display: none;"></iframe>