diff --git a/WBD2/.classpath b/WBD2/.classpath new file mode 100644 index 00000000..357f6fbf --- /dev/null +++ b/WBD2/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/WBD2/.project b/WBD2/.project new file mode 100644 index 00000000..208ef8dd --- /dev/null +++ b/WBD2/.project @@ -0,0 +1,23 @@ + + + WBD2 + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.m2e.core.maven2Nature + org.eclipse.jdt.core.javanature + + diff --git a/WBD2/.settings/org.eclipse.jdt.core.prefs b/WBD2/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..7341ab16 --- /dev/null +++ b/WBD2/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,11 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/WBD2/.settings/org.eclipse.m2e.core.prefs b/WBD2/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 00000000..f897a7f1 --- /dev/null +++ b/WBD2/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/WBD2/bin/AllControl.class b/WBD2/bin/AllControl.class new file mode 100644 index 00000000..cc3d1044 Binary files /dev/null and b/WBD2/bin/AllControl.class differ diff --git a/WBD2/bin/CookieHelper.class b/WBD2/bin/CookieHelper.class new file mode 100644 index 00000000..d73bb0f2 Binary files /dev/null and b/WBD2/bin/CookieHelper.class differ diff --git a/WBD2/bin/comments/Comment.class b/WBD2/bin/comments/Comment.class new file mode 100644 index 00000000..3b36d3b9 Binary files /dev/null and b/WBD2/bin/comments/Comment.class differ diff --git a/WBD2/bin/mysql/Connect.class b/WBD2/bin/mysql/Connect.class new file mode 100644 index 00000000..4c9acbf0 Binary files /dev/null and b/WBD2/bin/mysql/Connect.class differ diff --git a/WBD2/bin/mysql/SQLStatements.class b/WBD2/bin/mysql/SQLStatements.class new file mode 100644 index 00000000..4a75964b Binary files /dev/null and b/WBD2/bin/mysql/SQLStatements.class differ diff --git a/WBD2/bin/posts/Post.class b/WBD2/bin/posts/Post.class new file mode 100644 index 00000000..ec395443 Binary files /dev/null and b/WBD2/bin/posts/Post.class differ diff --git a/WBD2/bin/users/User.class b/WBD2/bin/users/User.class new file mode 100644 index 00000000..61407406 Binary files /dev/null and b/WBD2/bin/users/User.class differ diff --git a/WBD2/pom.xml b/WBD2/pom.xml new file mode 100644 index 00000000..7c7c7246 --- /dev/null +++ b/WBD2/pom.xml @@ -0,0 +1,72 @@ + + 4.0.0 + WBD2 + WBD2 + 0.0.1-SNAPSHOT + war + + + junit + junit + 3.8.1 + test + + + com.sun.faces + jsf-api + 2.1.7 + + + com.sun.faces + jsf-impl + 2.1.7 + + + javax.servlet + javax.servlet-api + 3.0.1 + + + mysql + mysql-connector-java + 5.1.23 + + + javax.servlet + jstl + 1.2 + + + javax.servlet.jsp + javax.servlet.jsp-api + 2.2.1 + provided + + + javax.el + javax.el-api + 2.2.1 + provided + + + javax.servlet.jsp.jstl + jstl-api + 1.2 + provided + + + + WBD2 + + + org.apache.maven.plugins + maven-compiler-plugin + 2.3.1 + + 1.7 + 1.7 + + + + + \ No newline at end of file diff --git a/WBD2/src/main/java/AllControl.java b/WBD2/src/main/java/AllControl.java new file mode 100644 index 00000000..c56fcd1f --- /dev/null +++ b/WBD2/src/main/java/AllControl.java @@ -0,0 +1,290 @@ + + +import java.io.IOException; +import java.io.Serializable; +import java.sql.SQLException; + +import posts.Post; +import users.User; + +import javax.faces.bean.ManagedBean; +import javax.faces.bean.SessionScoped; +import javax.faces.context.FacesContext; +import javax.servlet.http.Cookie; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import comments.Comment; + +import mysql.SQLStatements; + +@ManagedBean(name = "allControl", eager = true) +@SessionScoped + +public class AllControl implements Serializable{ + private static final long serialVersionUID = 1L; + + private Post CurrentPost; + private int PostID; + private User CurrentUser; + private String Date; + private SQLStatements s; + private String message; + private Comment lel; + + public AllControl(){ + CurrentPost = new Post(); + CurrentUser = new User(); + s = new SQLStatements(); + } + + public String showPost(){ + try { + CallThePage(); + if(CurrentUser.getAuth()=="Guest"){ + return "guestpost"; + } + else{ + return "post"; + } + } catch (SQLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + return Home(); + } + + } + + public String Home(){ + PostID= 0; + message = ""; + if(CurrentUser.getAuth().equals("Administrator")){ + return "admin"; + } + else if (CurrentUser.getAuth().equals("Owner")){ + return "ownerhome"; + } + else if (CurrentUser.getAuth().equals("Editor")) { + return "editor"; + } + else { + return "home"; + } + } + public String Login() { + message = ""; + try { + if(s.IsUserExist(CurrentUser.getName()) && s.isPassword(CurrentUser.getName(), CurrentUser.getPass())){ + setCurrentUser(s.SelectUser(CurrentUser.getName(), CurrentUser.getPass())); + setCookie(); + message = ""; + return Home(); + } + else { + if (s.IsUserExist(CurrentUser.getName())){ + message = "Incorect Password"; + } + else{ + message = "User doesn't exist"; + } + return "login"; + } + + } catch (SQLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + return Home(); + } + + } + private void setCookie() { + FacesContext fc = FacesContext.getCurrentInstance(); + + Cookie cookieUser = new Cookie("username", CurrentUser.getName()); + Cookie cookiePassword = new Cookie("password", CurrentUser.getPass()); + + cookieUser.setMaxAge(100000); + cookiePassword.setMaxAge(100000); + + HttpServletResponse servletResponse = (HttpServletResponse) (fc + .getExternalContext().getResponse()); + servletResponse.addCookie(cookieUser); + servletResponse.addCookie(cookiePassword); + } + + public String Logout(){ + CurrentUser = new User(); + deleteCookie(); + return Home(); + } + private void deleteCookie() { + FacesContext fc = FacesContext.getCurrentInstance(); + + Cookie cookieUser = new Cookie("username", null); + Cookie cookiePassword = new Cookie("password", null); + + cookieUser.setMaxAge(0); + cookiePassword.setMaxAge(0); + + HttpServletResponse servletResponse = (HttpServletResponse) (fc + .getExternalContext().getResponse()); + servletResponse.addCookie(cookieUser); + servletResponse.addCookie(cookiePassword); + } + + public void setCurrentUser(User U){ + CurrentUser = new User(); + CurrentUser.setId(U.getId()); + CurrentUser.setName(U.getName()); + CurrentUser.setPass(U.getPass()); + CurrentUser.setEmail(U.getEmail()); + CurrentUser.setAuth(U.getAuth()); + } + + public User getCurrentUser(){ + return CurrentUser; + } + + public void setCurrentPost(Post P){ + CurrentPost.setId(P.getId()); + CurrentPost.setTitle(P.getTitle()); + CurrentPost.setDate(P.getDate()); + CurrentPost.setContent(P.getContent()); + CurrentPost.setStatus(P.getStatus()); + } + + public Post getCurrentPost(){ + return CurrentPost; + } + + public void CallThePage() throws SQLException{ + setCurrentPost(s.GetPost(PostID)); + } + + public String getDate() { + return Date; + } + + public void setDate(String date) { + Date = date; + } + + public int getPostID() { + return PostID; + } + + public void setPostID(int postID) { + PostID = postID; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public void checkCookie() { + FacesContext fc = FacesContext.getCurrentInstance(); + + HttpServletRequest servletRequest = (HttpServletRequest) (fc + .getExternalContext().getRequest()); + Cookie cookies[] = servletRequest.getCookies(); + CurrentPost = new Post(); + CurrentUser = new User(); + lel = new Comment(); + s = new SQLStatements(); + + if (cookies != null) { + for (int i = 0; i < cookies.length; i++) { + String cookieName = cookies[i].getName(); + String cookieValue = cookies[i].getValue(); + + if (cookieName.equals("username")){ + CurrentUser.setName(cookieValue); + } + if (cookieName.equals("password")){ + CurrentUser.setPass(cookieValue); + } + } + try { + setCurrentUser(s.SelectUser(CurrentUser.getName(), CurrentUser.getPass())); + } catch (SQLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + try { + FacesContext.getCurrentInstance().getExternalContext() + .redirect(Home()+".jsf"); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + public Comment getLel() { + return lel; + } + + public void setLel(Comment lel) { + this.lel = lel; + } + + public void addComment(){ + lel.setPostId(Integer.toString(PostID)); + try { + s.AddComment(lel); + } catch (SQLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + lel = new Comment(); + } + public void userComment(){ + lel.setPostId(Integer.toString(PostID)); + lel.setName(CurrentUser.getName()); + lel.setEmail(CurrentUser.getEmail()); + try { + s.AddComment(lel); + } catch (SQLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + lel = new Comment(); + } + + public void addNewPost(){ + CurrentPost.setStatus("Unpublished"); + try { + s.AddPost(CurrentPost); + message="Post has been made"; + } catch (SQLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + CurrentPost = new Post(); + } + + public String editPostInit(){ + try { + CallThePage(); + } catch (SQLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return "editpost"; + } + + public void editPost(){ + try { + s.EditPost(CurrentPost.getId(), CurrentPost); + message="Post has been changed"; + } catch (SQLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } +} diff --git a/WBD2/src/main/java/CookieHelper.java b/WBD2/src/main/java/CookieHelper.java new file mode 100644 index 00000000..022b4879 --- /dev/null +++ b/WBD2/src/main/java/CookieHelper.java @@ -0,0 +1,55 @@ +import javax.faces.context.FacesContext; +import javax.servlet.http.Cookie; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +public class CookieHelper { + public void setCookie(String name, String value,int expiry) { + + FacesContext facesContext = FacesContext.getCurrentInstance(); + + HttpServletRequest request = (HttpServletRequest) facesContext.getExternalContext().getRequest(); + Cookie cookie = null; + + Cookie[] userCookies = request.getCookies(); + if (userCookies != null && userCookies.length > 0 ) { + for (int i = 0; i < userCookies.length; i++) { + if (userCookies[i].getName().equals(name)) { + cookie = userCookies[i]; + break; + } + } + } + + if (cookie != null) { + cookie.setValue(value); + } else { + cookie = new Cookie(name, value); + cookie.setPath(request.getContextPath()); + } + + cookie.setMaxAge(expiry); + + HttpServletResponse response = (HttpServletResponse) facesContext.getExternalContext().getResponse(); + response.addCookie(cookie); + } + + public Cookie getCookie(String name) { + + FacesContext facesContext = FacesContext.getCurrentInstance(); + + HttpServletRequest request = (HttpServletRequest) facesContext.getExternalContext().getRequest(); + Cookie cookie = null; + + Cookie[] userCookies = request.getCookies(); + if (userCookies != null && userCookies.length > 0 ) { + for (int i = 0; i < userCookies.length; i++) { + if (userCookies[i].getName().equals(name)) { + cookie = userCookies[i]; + return cookie; + } + } + } + return null; + } +} diff --git a/WBD2/src/main/java/comments/Comment.java b/WBD2/src/main/java/comments/Comment.java new file mode 100644 index 00000000..313b9caa --- /dev/null +++ b/WBD2/src/main/java/comments/Comment.java @@ -0,0 +1,84 @@ +package comments; + +public class Comment { + private int Id; + private String Name; + private String Email; + private String Date; + private String Content; + private String postId; + + public Comment(){ + setId(0); + setName(null); + setEmail(null); + setDate(null); + setContent(null); + setPostId(null); + } + public Comment(int I, String N, String E, String D, String C, String P){ + setId(I); + setName(N); + setEmail(E); + setDate(D); + setContent(C); + setPostId(P); + } + + public String getName() { + return Name; + } + + public void setName(String name) { + Name = name; + } + + public String getEmail() { + return Email; + } + + public void setEmail(String email) { + Email = email; + } + + public String getDate() { + return Date; + } + + public void setDate(String date) { + Date = date; + } + + public String getContent() { + return Content; + } + + public void setContent(String content) { + Content = content; + } + + public int getId() { + return Id; + } + + public void setId(int id) { + Id = id; + } + + public String getPostId() { + return postId; + } + + public void setPostId(String postId) { + this.postId = postId; + } + + public void setComment(int I, String N, String E, String D, String C, String P){ + setId(I); + setName(N); + setEmail(E); + setDate(D); + setContent(C); + setPostId(P); + } +} diff --git a/WBD2/src/main/java/mysql/Connect.java b/WBD2/src/main/java/mysql/Connect.java new file mode 100644 index 00000000..f1f876d2 --- /dev/null +++ b/WBD2/src/main/java/mysql/Connect.java @@ -0,0 +1,34 @@ +package mysql; + +import com.mysql.jdbc.Connection; +import com.mysql.jdbc.Driver; + +import java.sql.DriverManager; +import java.sql.SQLException; + +import javax.faces.bean.ApplicationScoped; +import javax.faces.bean.ManagedBean; + +@ManagedBean(name = "connect", eager = true) +@ApplicationScoped +public class Connect { + private String dbname = "wbd2"; + + public Connect() throws SQLException{ + makeConnection(); + } + + private Connection c; + + public Connection makeConnection() throws SQLException { + if (c == null) { + new Driver(); + // buat koneksi + c = (Connection) DriverManager.getConnection( + "jdbc:mysql://localhost/"+dbname, + "root", + ""); + } + return c; + } +} diff --git a/WBD2/src/main/java/mysql/SQLStatements.java b/WBD2/src/main/java/mysql/SQLStatements.java new file mode 100644 index 00000000..f5b607bc --- /dev/null +++ b/WBD2/src/main/java/mysql/SQLStatements.java @@ -0,0 +1,277 @@ +package mysql; + +import com.mysql.jdbc.Connection; +import com.mysql.jdbc.Statement; + +import comments.Comment; + +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import javax.faces.bean.ManagedBean; +import javax.faces.bean.RequestScoped; + +import posts.Post; +import users.User; +import mysql.Connect; + + +@ManagedBean(name = "dbStatement", eager = true) +@RequestScoped +public class SQLStatements { + private Statement statement; + + public void SQLStatement() throws SQLException{ + makeStatement(); + } + + public Statement makeStatement() throws SQLException{ + Connect c = new Connect(); + Connection conn = c.makeConnection(); + statement = (Statement) conn.createStatement(); + return statement; + } + public void AddUser(User U) throws SQLException { + Connect c = new Connect(); + Connection conn = c.makeConnection(); + if (conn == null){ + throw new SQLException("Can't get database connection"); + } + statement = (Statement) conn.createStatement(); + statement.execute("insert into user (Name, Password, Email, Authority) " + + "values (\""+U.getName()+"\", \""+U.getPass()+"\", \""+U.getEmail()+"\", \""+U.getAuth()+"\");"); + } + public void DeleteUser(int id) throws SQLException{ + Connect c = new Connect(); + Connection conn = c.makeConnection(); + if (conn == null){ + throw new SQLException("Can't get database connection"); + } + statement = (Statement) conn.createStatement(); + statement.execute("delete from user " + + "where id = \"" +id+ "\";"); + } + public void EditUser(int id, User U) throws SQLException { + Connect c = new Connect(); + Connection conn = c.makeConnection(); + if (conn == null){ + throw new SQLException("Can't get database connection"); + } + statement = (Statement) conn.createStatement(); + statement.execute("update user " + + "set Name = \"" +U.getName() +"\"," + + "Password = \"" +U.getPass() +"\"," + + "Email = \"" +U.getEmail() +"\"," + + "Authority = \""+U.getAuth() +"\" " + +"where id = \""+U.getId()+"\";"); + } + public void AddPost(Post P) throws SQLException { + Connect c = new Connect(); + Connection conn = c.makeConnection(); + if (conn == null){ + throw new SQLException("Can't get database connection"); + } + statement = (Statement) conn.createStatement(); + statement.execute("insert into Posts (Title, Date, Content, Status) " + + "values (\""+P.getTitle()+"\", \""+P.getDate()+"\", \""+P.getContent()+"\", \""+P.getStatus()+"\");"); + } + public void EditPost(int id, Post P) throws SQLException { + Connect c = new Connect(); + Connection conn = c.makeConnection(); + if (conn == null){ + throw new SQLException("Can't get database connection"); + } + statement = (Statement) conn.createStatement(); + statement.execute("update Posts " + + "set Title = \"" +P.getTitle() +"\"," + + "Date = \"" +P.getDate() +"\"," + + "Content = \"" +P.getContent() +"\"," + + "Status = \""+P.getStatus() +"\" " + +"where id = \""+P.getId()+"\";"); + } + public void DeletePost(int id) throws SQLException { + Connect c = new Connect(); + Connection conn = c.makeConnection(); + if (conn == null){ + throw new SQLException("Can't get database connection"); + } + statement = (Statement) conn.createStatement(); + statement.execute("delete from Posts " + + "where id = \"" +id+ "\";"); + } + public void AddComment(Comment C) throws SQLException { + Connect c = new Connect(); + Connection conn = c.makeConnection(); + if (conn == null){ + throw new SQLException("Can't get database connection"); + } + statement = (Statement) conn.createStatement(); + statement.execute("insert into Comments (Name, Email, Date, Content, PostID) " + + "values (\""+C.getName()+"\", \""+C.getEmail()+"\", \""+C.getDate()+"\", \""+C.getContent()+"\", \""+C.getPostId()+"\" );"); + } + public void DeleteComment(int id) throws SQLException { + Connect c = new Connect(); + Connection conn = c.makeConnection(); + if (conn == null){ + throw new SQLException("Can't get database connection"); + } + statement = (Statement) conn.createStatement(); + statement.execute("delete from Comments " + + "where id = \"" +id+ "\";"); + } + + public List GetPosts() throws SQLException { + + List Out = new ArrayList(); + Connect c = new Connect(); + Connection conn = c.makeConnection(); + if (conn == null){ + throw new SQLException("Can't get database connection"); + } + statement = (Statement) conn.createStatement(); + Post ah; + try (ResultSet rs = statement.executeQuery("select * from Posts;")) { + while(rs.next()) { + ah = new Post(rs.getInt("id"),rs.getString("Title"),rs.getString("Date"),rs.getString("Content"),rs.getString("Status")); + Out.add(ah); + } + } + return Out; + } + public List GetComments(String id) throws SQLException{ + List Out = new ArrayList(); + Connect c = new Connect(); + Connection conn = c.makeConnection(); + if (conn == null){ + throw new SQLException("Can't get database connection"); + } + statement = (Statement) conn.createStatement(); + Comment ah = new Comment(); + try (ResultSet rs = statement.executeQuery("select * from Comments where PostID = \""+id+"\";")) { + while(rs.next()) { + ah.setComment(rs.getInt("id"),rs.getString("Name"),rs.getString("Email"),rs.getString("Date"),rs.getString("Content"),Integer.toString(rs.getInt("PostID"))); + Out.add(ah); + } + } + return Out; + } + public List GetUser() throws SQLException { + List Out = new ArrayList(); + Connect c = new Connect(); + Connection conn = c.makeConnection(); + if (conn == null){ + throw new SQLException("Can't get database connection"); + } + statement = (Statement) conn.createStatement(); + User ah; + try (ResultSet rs = statement.executeQuery("select * from User;")) { + while(rs.next()) { + ah = new User(rs.getInt("id"),rs.getString("Name"),rs.getString("Password"),rs.getString("Email"),rs.getString("Authority")); + Out.add(ah); + } + } + return Out; + } + public List PickPublishedPost() throws SQLException{ + List Out = new ArrayList(Arrays.asList(new Post())); + Connect c = new Connect(); + Connection conn = c.makeConnection(); + if (conn == null){ + throw new SQLException("Can't get database connection"); + } + statement = (Statement) conn.createStatement(); + try (ResultSet rs = statement.executeQuery("select * from posts where Status = 'Published';")) { + while(rs != null && rs.next()) { + Post ah = new Post(); + ah.setPost(rs.getInt("id"),rs.getString("Title"),rs.getString("Date"),rs.getString("Content"),rs.getString("Status")); + Out.add(ah); + } + } + return Out; + } + + public Post GetPost(int id) throws SQLException { + Connect c = new Connect(); + Connection conn = c.makeConnection(); + if (conn == null){ + throw new SQLException("Can't get database connection"); + } + statement = (Statement) conn.createStatement(); + Post ah = new Post(); + try (ResultSet rs = statement.executeQuery("select * from Posts where id = \""+id+"\";")) { + while(rs.next()) { + ah.setPost(rs.getInt("id"),rs.getString("Title"),rs.getString("Date"),rs.getString("Content"),rs.getString("Status")); + } + } + return ah; + } + public boolean IsUserExist(String Name) throws SQLException{ + Connect c = new Connect(); + Connection conn = c.makeConnection(); + if (conn == null){ + throw new SQLException("Can't get database connection"); + } + statement = (Statement) conn.createStatement(); + String xname = null; + String query = "SELECT * FROM User WHERE Name=\"" + Name + "\";"; + ResultSet rs = statement.executeQuery(query); + while(rs.next()){ + xname = rs.getString("name"); + } + return xname!=null; + } + + public boolean isPassword(String Name, String Password) throws SQLException{ + Connect c = new Connect(); + Connection conn = c.makeConnection(); + if (conn == null){ + throw new SQLException("Can't get database connection"); + } + statement = (Statement) conn.createStatement(); + String pass = null; + String query = "SELECT Password FROM User WHERE Name=\"" + Name + "\";"; + ResultSet rs = statement.executeQuery(query); + while(rs.next()){ + pass = rs.getString("Password"); + } + return (pass.equals(Password)); + } + + public User SelectUser(String Name, String Password) throws SQLException{ + Connect c = new Connect(); + Connection conn = c.makeConnection(); + if (conn == null){ + throw new SQLException("Can't get database connection"); + } + statement = (Statement) conn.createStatement(); + User ah = new User(); + try (ResultSet rs = statement.executeQuery("select * from User where Name = \""+Name+"\" AND Password = \""+Password+"\";")) { + while(rs.next()) { + ah = new User(rs.getInt("id"),rs.getString("Name"),rs.getString("Password"),rs.getString("Email"),rs.getString("Authority")); + } + } + return ah; + } + + public List PostComments(int ID) throws SQLException{ + Connect c = new Connect(); + Connection conn = c.makeConnection(); + if (conn == null){ + throw new SQLException("Can't get database connection"); + } + statement = (Statement) conn.createStatement(); + List Out = new ArrayList(); + Comment ah; + try (ResultSet rs = statement.executeQuery("select * from Comments where PostID = \""+ID+"\";")) { + while(rs.next()) { + ah = new Comment(rs.getInt("id"),rs.getString("Title"),rs.getString("Date"),rs.getString("Content"),rs.getString("Status"),Integer.toString(rs.getInt("PostID"))); + Out.add(ah); + } + } + return Out; + } + +} diff --git a/WBD2/src/main/java/posts/Post.java b/WBD2/src/main/java/posts/Post.java new file mode 100644 index 00000000..e4803167 --- /dev/null +++ b/WBD2/src/main/java/posts/Post.java @@ -0,0 +1,68 @@ +package posts; + +public class Post { + private int Id; + private String Title; + private String Date; + private String Content; + private String Status; + + public Post(){ + setId(0); + setTitle(""); + setDate(""); + setContent(""); + setStatus(""); + } + public Post(int id, String T, String D, String C, String S){ + this.setId(id); + setTitle(T); + setDate(D); + setContent(C); + setStatus(S); + } + + public String getTitle() { + return Title; + } + + public void setTitle(String title) { + Title = title; + } + + public String getDate() { + return Date; + } + + public void setDate(String date) { + Date = date; + } + + public String getContent() { + return Content; + } + + public void setContent(String content) { + Content = content; + } + public String getStatus() { + return Status; + } + public void setStatus(String status) { + Status = status; + } + public int getId() { + return Id; + } + public void setId(int id) { + Id = id; + } + public void setPost(int id, String T, String D, String C, String S){ + setId(id); + setTitle(T); + setDate(D); + setContent(C); + setStatus(S); + } + +} diff --git a/WBD2/src/main/java/users/User.java b/WBD2/src/main/java/users/User.java new file mode 100644 index 00000000..e504dd67 --- /dev/null +++ b/WBD2/src/main/java/users/User.java @@ -0,0 +1,88 @@ +package users; + +import java.sql.SQLException; + +import javax.faces.bean.ManagedBean; +import javax.faces.bean.RequestScoped; + +import mysql.SQLStatements; + +@ManagedBean(name = "user", eager = true) +@RequestScoped +public class User { + private int Id; + private String Name; + private String Pass; + private String Email; + private String Auth; + + public User(){ + setId(0); + setName(""); + setPass(""); + setEmail(""); + setAuth("Guest"); + } + + public User(int I, String N, String P, String E, String A){ + setId(I); + setName(N); + setPass(P); + setEmail(E); + setAuth(A); + } + + public String getName() { + return Name; + } + + public void setName(String name) { + Name = name; + } + + public String getPass() { + return Pass; + } + + public void setPass(String pass) { + Pass = pass; + } + + public String getEmail() { + return Email; + } + + public void setEmail(String email) { + Email = email; + } + + public String getAuth() { + return Auth; + } + + public void setAuth(String auth) { + Auth = auth; + } + + public int getId() { + return Id; + } + + public void setId(int id) { + Id = id; + } + public void newUser(){ + User L = new User(); + L.setName(Name); + L.setPass(Pass); + L.setEmail(Email); + L.setAuth(Auth); + SQLStatements s = new SQLStatements(); + try { + s.AddUser(L); + } catch (SQLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } +} diff --git a/WBD2/src/main/webapp/UserList.xhtml b/WBD2/src/main/webapp/UserList.xhtml new file mode 100644 index 00000000..97b35b57 --- /dev/null +++ b/WBD2/src/main/webapp/UserList.xhtml @@ -0,0 +1,73 @@ + + + + + Simple Blog + + + +

Simple Blog

+ + + +
+

DataTable Example

+ + + + Name + #{U.name} + + + Pass + #{U.pass} + + + Email + #{U.email} + + + Authority + #{U.auth} + + + Delete? + + + + +

Add User

+
+ + + + + + + + + + + + + + + + + + + + + +
Name :
Password :
Email :
Authority :
+
+
+
+ \ No newline at end of file diff --git a/WBD2/src/main/webapp/WEB-INF/web.xml b/WBD2/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 00000000..e9d6ebc3 --- /dev/null +++ b/WBD2/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,46 @@ + + + + WBD2 + + + + javax.faces.PROJECT_STAGE + Development + + + + + faces/main.xhtml + + + + + Faces Servlet + javax.faces.webapp.FacesServlet + 1 + + + + + Faces Servlet + /faces/* + + + Faces Servlet + *.jsf + + + Faces Servlet + *.faces + + + Faces Servlet + *.xhtml + + + \ No newline at end of file diff --git a/WBD2/src/main/webapp/Who.xhtml b/WBD2/src/main/webapp/Who.xhtml new file mode 100644 index 00000000..e69de29b diff --git a/WBD2/src/main/webapp/WrongPass.xhtml b/WBD2/src/main/webapp/WrongPass.xhtml new file mode 100644 index 00000000..e69de29b diff --git a/WBD2/src/main/webapp/addpost.xhtml b/WBD2/src/main/webapp/addpost.xhtml new file mode 100644 index 00000000..ccc3e949 --- /dev/null +++ b/WBD2/src/main/webapp/addpost.xhtml @@ -0,0 +1,24 @@ + + + + + Simple Blog + + + +

Simple Blog

+ + +

Add Post

+ Title :
+ Date :
+ Content :
+ +

#{allControl.message}

+
+
+ \ No newline at end of file diff --git a/WBD2/src/main/webapp/admin.xhtml b/WBD2/src/main/webapp/admin.xhtml new file mode 100644 index 00000000..c636f1e6 --- /dev/null +++ b/WBD2/src/main/webapp/admin.xhtml @@ -0,0 +1,36 @@ + + + + + Simple Blog + + + +

Simple Blog

+ + + +
+ +

+ +

+

#{P.date}

+

#{P.content}

+

#{P.status}

+ + + + +
+ +
+
+
+ \ No newline at end of file diff --git a/WBD2/src/main/webapp/editor.xhtml b/WBD2/src/main/webapp/editor.xhtml new file mode 100644 index 00000000..666379f7 --- /dev/null +++ b/WBD2/src/main/webapp/editor.xhtml @@ -0,0 +1,34 @@ + + + + + Simple Blog + + + +

Simple Blog

+ +
+ +

+ +

+

#{P.date}

+

#{P.content}

+

#{P.status}

+ + + + +
+ +
+
+
+ \ No newline at end of file diff --git a/WBD2/src/main/webapp/editpost.xhtml b/WBD2/src/main/webapp/editpost.xhtml new file mode 100644 index 00000000..6a6031a8 --- /dev/null +++ b/WBD2/src/main/webapp/editpost.xhtml @@ -0,0 +1,25 @@ + + + + + Simple Blog + + + +

Simple Blog

+ + +

Add Post

+ Title :
+ Date :
+ Content :
+ Status :
+ +

#{allControl.message}

+
+
+ \ No newline at end of file diff --git a/WBD2/src/main/webapp/guestpost.xhtml b/WBD2/src/main/webapp/guestpost.xhtml new file mode 100644 index 00000000..3288b978 --- /dev/null +++ b/WBD2/src/main/webapp/guestpost.xhtml @@ -0,0 +1,37 @@ + + + + + Simple Blog + + + +

Simple Blog

+ +
+

#{allControl.currentPost.title}

+

#{allControl.currentPost.date}

+

#{allControl.currentPost.content}

+
+

Comments

+ +

#{C.name}

+

#{C.email}

+

#{C.date}

+

#{C.content}

+ +
+
+

Add Comment

+ Name :
+ Email :
+ Date :
+ Content :
+ +
+
+ \ No newline at end of file diff --git a/WBD2/src/main/webapp/home.xhtml b/WBD2/src/main/webapp/home.xhtml new file mode 100644 index 00000000..65e6886b --- /dev/null +++ b/WBD2/src/main/webapp/home.xhtml @@ -0,0 +1,27 @@ + + + + + Simple Blog + + + +

Simple Blog

+ +
+ +

+ +

+

#{P.date}

+

#{P.content}

+
+ +
+
+
+ \ No newline at end of file diff --git a/WBD2/src/main/webapp/login.xhtml b/WBD2/src/main/webapp/login.xhtml new file mode 100644 index 00000000..2a928554 --- /dev/null +++ b/WBD2/src/main/webapp/login.xhtml @@ -0,0 +1,20 @@ + + + + + Simple Blog + + + +

Login Page

+ +
+ Enter your username and password

+ Username : + Password : + + #{allControl.message} +
+
+ \ No newline at end of file diff --git a/WBD2/src/main/webapp/main.xhtml b/WBD2/src/main/webapp/main.xhtml new file mode 100644 index 00000000..7f22c098 --- /dev/null +++ b/WBD2/src/main/webapp/main.xhtml @@ -0,0 +1,15 @@ + + + + + + Hoya! + + + + + \ No newline at end of file diff --git a/WBD2/src/main/webapp/ownerhome.xhtml b/WBD2/src/main/webapp/ownerhome.xhtml new file mode 100644 index 00000000..7ec9ec94 --- /dev/null +++ b/WBD2/src/main/webapp/ownerhome.xhtml @@ -0,0 +1,28 @@ + + + + + Simple Blog + + + +

Simple Blog

+ + +
+ +

+ +

+

#{P.date}

+

#{P.content}

+
+ +
+
+
+ \ No newline at end of file diff --git a/WBD2/src/main/webapp/post.xhtml b/WBD2/src/main/webapp/post.xhtml new file mode 100644 index 00000000..26682b13 --- /dev/null +++ b/WBD2/src/main/webapp/post.xhtml @@ -0,0 +1,35 @@ + + + + + Simple Blog + + + +

Simple Blog

+ +
+

#{allControl.currentPost.title}

+

#{allControl.currentPost.date}

+

#{allControl.currentPost.content}

+
+

Comments

+ +

#{C.name}

+

#{C.email}

+

#{C.date}

+

#{C.content}

+ +
+
+

Add Comment

+ Date :
+ Content :
+ +
+
+ \ No newline at end of file diff --git a/assets/css/screen.css b/assets/css/screen.css deleted file mode 100644 index 1d8fdf3b..00000000 --- a/assets/css/screen.css +++ /dev/null @@ -1,861 +0,0 @@ -@import url(http://fonts.googleapis.com/css?family=Open+Sans); -@import url(http://fonts.googleapis.com/css?family=Questrial); - -/* Reset & Basics (Inspired by E. Meyers) -================================================== */ -html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, address, cite, code, em, img, small, strong, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, embed, figure, figcaption, footer, header, hgroup, menu, nav, section, summary, time, audio, video { - margin: 0; - padding: 0; - border: 0; - font-size: 100%; - font: inherit; - vertical-align: baseline; } -article, aside, details, figcaption, figure, footer, header, hgroup, menu, time, nav, section { - display: block; } -html, body, .wrapper { - min-height: 100%; -} - - -/* Body -================================================== */ -html, body { - height: 100%; -} -.wrapper { - min-height: 100%; -} -body { - overflow-x: hidden; - font: 17px/28px ff-meta-serif-web-pro, "Georgia", serif; - color: #333; - background: #fff; -} - - -/* Typography -================================================== */ -h1, h2, h3, h4, h5, h6 { - font-family: "proxima-nova", "helvetica neue", "helvetica", sans-serif; - font-weight: normal; - text-transform: uppercase; - font-weight: 700; - color: #000; - text-rendering: optimizeLegibility; -} - -h1 { - font-size: 50px; - padding-bottom: 30px; -} - -h2 { - font-size: 45px; - padding-bottom: 25px; -} - -h3 { - font-size: 40px; - padding-bottom: 20px; -} - -h4 { - font-size: 35px; - padding-bottom: 15px; -} - -h5 { - font-size: 30px; - padding-bottom: 10px; -} - -p { - margin: 0 0 28px 0; -} - -strong { - font-weight: bold; -} -em { - font-style: italic; -} -sup { - line-height: 0; -} - -small { - font-size: 70%; -} - -cite { - font-size: 80%; - font-style: italic; - } - -/* Teaser -================================================== */ - -header#teaser h1 { - text-transform: none !important; - color: #333; - font-size: 28px !important; - font-weight: 300 !important; -} - - -/* Links -================================================== */ -a { - color: #F40034; - text-decoration: none; - -webkit-transition: color .2s ease-in-out; - -moz-transition: color .2s ease-in-out; - transition: color .2s ease-in-out; -} -a:hover { - color: #F40034; -} - -/* Layout -================================================== */ -/* White container that is the "page" */ -.wrapper { - max-width: 1500px; - margin: 0 auto; - background: #fff; -} - -/* Containers to keep content to a set width */ -.nav, -.art-header-inner, -.footer, -.art-list, -.abt, -.fourohfour { - width: 980px; -} -.nav, -.art-body-inner, -.footer, -.art-list, -.abt, -.fourohfour { - position: relative; - margin: 0 auto; -} - -/* Nav -================================================== */ -.nav { - position: absolute; - top: 0; - left: 50%; - height: 70px; - padding-top: 40px; - margin-left: -490px; /* Half width of nav */ - border-bottom: 1px solid #333; - z-index: 2; -} -.nav.fixed { - position: fixed; -} -#logo { - float: left; -} -.nav-primary { - float: right; -} -.nav-primary li { - display: inline-block; - margin-left: 10px; - font-weight: 500; -} -#logo h1, -.nav-primary li, -.nav-primary li a { - font-family: "proxima-nova", "helvetica neue", "helvetica", sans-serif; - font-weight: 700; - font-size: 13px; - line-height: 30px; - color: #000; - text-transform: uppercase; -} - -#logo h1 { - height: 30px; - margin-left: 0px; - letter-spacing: 1px; - font-family: 'Questrial', sans-serif; - font-size: 30px; -} - -#logo h1 span{ - color: #F40034 !important; -} - -.nav li:first-child { - margin-left: 0; /* Remove left margin from the first nav li */ -} - -/* Home Page -================================================== */ - -div#home {} - -#home > div.cover { - max-width: 980px; - margin: 0px auto; - /*padding-top: 110px;*/ -} - -div.cover { - -} - -div.cover > img { - width: 100%; - height: 100%; -} - - -/* Article -================================================== */ -.art { - margin-top: -131px; -} -/* Header */ -.art-header { - height: 900px; - /* Background image is defined in the post */ - background-position: top center; - background-attachment: fixed; - overflow: hidden; -} -/* Contains the time, title and subtitle for an article */ -.art-header-inner { - position: fixed; - top: 300px; - left: 50%; - margin-left: -490px; -} -.art-time, -.art-title, -.art-subtitle { - text-align: center; - text-transform: uppercase; -} -.art-time { - font-size: 14px; - line-height: 1.8; - letter-spacing: 4px; -} -.art-title { - font-size: 100px; - line-height: .9; - letter-spacing: -2px; - width: 100%; -} -.art-subtitle { - margin-top: 4px; - font-size: 14px; - line-height: 1.3; - letter-spacing: 4px; -} - -/* If small header, make few adjustments */ -.small .art-title { - font-size: 70px; - line-height: 65px; -} -.small.art-header-inner { - top: 320px; -} - -/* Body */ -.art-body { - position: relative; - width: 100%; - background: #fff; - z-index: 100; - -webkit-box-shadow: 0 -3px 3px rgba(0,0,0,.2); - -moz-box-shadow: 0 -3px 3px rgba(0,0,0,.2); - box-shadow: 0 -3px 3px rgba(0,0,0,.2); -} -.art-body-inner { - font-family: Georgia,Cambria,"Times New Roman",Times,serif; - max-width: 640px; - padding: 80px 0 50px; - letter-spacing: 0.01rem; - font-weight: 400; - font-style: normal; - font-size: 21px; - line-height: 1.5; -} -.art-body-inner a:hover { - border-bottom: 1px solid #F40034; - padding-bottom:2px; -} -.art-body-inner ul, -.art-body-inner ol { /* For lists in the article body */ - margin-bottom: 26px; -} -.art-body-inner ul li { - list-style: disc; -} - -.art-body-inner mark { - background-color: #fdffb6; - padding: 2px; - -webkit-box-shadow: #fdffb6 0 0 5px; - -moz-box-shadow: #fdffb6 0 0 5px; - box-shadow: #fdffb6 0 0 5px; -} - -.art-body-inner blockquote { - font-size: 16px; - background: #f9f9f9; - border-left: 10px solid #ccc; - margin: 1.5em 10px; - padding: 0.5em 10px; - quotes: "\201C""\201D""\2018""\2019"; -} - -.art-body-inner blockquote p:first-child:before { - color: #ccc; - content: "“"; - font-size: 4em; - line-height: 0.1em; - margin-right: 0.25em; - vertical-align: -0.4em; -} - -.art-body-inner blockquote p { - margin-bottom: 1.5em; -} - -.art-body-inner blockquote p:last-child { - margin-bottom: 0; -} - - -.dropcap { /* First character on articles */ - float: left; - margin: 47px 10px 20px 0; - font-size: 100px; - line-height: 0; -} -.art-subhead { /* Subheads are used to break up sections of an article */ - margin: 60px 0 15px; - font-size: 20px; - line-height: 28px; - letter-spacing: 3px; -} -.callout { /* Callouts are like large pullquotes */ - font-weight: bold; -} -.art-body-inner img { - max-width: 100%; - max-height: 600px; - margin-bottom: 26px; -} -.art-body-inner img.center { - display: block; - margin-left: auto; - margin-right: auto; -} -.art-body-inner .art-reference { - font-size: 80%; - color: #999; - margin-top: 50px; -} - -/* For simple, white background posts */ -.simple .art-body { - background: none; - -webkit-box-shadow: none; - -moz-box-shadow: none; - box-shadow: none; -} - - -/* List of Articles -================================================== */ -.art-list { - padding: 120px 0 0; -} -.art-list-body { - position: relative; - overflow: hidden; -} -.art-list-item { - padding: 40px 0; - list-style: none; - overflow: hidden; - border-bottom: 1px solid #ccc; -} -.art-list-item:last-child { - border-bottom: none; -} -.art-list-title { - font-size: 26px; - line-height: 26px; - font-weight: 700; -} -.art-list-item-title-and-time { - float: left; - width: 30%; - margin-bottom: 10px; -} -.art-list-time { - font-size: 12px; - line-height: 20px; - letter-spacing: 2px; - text-transform: uppercase; - color: #999; -} -.art-list-title a { - color: #000; -} -.art-list-title a:hover { - color: #F40034; -} -.art-list-item p { - width: 65%; - float: left; - margin-left: 5%; - margin-bottom: 0; - font-size: 16px; - line-height: 24px; -} - - -/* Footer -================================================== */ -.footer { - padding: 30px 0 40px; - overflow: hidden; - border-top: 1px solid #ccc; -} -.footer, -.footer a { - font-family: "proxima-nova", "helvetica neue", "helvetica", sans-serif; - font-size: 13px; - text-transform: uppercase; - color: #777; -} -.footer a:hover { - color: #000; -} -.back-to-top, -.footer-nav, -.offsite-links { - width: 45%; - float: left; -} -.psi { - width:10%; - float:left; - text-align: center; -} -.footer-nav { - text-align: center; -} -.offsite-links { - text-align: right; -} -.footer .twitter-link:hover { - color: #0084B4; -} -.footer .instagram-link:hover { - color: #3F729B; -} -.footer .github-link:hover { - color: #c5376d; -} -.footer .caffein8-link:hover{ - color: black; -} -.footer .rss-link:hover { - color: #e85d24; -} -/* Remove prev & next links on loop */ -.art-list + .footer .footer-nav, -.abt + .footer .footer-nav { - text-indent: -9999px; - text-align: left; -} - - -/* White Reverse Theme -================================================== */ -/* Nav */ -.nav.white { - border-bottom-color: #fff; - border-bottom-color: rgba(255,255,255,.3); -} -.nav.white li a, -.nav.white li, -.nav.white #logo h1 { - color: #fff; - text-shadow: 0 0 8px rgba(0,0,0,.5); -} -.nav.white #logo h1 { - background-position: top center; -} - -nav.pagination{ - text-align: right; - padding-bottom: 25px; -} -/* Art header */ -.art-header.white { - background-color: #111; -} -.art-header.white .art-time, -.art-header.white .art-title, -.art-header.white .art-subtitle { - color: #fff; - text-shadow: 0 0 8px rgba(0,0,0,.5); -} - - -/* About page -================================================== */ -.abt { - padding: 200px 0 100px; - list-style: none; -} -.abt .abt-header { - font-size: 140px; - line-height: 1; - text-transform: none; -} -.abt .abt-subheader { - font-size: 24px; - font-style: italic; - text-transform: none; - color: #777; -} -.abt-body { - -moz-column-count: 2; - -moz-column-gap: 20px; - -webkit-column-count: 2; - -webkit-column-gap: 20px; - margin-bottom: 28px; -} -.abt-signoff { - line-height: 1.3; - font-style: italic; - color: #777; -} - -/* 404 page -================================================== */ -.fourohfour { - padding: 240px 0 100px; - text-align: center; -} - -/* Code -================================================== */ - -code, tt { -background: #ededee; -color: #3C4043; -font-size: 90%; -padding: 1px 3px; -} - -pre { - width: 92%; - overflow: auto; - margin: 2rem 0; - padding: 1rem 0.8rem 1rem 1.2rem; - color: #3f3b36; - border: 1px solid #ccc; - border-left: 1rem solid #ccc; - font: lighter 1.2rem/2rem monospace; - background: url(/assets/img/pre.png) repeat 0 -0.9rem; - background-size: 1px 4rem; -} - -pre code, tt { -font-size: inherit; -white-space: -moz-pre-wrap; -white-space: pre-wrap; -background: transparent; -border: none; -padding: 0; -} - - -.gist { - font-size: 14px; -} - - -/* Responsive -================================================== */ -@media only screen and (max-width: 1080px) { - /* Set all of the 980 containers to flexible width */ - .nav, - .art-body-inner, - .art-header-inner, - .footer, - .art-list, - .abt, - .fourohfour { - width: 90%; - } - .nav, - .art-header-inner { - margin-left: -45%; - } -} - -@media only screen and (max-width: 1024px) { - /* Everything becomes scrolling and non-fading */ - .nav, - .nav.fixed { - position: relative; - opacity: 1 !important; /* Important to override JS values */ - display: inline-block; - } - .art-header-inner { - position: relative; - top: 0 !important; /* Important to override JS values */ - margin-top: 240px !important; /* Important to override JS values */ - opacity: 1 !important; /* Important to override JS values */ - } - /* Articles no longer have fixed heights */ - .art-header { - height: auto; - padding-bottom: 100px; - background-size: cover !important; - background-attachment: scroll; - } - /* Remove bottom space out if articles doesn't have a background */ - .simple .art-header { - padding-bottom: 0; - } - .art-list { - padding-top: 0; - } - .abt { - padding: 40px 0; - } - .fourohfour { - padding: 80px 0 60px; - } -} - -@media only screen and (max-width: 780px) { - .art-body-inner ul, - .art-body-inner ol { - margin-left: 20px; - } - .art-title { - letter-spacing: 0; - } - .art-subtitle, - .art-time { - font-size: 12px; - } - .nav { - padding-top: 25px; - height: 55px; - } - .art-list-item-title-and-time, - .art-list-item p { - float: none; - width: auto; - margin-left: 0; - } - .abt-body { - -moz-column-count: 1; - -webkit-column-count: 1; - } -} - -@media only screen and (max-width: 500px) { - .nav-primary li { - margin-left: 10px; - } - .nav #logo h1 { - font-size: 16px; - letter-spacing: -1px; - } - .nav li a { - font-size: 12px; - } - .art-header { - padding-bottom: 50px; - } - .art-header-inner { - margin-top: 190px !important; - } - .art-body-inner { - padding-top: 30px; - } - body { - font-size: 15px; - line-height: 24px; - } - p { - margin-bottom: 24px; - } - .footer { - padding: 10px 0 20px; - } - .back-to-top, - .footer-nav { - width: 50%; - } - .back-to-top { - text-align: left; - } - .footer-nav { - text-align: right; - } - .offsite-links { - float: left; - width: 100%; - text-align: left; - } - .offsite-links a { - font-size: 12px; - } - .art-list + .footer .footer-nav { - display: none; - } - .abt .abt-header { - font-size: 80px; - } - .abt .abt-subheader { - font-size: 18px; - } -} - - -/* Misc -================================================== */ -::selection { - background: #000; - color: #fff; -} -::-moz-selection { - background: #000; - color: #fff; -} -img.left { - float: left; - margin-right: 20px; -} -img.right { - float: right; - margin-left: 20px; -} -/* Clearfixing pile */ -.nav:before, -.art-body-inner:before, -.footer:before, -.art-list:before { - content:""; - display:table; -} -.nav:after, -.art-body-inner:after, -.footer:after, -.art-list:after { - clear:both; -} -.nav, -.art-body-inner, -.footer, -.art-list { - zoom:1; /* For IE 6/7 (trigger hasLayout) */ -} - - -@-webkit-keyframes le-fade { - 0% { - opacity: 0; - } - 100% { - opacity: 1; - } -} -@-moz-keyframes le-fade { - 0% { - opacity: 0; - } - 100% { - opacity: 1; - } -} - -.art-header-inner { - -webkit-animation: le-fade .5s 0 1 ease-out; - -moz-animation: le-fade .5s 0 1 ease-out; -} - -.art-list, -.nav, -.abt, -.art-body { - -webkit-animation: le-fade .5s 0s 1 ease-out; - -moz-animation: le-fade .5s 0s 1 ease-out; -} - -hr.featured-article { - padding: 0; - border: none; - border-top: medium double #bbb; - color: #bbb; - text-align: center; -} -hr.featured-article:after { - content: "✭ Featured Article ✭"; - display: inline-block; - position: relative; - top: -0.8em; - font-size: 1.2em; - padding: 0 0.6em; - background: white; -} - -/* FORM */ - -#contact-area { - width: 600px; - margin-top: 25px; -} - -#contact-area input, #contact-area textarea { - padding: 5px; - width: 471px; - font-family: Helvetica, sans-serif; - margin: 0px 0px 10px 0px; - border: 2px solid #ccc; -} - -#contact-area textarea { - height: 90px; -} - -#contact-area textarea:focus, #contact-area input:focus { - border: 2px solid #900; -} - -#contact-area input.submit-button { - width: 100px; - -} - -label { - float: left; - text-align: right; - margin-right: 15px; - width: 100px; - padding-top: 5px; -} \ No newline at end of file diff --git a/assets/img/favicon.ico b/assets/img/favicon.ico deleted file mode 100644 index 40b40ed3..00000000 Binary files a/assets/img/favicon.ico and /dev/null differ diff --git a/assets/img/pre.png b/assets/img/pre.png deleted file mode 100644 index 7f48517b..00000000 Binary files a/assets/img/pre.png and /dev/null differ diff --git a/index.html b/index.html deleted file mode 100644 index 07cff0ba..00000000 --- a/index.html +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Simple Blog - - - - - -
- - - -
-
- -
-
- - - -
- - - - - - - - \ No newline at end of file diff --git a/new_post.html b/new_post.html deleted file mode 100644 index fc4e18ee..00000000 --- a/new_post.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Simple Blog | Tambah Post - - - - - -
- - - -
- - -

-

- -
-
-

Tambah Post

- -
-
- - - - - - -
- - - -
-
-
-
- -
- - - -
- - - - - - - - \ No newline at end of file diff --git a/post.html b/post.html deleted file mode 100644 index c0b6f9e6..00000000 --- a/post.html +++ /dev/null @@ -1,140 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Simple Blog | Apa itu Simple Blog? - - - - - -
- - - -
- -
-
- -

Apa itu Simple Blog?

-

-
-
- -
-
-
-

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Blanditiis aliquam minus consequuntur amet nulla eius, neque beatae, nostrum possimus, officiis eaque consectetur. Sequi sunt maiores dolore, illum quidem eos explicabo! Lorem ipsum dolor sit amet, consectetur adipisicing elit. Magnam consequuntur consequatur molestiae saepe sed, incidunt sunt inventore minima voluptatum adipisci hic, est ipsa iste. Nobis, aperiam provident quae. Reprehenderit, iste.

-

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Asperiores animi tenetur nam delectus eveniet iste non culpa laborum provident minima numquam excepturi rem commodi, officia accusamus eos voluptates obcaecati. Possimus?

- -
- -

Komentar

- -
-
- - - - - - -
- - - -
-
- -
    -
  • -
    -

    Jems

    -
    2 menit lalu
    -
    -

    Lorem ipsum dolor sit amet, consectetur adipisicing elit. Perferendis repudiandae quae natus quos alias eos repellendus a obcaecati cupiditate similique quibusdam, atque omnis illum, minus ex dolorem facilis tempora deserunt! …

    -
  • - -
  • -
    -

    Kave

    -
    1 jam lalu
    -
    -

    Lorem ipsum dolor sit amet, consectetur adipisicing elit. Perferendis repudiandae quae natus quos alias eos repellendus a obcaecati cupiditate similique quibusdam, atque omnis illum, minus ex dolorem facilis tempora deserunt! …

    -
  • -
-
-
- -
- - - -
- - - - - - - - \ No newline at end of file