зеркало из https://github.com/mozilla/FlightDeck.git
code review fixes
This commit is contained in:
Родитель
afac283063
Коммит
5b94a5b30e
|
@ -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> </span>
|
||||
<li title="Author" class="author"><span> </span>
|
||||
<a href="{{ url('person_public_profile', package.author.username) }}">{{ package.author.get_profile() }}</a></span></li>
|
||||
<li title="Forks" class='forks'><span> </span>
|
||||
<li title="Forks" class="forks"><span> </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> </span>
|
||||
<li title="Number of times used by other Addons or Libraries" class="used"><span> </span>
|
||||
{{ package.search_meta.times_depended }}</li>
|
||||
{% endif %}
|
||||
<li title="Development Activity" class='activity'><span> </span>
|
||||
<li title="Development Activity" class="activity"><span> </span>
|
||||
{{ get_activity_level_UI(package.search_meta.activity) }}</li>
|
||||
<li title="Package Size" class='size'><span> </span>
|
||||
<li title="Package Size" class="size"><span> </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
|
Загрузка…
Ссылка в новой задаче