Ssmith has uploaded a new change for review.
https://gerrit.wikimedia.org/r/199815
Change subject: Remove default wording and direct new user to lib
......................................................................
Remove default wording and direct new user to lib
bug: T93967
Change-Id: I7e8d373030380c74196285003c7093333cc46a0d
---
M persistence.js
M src/components/app-content/app-content.html
M src/components/boards/generic-board/generic-board.html
M src/components/boards/generic-board/generic-board.js
M src/css/style.css
5 files changed, 46 insertions(+), 33 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/dash
refs/changes/15/199815/1
diff --git a/persistence.js b/persistence.js
index ebdb290..5108a60 100644
--- a/persistence.js
+++ b/persistence.js
@@ -84,7 +84,8 @@
return;
}
// If user doesn't have a default board, insert one now
- return connection.query( insertBoard, [ 'Default
dashboard for ' + user.displayName, userId, userId ] );
+ var username = user.displayName.charAt(0).toUpperCase()
+ user.displayName.slice(1);
+ return connection.query( insertBoard, [ username + "'s
Board", userId, userId ] );
} )
.then( function( dbResults ) {
if ( !dbResults ) {
diff --git a/src/components/app-content/app-content.html
b/src/components/app-content/app-content.html
index caa32de..12def48 100644
--- a/src/components/app-content/app-content.html
+++ b/src/components/app-content/app-content.html
@@ -30,7 +30,7 @@
<img data-bind="attr: {src:
previewPath}">
<h3 data-bind="text: displayName"></h3>
<p class="widgetDesc" data-bind="text:
description"></p>
- <button class="btn btn-block btn-col
btn-primary addToBoardBtn" data-bind="attr: { id: 'add-widget-'+id }, click:
$parent.addWidgetToBoard">Add to my default board</button>
+ <button class="btn btn-block btn-col
btn-primary addToBoardBtn" data-bind="attr: { id: 'add-widget-'+id }, click:
$parent.addWidgetToBoard">Add to my board</button>
<button class="hide btn btn-block
btn-col btn-success addToBoardBtn" data-bind="attr: { id: 'saved-widget-'+id
}"><i class="fa fa-check-circle-o"></i> Added.</button>
</li>
</ul>
diff --git a/src/components/boards/generic-board/generic-board.html
b/src/components/boards/generic-board/generic-board.html
index 5a5855c..2c17a5b 100644
--- a/src/components/boards/generic-board/generic-board.html
+++ b/src/components/boards/generic-board/generic-board.html
@@ -3,13 +3,24 @@
<div class="row">
<div class="col-md-4 titleCol">
<h2 style="display:inline" data-bind="text:
displayedBoard().displayName"></h2>
- <p data-bind="text: displayDate"></p>
+ <p><span data-bind="text: displayDate"></span></p>
+ <!-- <i class="fa fa-gear" data-toggle="modal"
data-target="#changeBoardNameModal"></i></p> -->
</div>
<div class="col-md-8 titleCol">
<!-- <div class="btn-group btn-group-xs pull-right">
<button type="button" class="btn btn-default"
data-bind="click: reloadBoard"><i class="fa fa-refresh"
style="padding-right:5px"></i> Refresh</button>
</div> -->
</div>
+ </div>
+
+ <div class="row jumbotron transparent" data-bind="visible:
displayedBoard().widgets.length == 0">
+ <div class="alert alert-info">
+ <h1><i class="fa fa-flag"></i> There are no widgets on this
board.</h1>
+ <div class="text-center">
+ <h3>Don't worry, it's easy to add them. They live in the
Library.</h3>
+ <button class="btn btn-lg btn-info" id="Library"
data-bind="click: $parent.setDisplayPage"><i class="fa fa-paper-plane"></i>
Take me to the Library!</button>
+ </div>
+ </div>
</div>
<div class="row widgetDisplayRow" data-bind="foreach:
displayedBoard().widgets">
@@ -30,4 +41,23 @@
</div>
</div><!-- /.modal-content -->
</div>
-</div>
\ No newline at end of file
+</div>
+
+<div class="modal fade" id="changeBoardNameModal">
+ <div class="modal-dialog">
+ <div class="modal-content">
+ <div class="modal-header">
+ <button type="button" class="close" data-dismiss="modal"><span
aria-hidden="true">×</span><span class="sr-only">Close</span></button>
+ <h4 class="modal-title">Change Board Name</h4>
+ </div>
+ <div class="modal-body">
+ <label>New Name:</label>
+ <input type="text" class="form-control" data-bind="textInput:
boardName">
+ </div>
+ <div class="modal-footer">
+ <button type="button" class="btn btn-default"
data-dismiss="modal">Cancel</button>
+ <button type="button" class="btn btn-success pull-right"
data-dismiss="modal">Submit</button>
+ </div>
+ </div><!-- /.modal-content -->
+ </div><!-- /.modal-dialog -->
+</div><!-- /.modal -->
\ No newline at end of file
diff --git a/src/components/boards/generic-board/generic-board.js
b/src/components/boards/generic-board/generic-board.js
index 282a82d..fe1fad4 100644
--- a/src/components/boards/generic-board/generic-board.js
+++ b/src/components/boards/generic-board/generic-board.js
@@ -11,10 +11,11 @@
var self = this,
timeFormat = 'dddd, MMMM Do YYYY, h:mm:ss a';
- self.sharedContext = {};
+ self.sharedContext = {};
+ self.displayedBoard = params.displayedBoard;
+ self.boardName = ko.observable();
+ self.widgetLoads = ko.observableArray([]);
- self.displayedBoard = params.displayedBoard;
- self.widgetLoads = ko.observableArray([]);
function setWidgetLoads() {
self.widgetLoads.removeAll();
$.each( self.displayedBoard().widgets, function( i,
widget ) {
@@ -24,6 +25,9 @@
}
setWidgetLoads();
self.displayedBoard.subscribe( setWidgetLoads );
+
+ //TODO: be able to change board name
+ //self.boardName(self.displayedBoard().displayName);
//This will return true if any child widget is loading
self.dataLoading = ko.computed( function() {
@@ -48,32 +52,6 @@
} );
// Get the date
self.displayDate = ko.observable( moment().format( timeFormat ) );
-
- //todo: this could go elsewhere
- self.ellipsis = ko.observable('');
- self.ellipsisObj = {
- 'value' : ['', '.', '..', '...', '....'],
- 'count' : 0,
- 'run' : false,
- 'timer' : null,
- 'element' : '.ellipsis',
- 'start' : function () {
- var t = this;
- this.run = true;
- this.timer = setInterval(function () {
- if (t.run) {
- self.ellipsis(t.value[t.count % t.value.length]);
- t.count++;
- }
- }, 400);
- },
- 'stop' : function () {
- this.run = false;
- clearInterval(this.timer);
- this.count = 0;
- }
- };
- self.ellipsisObj.start();
// Reload the data. For the automatic reload, we're fine getting
// something from the cache.
diff --git a/src/css/style.css b/src/css/style.css
index fb73b21..e039ce8 100644
--- a/src/css/style.css
+++ b/src/css/style.css
@@ -289,6 +289,10 @@
border-bottom: 1px #ccc solid;
}
+.transparent {
+ background-color: #f5f5f5;
+}
+
/* Gauges */
.fraudGauge {
--
To view, visit https://gerrit.wikimedia.org/r/199815
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7e8d373030380c74196285003c7093333cc46a0d
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/dash
Gerrit-Branch: master
Gerrit-Owner: Ssmith <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits