Skip to content

Commit

Permalink
Merge pull request #670 from aholachek/orcid-formatting
Browse files Browse the repository at this point in the history
more orcid formatting tweaks, error message for link servers
  • Loading branch information
aholachek committed Nov 10, 2015
2 parents a8c306f + 514c803 commit b75dfea
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 11 deletions.
5 changes: 2 additions & 3 deletions src/js/widgets/navbar/template/navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ <h1 class="sr-only"> Link to the Astrophysics Data System Home Page</h1>
<ul class="dropdown-menu" role="menu">
<li class="no-hover-style">
{{#if orcidLastName}} <h4> Signed in to ORCID as <br/> <strong>{{orcidFirstName}} {{orcidLastName}}</strong></h4> {{/if}}
<hr/>
<div class="s-orcid-mode-label"><b>ORCID Mode</b></div>
<div class="s-orcid-label-container">
off
Expand All @@ -57,7 +56,7 @@ <h1 class="sr-only"> Link to the Astrophysics Data System Home Page</h1>
</div>
</li>
{{#if orcidLastName}}
<li class="no-hover-style" style="clear:both;padding-bottom:20px;"> <i>Get started adding papers to your profile:</i> <br/>
<li class="no-hover-style" style="clear:both;padding-bottom:20px;"> <i style="padding-bottom:10px;display:block;">Get started adding papers to your profile:</i>
<button class="btn sm btn-default search-author-name"><i class="fa fa-search"></i> author:"{{orcidLastName}}, {{orcidFirstName}}"</button>
</li>
{{else}}
Expand Down Expand Up @@ -86,7 +85,7 @@ <h1 class="sr-only"> Link to the Astrophysics Data System Home Page</h1>
alt="orcid symbol"/> ORCID <span class="caret"></span></button>
<ul class="dropdown-menu" role="menu">
<li class="no-hover-style">
{{#if orcidLastName}} <div> Signed in to ORCID as <strong>{{orcidFirstName}} {{orcidLastName}}</strong></div> {{/if}}
{{#if orcidLastName}} <h4> Signed in to ORCID as <br/> <strong>{{orcidFirstName}} {{orcidLastName}}</strong></h4> {{/if}}
<div class="s-orcid-mode-label"><b>ORCID Mode</b></div>
<div class="s-orcid-label-container">
off
Expand Down
22 changes: 15 additions & 7 deletions src/js/widgets/preferences/templates/openurl.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
{{#if link_server}}
<div class="current-link-server">
<p>Your Library Link Server is set to <b>{{openURLName}}</b>.</p>
<button class="btn btn-primary-faded btn-sm {{#if link_server}} collapsed {{/if}}" data-toggle="collapse" data-target="#link-server-container"><i class="toggle-icon"></i> Change Library Link Server</button>
</div>
{{/if}}
{{#if error}}
<p class="text-danger">Sorry, the library link information for your account could not be retrieved. Please try again later.</p>
{{else}}

{{#if openURLName}}
<div class="current-link-server">
<p>Your Library Link Server is set to <b>{{openURLName}}</b>.</p>
<button class="btn btn-primary-faded btn-sm {{#if link_server}} collapsed {{/if}}" data-toggle="collapse" data-target="#link-server-container"><i class="toggle-icon"></i> Change Library Link Server</button>
</div>
{{/if}}

<div id="link-server-container" class="{{#if link_server}} collapse {{/if}}">
<br/>
Expand Down Expand Up @@ -31,8 +35,12 @@
<p>
If you are still having difficulties, <b><a href="mailto:adshelp@cfa.harvard.edu">contact us</a></b> for help.
</p>
</form>
</form>
<br/>


</div>


{{/if}}

5 changes: 5 additions & 0 deletions src/js/widgets/preferences/views/openurl.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ define([

var data = this.model.toJSON();
data.openURLConfig = this.collection.toJSON();
//probably a server error
if (data.openURLConfig.length === 0){
data.error = true;
return data
}

var current = _.findWhere(data.openURLConfig, {link : data.link_server});
data.openURLName = current ? current.name : "";
Expand Down
1 change: 0 additions & 1 deletion src/js/widgets/preferences/widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ define([

//as soon as preferences widget is activated, get the open url config
this.getBeeHive().getObject("User").getOpenURLConfig().done(function (config) {
debugger
that.openURLCollection.reset(config);
});

Expand Down

0 comments on commit b75dfea

Please sign in to comment.