mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-23 08:22:15 +00:00
More UI Improvements
This commit is contained in:
@@ -1,110 +1,47 @@
|
|||||||
{% extends request.is_ajax|yesno:"base_ajax_nomodal.html,base.html" %}
|
|
||||||
|
|
||||||
{% load static %}
|
{% load static %}
|
||||||
{% load paginator from filters %}
|
|
||||||
{% load to_class_name from filters %}
|
|
||||||
|
|
||||||
{% block title %}Rigboard Activity Stream{% endblock %}
|
<script src="{% static "js/tooltip.js" %}"></script>
|
||||||
|
<script src="{% static "js/popover.js" %}"></script>
|
||||||
|
<script src="{% static "js/moment.min.js" %}"></script>
|
||||||
|
<script src="{% static "js/moment-twitter.js" %}"></script>
|
||||||
|
<script>
|
||||||
|
$(function () {
|
||||||
|
$('[data-toggle="popover"]').popover().click(function(){
|
||||||
|
if($(this).attr('href')){
|
||||||
|
window.location.href = $(this).attr('href');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
{% block js %}
|
// This keeps timeago values correct, but uses an insane amount of resources
|
||||||
<script src="{% static "js/tooltip.js" %}"></script>
|
// $(function () {
|
||||||
<script src="{% static "js/popover.js" %}"></script>
|
// setInterval(function() {
|
||||||
<script src="{% static "js/moment.min.js" %}"></script>
|
// $('.date').each(function (index, dateElem) {
|
||||||
<script src="{% static "js/moment-twitter.js" %}"></script>
|
// var $dateElem = $(dateElem);
|
||||||
<script>
|
// var formatted = moment($dateElem.attr('data-date')).fromNow();
|
||||||
$(function () {
|
// $dateElem.text(formatted);
|
||||||
$('[data-toggle="popover"]').popover().click(function(){
|
// })
|
||||||
if($(this).attr('href')){
|
// });
|
||||||
window.location.href = $(this).attr('href');
|
// }, 10000);
|
||||||
}
|
moment().twitter();
|
||||||
});
|
|
||||||
|
|
||||||
// This keeps timeago values correct, but uses an insane amount of resources
|
$('.date').each(function (index, dateElem) {
|
||||||
// $(function () {
|
var $dateElem = $(dateElem);
|
||||||
// setInterval(function() {
|
var formatted = moment($dateElem.attr('data-date'),"DD/MM/YYYY HH:mm").twitterLong();
|
||||||
// $('.date').each(function (index, dateElem) {
|
$dateElem.text(formatted);
|
||||||
// var $dateElem = $(dateElem);
|
});
|
||||||
// var formatted = moment($dateElem.attr('data-date')).fromNow();
|
|
||||||
// $dateElem.text(formatted);
|
|
||||||
// })
|
|
||||||
// });
|
|
||||||
// }, 10000);
|
|
||||||
moment().twitter();
|
|
||||||
|
|
||||||
$('.date').each(function (index, dateElem) {
|
})
|
||||||
var $dateElem = $(dateElem);
|
|
||||||
var formatted = moment($dateElem.attr('data-date'),"DD/MM/YYYY HH:mm").twitterLong();
|
|
||||||
$dateElem.text(formatted);
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
})
|
</script>
|
||||||
|
<div class="list-group">
|
||||||
</script>
|
<div class="list-group-item" style="background-color: #eee;">
|
||||||
{% endblock %}
|
<h4 class="list-group-item-heading" style="margin:0;">Recent Changes</h4>
|
||||||
|
</div>
|
||||||
{% block content %}
|
|
||||||
{% if not request.is_ajax %}
|
<div id="activity" style="overflow:scroll; height:500px">
|
||||||
<div class="col-sm-12">
|
</div>
|
||||||
<div class="row">
|
|
||||||
<div class="col-sm-12">
|
<div class="list-group-item" style="background-color: #eee;"></div>
|
||||||
<h3>Rigboard Activity Stream</h3>
|
|
||||||
</div>
|
|
||||||
<div class="text-right col-sm-12">{% paginator %}</div>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-sm-12" style="overflow-y:scroll;">
|
|
||||||
<div class="list-group">
|
|
||||||
<div class="list-group-item" style="background-color: #eee;">
|
|
||||||
<h4 class="list-group-item-heading" style="margin:0;">Recent Changes</h4>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div style="max-height:514px; overflow:scroll;">
|
|
||||||
{% for version in object_list %}
|
|
||||||
{% if version.item_changes or version.field_changes or version.old == None %}
|
|
||||||
<div class="list-group-item" style="border-radius:0">
|
|
||||||
<div class="media" >
|
|
||||||
<div class="media-left">
|
|
||||||
<a href="#">
|
|
||||||
<img class="media-object" src="{{ version.revision.user.profile_picture}}" style="max-width:3em;">
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<div class="media-body">
|
|
||||||
<b>{{version.revision.user.name}}</b>
|
|
||||||
<span class="pull-right"><small><span class="date" data-date="{{version.revision.date_created}}"></span></small></span>
|
|
||||||
<br>
|
|
||||||
<small>
|
|
||||||
{% if version.old == None %}
|
|
||||||
Created
|
|
||||||
{% else %}
|
|
||||||
Changed {% include 'RIGS/version_changes.html' %} in
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
|
|
||||||
{% include 'RIGS/object_button.html' with object=version.new %}
|
|
||||||
</small>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
<div class="list-group-item" style="background-color: #eee;"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{% if not request.is_ajax %}
|
|
||||||
<div class="align-right">{% paginator %}</div>
|
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
|
||||||
{% endblock %}
|
|
||||||
|
|||||||
40
RIGS/templates/RIGS/activity_feed_data.html
Normal file
40
RIGS/templates/RIGS/activity_feed_data.html
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
{% extends request.is_ajax|yesno:"base_ajax_nomodal.html,base.html" %}
|
||||||
|
|
||||||
|
{% load static %}
|
||||||
|
{% load paginator from filters %}
|
||||||
|
{% load to_class_name from filters %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
{% if request.is_ajax %}
|
||||||
|
|
||||||
|
{% for version in object_list %}
|
||||||
|
{% if version.item_changes or version.field_changes or version.old == None %}
|
||||||
|
<div class="list-group-item" style="border-radius:0">
|
||||||
|
<div class="media" >
|
||||||
|
<div class="media-left">
|
||||||
|
<a href="#">
|
||||||
|
<img class="media-object img-rounded" src="{{ version.revision.user.profile_picture}}" style="max-width:3em;">
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="media-body">
|
||||||
|
<b>{{version.revision.user.name}}</b>
|
||||||
|
<span class="pull-right"><small><span class="date" data-date="{{version.revision.date_created}}"></span></small></span>
|
||||||
|
<br>
|
||||||
|
<small>
|
||||||
|
{% if version.old == None %}
|
||||||
|
Created
|
||||||
|
{% else %}
|
||||||
|
Changed {% include 'RIGS/version_changes.html' %} in
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
|
{% include 'RIGS/object_button.html' with object=version.new %}
|
||||||
|
</small>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
{% endblock %}
|
||||||
@@ -13,6 +13,61 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
|
<style>
|
||||||
|
/* columns of same height styles */
|
||||||
|
|
||||||
|
.row-full-height {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
.col-full-height {
|
||||||
|
height: 100%;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
.row-same-height {
|
||||||
|
display: table;
|
||||||
|
width: 100%;
|
||||||
|
/* fix overflow */
|
||||||
|
table-layout: fixed;
|
||||||
|
}
|
||||||
|
.col-xs-height {
|
||||||
|
display: table-cell;
|
||||||
|
float: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 768px) {
|
||||||
|
.col-sm-height {
|
||||||
|
display: table-cell;
|
||||||
|
float: none !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@media (min-width: 992px) {
|
||||||
|
.col-md-height {
|
||||||
|
display: table-cell;
|
||||||
|
float: none !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@media (min-width: 1200px) {
|
||||||
|
.col-lg-height {
|
||||||
|
display: table-cell;
|
||||||
|
float: none !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* vertical alignment styles */
|
||||||
|
|
||||||
|
.col-top {
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
.col-middle {
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
.col-bottom {
|
||||||
|
vertical-align: bottom;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
||||||
<div class="col-sm-12">
|
<div class="col-sm-12">
|
||||||
<h1>R<small>ig</small> I<small>nformation</small> G<small>athering</small> S<small>ystem</small></h1>
|
<h1>R<small>ig</small> I<small>nformation</small> G<small>athering</small> S<small>ystem</small></h1>
|
||||||
</div>
|
</div>
|
||||||
@@ -20,7 +75,8 @@
|
|||||||
<p><h4 class="list-group-item-heading" style="margin:0;">Welcome back, {{ user.get_full_name }}, there are {{ rig_count }} rigs coming up.</h4>
|
<p><h4 class="list-group-item-heading" style="margin:0;">Welcome back, {{ user.get_full_name }}, there are {{ rig_count }} rigs coming up.</h4>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-6">
|
<div class="row"><div class="row-same-height">
|
||||||
|
<div class="col-sm-6 col-sm-height col-top">
|
||||||
|
|
||||||
<div class="list-group">
|
<div class="list-group">
|
||||||
<div class="list-group-item" style="background-color: #eee;">
|
<div class="list-group-item" style="background-color: #eee;">
|
||||||
@@ -29,9 +85,7 @@
|
|||||||
|
|
||||||
<a class="list-group-item" href="{% url 'rigboard' %}"><span class="glyphicon glyphicon-list"></span> Rigboard</a>
|
<a class="list-group-item" href="{% url 'rigboard' %}"><span class="glyphicon glyphicon-list"></span> Rigboard</a>
|
||||||
<a class="list-group-item" href="{% url 'web_calendar' %}"><span class="glyphicon glyphicon-calendar"></span> Calendar</a>
|
<a class="list-group-item" href="{% url 'web_calendar' %}"><span class="glyphicon glyphicon-calendar"></span> Calendar</a>
|
||||||
<a class="list-group-item" href="{% url 'event_create' %}">
|
<a class="list-group-item" href="{% url 'event_create' %}"><span class="glyphicon glyphicon-plus"></span> New Event</a>
|
||||||
<span class="glyphicon glyphicon-plus"></span> New Event
|
|
||||||
</a>
|
|
||||||
<div class="list-group-item" style="background-color: #eee;"></div>
|
<div class="list-group-item" style="background-color: #eee;"></div>
|
||||||
|
|
||||||
<a class="list-group-item" href="//members.nottinghamtec.co.uk/forum" target="_blank"><span class="glyphicon glyphicon-link"></span> TEC Forum</a>
|
<a class="list-group-item" href="//members.nottinghamtec.co.uk/forum" target="_blank"><span class="glyphicon glyphicon-link"></span> TEC Forum</a>
|
||||||
@@ -79,8 +133,9 @@
|
|||||||
<div class="list-group-item" style="background-color: #eee;"></div>
|
<div class="list-group-item" style="background-color: #eee;"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-6" id="activity">
|
<div class="col-sm-6 col-sm-height col-top" >
|
||||||
|
{% include 'RIGS/activity_feed.html' %}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
</div></div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
@@ -202,7 +202,7 @@ class ActivityTable(generic.ListView):
|
|||||||
|
|
||||||
class ActivityFeed(generic.ListView):
|
class ActivityFeed(generic.ListView):
|
||||||
model = reversion.revisions.Version
|
model = reversion.revisions.Version
|
||||||
template_name = "RIGS/activity_feed.html"
|
template_name = "RIGS/activity_feed_data.html"
|
||||||
paginate_by = 25
|
paginate_by = 25
|
||||||
|
|
||||||
def get_queryset(self):
|
def get_queryset(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user