Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/site/app/views/developers/versions_edit.thtml
diff options
context:
space:
mode:
authorfligtar@gmail.com <fligtar@gmail.com@4eb1ac78-321c-0410-a911-ec516a8615a5>2008-05-29 22:16:06 (GMT)
committer fligtar@gmail.com <fligtar@gmail.com@4eb1ac78-321c-0410-a911-ec516a8615a5>2008-05-29 22:16:06 (GMT)
commitdd556709c06ac5b693ff5817d6a0430cb18535f8 (patch)
tree4d1f2ad71f5bad87dfef4457123cb1293c512468 /site/app/views/developers/versions_edit.thtml
parent2e7e52e0d0599522358c5f6809807077cd650fbd (diff)
merging 3.5 -> trunk
git-svn-id: http://svn.mozilla.org/addons/trunk@14188 4eb1ac78-321c-0410-a911-ec516a8615a5
Diffstat (limited to 'site/app/views/developers/versions_edit.thtml')
-rw-r--r--site/app/views/developers/versions_edit.thtml243
1 files changed, 243 insertions, 0 deletions
diff --git a/site/app/views/developers/versions_edit.thtml b/site/app/views/developers/versions_edit.thtml
new file mode 100644
index 0000000..a58a8be
--- /dev/null
+++ b/site/app/views/developers/versions_edit.thtml
@@ -0,0 +1,243 @@
+<?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/myaddons', 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' => "Edit {$addon_name}", '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>';
+ }
+ ?>
+ <h2>Manage Version <?=$version['Version']['version']?></h2>
+ <?=$this->renderElement('noscript')?>
+ <?=$this->renderElement('developers/rolecheck')?>
+ <form id="versions-edit-form" action="" method="post">
+ <?=$html->hiddenSession();?>
+ <?php
+ // Retrieve language arrays from bootstrap.
+ global $valid_languages, $native_languages;
+ foreach (array_keys($valid_languages) as $key) {
+ $languages[$key] = $native_languages[$key]['native'];
+ }
+ ksort($languages);
+
+ $this->translationBox = array(
+ 'defaultLocale' => $addon['Addon']['defaultlocale'],
+ 'languages' => $languages,
+ 'table' => 'Version',
+ 'loaded' => false
+ );
+
+ echo '<div class="graybox rounded spaced field">';
+ echo '<h4>File Information</h4>';
+ if (!empty($version['File'])) {
+ echo '<table id="files-table" class="pretty-table">';
+ echo '<thead><tr>';
+ echo '<th>File</th>';
+ echo '<th>Platform</th>';
+ echo '<th>Size</th>';
+ echo '<th>Status</th>';
+ echo '<th style="width: 25px;"></th>';
+ echo '</tr></thead><tbody>';
+ $i = 0;
+ foreach ($version['File'] as $file) {
+ echo '<tr'.($i % 2 == 0 ? ' class="alt"' : '').'>';
+ echo '<td>';
+ echo '<input type="hidden" name="data[File]['.$file['id'].'][delete]" value="0" class="delete"/>';
+ echo '<a href="'.$html->urlFile($file['id'], $file['filename']).'" class="filelink">'.$file['filename'].'</a></td>';
+ echo '<td><select name="data[File]['.$file['id'].'][platform_id]">';
+ foreach ($platforms as $platform_id => $platform_name) {
+ echo '<option value="'.$platform_id.'"'.($file['platform_id'] == $platform_id ? ' selected="selected"' : '').'>'.$platform_name.'</option>';
+ }
+ echo '</select></td>';
+ echo '<td>'.sprintf(_('size_kb'), $file['size']).'</td>';
+ echo '<td>'.$statuses[$file['status']].'</td>';
+ echo '<td><div class="inline-delete-button uses-image">';
+ echo '<a href="#" onclick="versions_edit.deleteVersion(this); return false;">'.$html->image('developers/delete.png', array('alt' => 'Delete File', 'title' => 'Delete File')).'</a>';
+ echo '<div class="inline-delete-box">';
+ echo '<p>Are you <b>sure</b> you wish to permanently delete this file?</p><br />';
+ echo '<p><a href="#" onclick="versions_edit.confirmDelete(this); return false;" class="remove-button rounded">Delete File</a>&nbsp;&nbsp;';
+ echo '<a href="#" onclick="versions_edit.cancelDelete(this); return false;" class="button rounded">Cancel</a></p>';
+ echo '</div>';
+ echo '</div></td>';
+ echo '</tr>';
+ $i++;
+ }
+ echo '</tbody></table>';
+ }
+ else {
+ echo '<p><i>No files found.</i></p>';
+ }
+ echo '<div class="save-changes rounded"><strong>You have unsaved changes.</strong> Files will not be deleted until you click Update Version below.</div>';
+ echo '<div class="add-button-container"><a href="'.$html->url("/developers/versions/addfile/{$version['Version']['id']}").'" class="add-button rounded">Add New File</a></div>';
+ echo '</div>';
+
+ // Compatible applications (hidden for search engines)
+ if ($addon['Addon']['addontype_id'] != ADDON_SEARCH) {
+ echo '<div class="graybox rounded spaced field">';
+ echo '<h4>Compatible Applications</h4>';
+ echo '<p>Adjusting application information here will allow users to install your add-on even if the install.rdf in the package indicates that the add-on is incompatible. <a href="'.$html->url('/pages/appversions').'">List of supported applications and versions</a></p>';
+
+ echo '<table id="edit-versions-targetapps-table" class="pretty-table"><tbody>';
+ $i = 0;
+ if (!empty($targetApps)) {
+ foreach ($targetApps as $application_id => $versions) {
+ echo '<tr class="'.$application_id.($i % 2 == 0 ? ' alt' : '').'">';
+ echo '<td>'.$html->image('developers/'.strtolower($applications[$application_id]).'.png', array('alt' => $applications[$application_id], 'class' => 'compat-icon')).'</td>';
+ echo '<td class="appname">';
+ echo '<input type="hidden" name="data[Application]['.$application_id.'][delete]" value="0" class="delete"/>';
+ echo $applications[$application_id].'</td>';
+ echo '<td><select name="data[Application]['.$application_id.'][min]">';
+ if (!empty($possibleVersions[$application_id])) {
+ foreach ($possibleVersions[$application_id] as $possibleVersion_id => $possibleVersion) {
+ if (strpos($possibleVersion, '*') === false) {
+ echo '<option value="'.$possibleVersion_id.'"'.($versions['min'] == $possibleVersion_id ? ' selected="selected"' : '').'>'.$possibleVersion.'</option>';
+ }
+ }
+ }
+ echo '</select>';
+ echo '&nbsp;&mdash;&nbsp;';
+ echo '<select name="data[Application]['.$application_id.'][max]">';
+ if (!empty($possibleVersions[$application_id])) {
+ foreach ($possibleVersions[$application_id] as $possibleVersion_id => $possibleVersion) {
+ echo '<option value="'.$possibleVersion_id.'"'.($versions['max'] == $possibleVersion_id ? ' selected="selected"' : '').'>'.$possibleVersion.'</option>';
+ }
+ }
+ echo '</select></td>';
+ echo '<td style="width: 25px;">';
+ echo '<div class="inline-delete-button uses-image">';
+ echo '<a href="#" onclick="versions_edit.deleteVersion(this); return false;">'.$html->image('developers/delete.png', array('alt' => 'Remove Application Compatibility', 'title' => 'Remove Application Compatibility')).'</a>';
+ echo '<div class="inline-delete-box">';
+ echo '<p>Are you <b>sure</b> you wish to remove compatibility with this application?</p><br />';
+ echo '<p><a href="#" onclick="versions_edit.confirmDelete(this); return false;" class="remove-button rounded">Remove Application</a>&nbsp;&nbsp;';
+ echo '<a href="#" onclick="versions_edit.cancelDelete(this); return false;" class="button rounded">Cancel</a></p>';
+ echo '</div>';
+ echo '</div></td>';
+
+ echo '</tr>';
+ $i++;
+ }
+ }
+ echo '</tbody></table>';
+ echo '<div class="save-changes rounded"><strong>You have unsaved changes.</strong> Compatibility will not be modified until you click Update Version below.</div>';
+ echo '<div class="add-button-container" style="width: 60%; margin: 10px auto 0;"><a href="#" onclick="versions_edit.showAppPicker(); return false;" class="add-button rounded">Add New Application</a>';
+ echo '<span id="new-app-picker"><select onchange="versions_edit.addApplication(this);">';
+ echo '<option value="">Please Select an Application</option>';
+ foreach ($applications as $application_id => $application_name) {
+ echo '<option value="'.$application_id.'">'.$application_name.'</option>';
+ }
+ echo '</select>';
+ echo '</span></div>';
+ echo '</div>';
+ }
+
+ // Version Notes
+ echo $this->renderElement('developers/translationbox', array(
+ 'field' => 'releasenotes',
+ 'translations' => $translations['releasenotes'],
+ 'height' => '130',
+ 'width' => 'inherit',
+ 'displayName' => 'Release Notes',
+ 'description' => 'Information about changes in this release, new features, known bugs, and other useful information specific to this release/version. This information will also be available to users updating the add-on in the Firefox 3 Add-ons Manager interface.'
+ ));
+
+ echo '<div class="graybox rounded spaced field">';
+ echo '<h4>Approval Information</h4>';
+ if (!empty($version['File'])) {
+ echo '<ul>';
+ foreach ($version['File'] as $file) {
+ echo '<li>'.sprintf('File %1$s (%2$s) created on %3$s and changed to %4$s on %5$s', $file['id'], $platforms[$file['platform_id']], strftime(_('date'), strtotime($file['created'])), $statuses[$file['status']], strftime(_('date'), strtotime($file['datestatuschanged']))).'</li>';
+ }
+ echo '</ul>';
+ }
+ echo '<h5>Approval Notes</h5>';
+ echo '<p class="smallmargin">Optional information for the Editor that reviews this version.</p>';
+ echo '<textarea name="data[Version][approvalnotes]" style="width: 100%; height: 70px;" class="rounded">'.$version['Version']['approvalnotes'].'</textarea>';
+ echo '</div>';
+ ?>
+
+ <div class="action-button-container centered"><a href="#" onclick="versions_edit.save(); return false;" class="action-button rounded">Update Version</a></div>
+ </form>
+ </div>
+</div>
+
+<?php
+/**
+ * Data for dynamically adding applications on the page
+ */
+// Array of application names so they can be added
+if ($addon['Addon']['addontype_id'] != ADDON_SEARCH) {
+ echo '<script type="text/javascript">';
+ echo 'var application_names = {';
+ foreach ($applications as $application_id => $application_name) {
+ echo $application_id.': "'.$application_name.'", ';
+ }
+ echo '};';
+ echo '</script>';
+
+ // Dropdowns for all applications so they can be added. This must be
+ // outside of the <form>
+ foreach ($applications as $application_id => $application_name) {
+ echo '<div id="app'.$application_id.'-dropdowns" style="display: none;">';
+ echo '<select name="data[Application]['.$application_id.'][min]">';
+ if (!empty($possibleVersions[$application_id])) {
+ foreach ($possibleVersions[$application_id] as $possibleVersion_id => $possibleVersion) {
+ if (strpos($possibleVersion, '*') === false) {
+ echo '<option value="'.$possibleVersion_id.'">'.$possibleVersion.'</option>';
+ }
+ }
+ }
+ echo '</select>';
+ echo '&nbsp;&mdash;&nbsp;';
+ echo '<select name="data[Application]['.$application_id.'][max]">';
+ if (!empty($possibleVersions[$application_id])) {
+ foreach ($possibleVersions[$application_id] as $possibleVersion_id => $possibleVersion) {
+ echo '<option value="'.$possibleVersion_id.'">'.$possibleVersion.'</option>';
+ }
+ }
+ echo '</select>';
+ echo '</div>';
+ }
+}
+?> \ No newline at end of file