From 7a4f47d612030e213cf9cb149103a13505cb4695 Mon Sep 17 00:00:00 2001 From: yanglu Date: Sat, 4 May 2013 19:06:40 +0800 Subject: [PATCH 1/2] =?UTF-8?q?activity=E5=9F=BA=E6=9C=AC=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E5=AE=9E=E7=8E=B0=EF=BC=8C=E8=BF=98=E5=B7=AE=E6=80=BB?= =?UTF-8?q?=E7=BB=93=E5=92=8C=E8=AF=84=E8=AE=BA=E5=8A=A0=E4=B8=8A=E5=8E=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WebRoot/WEB-INF/views/activity/index.html | 27 +++++---- WebRoot/WEB-INF/views/activity/search.html | 47 --------------- .../views/{ => admin}/activity/add.html | 14 ++--- .../views/{ => admin}/activity/edit.html | 18 +++--- .../WEB-INF/views/admin/activity/index.html | 23 +++++++ .../admin/{ => activity}/photo/index.html | 2 +- .../WEB-INF/views/admin/activity/show.html | 32 ++++++++++ .../controller/ActivityController.java | 25 +------- .../controller/admin/ActivityController.java | 52 ++++++++++++++++ .../controller/admin/PhotoController.java | 15 ++--- src/me/thinkjet/model/ActivitySummary.java | 11 ---- syj.sql | 60 +------------------ 12 files changed, 149 insertions(+), 177 deletions(-) delete mode 100644 WebRoot/WEB-INF/views/activity/search.html rename WebRoot/WEB-INF/views/{ => admin}/activity/add.html (67%) rename WebRoot/WEB-INF/views/{ => admin}/activity/edit.html (64%) create mode 100644 WebRoot/WEB-INF/views/admin/activity/index.html rename WebRoot/WEB-INF/views/admin/{ => activity}/photo/index.html (90%) create mode 100644 WebRoot/WEB-INF/views/admin/activity/show.html create mode 100644 src/me/thinkjet/controller/admin/ActivityController.java delete mode 100644 src/me/thinkjet/model/ActivitySummary.java diff --git a/WebRoot/WEB-INF/views/activity/index.html b/WebRoot/WEB-INF/views/activity/index.html index 10f7f03..824dfb9 100644 --- a/WebRoot/WEB-INF/views/activity/index.html +++ b/WebRoot/WEB-INF/views/activity/index.html @@ -1,6 +1,4 @@ -<#include "/layout/_layout.html" /> -<@head title="首页|四眼井|互联网人的乐园 "> -<@body> +<#include "/layout/_layout.html" /> <@head title="首页|四眼井|互联网人的乐园 "> <@body>
@@ -10,18 +8,21 @@

xxx10

More
- +
    + <#list activitylist.getList() as a> +
  • + ${a.title} +
  • + +
+
+
+ <#include "/layout/_paginate.html" /><@paginate currentPage=activitylist.pageNumber totalPage=activitylist.totalPage actionUrl="/activity?page=" />
- \ No newline at end of file + +<@script> + \ No newline at end of file diff --git a/WebRoot/WEB-INF/views/activity/search.html b/WebRoot/WEB-INF/views/activity/search.html deleted file mode 100644 index 3be5daa..0000000 --- a/WebRoot/WEB-INF/views/activity/search.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - -Insert title here - - - - - - - - - - - - - - - - - - - - - - - - - - - <#list joblist as job> - - - - - - - - - - - - -
创建时间名称|交易号对方金额|明细状态操作备注备注
DataDataDataDataDataDataDataData
${job.createtime}${job.name}${job.title}${job.salary}${job.email}${job.author}${job.company}${job.views}
- - \ No newline at end of file diff --git a/WebRoot/WEB-INF/views/activity/add.html b/WebRoot/WEB-INF/views/admin/activity/add.html similarity index 67% rename from WebRoot/WEB-INF/views/activity/add.html rename to WebRoot/WEB-INF/views/admin/activity/add.html index cf6969a..4ef3231 100644 --- a/WebRoot/WEB-INF/views/activity/add.html +++ b/WebRoot/WEB-INF/views/admin/activity/add.html @@ -1,25 +1,24 @@ -<#include "/layout/_layout.html" /> -<@head title="首页|四眼井|互联网人的乐园 "> +<#include "/layout/admin/_layout.html" /> +<@head title="四眼井-后台管理系统 "> <@body> -
-
+

发布活动

-
+ ${errormsg!}
- +
- +
@@ -27,7 +26,6 @@

发布活动

-
<@script> + + + + +<@body> +
+
+ +
+ + +<@script> + + \ No newline at end of file diff --git a/src/me/thinkjet/controller/UploadController.java b/src/me/thinkjet/controller/UploadController.java index c348745..61127fa 100644 --- a/src/me/thinkjet/controller/UploadController.java +++ b/src/me/thinkjet/controller/UploadController.java @@ -10,8 +10,13 @@ /** * kindeditor 专用 文件&图片上传实现 */ -@ControllerBind(controllerKey = "/upload", viewPath = "") +@ControllerBind(controllerKey = "/upload", viewPath = "/") public class UploadController extends Controller { + + public void index(){ + render("upload.html"); + } + public void file() { File file = this.getFile().getFile(); String url = UploadService.uplaodFileToLocal(file); @@ -27,6 +32,7 @@ public void file() { } public void img() { + System.out.println("ok"); File file = this.getFile().getFile(); String url = UploadService.uplaodImgToLocal(file); if (file.exists()) @@ -37,6 +43,7 @@ public void img() { } else { this.setAttr("error", 1); } + System.out.println(url); this.renderJson(); } diff --git a/src/me/thinkjet/controller/admin/UploadController.java b/src/me/thinkjet/controller/admin/UploadController.java new file mode 100644 index 0000000..eb419c2 --- /dev/null +++ b/src/me/thinkjet/controller/admin/UploadController.java @@ -0,0 +1,31 @@ +package me.thinkjet.controller.admin; + +import java.io.File; + +import me.thinkjet.service.upyun.UploadService; + +import com.jfinal.core.Controller; +import com.jfinal.ext.route.ControllerBind; + +@ControllerBind(controllerKey = "/admin/upload", viewPath = "admin/") +public class UploadController extends Controller { + + public void index() { + render("upload.html"); + } + + public void img() { + File file = this.getFile().getFile(); + String url = UploadService.uplaodImgToLocal(file); + if (file.exists()) + file.delete(); + if (url != null) { + this.setAttr("error", 0); + this.setAttr("url", url); + } else { + this.setAttr("error", 1); + } + this.renderJson(); + } + +}