mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-23 08:22:15 +00:00
Redesigned homepage
This commit is contained in:
110
RIGS/templates/RIGS/activity_feed.html
Normal file
110
RIGS/templates/RIGS/activity_feed.html
Normal file
@@ -0,0 +1,110 @@
|
||||
{% extends request.is_ajax|yesno:"base_ajax_nomodal.html,base.html" %}
|
||||
|
||||
{% load static %}
|
||||
{% load paginator from filters %}
|
||||
{% load to_class_name from filters %}
|
||||
|
||||
{% block title %}Rigboard Activity Stream{% endblock %}
|
||||
|
||||
{% block js %}
|
||||
<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');
|
||||
}
|
||||
});
|
||||
|
||||
// This keeps timeago values correct, but uses an insane amount of resources
|
||||
// $(function () {
|
||||
// setInterval(function() {
|
||||
// $('.date').each(function (index, dateElem) {
|
||||
// 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>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% if not request.is_ajax %}
|
||||
<div class="col-sm-12">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<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.current %}
|
||||
</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>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
@@ -85,36 +85,4 @@
|
||||
</div>
|
||||
<div class="align-right">{% paginator %}</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div>
|
||||
<br>
|
||||
<h2>Rigboard Activity Stream - Scrollable Stream View <br/><small>Possibly to go on homepage</small></h2>
|
||||
<br>
|
||||
<div style="
|
||||
max-height: 500px;
|
||||
max-width: 300px;
|
||||
overflow-y:scroll;
|
||||
border:1px solid black;">
|
||||
{% for version in object_list %}
|
||||
{% if version.item_changes or version.field_changes or version.old == None %}
|
||||
<div class="well">
|
||||
{% include 'RIGS/profile_button.html' with profile=version.revision.user %}
|
||||
|
||||
{% if version.old == None %}
|
||||
created
|
||||
{% else %}
|
||||
changed {% include 'RIGS/version_changes.html' %} in
|
||||
{% endif %}
|
||||
{% include 'RIGS/object_button.html' with object=version.current %}
|
||||
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
@@ -1,46 +1,86 @@
|
||||
{% extends 'base.html' %}
|
||||
{% block title %}RIGS{% endblock %}
|
||||
|
||||
{% block js %}
|
||||
<script>
|
||||
$(function () {
|
||||
$( "#activity" ).load( "{% url 'activity_feed' %}", function() {
|
||||
// Loaded
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="col-sm-12">
|
||||
<h2>Rig Information Gathering System</h2>
|
||||
<h1>R<small>ig</small> I<small>nformation</small> G<small>athering</small> S<small>ystem</small></h1>
|
||||
</div>
|
||||
<div class="col-sm-12">
|
||||
<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>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="well">
|
||||
{% if user.is_authenticated %}
|
||||
<h3>Welcome back {{ user.get_full_name }}.<br />
|
||||
<small>Your rigboard initials are {{ user.initials }}</small></h3>
|
||||
{% endif %}
|
||||
<h3>There are currently {{ rig_count }} rigs coming up.</h3>
|
||||
<a class="btn btn-default" href="{% url 'rigboard' %}">View Rigboard</a>
|
||||
<a class="btn btn-default" href="{% url 'event_create' %}">
|
||||
New Event <span class="glyphicon glyphicon-plus"></span>
|
||||
</a>
|
||||
|
||||
<div class="list-group">
|
||||
<div class="list-group-item" style="background-color: #eee;">
|
||||
<h4 class="list-group-item-heading" style="margin:0;">Quick Links</h4>
|
||||
</div>
|
||||
|
||||
<a class="list-group-item" href="{% url 'rigboard' %}"><span class="glyphicon glyphicon-plus"></span> Rigboard</a>
|
||||
<a class="list-group-item" href="{% url 'web_calendar' %}"><span class="glyphicon glyphicon-plus"></span> Calendar</a>
|
||||
<a class="list-group-item" href="{% url 'event_create' %}">
|
||||
<span class="glyphicon glyphicon-plus"></span> New Event
|
||||
</a>
|
||||
<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/wiki" target="_blank"><span class="glyphicon glyphicon-link"></span> TEC Wiki</a>
|
||||
<a class="list-group-item" href="//members.nottinghamtec.co.uk/price" target="_blank"><span class="glyphicon glyphicon-link"></span> Price List</a>
|
||||
|
||||
|
||||
<div class="list-group-item" style="background-color: #eee;"></div>
|
||||
</div>
|
||||
|
||||
<div class="list-group">
|
||||
<div class="list-group-item" style="background-color: #eee;">
|
||||
<h4 class="list-group-item-heading" style="margin:0;">Search Rigboard</h4>
|
||||
</div>
|
||||
<div class="list-group-item">
|
||||
<form class="form" role="form" action="{% url 'person_list' %}" method="GET">
|
||||
<div class="input-group">
|
||||
<input type="search" name="q" class="form-control" placeholder="Search People" />
|
||||
<span class="input-group-btn">
|
||||
<button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-search"></span></button>
|
||||
</span>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="list-group-item">
|
||||
<form class="form" role="form" action="{% url 'organisation_list' %}" method="GET">
|
||||
<div class="input-group">
|
||||
<input type="search" name="q" class="form-control" placeholder="Search Organisations" />
|
||||
<span class="input-group-btn">
|
||||
<button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-search"></span></button>
|
||||
</span>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="list-group-item">
|
||||
<form class="form" role="form" action="{% url 'venue_list' %}" method="GET">
|
||||
<div class="input-group">
|
||||
<input type="search" name="q" class="form-control" placeholder="Search Venues" />
|
||||
<span class="input-group-btn">
|
||||
<button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-search"></span></button>
|
||||
</span>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="list-group-item" style="background-color: #eee;"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="well">
|
||||
<div>
|
||||
<h4><a href="{% url 'person_list' %}">People</a></h4>
|
||||
<form class="form-inline" role="form" action="{% url 'person_list' %}" method="GET">
|
||||
<input type="search" name="q" class="form-control" placeholder="Search People" />
|
||||
<button type="submit" class="form-control"><span class="glyphicon glyphicon-search"></span></button>
|
||||
</form>
|
||||
</div>
|
||||
<div>
|
||||
<h4><a href="{% url 'organisation_list' %}">Organisations</a></h4>
|
||||
<form class="form-inline" role="form" action="{% url 'organisation_list' %}" method="GET">
|
||||
<input type="search" name="q" class="form-control" placeholder="Search Organisations" />
|
||||
<button type="submit" class="form-control"><span class="glyphicon glyphicon-search"></span></button>
|
||||
</form>
|
||||
</div>
|
||||
<div>
|
||||
<h4><a href="{% url 'venue_list' %}">Venues</a></h4>
|
||||
<form class="form-inline" role="form" action="{% url 'venue_list' %}" method="GET">
|
||||
<input type="search" name="q" class="form-control" placeholder="Search Venues" />
|
||||
<button type="submit" class="form-control"><span class="glyphicon glyphicon-search"></span></button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6" id="activity">
|
||||
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -1,4 +1,4 @@
|
||||
{% load to_class_name from filters %}
|
||||
{# pass in variable "object" to this template #}
|
||||
|
||||
<a title="{{object|to_class_name}} {{ object.pk|stringformat:"05d" }} | {{object.name}}" type="button" href="{{ object.get_absolute_url }}" class="btn btn-default btn-xs">{{object|to_class_name}} {{ object.pk|stringformat:"05d" }}</a>
|
||||
<a title="{% if object.is_rig == False %}Non-rig{% elif object.dry_hire %}Dry Hire{% elif object.is_rig %}Rig{%else%}{{object|to_class_name}}{% endif %} | '{{object.name}}'" href="{{ object.get_absolute_url }}">{% if object.is_rig == False %}Non-rig{% elif object.dry_hire %}Dry Hire{% elif object.is_rig %}Rig{%else%}{{object|to_class_name}}{% endif %} | '{{object.name}}'</a>
|
||||
Reference in New Issue
Block a user