forked from Archives/Athou_commafeed
more styling
This commit is contained in:
@@ -6,12 +6,18 @@
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="text-center">
|
||||
<h1>CommaFeed</h1>
|
||||
Bloat-free feed reader.
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="span6">
|
||||
<h3>Login</h3>
|
||||
<span wicket:id="login"></span>
|
||||
</div>
|
||||
<div class="span6">
|
||||
<div class="span6" wicket:enclosure="register">
|
||||
<h3>Register</h3>
|
||||
<span wicket:id="register"></span>
|
||||
</div>
|
||||
|
||||
@@ -1,13 +1,26 @@
|
||||
package com.commafeed.frontend.pages;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import com.commafeed.backend.dao.ApplicationSettingsService;
|
||||
import com.commafeed.frontend.pages.components.LoginPanel;
|
||||
import com.commafeed.frontend.pages.components.RegisterPanel;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class WelcomePage extends BasePage {
|
||||
|
||||
@Inject
|
||||
ApplicationSettingsService applicationSettingsService;
|
||||
|
||||
public WelcomePage() {
|
||||
add(new LoginPanel("login"));
|
||||
add(new RegisterPanel("register"));
|
||||
add(new RegisterPanel("register") {
|
||||
@Override
|
||||
protected void onConfigure() {
|
||||
super.onConfigure();
|
||||
setVisibilityAllowed(applicationSettingsService.get()
|
||||
.isAllowRegistrations());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,10 @@
|
||||
</div>
|
||||
</div>
|
||||
<p class="help-block" wicket:id="rememberMeRow">
|
||||
<input wicket:id="rememberMe" type="checkbox" /> Remember me
|
||||
<label class="checkbox">
|
||||
<input wicket:id="rememberMe" type="checkbox" />
|
||||
Remember me
|
||||
</label>
|
||||
</p>
|
||||
<div>
|
||||
<input type="submit" class="btn btn-primary" value="Log in" />
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">Email address</label>
|
||||
<label class="control-label">Email address (optional)</label>
|
||||
<div class="controls">
|
||||
<input type="email" wicket:id="email"></input>
|
||||
</div>
|
||||
|
||||
@@ -19,6 +19,7 @@ import org.apache.wicket.validation.IValidator;
|
||||
import org.apache.wicket.validation.ValidationError;
|
||||
import org.apache.wicket.validation.validator.StringValidator;
|
||||
|
||||
import com.commafeed.backend.dao.ApplicationSettingsService;
|
||||
import com.commafeed.backend.dao.UserService;
|
||||
import com.commafeed.backend.model.User;
|
||||
import com.commafeed.backend.model.UserRole.Role;
|
||||
@@ -31,6 +32,9 @@ public class RegisterPanel extends Panel {
|
||||
@Inject
|
||||
UserService userService;
|
||||
|
||||
@Inject
|
||||
ApplicationSettingsService applicationSettingsService;
|
||||
|
||||
public RegisterPanel(String markupId) {
|
||||
super(markupId);
|
||||
|
||||
@@ -40,12 +44,14 @@ public class RegisterPanel extends Panel {
|
||||
"form", model) {
|
||||
@Override
|
||||
protected void onSubmit() {
|
||||
RegistrationRequest req = getModelObject();
|
||||
userService.register(req.getName(), req.getPassword(),
|
||||
Arrays.asList(Role.USER));
|
||||
IAuthenticationStrategy strategy = getApplication()
|
||||
.getSecuritySettings().getAuthenticationStrategy();
|
||||
strategy.save(req.getName(), req.getPassword());
|
||||
if (applicationSettingsService.get().isAllowRegistrations()) {
|
||||
RegistrationRequest req = getModelObject();
|
||||
userService.register(req.getName(), req.getPassword(),
|
||||
Arrays.asList(Role.USER));
|
||||
IAuthenticationStrategy strategy = getApplication()
|
||||
.getSecuritySettings().getAuthenticationStrategy();
|
||||
strategy.save(req.getName(), req.getPassword());
|
||||
}
|
||||
setResponsePage(getApplication().getHomePage());
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user