Skip to content

Commit

Permalink
Updates for latest NodeBB
Browse files Browse the repository at this point in the history
  • Loading branch information
pichalite committed Aug 28, 2018
1 parent 7eaa221 commit e60ee75
Show file tree
Hide file tree
Showing 26 changed files with 362 additions and 63 deletions.
3 changes: 2 additions & 1 deletion less/skins.less
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
body {
&.skin-dark {
&.theme-dark {
color: @body-color-dark;
background-color: @body-bg-color-dark;

Expand Down Expand Up @@ -35,6 +35,7 @@ body {
}

.btn-default {
color: @material-primary !important;
background-color: @btn-default-bg-color-dark;
}

Expand Down
5 changes: 3 additions & 2 deletions lib/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ theme.getConfig = function (config, callback) {
config.categoriesAsList = settings.categoriesAsList === 'on';
config.listSubcategories = settings.listSubcategories === 'on';
config.selectedSkin = themeMaterialSkin || settings.skinOption || 'default';
});
config.bootswatchSkin = 'default';

callback(false, config);
callback(false, config);
});
};

theme.customSettings = function (data, callback) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "nodebb-theme-material",
"version": "2.12.0",
"nbbpm": {
"compatibility": "^1.8.0"
"compatibility": "^1.10.0"
},
"description": "Material Design theme for NodeBB",
"main": "theme.less",
Expand Down
54 changes: 54 additions & 0 deletions templates/account/blocks.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<!-- IMPORT partials/breadcrumbs.tpl -->
<div class="account">
<!-- IMPORT partials/account/header.tpl -->

<div class="users row">
<div class="col-sm-8 col-xs-12">
<div class="card">
<div class="card-header">
<h4>[[pages:account/blocks, {username}]]</h4>
</div>
<div class="card-body card-padding">
<ul id="users-container" class="users-container" data-nextstart="{nextStart}">
<!-- IMPORT partials/users_list.tpl -->
</ul>
<div class="alert alert-warning text-center"<!-- IF users.length --> style="display: none;"<!-- END -->>[[user:has_no_blocks]]</div>
<!-- IMPORT partials/paginator.tpl -->
</div>
</div>
</div>
<div class="col-sm-4 col-xs-12">
<div class="card">
<div class="card-body card-padding form">
<div class="form-group">
<div class="fg-line">
<label for="user-search">[[users:search]]</label>
<input class="form-control" type="text" id="user-search" placeholder="[[users:enter_username]]" />
</div>
</div>
<div class="block-edit">
<!-- IF edit -->
<!-- BEGIN edit -->
<table class="table">
<tr>
<td>
<a href="{config.relative_path}/uid/{../uid}">
<!-- IF ../picture -->
<img class="user-picture" component="user/picture" src="{../picture}" itemprop="image" />
<!-- ELSE -->
<div class="user-icon user-picture" component="user/picture" style="background-color: {../icon:bgColor};">{../icon:text}</div><!-- END -->{../username}
</a>
</td>
<td>
<button class="btn btn-sm btn-primary pull-right" data-uid="{../uid}" data-action="toggle">[[user:block_toggle]]</button>
</td>
</tr>
</table>
<!-- END -->
<!-- END -->
</div>
</div>
</div>
</div>
</div>
</div>
75 changes: 75 additions & 0 deletions templates/account/consent.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<!-- IMPORT partials/breadcrumbs.tpl -->
<div class="account">
<!-- IMPORT partials/account/header.tpl -->
<div class="card">
<div class="card-header">
<h4>[[user:consent.title]]</h4>
</div>
<div class="card-body card-padding">
<p class="lead">[[user:consent.lead]]</p>
<p>[[user:consent.intro]]</p>
</div>
</div>


<div class="row">
<div class="col-sm-6">
<!-- IF gdpr_consent -->
<div class="alert alert-success">
<i class="fa fa-check pull-right fa-3x"></i>
[[user:consent.received]]
</div>
<!-- ELSE -->
<div class="alert alert-warning">
[[user:consent.not_received]]
<br /><br />
<div class="text-center">
<button class="btn btn-warning" data-action="consent">[[user:consent.give]]</button>
</div>
</div>
<!-- END -->
<div class="card">
<div class="card-body card-padding">
<p>[[user:consent.email_intro]]</p>
<!-- IF digest.enabled -->
<p>[[user:consent.digest_frequency, {digest.frequency}]]</p>
<!-- ELSE -->
[[user:consent.digest_off]]
<!-- END -->

