【发布时间】:2016-05-09 01:34:46
【问题描述】:
我正在使用 meteor-useraccounts 处理用户帐户 - 包括 useraccounts:bootstrap。我的 boilerplate 直接来自 repo。
我的问题: 我不明白要放置我自己的 HTML/CSS。
我的 config.js:
// Options
AccountsTemplates.configure({
defaultLayout: 'emptyLayout',
showForgotPasswordLink: true,
overrideLoginErrors: true,
enablePasswordChange: true,
showLabels: false,
showPlaceholders: true,
negativeValidation: true,
positiveValidation: true,
negativeFeedback: true,
positiveFeedback: true,
});
AccountsTemplates.addFields([
{
_id: 'firstName',
type: 'text',
placeholder: "First Name",
required: true,
re: /^[^\d]{2,}$/i,
errStr: "Please enter your first name.",
},
{
_id: 'surName',
type: 'text',
placeholder: "Sur Name",
required: true,
re: /^[^\d]{2,}$/i,
errStr: "Please enter your first name.",
},
{
_id: 'institution',
type: 'text',
placeholder: "Institution/Company",
required: true,
re: /^[^\d]{2,}$/i,
errStr: "Please enter the institution or company you work for.",
},
{
_id: 'position',
type: 'text',
placeholder: "Position",
required: true,
re: /^[^\d]{2,}$/i,
errStr: "Please enter the your position in the institution/company.",
},
]);
我在文档中阅读了您应该用自己的模板替换原始模板,这就是我对Template.myAtForm.replaces("atForm"); 和以下模板所做的:
<template name="myAtForm">
{{#unless hide}}
<div class="at-form">
{{#if showTitle}}
{{> atTitle}}
{{/if}}
{{#if showError}}
{{> atError}}
{{/if}}
{{#if showResult}}
{{> atResult}}
{{/if}}
{{#if showOauthServices}}
{{> atOauth}}
{{/if}}
{{#if showServicesSeparator}}
{{> atSep}}
{{/if}}
{{#if showPwdForm}}
{{> atPwdForm}}
{{/if}}
{{#if showTermsLink}}
{{> atTermsLink}}
{{/if}}
{{#if showSignInLink}}
{{> atSigninLink}}
{{/if}}
{{#if showSignUpLink}}
{{> atSignupLink}}
{{/if}}
</div> <!-- end main div -->
{{/unless}}
</template>
例如,我必须在哪里添加引导类,以便我在一行中有两个输入字段(但不是在 WF 中看到的每一行)?或者,我如何设计自己的上传按钮(据我所知,甚至没有 type:file)?
useraccounts:unstyled 包的事件,我不明白 HTML/CSS 应该放在哪里。
非常感谢任何帮助。
【问题讨论】:
-
构建您的模板,然后手动调用
Accounts.createUser或Accounts.loginWith<service>..(不需要用户帐户:*) -
@webdeb:我考虑过,但 useraccounts 已经做得很好并且处理了很多其他事情。如果我能以某种方式添加 html/css ...
标签: html css twitter-bootstrap meteor user-accounts