Skip to content

Commit

Permalink
Merge pull request #2691 from Trustroots/2690-adding-npub-field
Browse files Browse the repository at this point in the history
#2690 profile.nostrNpub
  • Loading branch information
guaka authored May 26, 2024
2 parents 24aa932 + 6194302 commit 9e68445
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 0 deletions.
12 changes: 12 additions & 0 deletions modules/users/client/components/ProfileViewBasics.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,18 @@ export default function ProfileViewBasics({ profile }) {
className="social-profiles list-unstyled"
aria-describedby="profile-networks"
>
{profile.nostrNpub && (
<li className="social-profile">
<i className="social-profile-icon icon-fw icon-lg"></i>
<a
rel="noopener"
className="social-profile-handle"
href={`https://njump.me/${profile.nostrNpub}`}
>
nostr npub
</a>
</li>
)}
{/*
Facebook profile link is hidden here until issue with their API gets resolved
See https://github.com/Trustroots/trustroots/issues/237
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,67 @@ <h4>Other hospitality networks</h4>
</div>
</div>

<div class="extsites">
<h4>nostr</h4>
<!--
Note:
- links here have `rel="noopener"` because;
https://mathiasbynens.github.io/rel-noopener/
- CS link has `rel="noreferrer"` because;
https://github.com/Trustroots/trustroots/issues/464
-->
<div class="form-group">
<div class="input-group">
<div class="input-group-addon">
<a
tabindex="0"
class="icon-help cursor-help tr-help"
popover-placement="bottom-left"
popover-trigger="'mouseenter'"
uib-popover-template="'nostrGuidePopover.html'"
></a>
<script type="text/ng-template" id="nostrGuidePopover.html">
<div>
Paste your nostr npub in here.
<br><br>
</div>
</script>
</div>
<label class="input-group-addon" for="extSitesCouchers">
<span class="hidden-xs"></span>
<span class="visible-xs-inline">npub:</span>
</label>
<input
id="nostrNpub"
type="text"
class="form-control"
ng-model="profileEditNetworks.user.nostrNpub"
ng-change="profileEdit.unsavedModifications=true"
placeholder="npub"
aria-label="nostr npub"
/>
<!--
<span
class="input-group-btn"
ng-if="profileEditNetworks.user.nostrNpub.length"
>
<a
ng-href="https://app.couchers.org/user/{{ profileEditNetworks.user.extSitesCouchers }}"
target="_blank"
class="btn btn-primary"
role="button"
rel="noopener"
>
<small>Test</small>
</a>
</span>
-->
</div>
</div>

</div>


<p>
<button
type="submit"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ exports.userProfileFields = [
'extSitesBW', // BeWelcome username
'extSitesCS', // CouchSurfing username
'extSitesWS', // WarmShowers username
'nostrNpub', // nostr npub
'emailHash', // MD5 hashed email to use with Gravatars
'additionalProvidersData.facebook.id', // For FB avatars and profile links
'additionalProvidersData.twitter.screen_name', // For Twitter profile links
Expand Down
6 changes: 6 additions & 0 deletions modules/users/server/models/user.server.model.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,12 @@ const UserSchema = new Schema({
trim: true,
set: setPlainTextField,
},
// nostr npub
nostrNpub: {
type: String,
trim: true,
set: setPlainTextField,
},
password: {
type: String,
default: '',
Expand Down

0 comments on commit 9e68445

Please sign in to comment.