Gitlab CSE Unil

Commit 6c759df8 authored by Julien Furrer's avatar Julien Furrer
Browse files

Changed the way sharing properties are displayed in AOMgr

Display URL and label for ttp shared objects
parent 7d2e167d
...@@ -106,11 +106,18 @@ class AnObjSerializer(BaseAnObjSerializer): ...@@ -106,11 +106,18 @@ class AnObjSerializer(BaseAnObjSerializer):
class SharedAnObjSerializer(BaseAnObjSerializer): class SharedAnObjSerializer(BaseAnObjSerializer):
sharing_opts = serializers.SerializerMethodField()
class Meta: class Meta:
model = AnObj model = AnObj
fields = ('id', 'uuid', 'name', 'owners', 'owner', 'owner_name', 'annotations', 'locked', fields = ('id', 'uuid', 'name', 'owners', 'owner', 'owner_name', 'annotations', 'locked',
'sharing_mode', 'allow_public_publishing') 'sharing_mode', 'sharing_opts', 'allow_public_publishing')
def get_sharing_opts(self, anobj):
if anobj.sharing_mode > 15:
return anobj.sharing_opts
else:
return None
class AnObjListSerializer(BaseAnObjSerializer): class AnObjListSerializer(BaseAnObjSerializer):
......
...@@ -48,6 +48,7 @@ define([ ...@@ -48,6 +48,7 @@ define([
this.publicPublishEl = this.$("#aom-prop-publishall"); this.publicPublishEl = this.$("#aom-prop-publishall");
this.propOwnerEl = this.$el.find(".aom-prop-owner").prev('dt').andSelf(); this.propOwnerEl = this.$el.find(".aom-prop-owner").prev('dt').andSelf();
//this.propOwnerEl = this.$el.find(".aom-prop-owner").closest('.form-group');
this.sharingPropEl.find(".aom-prop-locked-info").popover({ this.sharingPropEl.find(".aom-prop-locked-info").popover({
placement: 'bottom', placement: 'bottom',
...@@ -128,9 +129,10 @@ define([ ...@@ -128,9 +129,10 @@ define([
// Update sharing properties // Update sharing properties
var sharingMode = itemModel.get('sharing_mode'), var sharingMode = itemModel.get('sharing_mode'),
ttpShared = itemModel.get('ttpShared'), // sharingMode > 15 are reserved for TTP ttpShared = itemModel.get('ttpShared') === true, // sharingMode > 15 are reserved for TTP
locked = itemModel.get('locked'), locked = itemModel.get('locked') === true,
publicPublish = itemModel.get('allow_public_publishing'); owned = itemModel.get('owned') === true,
publicPublish = itemModel.get('allow_public_publishing') === true;
this.sharingPropEl this.sharingPropEl
.toggleClass("aom-prop-locked", locked) .toggleClass("aom-prop-locked", locked)
...@@ -141,9 +143,13 @@ define([ ...@@ -141,9 +143,13 @@ define([
if (ttpShared) { if (ttpShared) {
this.$(".aom-shm-frontdrop").css("visibility", "hidden"); // Inhibbit the locking overlay for ttp sharing (not applied even for locked ttp images) this.$(".aom-shm-frontdrop").css("visibility", "hidden"); // Inhibbit the locking overlay for ttp sharing (not applied even for locked ttp images)
this.$(".aom-prop-lock-but").attr("disabled", "disabled");
} else { } else {
this.$(".aom-shm-frontdrop").css("visibility", "visible"); // Restore the locking overlay capability (it is active only for locked images) this.$(".aom-shm-frontdrop").css("visibility", "visible"); // Restore the locking overlay capability (it is active only for locked images)
}
if (ttpShared || !owned) {
this.$(".aom-prop-lock-but").attr("disabled", "disabled");
} else {
this.$(".aom-prop-lock-but").removeAttr("disabled"); this.$(".aom-prop-lock-but").removeAttr("disabled");
} }
...@@ -160,6 +166,7 @@ define([ ...@@ -160,6 +166,7 @@ define([
.closest(".checkbox").removeClass("disabled text-muted"); .closest(".checkbox").removeClass("disabled text-muted");
} }
sharingModeSelect.val([sharingMode]); sharingModeSelect.val([sharingMode]);
this.sharingPropEl.find(".aom-prop-sharingmode-info").text(sharingModeSelect.find("option:selected").text());
this.publicPublishEl.val([publicPublish]); this.publicPublishEl.val([publicPublish]);
this.propShMdParamsAll.addClass("hidden"); this.propShMdParamsAll.addClass("hidden");
if (sharingMode) { if (sharingMode) {
...@@ -176,6 +183,7 @@ define([ ...@@ -176,6 +183,7 @@ define([
_setOptCtrlValue: function(shmGroupElem, sharingMode, itemModel) { _setOptCtrlValue: function(shmGroupElem, sharingMode, itemModel) {
var me = this, var me = this,
sharingOpts = itemModel.get('sharing_opts'); sharingOpts = itemModel.get('sharing_opts');
console.log("sharingOpts", sharingOpts);
//if (sharingOpts) try { //if (sharingOpts) try {
// sharingOpts = JSON.parse(itemModel.get('sharing_opts')); // sharingOpts = JSON.parse(itemModel.get('sharing_opts'));
//} catch(e) { sharingOpts = null; } //} catch(e) { sharingOpts = null; }
...@@ -220,7 +228,7 @@ define([ ...@@ -220,7 +228,7 @@ define([
}, },
'attp_label': function($el, model, opts) { 'attp_label': function($el, model, opts) {
if (opts.url && opts.label) { if (opts && opts.url && opts.label) {
$el.text(opts.label); $el.text(opts.label);
} else { } else {
$el.closest('.aom-prop-shm').addClass('hidden'); $el.closest('.aom-prop-shm').addClass('hidden');
...@@ -228,7 +236,7 @@ define([ ...@@ -228,7 +236,7 @@ define([
}, },
'attp_url': function($el, model, opts) { 'attp_url': function($el, model, opts) {
if (opts.url && opts.label) { if (opts && opts.url && opts.label) {
$el.attr("href", opts.url); $el.attr("href", opts.url);
} else { } else {
$el.closest('.aom-prop-shm').addClass('hidden'); $el.closest('.aom-prop-shm').addClass('hidden');
...@@ -257,6 +265,7 @@ define([ ...@@ -257,6 +265,7 @@ define([
clear: function() { clear: function() {
this.thumbEl.css("background-image", "none"); this.thumbEl.css("background-image", "none");
this.$(".aom-shm-frontdrop").css("visibility", "visible");
this._updateItemProp({get: function(){return ""}}); this._updateItemProp({get: function(){return ""}});
this.currentModel = null; this.currentModel = null;
}, },
...@@ -286,8 +295,11 @@ define([ ...@@ -286,8 +295,11 @@ define([
*/ */
setMode: function(mode) { setMode: function(mode) {
var isShared = mode === 'shared'; var isShared = mode === 'shared';
this.sharingPropEl.toggleClass('hidden', isShared); this.sharingPropEl.find(".aom-prop-form").toggleClass('hidden', isShared);
this.propListEl.find(".aom-prop-lock-but").toggleClass('hidden', isShared);
this.propOwnerEl.toggleClass('hidden', !isShared); this.propOwnerEl.toggleClass('hidden', !isShared);
this.sharingPropEl.find(".aom-info-share-form").toggleClass('hidden', !isShared);
}, },
// ######################## // ########################
......
...@@ -1629,6 +1629,7 @@ fieldset[disabled] .btn-cimaf-layer.active { ...@@ -1629,6 +1629,7 @@ fieldset[disabled] .btn-cimaf-layer.active {
} }
.aom-info-panel .panel-body dl.aom-info-prop { .aom-info-panel .panel-body dl.aom-info-prop {
margin-top: 15px; margin-top: 15px;
margin-left: 190px;
padding-right: 10px; padding-right: 10px;
} }
.aom-info-panel .panel-body dl.aom-info-prop dd { .aom-info-panel .panel-body dl.aom-info-prop dd {
...@@ -1739,7 +1740,7 @@ fieldset[disabled] .btn-cimaf-layer.active { ...@@ -1739,7 +1740,7 @@ fieldset[disabled] .btn-cimaf-layer.active {
width: 100%; width: 100%;
z-index: 100; z-index: 100;
} }
#aom-shared-images-list .aom-list-item .btn-toolbar .aom-item-sh-status { #aom-shared-images-list .aom-list-item .btn-toolbar .icon-share-alt {
display: none; display: none;
} }
.aom-list-container { .aom-list-container {
......
...@@ -152,6 +152,7 @@ ...@@ -152,6 +152,7 @@
} }
.aom-info-panel .panel-body dl.aom-info-prop { .aom-info-panel .panel-body dl.aom-info-prop {
margin-top: 15px; margin-top: 15px;
margin-left: 190px;
padding-right: 10px; padding-right: 10px;
} }
.aom-info-panel .panel-body dl.aom-info-prop dd { .aom-info-panel .panel-body dl.aom-info-prop dd {
...@@ -262,7 +263,7 @@ ...@@ -262,7 +263,7 @@
width: 100%; width: 100%;
z-index: 100; z-index: 100;
} }
#aom-shared-images-list .aom-list-item .btn-toolbar .aom-item-sh-status { #aom-shared-images-list .aom-list-item .btn-toolbar .icon-share-alt {
display: none; display: none;
} }
.aom-list-container { .aom-list-container {
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
@modal-header: #d0d0d0; @modal-header: #d0d0d0;
@aom-thumb-width: 150px; @aom-thumb-width: 150px;
@aom-thumb-margin: 30px;
@aom-thumb-height: @aom-thumb-width; @aom-thumb-height: @aom-thumb-width;
@aom-list-item-width: @aom-thumb-width + 30; @aom-list-item-width: @aom-thumb-width + 30;
...@@ -106,9 +107,8 @@ ...@@ -106,9 +107,8 @@
font-size: 12px; font-size: 12px;
padding: 0; padding: 0;
.aom-image-thumb { .aom-image-thumb {
@thumb-margin: 30px; width: @aom-thumb-width + @aom-thumb-margin;
width: @aom-thumb-width + @thumb-margin; height: @aom-thumb-height + @aom-thumb-margin;
height: @aom-thumb-height + @thumb-margin;
background-color: @aom-list-item-bg; background-color: @aom-list-item-bg;
border-color: @modal-header; border-color: @modal-header;
border-style: solid; border-style: solid;
...@@ -119,6 +119,7 @@ ...@@ -119,6 +119,7 @@
dl.aom-info-prop { dl.aom-info-prop {
margin-top: 15px; margin-top: 15px;
margin-left: @aom-thumb-width + @aom-thumb-margin + 10px;
padding-right: 10px; padding-right: 10px;
dd { margin-bottom: 1.4em; } dd { margin-bottom: 1.4em; }
} }
...@@ -233,7 +234,8 @@ ...@@ -233,7 +234,8 @@
#aom-shared-images-list { #aom-shared-images-list {
.aom-list-item { .aom-list-item {
.btn-toolbar { .btn-toolbar {
.aom-item-sh-status { display: none; } //.aom-item-sh-status { display: none; }
.icon-share-alt { display: none; }
} }
} }
} }
......
...@@ -14140,6 +14140,7 @@ define('anobj-mgr/views/anobj/properties-panel',[ ...@@ -14140,6 +14140,7 @@ define('anobj-mgr/views/anobj/properties-panel',[
this.publicPublishEl = this.$("#aom-prop-publishall"); this.publicPublishEl = this.$("#aom-prop-publishall");
   
this.propOwnerEl = this.$el.find(".aom-prop-owner").prev('dt').andSelf(); this.propOwnerEl = this.$el.find(".aom-prop-owner").prev('dt').andSelf();
//this.propOwnerEl = this.$el.find(".aom-prop-owner").closest('.form-group');
   
this.sharingPropEl.find(".aom-prop-locked-info").popover({ this.sharingPropEl.find(".aom-prop-locked-info").popover({
placement: 'bottom', placement: 'bottom',
...@@ -14220,9 +14221,10 @@ define('anobj-mgr/views/anobj/properties-panel',[ ...@@ -14220,9 +14221,10 @@ define('anobj-mgr/views/anobj/properties-panel',[
   
// Update sharing properties // Update sharing properties
var sharingMode = itemModel.get('sharing_mode'), var sharingMode = itemModel.get('sharing_mode'),
ttpShared = itemModel.get('ttpShared'), // sharingMode > 15 are reserved for TTP ttpShared = itemModel.get('ttpShared') === true, // sharingMode > 15 are reserved for TTP
locked = itemModel.get('locked'), locked = itemModel.get('locked') === true,
publicPublish = itemModel.get('allow_public_publishing'); owned = itemModel.get('owned') === true,
publicPublish = itemModel.get('allow_public_publishing') === true;
   
this.sharingPropEl this.sharingPropEl
.toggleClass("aom-prop-locked", locked) .toggleClass("aom-prop-locked", locked)
...@@ -14233,9 +14235,13 @@ define('anobj-mgr/views/anobj/properties-panel',[ ...@@ -14233,9 +14235,13 @@ define('anobj-mgr/views/anobj/properties-panel',[
   
if (ttpShared) { if (ttpShared) {
this.$(".aom-shm-frontdrop").css("visibility", "hidden"); // Inhibbit the locking overlay for ttp sharing (not applied even for locked ttp images) this.$(".aom-shm-frontdrop").css("visibility", "hidden"); // Inhibbit the locking overlay for ttp sharing (not applied even for locked ttp images)
this.$(".aom-prop-lock-but").attr("disabled", "disabled");
} else { } else {
this.$(".aom-shm-frontdrop").css("visibility", "visible"); // Restore the locking overlay capability (it is active only for locked images) this.$(".aom-shm-frontdrop").css("visibility", "visible"); // Restore the locking overlay capability (it is active only for locked images)
}
if (ttpShared || !owned) {
this.$(".aom-prop-lock-but").attr("disabled", "disabled");
} else {
this.$(".aom-prop-lock-but").removeAttr("disabled"); this.$(".aom-prop-lock-but").removeAttr("disabled");
} }
   
...@@ -14252,6 +14258,7 @@ define('anobj-mgr/views/anobj/properties-panel',[ ...@@ -14252,6 +14258,7 @@ define('anobj-mgr/views/anobj/properties-panel',[
.closest(".checkbox").removeClass("disabled text-muted"); .closest(".checkbox").removeClass("disabled text-muted");
} }
sharingModeSelect.val([sharingMode]); sharingModeSelect.val([sharingMode]);
this.sharingPropEl.find(".aom-prop-sharingmode-info").text(sharingModeSelect.find("option:selected").text());
this.publicPublishEl.val([publicPublish]); this.publicPublishEl.val([publicPublish]);
this.propShMdParamsAll.addClass("hidden"); this.propShMdParamsAll.addClass("hidden");
if (sharingMode) { if (sharingMode) {
...@@ -14268,6 +14275,7 @@ define('anobj-mgr/views/anobj/properties-panel',[ ...@@ -14268,6 +14275,7 @@ define('anobj-mgr/views/anobj/properties-panel',[
_setOptCtrlValue: function(shmGroupElem, sharingMode, itemModel) { _setOptCtrlValue: function(shmGroupElem, sharingMode, itemModel) {
var me = this, var me = this,
sharingOpts = itemModel.get('sharing_opts'); sharingOpts = itemModel.get('sharing_opts');
console.log("sharingOpts", sharingOpts);
//if (sharingOpts) try { //if (sharingOpts) try {
// sharingOpts = JSON.parse(itemModel.get('sharing_opts')); // sharingOpts = JSON.parse(itemModel.get('sharing_opts'));
//} catch(e) { sharingOpts = null; } //} catch(e) { sharingOpts = null; }
...@@ -14312,7 +14320,7 @@ define('anobj-mgr/views/anobj/properties-panel',[ ...@@ -14312,7 +14320,7 @@ define('anobj-mgr/views/anobj/properties-panel',[
}, },
   
'attp_label': function($el, model, opts) { 'attp_label': function($el, model, opts) {
if (opts.url && opts.label) { if (opts && opts.url && opts.label) {
$el.text(opts.label); $el.text(opts.label);
} else { } else {
$el.closest('.aom-prop-shm').addClass('hidden'); $el.closest('.aom-prop-shm').addClass('hidden');
...@@ -14320,7 +14328,7 @@ define('anobj-mgr/views/anobj/properties-panel',[ ...@@ -14320,7 +14328,7 @@ define('anobj-mgr/views/anobj/properties-panel',[
}, },
   
'attp_url': function($el, model, opts) { 'attp_url': function($el, model, opts) {
if (opts.url && opts.label) { if (opts && opts.url && opts.label) {
$el.attr("href", opts.url); $el.attr("href", opts.url);
} else { } else {
$el.closest('.aom-prop-shm').addClass('hidden'); $el.closest('.aom-prop-shm').addClass('hidden');
...@@ -14349,6 +14357,7 @@ define('anobj-mgr/views/anobj/properties-panel',[ ...@@ -14349,6 +14357,7 @@ define('anobj-mgr/views/anobj/properties-panel',[
   
clear: function() { clear: function() {
this.thumbEl.css("background-image", "none"); this.thumbEl.css("background-image", "none");
this.$(".aom-shm-frontdrop").css("visibility", "visible");
this._updateItemProp({get: function(){return ""}}); this._updateItemProp({get: function(){return ""}});
this.currentModel = null; this.currentModel = null;
}, },
...@@ -14378,8 +14387,11 @@ define('anobj-mgr/views/anobj/properties-panel',[ ...@@ -14378,8 +14387,11 @@ define('anobj-mgr/views/anobj/properties-panel',[
*/ */
setMode: function(mode) { setMode: function(mode) {
var isShared = mode === 'shared'; var isShared = mode === 'shared';
this.sharingPropEl.toggleClass('hidden', isShared); this.sharingPropEl.find(".aom-prop-form").toggleClass('hidden', isShared);
this.propListEl.find(".aom-prop-lock-but").toggleClass('hidden', isShared);
this.propOwnerEl.toggleClass('hidden', !isShared); this.propOwnerEl.toggleClass('hidden', !isShared);
this.sharingPropEl.find(".aom-info-share-form").toggleClass('hidden', !isShared);
}, },
   
// ######################## // ########################
......
...@@ -14140,6 +14140,7 @@ define('anobj-mgr/views/anobj/properties-panel',[ ...@@ -14140,6 +14140,7 @@ define('anobj-mgr/views/anobj/properties-panel',[
this.publicPublishEl = this.$("#aom-prop-publishall"); this.publicPublishEl = this.$("#aom-prop-publishall");
   
this.propOwnerEl = this.$el.find(".aom-prop-owner").prev('dt').andSelf(); this.propOwnerEl = this.$el.find(".aom-prop-owner").prev('dt').andSelf();
//this.propOwnerEl = this.$el.find(".aom-prop-owner").closest('.form-group');
   
this.sharingPropEl.find(".aom-prop-locked-info").popover({ this.sharingPropEl.find(".aom-prop-locked-info").popover({
placement: 'bottom', placement: 'bottom',
...@@ -14220,9 +14221,10 @@ define('anobj-mgr/views/anobj/properties-panel',[ ...@@ -14220,9 +14221,10 @@ define('anobj-mgr/views/anobj/properties-panel',[
   
// Update sharing properties // Update sharing properties
var sharingMode = itemModel.get('sharing_mode'), var sharingMode = itemModel.get('sharing_mode'),
ttpShared = itemModel.get('ttpShared'), // sharingMode > 15 are reserved for TTP ttpShared = itemModel.get('ttpShared') === true, // sharingMode > 15 are reserved for TTP
locked = itemModel.get('locked'), locked = itemModel.get('locked') === true,
publicPublish = itemModel.get('allow_public_publishing'); owned = itemModel.get('owned') === true,
publicPublish = itemModel.get('allow_public_publishing') === true;
   
this.sharingPropEl this.sharingPropEl
.toggleClass("aom-prop-locked", locked) .toggleClass("aom-prop-locked", locked)
...@@ -14233,9 +14235,13 @@ define('anobj-mgr/views/anobj/properties-panel',[ ...@@ -14233,9 +14235,13 @@ define('anobj-mgr/views/anobj/properties-panel',[
   
if (ttpShared) { if (ttpShared) {
this.$(".aom-shm-frontdrop").css("visibility", "hidden"); // Inhibbit the locking overlay for ttp sharing (not applied even for locked ttp images) this.$(".aom-shm-frontdrop").css("visibility", "hidden"); // Inhibbit the locking overlay for ttp sharing (not applied even for locked ttp images)
this.$(".aom-prop-lock-but").attr("disabled", "disabled");
} else { } else {
this.$(".aom-shm-frontdrop").css("visibility", "visible"); // Restore the locking overlay capability (it is active only for locked images) this.$(".aom-shm-frontdrop").css("visibility", "visible"); // Restore the locking overlay capability (it is active only for locked images)
}
if (ttpShared || !owned) {
this.$(".aom-prop-lock-but").attr("disabled", "disabled");
} else {
this.$(".aom-prop-lock-but").removeAttr("disabled"); this.$(".aom-prop-lock-but").removeAttr("disabled");
} }
   
...@@ -14252,6 +14258,7 @@ define('anobj-mgr/views/anobj/properties-panel',[ ...@@ -14252,6 +14258,7 @@ define('anobj-mgr/views/anobj/properties-panel',[
.closest(".checkbox").removeClass("disabled text-muted"); .closest(".checkbox").removeClass("disabled text-muted");
} }
sharingModeSelect.val([sharingMode]); sharingModeSelect.val([sharingMode]);
this.sharingPropEl.find(".aom-prop-sharingmode-info").text(sharingModeSelect.find("option:selected").text());
this.publicPublishEl.val([publicPublish]); this.publicPublishEl.val([publicPublish]);
this.propShMdParamsAll.addClass("hidden"); this.propShMdParamsAll.addClass("hidden");
if (sharingMode) { if (sharingMode) {
...@@ -14268,6 +14275,7 @@ define('anobj-mgr/views/anobj/properties-panel',[ ...@@ -14268,6 +14275,7 @@ define('anobj-mgr/views/anobj/properties-panel',[
_setOptCtrlValue: function(shmGroupElem, sharingMode, itemModel) { _setOptCtrlValue: function(shmGroupElem, sharingMode, itemModel) {
var me = this, var me = this,
sharingOpts = itemModel.get('sharing_opts'); sharingOpts = itemModel.get('sharing_opts');
console.log("sharingOpts", sharingOpts);
//if (sharingOpts) try { //if (sharingOpts) try {
// sharingOpts = JSON.parse(itemModel.get('sharing_opts')); // sharingOpts = JSON.parse(itemModel.get('sharing_opts'));
//} catch(e) { sharingOpts = null; } //} catch(e) { sharingOpts = null; }
...@@ -14312,7 +14320,7 @@ define('anobj-mgr/views/anobj/properties-panel',[ ...@@ -14312,7 +14320,7 @@ define('anobj-mgr/views/anobj/properties-panel',[
}, },
   
'attp_label': function($el, model, opts) { 'attp_label': function($el, model, opts) {
if (opts.url && opts.label) { if (opts && opts.url && opts.label) {
$el.text(opts.label); $el.text(opts.label);
} else { } else {
$el.closest('.aom-prop-shm').addClass('hidden'); $el.closest('.aom-prop-shm').addClass('hidden');
...@@ -14320,7 +14328,7 @@ define('anobj-mgr/views/anobj/properties-panel',[ ...@@ -14320,7 +14328,7 @@ define('anobj-mgr/views/anobj/properties-panel',[
}, },
   
'attp_url': function($el, model, opts) { 'attp_url': function($el, model, opts) {
if (opts.url && opts.label) { if (opts && opts.url && opts.label) {
$el.attr("href", opts.url); $el.attr("href", opts.url);
} else { } else {
$el.closest('.aom-prop-shm').addClass('hidden'); $el.closest('.aom-prop-shm').addClass('hidden');
...@@ -14349,6 +14357,7 @@ define('anobj-mgr/views/anobj/properties-panel',[ ...@@ -14349,6 +14357,7 @@ define('anobj-mgr/views/anobj/properties-panel',[
   
clear: function() { clear: function() {
this.thumbEl.css("background-image", "none"); this.thumbEl.css("background-image", "none");
this.$(".aom-shm-frontdrop").css("visibility", "visible");
this._updateItemProp({get: function(){return ""}}); this._updateItemProp({get: function(){return ""}});
this.currentModel = null; this.currentModel = null;
}, },
...@@ -14378,8 +14387,11 @@ define('anobj-mgr/views/anobj/properties-panel',[ ...@@ -14378,8 +14387,11 @@ define('anobj-mgr/views/anobj/properties-panel',[
*/ */
setMode: function(mode) { setMode: function(mode) {
var isShared = mode === 'shared'; var isShared = mode === 'shared';
this.sharingPropEl.toggleClass('hidden', isShared); this.sharingPropEl.find(".aom-prop-form").toggleClass('hidden', isShared);
this.propListEl.find(".aom-prop-lock-but").toggleClass('hidden', isShared);
this.propOwnerEl.toggleClass('hidden', !isShared); this.propOwnerEl.toggleClass('hidden', !isShared);
this.sharingPropEl.find(".aom-info-share-form").toggleClass('hidden', !isShared);
}, },
   
// ######################## // ########################
......
...@@ -12,7 +12,7 @@ urlpatterns = [ ...@@ -12,7 +12,7 @@ urlpatterns = [
url(r'^admin/', include(admin.site.urls)), url(r'^admin/', include(admin.site.urls)),
url(r'^shibauth/', include('shibauth.urls')), url(r'^shibauth/', include('shibauth.urls')),
url(r'^accounts/login/$', 'django.contrib.auth.views.login', {'template_name': "adim_app/home.html"}), url(r'^accounts/login/$', 'django.contrib.auth.views.login', {'template_name': "adim/home.html"}),
url(r'^accounts/logout/$', 'django.contrib.auth.views.logout_then_login', name="logout"), url(r'^accounts/logout/$', 'django.contrib.auth.views.logout_then_login', name="logout"),
url(r'^api/', include('adim.urls')), url(r'^api/', include('adim.urls')),
......
...@@ -54,7 +54,7 @@ def get_or_create_user(attp_user): ...@@ -54,7 +54,7 @@ def get_or_create_user(attp_user):
user.first_name = attp_user['first_name'] user.first_name = attp_user['first_name']
user_changed = True user_changed = True
if attp_user.get('last_name') and user.first_name != attp_user['last_name']: # Update last_name if provided if attp_user.get('last_name') and user.last_name != attp_user['last_name']: # Update last_name if provided
user.last_name = attp_user['last_name'] user.last_name = attp_user['last_name']
user_changed = True user_changed = True
......
...@@ -21,14 +21,12 @@ ...@@ -21,14 +21,12 @@
<div class="panel-body"> <div class="panel-body">
<img class="aom-image-thumb" <img class="aom-image-thumb"
src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"> src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7">
{# ===== AnObj properties ===== #} {# ===== AnObj properties ===== #}
<dl class="aom-info-prop aom-prop-unlocked"> <dl class="aom-info-prop aom-prop-unlocked">
<dt>Nom</dt> <dt>Nom</dt>
<dd class="aom-prop-name"></dd> <dd class="aom-prop-name"></dd>
<dt>Propriétaire</dt>
<dd class="aom-prop-owner"></dd>
<dt>URL</dt> <dt>URL</dt>
<dd> <dd>
<div class="input-group input-group-sm"> <div class="input-group input-group-sm">
...@@ -44,6 +42,10 @@ ...@@ -44,6 +42,10 @@
</div> </div>
</dd> </dd>
<dt> <dt>
<dt class="hidden">Propriétaire</dt>
<dd class="aom-prop-owner hidden"></dd>