From af9d8c742418a3229acca8bc58b12f1fb95c2fcf Mon Sep 17 00:00:00 2001 From: manolobevia Date: Mon, 31 Oct 2011 22:05:57 +0000 Subject: [PATCH] NIHVIVO-3213: Worked on markup/styles for adding proxies through account pages --- webapp/web/css/account/account.css | 40 ++++++++++++ webapp/web/js/account/accountProxyCommon.js | 6 +- webapp/web/js/account/proxyUtils.js | 7 ++ .../body/accounts/userAccounts-myAccount.ftl | 3 +- .../accounts/userAccounts-myProxiesPanel.ftl | 64 +++++++++---------- 5 files changed, 82 insertions(+), 38 deletions(-) create mode 100644 webapp/web/js/account/proxyUtils.js diff --git a/webapp/web/css/account/account.css b/webapp/web/css/account/account.css index d5cca34d8..bb83f057f 100644 --- a/webapp/web/css/account/account.css +++ b/webapp/web/css/account/account.css @@ -275,4 +275,44 @@ a.disable-delete { } .disabledSubmit { cursor: default ! important; +} + +/* PROXY MY ACCOUNT'S PROFILE ------> */ +#edit-myProxy { + float: right; + padding: 2em; + padding-top: 1em; + background-color: #f7f7f4; + border-radius: 10px; + -moz-border-radius: 10px; + -webkit-border-radius: 10px; +} +#edit-myProxy h4 { + padding-top: 0; +} +.photo-profile { + border: 2px solid #DDE4E3; +} +.proxyInfoElement { + padding-top: .8em; + border-bottom: 1px dotted #E0DFDF; + padding-bottom: 1em; +} + +#edit-myProxy p.search-status { + margin-top: -10px; + font-size: .8em; + color: #7F8993; + padding-left: 10px; +} +#edit-myProxy p.selected-editors { + padding-top: 1.2em; + border-top: 1px solid #E0DFDF; +} +#edit-myProxy a.remove-proxy { + font-size: .9em; +} +#edit-myProxy .proxy-info { + padding-left: 1em; + vertical-align: middle; } \ No newline at end of file diff --git a/webapp/web/js/account/accountProxyCommon.js b/webapp/web/js/account/accountProxyCommon.js index 7669245ef..45bc2d37d 100644 --- a/webapp/web/js/account/accountProxyCommon.js +++ b/webapp/web/js/account/accountProxyCommon.js @@ -41,7 +41,7 @@ function proxyInfoElement(template, uri, label, classLabel, imageUrl, removeInfo this.uri = uri; this.label = label; this.classLabel = classLabel; - this.imageUrl = imageUrl; + this.imageUrl = (imageUrl) ? imageUrl : imageUrl="../images/placeholders/person.thumbnail.jpg"; this.toString = function() { return "proxyInfoElement: " + content; @@ -52,8 +52,10 @@ function proxyInfoElement(template, uri, label, classLabel, imageUrl, removeInfo .replace(/%label%/g, this.label) .replace(/%classLabel%/g, this.classLabel) .replace(/%imageUrl%/g, this.imageUrl); + - var element = $("
" + content + "
"); + + var element = $("
" + content + "
"); var removeLink = $("[templatePart='remove']", element).first(); removeLink.click(function(event) { diff --git a/webapp/web/js/account/proxyUtils.js b/webapp/web/js/account/proxyUtils.js new file mode 100644 index 000000000..0d5bcd67b --- /dev/null +++ b/webapp/web/js/account/proxyUtils.js @@ -0,0 +1,7 @@ +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ + +$(document).ready(function(){ + $('input[name="proxySelectorAC"]').click(function(){ + $(this).val(''); + }) +}); \ No newline at end of file diff --git a/webapp/web/templates/freemarker/body/accounts/userAccounts-myAccount.ftl b/webapp/web/templates/freemarker/body/accounts/userAccounts-myAccount.ftl index f28170bcc..e77b1b52b 100644 --- a/webapp/web/templates/freemarker/body/accounts/userAccounts-myAccount.ftl +++ b/webapp/web/templates/freemarker/body/accounts/userAccounts-myAccount.ftl @@ -93,6 +93,5 @@ ${stylesheets.add('')} ${stylesheets.add('')} -${scripts.add('', - '', +${scripts.add('', '')} \ No newline at end of file diff --git a/webapp/web/templates/freemarker/body/accounts/userAccounts-myProxiesPanel.ftl b/webapp/web/templates/freemarker/body/accounts/userAccounts-myProxiesPanel.ftl index 8dff93db9..76e710620 100644 --- a/webapp/web/templates/freemarker/body/accounts/userAccounts-myProxiesPanel.ftl +++ b/webapp/web/templates/freemarker/body/accounts/userAccounts-myProxiesPanel.ftl @@ -5,46 +5,42 @@ ${stylesheets.add('', '')} -
- Proxy self editors -

-

Add proxy:

-

-

type here

-

-

Selected proxies:

+
+

Who can edit my profile

+ +

Add profile editor

+ +

+

 

- <#-- Magic div thst holds all of the proxy data and the template that shows how to display it. --> +

Selected editors:

+ <#-- Magic div thst holds all of the proxy data and the template that shows how to display it. -->
- <#list proxies as proxy> -
-

${proxy.uri}

-

${proxy.label}

-

${proxy.classLabel}

-

${proxy.imageUrl}

+ <#list proxies as proxy> +
+

${proxy.uri}

+

${proxy.label}

+

${proxy.classLabel}

+

${proxy.imageUrl}

- <#-- - Each proxy will be shown using the HTML inside this div. - It must contain at least: - -- a link with templatePart="remove" - -- a hidden input field with templatePart="uriField" - --> + <#-- + Each proxy will be shown using the HTML inside this div. + It must contain at least: + -- a link with templatePart="remove" + -- a hidden input field with templatePart="uriField" + -->
-
- %label% + %label% -
+
%label% | %classLabel% - -
- remove - -
+
Remove selection +
@@ -54,14 +50,14 @@ ${stylesheets.add(' var proxyMechanism = { - baseUrl: '${urls.base}', - sparqlQueryUrl: '${formUrls.sparqlQueryAjax}', - matchingProperty: '${matchingProperty}', - myAccountUri: '${myAccountUri}' + baseUrl: '${urls.base}', + sparqlQueryUrl: '${formUrls.sparqlQueryAjax}', + matchingProperty: '${matchingProperty}', + myAccountUri: '${myAccountUri}' }; -${scripts.add('', +${scripts.add('', '', '', '')}