Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions app/controllers/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

public class Application extends Controller {

final static Form<Event> eventForm = form(Event.class);
final static Form<Event> eventForm = Form.form(Event.class);

/**
* Checks if events ends the same day which starts
Expand Down Expand Up @@ -95,7 +95,7 @@ public static Result blank() {
* @return Result
*/
public static Result add() {
Form<Event> eventForm = form(Event.class).bindFromRequest();
Form<Event> eventForm = Form.form(Event.class).bindFromRequest();
if (eventForm.hasErrors()) {
return badRequest(formNew.render(eventForm));
}
Expand All @@ -119,7 +119,7 @@ public static Result add() {
*/
public static Result edit(Long id) {
Event event = Event.find.byId(id);
Form<Event> eventForm = form(Event.class).fill(event);
Form<Event> eventForm = Form.form(Event.class).fill(event);
return ok(formEdit.render(id, eventForm, event));
}

Expand All @@ -130,7 +130,7 @@ public static Result edit(Long id) {
* @return Result
*/
public static Result update(Long id) {
Form<Event> eventForm = form(Event.class).bindFromRequest();
Form<Event> eventForm = Form.form(Event.class).bindFromRequest();
if (eventForm.hasErrors()) {
return badRequest(formEdit.render(id, eventForm, Event.find.byId(id)));
}
Expand Down Expand Up @@ -161,7 +161,7 @@ public static Result delete(Long id) {
* @return Result
*/
public static Result addByAjax() {
Form<Event> eventForm = form(Event.class).bindFromRequest();
Form<Event> eventForm = Form.form(Event.class).bindFromRequest();
Event newEvent = eventForm.get();
newEvent.endsSameDay = endsSameDay(newEvent.start, newEvent.end);
newEvent.save();
Expand All @@ -184,14 +184,14 @@ public static Result addByAjax() {
*/
public static Result move() {

Long id = Long.valueOf(form().bindFromRequest().get("id"));
int dayDelta = Integer.parseInt(form().bindFromRequest().get("dayDelta"));
int minuteDelta = Integer.parseInt(form().bindFromRequest().get("minuteDelta"));
Long id = Long.valueOf(Form.form().bindFromRequest().get("id"));
int dayDelta = Integer.parseInt(Form.form().bindFromRequest().get("dayDelta"));
int minuteDelta = Integer.parseInt(Form.form().bindFromRequest().get("minuteDelta"));

Event event = Event.find.byId(id);
event.start = new DateTime(event.start).plusDays(dayDelta).plusMinutes(minuteDelta).toDate();
event.end = new DateTime(event.end).plusDays(dayDelta).plusMinutes(minuteDelta).toDate();
event.allDay = Boolean.valueOf(form().bindFromRequest().get("allDay"));
event.allDay = Boolean.valueOf(Form.form().bindFromRequest().get("allDay"));
event.endsSameDay = endsSameDay(event.start, event.end);
event.update();

Expand All @@ -208,9 +208,9 @@ public static Result move() {
*/
public static Result resize() {

Long id = Long.valueOf(form().bindFromRequest().get("id"));
int dayDelta = Integer.parseInt(form().bindFromRequest().get("dayDelta"));
int minuteDelta = Integer.parseInt(form().bindFromRequest().get("minuteDelta"));
Long id = Long.valueOf(Form.form().bindFromRequest().get("id"));
int dayDelta = Integer.parseInt(Form.form().bindFromRequest().get("dayDelta"));
int minuteDelta = Integer.parseInt(Form.form().bindFromRequest().get("minuteDelta"));

Event event = Event.find.byId(id);
event.end = new DateTime(event.end).plusDays(dayDelta).plusMinutes(minuteDelta).toDate();
Expand Down
52 changes: 26 additions & 26 deletions conf/evolutions/default/1.sql
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
# --- Created by Ebean DDL
# To stop Ebean DDL generation, remove this comment and start using Evolutions

# --- !Ups

create table event (
id bigint not null,
title varchar(255),
all_day boolean,
start timestamp,
end timestamp,
ends_same_day boolean,
constraint pk_event primary key (id))
;

create sequence event_seq;



# --- Created by Ebean DDL
# To stop Ebean DDL generation, remove this comment and start using Evolutions

# --- !Ups

create table event (
id bigint not null,
title varchar(255),
all_day boolean,
start timestamp,
end timestamp,
ends_same_day boolean,
constraint pk_event primary key (id))
;

create sequence event_seq;


# --- !Downs

SET REFERENTIAL_INTEGRITY FALSE;

drop table if exists event;

SET REFERENTIAL_INTEGRITY TRUE;

drop sequence if exists event_seq;
# --- !Downs

SET REFERENTIAL_INTEGRITY FALSE;

drop table if exists event;

SET REFERENTIAL_INTEGRITY TRUE;

drop sequence if exists event_seq;

7 changes: 5 additions & 2 deletions project/Build.scala
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
import sbt._
import Keys._
import PlayProject._
import play.Project._

object ApplicationBuild extends Build {

val appName = "FullCalendar"
val appVersion = "1.1.2-Snapshot"

val appDependencies = Seq(
javaCore,
javaJdbc,
javaEbean,
// Add your project dependencies here,
"mysql" % "mysql-connector-java" % "5.1.18"
)

val main = PlayProject(appName, appVersion, appDependencies, mainLang = JAVA).settings(
val main = play.Project(appName, appVersion, appDependencies).settings(
// Add your own project settings here
)

Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=0.11.3
sbt.version=0.13.0
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/release


// Use the Play sbt plugin for Play projects
addSbtPlugin("play" % "sbt-plugin" % "2.0.2")
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.2.0")