This commit is contained in:
Arron Schaar 2011-12-02 15:37:28 -08:00
Родитель afac283063
Коммит 5b94a5b30e
4 изменённых файлов: 12 добавлений и 11 удалений

Просмотреть файл

@ -206,10 +206,10 @@ def get_package(request):
@user_passes_test(lambda u: u.is_superuser)
def update_package(request):
package = get_object_or_404(Package, pk=request.POST['package_id'])
if request.POST.__contains__('featured'):
if 'featured' in request.POST:
package.featured = request.POST.get('featured') == 'true'
if request.POST.__contains__('example'):
if 'example' in request.POST:
package.example = request.POST.get('example') == 'true'
package.save()

Просмотреть файл

@ -11,17 +11,17 @@
</h3>
<p class="description">{{ package.description }}</p>
<ul class="search_meta">
<li title="Author" class='author'><span>&nbsp;</span>
<li title="Author" class="author"><span>&nbsp;</span>
<a href="{{ url('person_public_profile', package.author.username) }}">{{ package.author.get_profile() }}</a></span></li>
<li title="Forks" class='forks'><span>&nbsp;</span>
<li title="Forks" class="forks"><span>&nbsp;</span>
{{ package.search_meta.copies_count }}</li>
{% if package.is_library() %}
<li title="Number of times used by other Addons or Libraries" class='used'><span>&nbsp;</span>
<li title="Number of times used by other Addons or Libraries" class="used"><span>&nbsp;</span>
{{ package.search_meta.times_depended }}</li>
{% endif %}
<li title="Development Activity" class='activity'><span>&nbsp;</span>
<li title="Development Activity" class="activity"><span>&nbsp;</span>
{{ get_activity_level_UI(package.search_meta.activity) }}</li>
<li title="Package Size" class='size'><span>&nbsp;</span>
<li title="Package Size" class="size"><span>&nbsp;</span>
{{ package.search_meta.size|filesizeformat }}</li>
</ul>
<ul class="UI_Actions">

Просмотреть файл

@ -1,8 +1,9 @@
window.addEvent('domready', function(e){
var setMsg = function(msg){
$('package_msg').set('html', msg);
var elem = $('package_msg');
elem.set('html', msg);
setTimeout(function(){
$('package_msg').set('html','');
elem.set('html','');
},2000);
}
$('btn_find_package').addEvent('click', function(e){
@ -25,7 +26,7 @@ window.addEvent('domready', function(e){
enabled = elem.getParent().hasClass('pressed'),
r = new Request({
url: admin_settings.update_package_url,
methpd: 'post',
method: 'post',
onSuccess: function(p){
setMsg("updated");
elem.getParent().toggleClass('pressed');

@ -1 +1 @@
Subproject commit 85f0e6f71ffeeb104f20da889c1f1a5edea624a1
Subproject commit ab0f4bd7077e1dfdba70bbdaea1be83d14405b83