diff --git a/maraudes/forms.py b/maraudes/forms.py index fce4cc5..a7b8a3f 100644 --- a/maraudes/forms.py +++ b/maraudes/forms.py @@ -33,8 +33,7 @@ class SignalementForm(NoteForm): ObservationInlineFormSet = inlineformset_factory( Rencontre, Observation, form=NoteForm, - extra = 0, - min_num = 1, + extra = 1, ) RencontreInlineFormSet = inlineformset_factory( diff --git a/maraudes/models.py b/maraudes/models.py index 16dc944..48a3866 100644 --- a/maraudes/models.py +++ b/maraudes/models.py @@ -123,6 +123,12 @@ class Maraude(models.Model): def rencontre_count(self): return self.rencontres.count() + def get_observations(self): + observations = [] + for r in self.rencontres.all(): + observations += r.observations.all() + return observations + def get_absolute_url(self): return reverse('maraudes:details', kwargs={'pk': self.id}) diff --git a/maraudes/templates/compte_rendu/compterendu_create.html b/maraudes/templates/compte_rendu/compterendu_create.html index 950073e..0d43c72 100644 --- a/maraudes/templates/compte_rendu/compterendu_create.html +++ b/maraudes/templates/compte_rendu/compterendu_create.html @@ -105,9 +105,9 @@
{% csrf_token %} -
+
-

Nouvelle rencontre +

Nouvelle rencontre {% bootstrap_button "Enregistrer" icon="save" button_type="submit" button_class="btn btn-success btn-sm pull-right" %}

@@ -127,8 +127,8 @@
-
-

Enregistrées +
+ diff --git a/maraudes/templates/maraudes/details.html b/maraudes/templates/maraudes/details.html index 6cf8573..ca05f01 100644 --- a/maraudes/templates/maraudes/details.html +++ b/maraudes/templates/maraudes/details.html @@ -1,4 +1,4 @@ -
+
{% if maraude.est_terminee %} {% include "compte_rendu/compterendu.html" %} {% else %} diff --git a/maraudes/templates/maraudes/index.html b/maraudes/templates/maraudes/index.html index 15a463f..1823199 100644 --- a/maraudes/templates/maraudes/index.html +++ b/maraudes/templates/maraudes/index.html @@ -1,4 +1,4 @@ -
+
Votre prochaine maraude
diff --git a/maraudes/templates/maraudes/list.html b/maraudes/templates/maraudes/list.html index 78ff6b4..778a180 100644 --- a/maraudes/templates/maraudes/list.html +++ b/maraudes/templates/maraudes/list.html @@ -1,49 +1,56 @@ {% load bootstrap3 %} -
- -
- - - - +
+
+ +
+

Maraudes

+
+ + + + {% for maraude in object_list %} + + + + {% endfor %} +
+ +
+ {{ maraude.binome }} & {{ maraude.referent }} + {{maraude.rencontres.count}} rencontres +
+
+ {% if is_paginated %} + + {% endif %}
- - - - - - - {% for maraude in object_list %} - - - -{% endfor %} -
Maraudes
- -
- {{ maraude.binome }} & {{ maraude.referent }} - {{maraude.rencontres.count}} rencontres -
-
-
-{% if is_paginated %} -
-
    - {% for num in page_obj.paginator.page_range %} -
  • {{num}}
  • - {%endfor%} -
+
+
+ +
+

Filtres

+
+ +
-{% endif %} diff --git a/maraudes/templates/maraudes/menu.html b/maraudes/templates/maraudes/menu.html deleted file mode 100644 index bb64c7e..0000000 --- a/maraudes/templates/maraudes/menu.html +++ /dev/null @@ -1,16 +0,0 @@ -{% if dernieres_maraudes %}
-
Maraudes
-
- {% for maraude in dernieres_maraudes %} - {{ maraude }} - {% endfor %} - Autres... -
-
{% endif %} - -{% if user.is_superuser %}
-
Administration
-
- Planning -
-
{% endif %} diff --git a/maraudes/templates/maraudes/menu_administration.html b/maraudes/templates/maraudes/menu_administration.html new file mode 100644 index 0000000..f3fe8e7 --- /dev/null +++ b/maraudes/templates/maraudes/menu_administration.html @@ -0,0 +1,7 @@ +{% if user.is_superuser %} + +{% endif %} diff --git a/maraudes/templates/maraudes/panel_admin.html b/maraudes/templates/maraudes/panel_admin.html deleted file mode 100644 index 88ce05a..0000000 --- a/maraudes/templates/maraudes/panel_admin.html +++ /dev/null @@ -1,7 +0,0 @@ -{% if user.is_superuser %}
-
Administration
- -
{% endif %} diff --git a/maraudes/templates/maraudes/panel_dernieres_maraudes.html b/maraudes/templates/maraudes/panel_dernieres_maraudes.html deleted file mode 100644 index 5c09a50..0000000 --- a/maraudes/templates/maraudes/panel_dernieres_maraudes.html +++ /dev/null @@ -1,15 +0,0 @@ -{% if dernieres_maraudes %} -
-
-

Dernières maraudes - Aller à la liste

-
-
- {% for m in dernieres_maraudes %} - - {{ m }} {{m.binome}} & {{m.referent}} - - {% endfor %} -
-
-{% endif %} diff --git a/maraudes/views.py b/maraudes/views.py index 466883d..c33f322 100644 --- a/maraudes/views.py +++ b/maraudes/views.py @@ -23,7 +23,11 @@ from .forms import ( RencontreForm, RencontreInlineFormSet, SignalementForm, MaraudeAutoDateForm, MonthSelectForm, ) from website import decorators as website -webpage = website.webpage(ajax=False, permissions=['maraudes.view_maraudes']) +webpage = website.webpage( + ajax=False, + permissions=['maraudes.view_maraudes'], + app_menu=["maraudes/menu_dernieres_maraudes.html", "maraudes/menu_administration.html"] + ) @@ -46,7 +50,7 @@ class DerniereMaraudeMixin(object): @webpage -class IndexView(DerniereMaraudeMixin, generic.FormView): +class IndexView(DerniereMaraudeMixin, generic.TemplateView): class PageInfo: title = "Maraude - Tableau de bord" @@ -54,10 +58,6 @@ class IndexView(DerniereMaraudeMixin, generic.FormView): header_small = "Tableau de bord" template_name = "maraudes/index.html" - form_class = SignalementForm - - def get_panels(self): - return ["maraudes/panel_dernieres_maraudes.html", "maraudes/panel_admin.html"] ## MARAUDES @@ -75,15 +75,9 @@ class MaraudeDetailsView(DerniereMaraudeMixin, generic.DetailView): def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) - context['notes'] = Note.objects.filter( #TODO: use better selection, - # using time range. - created_date=self.object.date - ).by_time() + context['notes'] = self.object.get_observations() return context - def get_panels(self): - return ["maraudes/panel_dernieres_maraudes.html"] - @webpage @@ -138,12 +132,6 @@ class CompteRenduCreateView(generic.DetailView): def post(self, request, *args, **kwargs): self.get_forms(request.POST, request.FILES) if self.form.has_changed(): - if not self.inline_formset.has_changed(): - if request.GET['finalize'] == "True": - return self.finalize() - messages.warning(request, "Vous devez ajouter une observation !") - return self.get(request, new_form=False) - if not self.form.is_valid() or not self.inline_formset.is_valid(): return self.get(request, new_form=False) rencontre = self.form.save(commit=False) diff --git a/suivi/templates/suivi/menu_administration.html b/suivi/templates/suivi/menu_administration.html new file mode 100644 index 0000000..1d43170 --- /dev/null +++ b/suivi/templates/suivi/menu_administration.html @@ -0,0 +1,6 @@ +{% if user.is_superuser %} +
',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},i.prototype.init=function(e,i,o){if(this.enabled=!0,this.type=e,this.$element=t(i),this.options=this.getOptions(o),this.$viewport=this.options.viewport&&t(t.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var n=this.options.trigger.split(" "),s=n.length;s--;){var a=n[s];if("click"==a)this.$element.on("click."+this.type,this.options.selector,t.proxy(this.toggle,this));else if("manual"!=a){var r="hover"==a?"mouseenter":"focusin",l="hover"==a?"mouseleave":"focusout";this.$element.on(r+"."+this.type,this.options.selector,t.proxy(this.enter,this)),this.$element.on(l+"."+this.type,this.options.selector,t.proxy(this.leave,this))}}this.options.selector?this._options=t.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},i.prototype.getDefaults=function(){return i.DEFAULTS},i.prototype.getOptions=function(e){return e=t.extend({},this.getDefaults(),this.$element.data(),e),e.delay&&"number"==typeof e.delay&&(e.delay={show:e.delay,hide:e.delay}),e},i.prototype.getDelegateOptions=function(){var e={},i=this.getDefaults();return this._options&&t.each(this._options,function(t,o){i[t]!=o&&(e[t]=o)}),e},i.prototype.enter=function(e){var i=e instanceof this.constructor?e:t(e.currentTarget).data("bs."+this.type);return i||(i=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,i)),e instanceof t.Event&&(i.inState["focusin"==e.type?"focus":"hover"]=!0),i.tip().hasClass("in")||"in"==i.hoverState?void(i.hoverState="in"):(clearTimeout(i.timeout),i.hoverState="in",i.options.delay&&i.options.delay.show?void(i.timeout=setTimeout(function(){"in"==i.hoverState&&i.show()},i.options.delay.show)):i.show())},i.prototype.isInStateTrue=function(){for(var t in this.inState)if(this.inState[t])return!0;return!1},i.prototype.leave=function(e){var i=e instanceof this.constructor?e:t(e.currentTarget).data("bs."+this.type);return i||(i=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,i)),e instanceof t.Event&&(i.inState["focusout"==e.type?"focus":"hover"]=!1),i.isInStateTrue()?void 0:(clearTimeout(i.timeout),i.hoverState="out",i.options.delay&&i.options.delay.hide?void(i.timeout=setTimeout(function(){"out"==i.hoverState&&i.hide()},i.options.delay.hide)):i.hide())},i.prototype.show=function(){var e=t.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(e);var o=t.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(e.isDefaultPrevented()||!o)return;var n=this,s=this.tip(),a=this.getUID(this.type);this.setContent(),s.attr("id",a),this.$element.attr("aria-describedby",a),this.options.animation&&s.addClass("fade");var r="function"==typeof this.options.placement?this.options.placement.call(this,s[0],this.$element[0]):this.options.placement,l=/\s?auto?\s?/i,h=l.test(r);h&&(r=r.replace(l,"")||"top"),s.detach().css({top:0,left:0,display:"block"}).addClass(r).data("bs."+this.type,this),this.options.container?s.appendTo(this.options.container):s.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var d=this.getPosition(),p=s[0].offsetWidth,c=s[0].offsetHeight;if(h){var f=r,u=this.getPosition(this.$viewport);r="bottom"==r&&d.bottom+c>u.bottom?"top":"top"==r&&d.top-cu.width?"left":"left"==r&&d.left-pa.top+a.height&&(n.top=a.top+a.height-l)}else{var h=e.left-s,d=e.left+s+i;ha.right&&(n.left=a.left+a.width-d)}return n},i.prototype.getTitle=function(){var t,e=this.$element,i=this.options;return t=e.attr("data-original-title")||("function"==typeof i.title?i.title.call(e[0]):i.title)},i.prototype.getUID=function(t){do t+=~~(1e6*Math.random());while(document.getElementById(t));return t},i.prototype.tip=function(){if(!this.$tip&&(this.$tip=t(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},i.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},i.prototype.enable=function(){this.enabled=!0},i.prototype.disable=function(){this.enabled=!1},i.prototype.toggleEnabled=function(){this.enabled=!this.enabled},i.prototype.toggle=function(e){var i=this;e&&(i=t(e.currentTarget).data("bs."+this.type),i||(i=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,i))),e?(i.inState.click=!i.inState.click,i.isInStateTrue()?i.enter(i):i.leave(i)):i.tip().hasClass("in")?i.leave(i):i.enter(i)},i.prototype.destroy=function(){var t=this;clearTimeout(this.timeout),this.hide(function(){t.$element.off("."+t.type).removeData("bs."+t.type),t.$tip&&t.$tip.detach(),t.$tip=null,t.$arrow=null,t.$viewport=null,t.$element=null})};var o=t.fn.tooltip;t.fn.tooltip=e,t.fn.tooltip.Constructor=i,t.fn.tooltip.noConflict=function(){return t.fn.tooltip=o,this}}(jQuery),+function(t){"use strict";function e(e){return this.each(function(){var o=t(this),n=o.data("bs.popover"),s="object"==typeof e&&e;!n&&/destroy|hide/.test(e)||(n||o.data("bs.popover",n=new i(this,s)),"string"==typeof e&&n[e]())})}var i=function(t,e){this.init("popover",t,e)};if(!t.fn.tooltip)throw new Error("Popover requires tooltip.js");i.VERSION="3.3.7",i.DEFAULTS=t.extend({},t.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:''}),i.prototype=t.extend({},t.fn.tooltip.Constructor.prototype),i.prototype.constructor=i,i.prototype.getDefaults=function(){return i.DEFAULTS},i.prototype.setContent=function(){var t=this.tip(),e=this.getTitle(),i=this.getContent();t.find(".popover-title")[this.options.html?"html":"text"](e),t.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof i?"html":"append":"text"](i),t.removeClass("fade top bottom left right in"),t.find(".popover-title").html()||t.find(".popover-title").hide()},i.prototype.hasContent=function(){return this.getTitle()||this.getContent()},i.prototype.getContent=function(){var t=this.$element,e=this.options;return t.attr("data-content")||("function"==typeof e.content?e.content.call(t[0]):e.content)},i.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var o=t.fn.popover;t.fn.popover=e,t.fn.popover.Constructor=i,t.fn.popover.noConflict=function(){return t.fn.popover=o,this}}(jQuery),+function(t){"use strict";function e(e){return this.each(function(){var o=t(this),n=o.data("bs.tab");n||o.data("bs.tab",n=new i(this)),"string"==typeof e&&n[e]()})}var i=function(e){this.element=t(e)};i.VERSION="3.3.7",i.TRANSITION_DURATION=150,i.prototype.show=function(){var e=this.element,i=e.closest("ul:not(.dropdown-menu)"),o=e.data("target");if(o||(o=e.attr("href"),o=o&&o.replace(/.*(?=#[^\s]*$)/,"")),!e.parent("li").hasClass("active")){var n=i.find(".active:last a"),s=t.Event("hide.bs.tab",{relatedTarget:e[0]}),a=t.Event("show.bs.tab",{relatedTarget:n[0]});if(n.trigger(s),e.trigger(a),!a.isDefaultPrevented()&&!s.isDefaultPrevented()){var r=t(o);this.activate(e.closest("li"),i),this.activate(r,r.parent(),function(){n.trigger({type:"hidden.bs.tab",relatedTarget:e[0]}),e.trigger({type:"shown.bs.tab",relatedTarget:n[0]})})}}},i.prototype.activate=function(e,o,n){function s(){a.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),e.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),r?(e[0].offsetWidth,e.addClass("in")):e.removeClass("fade"),e.parent(".dropdown-menu").length&&e.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),n&&n()}var a=o.find("> .active"),r=n&&t.support.transition&&(a.length&&a.hasClass("fade")||!!o.find("> .fade").length);a.length&&r?a.one("bsTransitionEnd",s).emulateTransitionEnd(i.TRANSITION_DURATION):s(),a.removeClass("in")};var o=t.fn.tab;t.fn.tab=e,t.fn.tab.Constructor=i,t.fn.tab.noConflict=function(){return t.fn.tab=o,this};var n=function(i){i.preventDefault(),e.call(t(this),"show")};t(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',n).on("click.bs.tab.data-api",'[data-toggle="pill"]',n)}(jQuery),+function(t){"use strict";function e(e){return this.each(function(){var o=t(this),n=o.data("bs.affix"),s="object"==typeof e&&e;n||o.data("bs.affix",n=new i(this,s)),"string"==typeof e&&n[e]()})}var i=function(e,o){this.options=t.extend({},i.DEFAULTS,o),this.$target=t(this.options.target).on("scroll.bs.affix.data-api",t.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",t.proxy(this.checkPositionWithEventLoop,this)),this.$element=t(e),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};i.VERSION="3.3.7",i.RESET="affix affix-top affix-bottom",i.DEFAULTS={offset:0,target:window},i.prototype.getState=function(t,e,i,o){var n=this.$target.scrollTop(),s=this.$element.offset(),a=this.$target.height();if(null!=i&&"top"==this.affixed)return i>n?"top":!1;if("bottom"==this.affixed)return null!=i?n+this.unpin<=s.top?!1:"bottom":t-o>=n+a?!1:"bottom";var r=null==this.affixed,l=r?n:s.top,h=r?a:e;return null!=i&&i>=n?"top":null!=o&&l+h>=t-o?"bottom":!1},i.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(i.RESET).addClass("affix");var t=this.$target.scrollTop(),e=this.$element.offset();return this.pinnedOffset=e.top-t},i.prototype.checkPositionWithEventLoop=function(){setTimeout(t.proxy(this.checkPosition,this),1)},i.prototype.checkPosition=function(){if(this.$element.is(":visible")){var e=this.$element.height(),o=this.options.offset,n=o.top,s=o.bottom,a=Math.max(t(document).height(),t(document.body).height());"object"!=typeof o&&(s=n=o),"function"==typeof n&&(n=o.top(this.$element)),"function"==typeof s&&(s=o.bottom(this.$element));var r=this.getState(a,e,n,s);if(this.affixed!=r){null!=this.unpin&&this.$element.css("top","");var l="affix"+(r?"-"+r:""),h=t.Event(l+".bs.affix");if(this.$element.trigger(h),h.isDefaultPrevented())return;this.affixed=r,this.unpin="bottom"==r?this.getPinnedOffset():null,this.$element.removeClass(i.RESET).addClass(l).trigger(l.replace("affix","affixed")+".bs.affix")}"bottom"==r&&this.$element.offset({top:a-e-s})}};var o=t.fn.affix;t.fn.affix=e,t.fn.affix.Constructor=i,t.fn.affix.noConflict=function(){return t.fn.affix=o,this},t(window).on("load",function(){t('[data-spy="affix"]').each(function(){var i=t(this),o=i.data();o.offset=o.offset||{},null!=o.offsetBottom&&(o.offset.bottom=o.offsetBottom),null!=o.offsetTop&&(o.offset.top=o.offsetTop),e.call(i,o)})})}(jQuery),+function(t){"use strict";function e(e){var i,o=e.attr("data-target")||(i=e.attr("href"))&&i.replace(/.*(?=#[^\s]+$)/,"");return t(o)}function i(e){return this.each(function(){var i=t(this),n=i.data("bs.collapse"),s=t.extend({},o.DEFAULTS,i.data(),"object"==typeof e&&e);!n&&s.toggle&&/show|hide/.test(e)&&(s.toggle=!1),n||i.data("bs.collapse",n=new o(this,s)),"string"==typeof e&&n[e]()})}var o=function(e,i){this.$element=t(e),this.options=t.extend({},o.DEFAULTS,i),this.$trigger=t('[data-toggle="collapse"][href="#'+e.id+'"],[data-toggle="collapse"][data-target="#'+e.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};o.VERSION="3.3.7",o.TRANSITION_DURATION=350,o.DEFAULTS={toggle:!0},o.prototype.dimension=function(){var t=this.$element.hasClass("width");return t?"width":"height"},o.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var e,n=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(n&&n.length&&(e=n.data("bs.collapse"),e&&e.transitioning))){var s=t.Event("show.bs.collapse");if(this.$element.trigger(s),!s.isDefaultPrevented()){n&&n.length&&(i.call(n,"hide"),e||n.data("bs.collapse",null));var a=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[a](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var r=function(){this.$element.removeClass("collapsing").addClass("collapse in")[a](""),this.transitioning=0, this.$element.trigger("shown.bs.collapse")};if(!t.support.transition)return r.call(this);var l=t.camelCase(["scroll",a].join("-"));this.$element.one("bsTransitionEnd",t.proxy(r,this)).emulateTransitionEnd(o.TRANSITION_DURATION)[a](this.$element[0][l])}}}},o.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var e=t.Event("hide.bs.collapse");if(this.$element.trigger(e),!e.isDefaultPrevented()){var i=this.dimension();this.$element[i](this.$element[i]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var n=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return t.support.transition?void this.$element[i](0).one("bsTransitionEnd",t.proxy(n,this)).emulateTransitionEnd(o.TRANSITION_DURATION):n.call(this)}}},o.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},o.prototype.getParent=function(){return t(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(t.proxy(function(i,o){var n=t(o);this.addAriaAndCollapsedClass(e(n),n)},this)).end()},o.prototype.addAriaAndCollapsedClass=function(t,e){var i=t.hasClass("in");t.attr("aria-expanded",i),e.toggleClass("collapsed",!i).attr("aria-expanded",i)};var n=t.fn.collapse;t.fn.collapse=i,t.fn.collapse.Constructor=o,t.fn.collapse.noConflict=function(){return t.fn.collapse=n,this},t(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(o){var n=t(this);n.attr("data-target")||o.preventDefault();var s=e(n),a=s.data("bs.collapse"),r=a?"toggle":n.data();i.call(s,r)})}(jQuery),+function(t){"use strict";function e(i,o){this.$body=t(document.body),this.$scrollElement=t(t(i).is(document.body)?window:i),this.options=t.extend({},e.DEFAULTS,o),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",t.proxy(this.process,this)),this.refresh(),this.process()}function i(i){return this.each(function(){var o=t(this),n=o.data("bs.scrollspy"),s="object"==typeof i&&i;n||o.data("bs.scrollspy",n=new e(this,s)),"string"==typeof i&&n[i]()})}e.VERSION="3.3.7",e.DEFAULTS={offset:10},e.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},e.prototype.refresh=function(){var e=this,i="offset",o=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),t.isWindow(this.$scrollElement[0])||(i="position",o=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var e=t(this),n=e.data("target")||e.attr("href"),s=/^#./.test(n)&&t(n);return s&&s.length&&s.is(":visible")&&[[s[i]().top+o,n]]||null}).sort(function(t,e){return t[0]-e[0]}).each(function(){e.offsets.push(this[0]),e.targets.push(this[1])})},e.prototype.process=function(){var t,e=this.$scrollElement.scrollTop()+this.options.offset,i=this.getScrollHeight(),o=this.options.offset+i-this.$scrollElement.height(),n=this.offsets,s=this.targets,a=this.activeTarget;if(this.scrollHeight!=i&&this.refresh(),e>=o)return a!=(t=s[s.length-1])&&this.activate(t);if(a&&e=n[t]&&(void 0===n[t+1]||e.container .navbar-brand,.navbar-fixed-side>.container-fluid .navbar-brand{margin-left:0}.navbar-fixed-side .navbar-collapse{width:100%;border-top:1px solid #e7e7e7}.navbar-fixed-side .navbar-nav{float:none;margin:0 -15px}.navbar-fixed-side .navbar-nav>li{float:none}.navbar-fixed-side .navbar-nav>li>a{padding-top:10px;padding-bottom:10px;border-bottom:1px solid #e7e7e7}.navbar-fixed-side .navbar-form{margin:0;margin-left:-15px;margin-right:-15px;padding:10px 15px;border-bottom:1px solid #e7e7e7}.navbar-fixed-side .navbar-text{float:none;margin-left:0;margin-right:0}.navbar-fixed-side .navbar-left,.navbar-fixed-side .navbar-right{float:none !important}.navbar-fixed-side .navbar-nav .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;box-shadow:none;border-bottom:1px solid #e7e7e7}.navbar-fixed-side .navbar-nav .dropdown-menu>li>a,.navbar-fixed-side .navbar-nav .dropdown-menu .dropdown-header{padding:5px 15px 5px 25px}.navbar-fixed-side .navbar-nav .dropdown-menu>li>a{line-height:20px;color:#777}.navbar-fixed-side .navbar-nav .dropdown-menu>li>a:hover,.navbar-fixed-side .navbar-nav .dropdown-menu>li>a:focus{background-image:none}.navbar-fixed-side .navbar-nav .dropdown-menu>.active>a{background-color:#e7e7e7;color:#555}.navbar-fixed-side .navbar-nav>li>a:hover,.navbar-fixed-side .navbar-nav>li>a:focus,.navbar-fixed-side .navbar-nav .dropdown-menu>li>a:hover,.navbar-fixed-side .navbar-nav .dropdown-menu>li>a:focus{background-color:#f0f0f0;color:#333}.navbar-fixed-side .dropdown>.dropdown-toggle,.navbar-fixed-side .dropdown-menu>.dropdown-header{background-color:transparent !important;color:#9d9d9d !important;cursor:default;font-size:0.8em;text-transform:uppercase;border-bottom:none;padding-bottom:0}.navbar-fixed-side .dropdown-toggle .caret{display:none}.navbar-fixed-side .dropdown-menu{display:block}.navbar-fixed-side.navbar-inverse .navbar-collapse,.navbar-fixed-side.navbar-inverse .navbar-nav>li>a,.navbar-fixed-side.navbar-inverse .navbar-form,.navbar-fixed-side.navbar-inverse .navbar-nav .dropdown-menu{border-color:#363636}.navbar-fixed-side.navbar-inverse .divider{background-color:#363636}.navbar-fixed-side.navbar-inverse .navbar-nav .dropdown-menu>li>a{color:#9d9d9d}.navbar-fixed-side.navbar-inverse .navbar-nav .dropdown-menu>.active>a{background-color:#090909;color:#fff}.navbar-fixed-side.navbar-inverse .navbar-nav>li:not(.active)>a:hover,.navbar-fixed-side.navbar-inverse .navbar-nav>li:not(.active)>a:focus,.navbar-fixed-side.navbar-inverse .navbar-nav .dropdown-menu>li:not(.active)>a:hover,.navbar-fixed-side.navbar-inverse .navbar-nav .dropdown-menu>li:not(.active)>a:focus{background-color:#2f2f2f;color:#fff}.navbar-fixed-side.navbar-inverse .dropdown>.dropdown-toggle{color:#777777 !important}} \ No newline at end of file diff --git a/website/templates/base.html b/website/templates/base.html index 345bfb5..39c47c2 100644 --- a/website/templates/base.html +++ b/website/templates/base.html @@ -5,19 +5,18 @@ {% block title %}La maraude{% endblock %} {% if stylesheets %}{% for stylesheet in stylesheets %}{% endfor %}{% endif %} {# Load CSS and JavaScript #}{% bootstrap_css %}{% bootstrap_javascript %} + - {% block globalnav %}{% endblock %} -
+
- {% if panels %}
{% else %}
{% endif %} - {% bootstrap_messages %} - +
+ {% include "navbar.html" %} +
+
+

{% block page_header %}{% endblock %}

{% block content %}{% endblock %}
- {% if panels %}{% endif %}
diff --git a/website/templates/base_site.html b/website/templates/base_site.html index 577c0ed..c946a5f 100644 --- a/website/templates/base_site.html +++ b/website/templates/base_site.html @@ -3,13 +3,6 @@ {% block title %}{{ page_title }}{% endblock %} {% block page_header %}{{ page_header }} {{ page_header_small }}{% endblock %} -{% block globalnav %} -
-
- {% include "navbar.html" %} -
-
-{% endblock %} {% block content %}{% include content_template %}{% endblock %} diff --git a/website/templates/login.html b/website/templates/login.html index 7442ffc..035acc5 100644 --- a/website/templates/login.html +++ b/website/templates/login.html @@ -5,13 +5,6 @@ {# Tweak columns layout for login box %} {% block panels %}
{% endblock %} -{% block page_header %} -
-

ALSA - Projet Maraude

-

Description de la maraude...

-
-{% endblock %} - {% block content %}

Connexion

diff --git a/website/templates/main.html b/website/templates/main.html index 46682a5..4f378ea 100644 --- a/website/templates/main.html +++ b/website/templates/main.html @@ -1,38 +1,12 @@ -{% load bootstrap3 %} +
+
+

Objectifs

+

Description de la maraude à destination des visiteurs, partenaires, etc...

+

Nous rencontrer

-{% block content %} -{% bootstrap_messages %} -
-

Maraude ALSA

-
- {% if user.is_authenticated %} -

Bienvenue {{ user }} !

-
- Entrer - {% if user.is_superuser %} - Administration - {% endif %} +

Les maraudeurs arpentent les rues de Mulhouse les lundis, mardis et jeudis en soirée, + et les vendredis en fin d'après-midi. +

+

Ils sont reconnaissables à leur vestes oranges, n'hésitez pas à les interpeller.

- {% else %} - {% if form.errors %} -

Your username and password didn't match. Please try again.

- {% endif %} - {% if next %} - {% if user.is_authenticated %} -

Your account doesn't have access to this page. To proceed, - please login with an account that has access.

- {% else %} -

Veuillez vous connecter pour accéder à cette page.

- {% endif %} - {% endif %} -
- {% csrf_token %} - {% bootstrap_form form %} - {% bootstrap_button "Connexion" button_type="submit" button_class="btn-lg btn-primary" %} - -
- {% endif %} -
- -
-{% endblock %} +
diff --git a/website/templates/navbar.html b/website/templates/navbar.html index 8ecf584..21a3a5d 100644 --- a/website/templates/navbar.html +++ b/website/templates/navbar.html @@ -1,25 +1,45 @@ {% load bootstrap3 %}{% load staticfiles %} -