This repository has been archived by the owner on Jan 12, 2022. It is now read-only.
forked from felipelerena/FlightDeck
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #77 from pennyfx/tags
Added featured and example tags to packages, updated styles, fixed admin template bug
- Loading branch information
Showing
16 changed files
with
248 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,66 @@ | ||
{% extends 'base.html' %} | ||
|
||
{% block title %}Mozilla FlightDeck Admin Area{% endblock title %} | ||
{% block title %}Mozilla FlightDeck Admin Area - {% endblock title %} | ||
|
||
{% block head_prejs %} | ||
<style type="text/css"> | ||
.UI_Forms .UI_Form_Actions li { | ||
float:none; | ||
display:inline-block; | ||
float: none; | ||
display: inline-block; | ||
} | ||
#package_msg{ | ||
color: red; | ||
} | ||
.package_meta li span{ | ||
font-weight: bold; | ||
margin-right: 4px; | ||
} | ||
#package_actions label{ | ||
display: inline; | ||
} | ||
#package_actions input, #package_actions button{ | ||
display: inline; | ||
border: solid 1px #ccc; | ||
} | ||
#package_actions button{ | ||
cursor: pointer; | ||
} | ||
</style> | ||
{% endblock %} | ||
|
||
{% block app_content %} | ||
<form method="post" action="" class="UI_Forms"> | ||
<h2 class="UI_Heading" style="padding-top:3em;">Search</h2> | ||
{% if message %} | ||
<p><strong>{{message}}</strong></p> | ||
{% endif %} | ||
{% csrf_token %} | ||
<ul class="UI_Form_Actions"> | ||
<li> | ||
<button name="action" value="setup_mapping" type="submit">Setup Mapping</button> | ||
</li> | ||
<li> | ||
<button name="action" value="index_all" type="submit">Index All</button> | ||
</li> | ||
</ul> | ||
</form> | ||
{% block head %} | ||
<script type="text/javascript"> | ||
var admin_settings = { | ||
'get_package_url':'{{ url('admin_get_package') }}', | ||
'update_package_url':'{{ url('admin_update_package') }}', | ||
}; | ||
</script> | ||
<script type="text/javascript" src="/media/base/js/Admin.js" ></script> | ||
{% endblock %} | ||
|
||
{% block app_content %} | ||
<form method="post" action="" class="UI_Forms"> | ||
<h2 class="UI_Heading" style="padding-top:3em;">Crons</h2> | ||
{% if message %} | ||
<p><strong>{{message}}</strong></p> | ||
{% endif %} | ||
{{ safe_csrf_token()|safe }} | ||
<ul class="UI_Form_Actions"> | ||
<li> | ||
<button name="action" value="setup_mapping" type="submit">Setup Mapping</button> | ||
</li> | ||
<li> | ||
<button name="action" value="index_all" type="submit">Index All</button> | ||
</li> | ||
</ul> | ||
</form> | ||
|
||
|
||
<div id="package_actions"> | ||
<h2 class="UI_Heading" style="padding-top:3em;">Package <span id="package_msg"></span></h2> | ||
<label for="txt_package_id">Fetch Package by Id</label> | ||
<input type="text" id="txt_package_id" /> <button type="button" id="btn_find_package">Find</button> | ||
<div id="package_item"></div> | ||
</div> | ||
|
||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
|
||
<div class="result package {{ package.is_addon()|yesno("addon,library") }}"> | ||
<input class="package_id" type="hidden" value="{{ package.id }}" /> | ||
<ul class="package_meta"> | ||
<li><span>name:</span>{{package.full_name}}<li> | ||
<li><span>package type:</span>{{ package.is_addon()|yesno("addon,library") }}<li> | ||
<li><span>author:</span> | ||
<a href="{{ url('person_public_profile', package.author.username) }}">{{ package.author.get_profile() }}</a></li> | ||
<li><span>version_name:</span>{{package.version_name}}<li> | ||
<li><span>version_id:</span>{{package.version_id}}</li> | ||
<li><span>active:</span>{{package.active}}</li> | ||
<li><span>deleted:</span>{{package.deleted}}</li> | ||
<li><span>created:</span>{{package.created_at}}</li> | ||
<li><span>updated:</span>{{package.last_update}}</li> | ||
<li><span>description:</span><p>{{package.description}}</p><li> | ||
</ul> | ||
<ul class="UI_Actions"> | ||
<li class="UI_Package_Featured {{ 'pressed' if package.featured else '' }}"><a href="">Featured</a></li> | ||
<li class="UI_Package_Example {{ 'pressed' if package.example else '' }}"><a href="">Example</a></li> | ||
</ul> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
window.addEvent('domready', function(e){ | ||
var setMsg = function(msg){ | ||
var elem = $('package_msg'); | ||
elem.set('html', msg); | ||
setTimeout(function(){ | ||
elem.set('html',''); | ||
},2000); | ||
} | ||
$('btn_find_package').addEvent('click', function(e){ | ||
var r = new Request({ | ||
url: admin_settings.get_package_url, | ||
onSuccess: function(p){ | ||
$('package_item').set('html',p); | ||
}, | ||
onFailure: function(err){ | ||
console.log(err); | ||
setMsg(err.status + " " + err.statusText); | ||
} | ||
}); | ||
r.get('package_id='+ $('txt_package_id').value); | ||
|
||
}); | ||
|
||
var updatePackage = function(elem, field, callback){ | ||
var id = elem.getParent('.package').getElement('.package_id').value, | ||
enabled = elem.getParent().hasClass('pressed'), | ||
r = new Request({ | ||
url: admin_settings.update_package_url, | ||
method: 'post', | ||
onSuccess: function(p){ | ||
setMsg("updated"); | ||
elem.getParent().toggleClass('pressed'); | ||
if (callback) callback(); | ||
}, | ||
onFailure: function(err){ | ||
if(err.status == 404){ | ||
$('package_item').set('html', ''); | ||
} | ||
setMsg(err.status + " " + err.statusText); | ||
} | ||
}); | ||
r.send('package_id='+id+'&'+field+'='+!enabled); | ||
}; | ||
|
||
$('package_item').addEvent('click:relay(.UI_Package_Featured a)', function(e){ | ||
e.stop(); | ||
updatePackage(this, 'featured') | ||
}); | ||
$('package_item').addEvent('click:relay(.UI_Package_Example a)', function(e){ | ||
e.stop(); | ||
updatePackage(this, 'example') | ||
}); | ||
}); |
Submodule shipyard
updated
from 85f0e6 to ab0f4b
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.