summaryrefslogtreecommitdiffstats
path: root/client/components
diff options
context:
space:
mode:
authorMaxime Quandalle <maxime@quandalle.com>2015-10-20 20:02:12 +0200
committerMaxime Quandalle <maxime@quandalle.com>2015-10-20 20:02:12 +0200
commit118b434a5aad35df8eefea85624ab9abafab56f0 (patch)
tree551e0123c5b17ca98ef29bcf75a867644299bfa7 /client/components
parent8e0ad9119190ac0cfa22827fa278b498eba02d6c (diff)
downloadwekan-118b434a5aad35df8eefea85624ab9abafab56f0.tar.gz
wekan-118b434a5aad35df8eefea85624ab9abafab56f0.tar.bz2
wekan-118b434a5aad35df8eefea85624ab9abafab56f0.zip
Provide a default date for lists and cards creation date
See https://github.com/wekan/wekan/pull/362#issuecomment-149645497 for motivation. This commit also contains cosmetic changes to the import Popup and on the code style to be more consistent with the code base.
Diffstat (limited to 'client/components')
-rw-r--r--client/components/boards/boardHeader.jade5
-rw-r--r--client/components/import/import.jade5
-rw-r--r--client/components/import/import.js28
-rw-r--r--client/components/main/popup.styl6
4 files changed, 23 insertions, 21 deletions
diff --git a/client/components/boards/boardHeader.jade b/client/components/boards/boardHeader.jade
index e460170b..cb86e9bb 100644
--- a/client/components/boards/boardHeader.jade
+++ b/client/components/boards/boardHeader.jade
@@ -107,8 +107,9 @@ template(name="createBoardPopup")
| {{{_ 'board-private-info'}}}
a.js-change-visibility {{_ 'change'}}.
input.primary.wide(type="submit" value="{{_ 'create'}}")
- | {{_ 'or'}}
- a.js-import {{_ 'import-board'}}
+ span.quiet
+ | {{_ 'or'}}
+ a.js-import {{_ 'import-board'}}
template(name="boardChangeTitlePopup")
diff --git a/client/components/import/import.jade b/client/components/import/import.jade
index 8059b65b..f63661af 100644
--- a/client/components/import/import.jade
+++ b/client/components/import/import.jade
@@ -2,7 +2,6 @@ template(name="importPopup")
if error.get
.warning {{_ error.get}}
form
- label
- | {{_ getLabel}}
- textarea.js-card-json(placeholder="{{_ 'import-json-placeholder'}}" autofocus)
+ p: label(for='import-textarea') {{_ getLabel}}
+ textarea#import-textarea.js-import-json(placeholder="{{_ 'import-json-placeholder'}}" autofocus)
input.primary.wide(type="submit" value="{{_ 'import'}}")
diff --git a/client/components/import/import.js b/client/components/import/import.js
index 00918aac..c6957fa9 100644
--- a/client/components/import/import.js
+++ b/client/components/import/import.js
@@ -1,20 +1,21 @@
-/**
- * Abstract root for all import popup screens.
- * Descendants must define:
- * - getMethodName(): return the Meteor method to call for import, passing json data decoded as object
- * and additional data (see below)
- * - getAdditionalData(): return object containing additional data passed to Meteor method
- * (like list ID and position for a card import)
- * - getLabel(): i18n key for the text displayed in the popup, usually to explain how to get the data out of the
- * source system.
- */
+/// Abstract root for all import popup screens.
+/// Descendants must define:
+/// - getMethodName(): return the Meteor method to call for import, passing json
+/// data decoded as object and additional data (see below);
+/// - getAdditionalData(): return object containing additional data passed to
+/// Meteor method (like list ID and position for a card import);
+/// - getLabel(): i18n key for the text displayed in the popup, usually to
+/// explain how to get the data out of the source system.
const ImportPopup = BlazeComponent.extendComponent({
- template() {return 'importPopup';},
+ template() {
+ return 'importPopup';
+ },
+
events() {
return [{
'submit': (evt) => {
evt.preventDefault();
- const dataJson = $(evt.currentTarget).find('textarea').val();
+ const dataJson = $(evt.currentTarget).find('.js-import-json').val();
let dataObject;
try {
dataObject = JSON.parse(dataJson);
@@ -52,7 +53,8 @@ const ImportPopup = BlazeComponent.extendComponent({
ImportPopup.extendComponent({
getAdditionalData() {
const listId = this.data()._id;
- const firstCardDom = $(`#js-list-${this.currentData()._id} .js-minicard:first`).get(0);
+ const selector = `#js-list-${this.currentData()._id} .js-minicard:first`;
+ const firstCardDom = $(selector).get(0);
const sortIndex = Utils.calculateIndex(null, firstCardDom).base;
const result = {listId, sortIndex};
return result;
diff --git a/client/components/main/popup.styl b/client/components/main/popup.styl
index 3bef4f7d..8a685069 100644
--- a/client/components/main/popup.styl
+++ b/client/components/main/popup.styl
@@ -17,9 +17,11 @@ $popupWidth = 300px
margin: 4px -10px
width: $popupWidth
+ p,
+ textarea,
input[type="text"],
input[type="email"],
- input[type="password"]
+ input[type="password"],
input[type="file"]
margin: 4px 0 12px
width: 100%
@@ -30,8 +32,6 @@ $popupWidth = 300px
textarea
height: 72px
- margin: 4px 0 12px
- width: 100%
.header
height: 36px