Skip to content

Commit

Permalink
make ui neater (thanks @SteveBarnett)
Browse files Browse the repository at this point in the history
  • Loading branch information
miltontony committed Nov 7, 2014
1 parent fcdaf8a commit 4fd9ec3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
16 changes: 10 additions & 6 deletions project/templates/unicoremc/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<div class="grp-text">&nbsp;</div>
</th>
<th scope="col">
<div class="grp-text">&nbsp;</div>
<div class="grp-text">Content Store</div>
</th>
<th scope="col">
<div class="grp-text">Frontend URL</div>
Expand All @@ -47,24 +47,28 @@
{% block script %}
<script src="{{STATIC_URL}}js/jquery.min.js"></script>
<script type="text/javascript">

function reload_projects(){
$.getJSON('/progress/')
.done(function(data){
var projects = new Array();
$.each(data, function(){
var repo_url = this.repo_url.replace(/^(https?):\/\/github.com\//, '');
var frontend_url = this.frontend_url.replace(/^(https?):\/\//, '');
var cms_url = this.cms_url.replace(/^(https?):\/\//, '');

var row = '<th>' + this.app_type +'</th>' +
'<td>' + this.country + '</td>' +
'<td>' + this.state + '</td>' +
'<td><a target="_blank" href="'+ this.repo_url +'">'+ this.repo_url +'</a></td>' +
'<td><a target="_blank" href="'+ this.frontend_url +'">'+ this.frontend_url +'</a></td>' +
'<td><a target="_blank" href="'+ this.cms_url +'">'+ this.cms_url +'</a></td>' +
'<td><a target="_blank" href="'+ this.repo_url +'">'+ repo_url +'</a></td>' +
'<td><a target="_blank" href="'+ this.frontend_url +'">'+ frontend_url +'</a></td>' +
'<td><a target="_blank" href="'+ this.cms_url +'">'+ cms_url +'</a></td>' +
{% if user.is_superuser %}
'<td><a href="/advanced/'+ this.id +'/">'+ 'edit' +'</a></td>' +
{% endif %}
'';

var state_class = this.state == 'Done' ? 'bg-success' : 'bg-warning';
console.log(state_class)
var state_class = this.state == 'Ready for use' ? 'bg-success' : 'bg-warning';
projects.push(
$('<tr>').html(row).addClass(state_class));
});
Expand Down
6 changes: 3 additions & 3 deletions project/templates/unicoremc/new_project.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@
var options = new Array();
options.push($('<option>').val('').text('---------'));
$.each(data, function(){
if(this.name.startsWith('unicore-cms-content-' + app_name)){
options.push(
$('<option>').val(this.git_url).text(this.name));
if(this.name.startsWith('unicore-cms-content-' + app_name) ||
this.name.startsWith('unicore-cms-content-blank')){
options.push($('<option>').val(this.git_url).text(this.name));
}
});
$('#base_repo').html(options).removeAttr('disabled').change();
Expand Down
2 changes: 1 addition & 1 deletion unicoremc/states.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class DbInitialized(State):


class Done(State):
verbose_name = 'Done'
verbose_name = 'Ready for use'
transitions = {'destroy': 'destroyed'}


Expand Down

0 comments on commit 4fd9ec3

Please sign in to comment.