<div class="text-center">
<a class="btn btn-default" href="./settings">
<i class="fa fa-cog"></i>
[[pages:account/settings]]
</a>
</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="card">
<div class="card-body card-padding">
<p><strong>[[user:consent.right_of_access]]</strong></p>
<p>[[user:consent.right_of_access_description]]</p>
<p><strong>[[user:consent.right_to_rectification]]</strong></p>
<p>[[user:consent.right_to_rectification_description]]</p>
<p><strong>[[user:consent.right_to_erasure]]</strong></p>
<p>[[user:consent.right_to_erasure_description]]</p>
<p><strong>[[user:consent.right_to_data_portability]]</strong></p>
<p>[[user:consent.right_to_data_portability_description]]</p>

<div class="btn-group-vertical btn-block">
<a class="btn btn-default" href="{config.relative_path}/api/user/uid/{userslug}/export/profile">
<i class="fa fa-download"></i> [[user:consent.export_profile]]
</a>
<a class="btn btn-default" href="{config.relative_path}/api/user/uid/{userslug}/export/posts">
<i class="fa fa-download"></i> [[user:consent.export_posts]]
</a>
<a class="btn btn-default" href="{config.relative_path}/api/user/uid/{userslug}/export/uploads">
<i class="fa fa-download"></i> [[user:consent.export_uploads]]
</a>
</div>
</div>
</div>
</div>
</div>
2 changes: 2 additions & 0 deletions templates/account/edit.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
</button>

<ul class="dropdown-menu dropdown-menu-right">
<!-- IF allowProfilePicture -->
<li><a id="changePictureBtn" href="#">[[user:change_picture]]</a></li>
<!-- ENDIF allowProfilePicture -->
<!-- IF !username:disableEdit -->
<li><a href="{config.relative_path}/user/{userslug}/edit/username">[[user:change_username]]</a></li>
<!-- ENDIF !username:disableEdit -->
Expand Down
2 changes: 1 addition & 1 deletion templates/account/profile.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

<!-- IF websiteName -->
<div class="profile-label">[[user:website]]</div>
<div><a href="{websiteLink}">{websiteName}</a></div>
<div><a href="{websiteLink}" rel="nofollow noopener noreferrer">{websiteName}</a></div>
<!-- ENDIF websiteName -->

<!-- IF location -->
Expand Down
52 changes: 52 additions & 0 deletions templates/account/uploads.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<!-- IMPORT partials/breadcrumbs.tpl -->
<div class="account">
<!-- IMPORT partials/account/header.tpl -->
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-header ch-alt">
<h4>{title}</h4>
</div>
<div class="card-body card-padding">

<!-- IF privateUploads -->
<div class="alert alert-info text-center">[[uploads:private-uploads-info]]</div>
<!-- ELSE -->
<div class="alert alert-info text-center">[[uploads:public-uploads-info]]</div>
<!-- ENDIF privateUploads -->

<!-- IF !uploads.length -->
<div class="alert alert-warning text-center">[[uploads:no-uploads-found]]</div>
<!-- ELSE -->
<div class="col-xs-12">
<table class="table table-striped">
<thead>
<tr>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<!-- BEGIN uploads -->
<tr data-name="{uploads.name}">
<td>
<a href="{config.relative_path}{uploads.url}">{uploads.url}</a>
</td>
<td>
<div class="btn-group ">
<button class="btn btn-danger btn-xs" data-action="delete"><i class="fa fa-trash"></i></button>
</div>
</td>
</tr>
<!-- END uploads -->
</tbody>
</table>

<!-- IMPORT partials/paginator.tpl -->
</div>
<!-- ENDIF !uploads.length -->
</div>
</div>
</div>
</div>
</div>
4 changes: 2 additions & 2 deletions templates/chat.tpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div id="chat-modal" class="chat-modal hide" tabindex="-1" role="dialog" aria-labelledby="Chat" aria-hidden="true" data-backdrop="none" data-name="{roomName}">
<div id="chat-modal" class="chat-modal hide" tabindex="-1" role="dialog" aria-labelledby="Chat" aria-hidden="true" data-backdrop="none">
<div class="modal-dialog">
<div class="modal-content listview lv-message">
<div class="modal-header">
Expand All @@ -23,7 +23,7 @@
<!-- END -->
<li class="dropdown-header">[[modules:chat.options]]</li>
<li>
<a href="#" data-action="members"><i class="fa fa-fw fa-plus"></i> [[modules:chat.add-users-to-room]]</a>
<a href="#" data-action="members"><i class="fa fa-fw fa-cog"></i> [[modules:chat.manage-room]]</a>
</li>
<li>
<a href="#" data-action="rename"><i class="fa fa-fw fa-edit"></i> [[modules:chat.rename-room]]</a>
Expand Down
2 changes: 1 addition & 1 deletion templates/footer.tpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
</div><!-- END container -->
</div><!-- /.container#content -->

