mirror of
https://github.com/theonedev/onedev.git
synced 2025-12-08 18:26:30 +00:00
Merge with robin's change
This commit is contained in:
parent
4b10ee989f
commit
fb96450dc7
@ -42,6 +42,7 @@ import com.pmease.gitop.web.page.account.setting.repos.AccountReposPage;
|
||||
import com.pmease.gitop.web.page.home.HomePage;
|
||||
import com.pmease.gitop.web.page.init.ServerInitPage;
|
||||
import com.pmease.gitop.web.page.project.ProjectHomePage;
|
||||
import com.pmease.gitop.web.page.test.TestPage;
|
||||
import com.pmease.gitop.web.shiro.LoginPage;
|
||||
import com.pmease.gitop.web.shiro.LogoutPage;
|
||||
import com.pmease.gitop.web.shiro.ShiroWicketPlugin;
|
||||
@ -187,9 +188,6 @@ public class GitopWebApp extends AbstractWicketConfig {
|
||||
private void mountResources() {
|
||||
getSharedResources().add(AvatarImageResourceReference.AVATAR_RESOURCE, new AvatarImageResource());
|
||||
mountResource("avatars/${type}/${id}", new AvatarImageResourceReference());
|
||||
|
||||
// mountResource("fileManager", new FileManagerResourceReference(SitePaths.get().uploadsDir().getAbsolutePath()));
|
||||
// mountResource("fileUpload", new FileUploadResourceReference(SitePaths.get().uploadsDir().getAbsolutePath()));
|
||||
}
|
||||
|
||||
public boolean isGravatarEnabled() {
|
||||
|
||||
@ -1,48 +0,0 @@
|
||||
package com.pmease.gitop.web;
|
||||
|
||||
import org.apache.wicket.Component;
|
||||
import org.apache.wicket.markup.html.form.Form;
|
||||
|
||||
import com.pmease.commons.editable.EditContext;
|
||||
import com.pmease.commons.editable.EditableUtils;
|
||||
import com.pmease.gitop.core.Gitop;
|
||||
import com.pmease.gitop.core.manager.ProjectManager;
|
||||
import com.pmease.gitop.core.manager.UserManager;
|
||||
import com.pmease.gitop.core.model.Project;
|
||||
import com.pmease.gitop.web.page.BasePage;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class TestPage extends BasePage {
|
||||
|
||||
@Override
|
||||
protected void onInitialize() {
|
||||
super.onInitialize();
|
||||
|
||||
final EditContext editContext = EditableUtils.getContext(new Project());
|
||||
|
||||
Form<?> form = new Form<Void>("form") {
|
||||
|
||||
@Override
|
||||
protected void onSubmit() {
|
||||
super.onSubmit();
|
||||
editContext.validate();
|
||||
if (!editContext.hasValidationError(true)) {
|
||||
Project project = (Project) editContext.getBean();
|
||||
project.setOwner(Gitop.getInstance(UserManager.class).getRootUser());
|
||||
Gitop.getInstance(ProjectManager.class).save(project);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
form.add((Component)editContext.renderForEdit("editor"));
|
||||
|
||||
add(form);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getPageTitle() {
|
||||
return "Test page used by Robin";
|
||||
}
|
||||
|
||||
}
|
||||
@ -29,9 +29,6 @@
|
||||
});
|
||||
</script>
|
||||
|
||||
<a wicket:id="vex" class="btn btn-danger">Confirmation</a>
|
||||
</div>
|
||||
<a wicket:id="accountLink">account</a>
|
||||
<a wicket:id="projectLink">project</a>
|
||||
</wicket:extend>
|
||||
</html>
|
||||
|
||||
@ -1,14 +1,6 @@
|
||||
package com.pmease.gitop.web.page.home;
|
||||
|
||||
import org.apache.wicket.markup.html.link.BookmarkablePageLink;
|
||||
|
||||
import com.pmease.gitop.core.Gitop;
|
||||
import com.pmease.gitop.core.manager.ProjectManager;
|
||||
import com.pmease.gitop.core.manager.UserManager;
|
||||
import com.pmease.gitop.web.common.component.fileupload.FileUploadBar;
|
||||
import com.pmease.gitop.web.page.AbstractLayoutPage;
|
||||
import com.pmease.gitop.web.page.account.AccountHomePage;
|
||||
import com.pmease.gitop.web.page.project.ProjectHomePage;
|
||||
|
||||
public class HomePage extends AbstractLayoutPage {
|
||||
|
||||
@ -23,9 +15,7 @@ public class HomePage extends AbstractLayoutPage {
|
||||
protected void onInitialize() {
|
||||
super.onInitialize();
|
||||
|
||||
add(new FileUploadBar("upload"));
|
||||
|
||||
add(new BookmarkablePageLink<>("accountLink", AccountHomePage.class, AccountHomePage.paramsOf(Gitop.getInstance(UserManager.class).getRootUser())));
|
||||
add(new BookmarkablePageLink<>("projectLink", ProjectHomePage.class, ProjectHomePage.paramsOf(Gitop.getInstance(ProjectManager.class).load(1L))));
|
||||
// add(new BookmarkablePageLink<>("accountLink", AccountHomePage.class, AccountHomePage.paramsOf(Gitop.getInstance(UserManager.class).getRootUser())));
|
||||
// add(new BookmarkablePageLink<>("projectLink", ProjectHomePage.class, ProjectHomePage.paramsOf(Gitop.getInstance(ProjectManager.class).load(1L))));
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user