Parent: [ddf08c] (diff)

Download this file

project_overview.html    155 lines (144 with data), 5.9 kB

  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
{#-
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-#}
{% extends g.theme.master %}
{% block title %}{{c.project.name}} / Metadata{% endblock %}
{% block header %}Project Admin{% endblock %}
{% block content %}
{% if c.project.deleted %}
<div class="notice">This project has been deleted and is not visible to non-admin users</div>
{% endif %}
{{c.metadata_admin.display(value=c.project,
show_export_control=show_export_control,
allow_project_delete=allow_project_delete)}}
{{c.explain_export_modal.display(content=explain_export_text)}}
{% endblock %}
{% block extra_js %}
<script type="text/javascript" src="{{g.forge_static('js/jquery.maxlength.min.js')}}"></script>
<script type="text/javascript">
/*global confirm: true*/
$(document).ready(function () {
$.maxlength.setDefaults({feedbackText : '{r} characters left'})
var $metadata_form = $('#metadata_form');
var $removal_original = $('input[name=removal]:checked');
var $removal_delete_cb = $('#removal_delete_cb');
var currently_deleted = $removal_delete_cb.is(':checked');
var $support_page_url_cb = $('#support_page_url_cb');
var $removal_moved_cb = $('#removal_moved_cb');
var $support_page_url = $('input[name=support_page_url]');
var $moved_to_url = $('input[name=moved_to_url]');
var update_url = function(check_cb, url_input){
if(check_cb.is(':checked')){
url_input.attr('disabled', false);
}
else{
url_input.attr('disabled', true);
url_input.val('');
}
};
// manage url input state for support page and removal
update_url($support_page_url_cb, $support_page_url);
update_url($removal_moved_cb, $moved_to_url);
$('input[name=summary]').maxlength({max: 70});
$('textarea[name=short_description]').maxlength({max: 1000});
$('input[name=support_page]').change(function(){
update_url($support_page_url_cb, $support_page_url);
});
$('#delete-icon').click(function(e) {
e.preventDefault();
if (confirm('Remove project icon? This cannot be undone.')) {
$(this).after('<input type="hidden" name="delete_icon" value="Delete Icon" />')
.closest('form').submit();
}
});
$('#edit-icon').click(function(e) {
e.preventDefault();
var $this = $(this);
var $parent = $this.closest('#project-icon');
$('#project-icon-upload').removeClass('hidden');
});
$('#project-status a').click(function(e) {
e.preventDefault();
$('#project-status-edit').removeClass('hidden');
});
$('input[name=removal]').change(function(){
update_url($removal_moved_cb, $moved_to_url);
// confirmation for delete
if($(this).val()==='deleted' && !currently_deleted){
if(confirm('Are you sure you want to delete this project?')){
$metadata_form.append('<input type="hidden" name="delete" value="true">');
$('#metadata_form').submit();
}
else{
$removal_original.attr('checked', true);
}
}
{% if config.get('auth.method', 'local') == 'sfx' %}
else if($(this).val()!=='deleted' && currently_deleted){
alert('You may not undelete a project that has already been deleted.');
$removal_original.attr('checked', true);
}
{% else %}
else if($(this).val()!=='deleted' && currently_deleted){
if(confirm('Are you sure you want to undelete this project?')){
$metadata_form.append('<input type="hidden" name="undelete" value="true">');
$('#metadata_form').submit();
}
else{
$removal_original.attr('checked', true);
}
}
{% endif %}
});
// export control functionality
var $export_details = $('#export_details');
var $export_controlled = $('#export_controlled');
var $export_control_type = $('input[name=export_control_type]');
var $export_warning = $('#export_warning');
$export_controlled.change(function(){
if($export_controlled.is(':checked')){
$export_details.show();
$export_control_type.change();
}
else{
$export_details.hide();
$export_warning.hide();
}
});
$export_control_type.change(function(evt){
var $targ = jQuery(evt.target);
if ($targ.is(':checked') && $targ.val() === 'more_than_25') {
$export_warning.show();
} else {
$export_warning.hide();
}
}).change();
});
</script>
{% endblock %}
{% block extra_css %}
<style type="text/css">
.grid-9 input[type="text"], .grid-9 select, .grid-9 textarea{
width: 95%
}
.grid-9 input[type="radio"]{
vertical-align: middle
}
textarea[name="short_description"]{
height: 100px;
}
</style>
{% endblock %}