<div class="hide">
<!-- IMPORT 500-embed.tpl -->
Expand Down
17 changes: 12 additions & 5 deletions templates/groups/details.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<div>{group.descriptionParsed}</div>
<!-- IF isAdmin -->
<div class="pull-right">
<a href="{config.relative_path}/admin/manage/groups/{group.nameEncoded}" target="_blank" class="btn btn-info"><i class="fa fa-gear"></i> [[user:edit]]</a>
<a href="{config.relative_path}/admin/manage/groups/{group.nameEncoded}" target="_blank" class="btn btn-primary"><i class="fa fa-gear"></i> [[user:edit]]</a>
</div>
<!-- ENDIF isAdmin -->
<!-- IF loggedIn -->
Expand All @@ -42,12 +42,19 @@
<i class="fa fa-users"></i> [[groups:details.members]]
</div>
<div class="card-body card-padding group-members">
<div class="fg-line">
<input class="form-control" type="text" component="groups/members/search" placeholder="[[global:search]]"/>
<!-- IF group.isOwner -->
<div class="col-lg-2">
<button component="groups/members/add" type="button" class="btn btn-primary" title="[[groups:details.add-member]]"><i class="fa fa-user-plus"></i></button>
</div>
<!-- ENDIF group.isOwner -->
<div class="<!-- IF group.isOwner -->col-lg-10<!-- ELSE -->col-lg-12<!-- ENDIF group.isOwner -->">
<div class="fg-line input-group">
<input class="form-control" type="text" component="groups/members/search" placeholder="[[global:search]]"/>
</div>
</div>
<table component="groups/members" class="table members" data-nextstart="{group.membersNextStart}">
<tbody>
<!-- BEGIN members -->
<!-- BEGIN group.members -->
<tr data-uid="{group.members.uid}">
<td>
<a href="{config.relative_path}/user/{group.members.userslug}">
Expand Down Expand Up @@ -83,7 +90,7 @@
</td>
<!-- ENDIF group.isOwner -->
</tr>
<!-- END members -->
<!-- END group.members -->
</tbody>
</table>
</div>
Expand Down
2 changes: 1 addition & 1 deletion templates/header.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<!-- ENDIF useCustomCSS -->
</head>

<body class="{bodyClass} skin-{config.selectedSkin}">
<body class="{bodyClass} theme-{config.selectedSkin}">
<!-- IMPORT partials/menu.tpl -->

<div class="container" id="content">
Expand Down
2 changes: 1 addition & 1 deletion templates/login.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<div class="login-options">
<ul class="alternate-auth">
<!-- BEGIN authentication -->
<li class="{authentication.name}"><a rel="nofollow" target="_top" href="{config.relative_path}{authentication.url}"><i class="fa {authentication.icon} fa-2x"></i></a></li>
<li class="{authentication.name}"><a rel="nofollow noopener noreferrer" target="_top" href="{config.relative_path}{authentication.url}"><i class="fa {authentication.icon} fa-2x"></i></a></li>
<!-- END authentication -->
</ul>
</div>
Expand Down
4 changes: 2 additions & 2 deletions templates/partials/account/header.tpl
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<div class="card user-profile-view" data-uid="{uid}">
<div class="card-body cover" component="account/cover" style="background-image: url({cover:url}); background-position: {cover:position};">
<!-- IF showHidden -->
<!-- IF allowCoverPicture -->
<div class="controls">
<span class="upload"><i class="fa fa-fw fa-3x fa-upload"></i></span>
<span class="resize"><i class="fa fa-fw fa-3x fa-arrows"></i></span>
<span class="remove"><i class="fa fa-fw fa-3x fa-times"></i></span>
</div>
<div class="save">[[groups:cover-save]] <i class="fa fa-fw fa-floppy-o"></i></div>
<div class="indicator">[[groups:cover-saving]] <i class="fa fa-fw fa-refresh fa-spin"></i></div>
<!-- ENDIF showHidden -->
<!-- ENDIF allowCoverPicture -->
</div>

<div class="card-footer">
Expand Down
13 changes: 12 additions & 1 deletion templates/partials/account/menu.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,18 @@
<a href="{config.relative_path}/user/{userslug}" class="inline-block" id="profile"><i class="fa fa-fw fa-user"></i> [[user:profile]]</a>
</li>
<!-- IF showHidden -->
<li><a href="{config.relative_path}/user/{userslug}/settings"><i class="fa fa-fw fa-edit"></i> [[user:settings]]</a></li>
<li><a href="{config.relative_path}/user/{userslug}/edit"><i class="fa fa-fw fa-gear"></i> [[user:edit]]</a></li>
<li><a href="{config.relative_path}/user/{userslug}/settings"><i class="fa fa-fw fa-edit"></i> [[user:settings]]</a></li>
<!-- ENDIF showHidden -->

<!-- IF !isSelf -->
<!-- IF !banned -->
<li>
<a component="account/flag" href="#">[[user:flag-profile]]</a>
</li>
<li>
<a component="account/block" href="#"><!-- IF !../isBlocked -->[[user:block_user]]<!-- ELSE -->[[user:unblock_user]]<!-- END --></a>
</li>
<!-- ENDIF !banned -->

<!-- IF canBan -->
Expand All @@ -36,6 +39,9 @@
<li class="divider"></li>
<li><a href="{config.relative_path}/user/{userslug}/following"><i class="fa fa-fw fa-users"></i> [[user:following]]</a></li>
<li><a href="{config.relative_path}/user/{userslug}/followers"><i class="fa fa-fw fa-users"></i> [[user:followers]]</a></li>
<!-- IF showHidden -->
<li><a href="{config.relative_path}/user/{userslug}/blocks"><i class="fa fa-fw fa-ban"></i> [[user:blocks]]</a></li>
<!-- ENDIF showHidden -->
<li class="divider"></li>
<li><a href="{config.relative_path}/user/{userslug}/topics"><i class="fa fa-fw fa-book"></i> [[global:topics]]</a></li>
<li><a href="{config.relative_path}/user/{userslug}/posts"><i class="fa fa-fw fa-pencil"></i> [[global:posts]]</a></li>
Expand All @@ -45,8 +51,13 @@
<li><a href="{config.relative_path}/user/{userslug}/bookmarks"><i class="fa fa-fw fa-heart"></i> [[user:bookmarks]]</a></li>
<li><a href="{config.relative_path}/user/{userslug}/watched"><i class="fa fa-fw fa-eye"></i> [[user:watched]]</a></li>
<li><a href="{config.relative_path}/user/{userslug}/ignored"><i class="fa fa-fw fa-eye-slash"></i>[[user:ignored]]</a></li>
<!-- IF !reputation:disabled -->
<li><a href="{config.relative_path}/user/{userslug}/upvoted"><i class="fa fa-fw fa-thumbs-o-up"></i> [[global:upvoted]]</a></li>
<!-- IF !downvote:disabled -->
<li><a href="{config.relative_path}/user/{userslug}/downvoted"><i class="fa fa-fw fa-thumbs-o-down"></i> [[global:downvoted]]</a></li>
<!-- ENDIF !downvote:disabled -->
<!-- ENDIF !reputation:disabled -->
<li><a href="{config.relative_path}/user/{userslug}/uploads"><i class="fa fa-fw fa-upload"></i> [[global:uploads]]</a></li>
<!-- ENDIF showHidden -->
<!-- BEGIN profile_links -->
<!-- IF @first -->
Expand Down
2 changes: 1 addition & 1 deletion templates/partials/chats/message-window.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<!-- END -->
<li class="dropdown-header">[[modules:chat.options]]</li>
<li>
<a href="#" data-action="members"><i class="fa fa-fw fa-plus"></i> [[modules:chat.add-users-to-room]]</a>
<a href="#" data-action="members"><i class="fa fa-fw fa-cog"></i> [[modules:chat.manage-room]]</a>
</li>
<li>
<a href="#" data-action="rename"><i class="fa fa-fw fa-edit"></i> [[modules:chat.rename-room]]</a>
Expand Down
Loading

0 comments on commit e60ee75

Please sign in to comment.