Skip to content

Commit

Permalink
Merge branch 'dev' into oper/uihyeon
Browse files Browse the repository at this point in the history
# Conflicts:
#	board/templates/test.html
  • Loading branch information
UiHyeon committed Aug 9, 2019
2 parents 9ba5475 + 5dbcc89 commit 263a878
Show file tree
Hide file tree
Showing 39 changed files with 647 additions and 116 deletions.
11 changes: 0 additions & 11 deletions accounts/templates/accounts/home.html

This file was deleted.

2 changes: 2 additions & 0 deletions accounts/templates/accounts/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

{% block content %}
<div class="container-fluid row" style="width:100%; margin:0; padding:0;">

<div class="containerleft">
</div>
<div class="containerbody">
Expand Down Expand Up @@ -31,5 +32,6 @@ <h1>Sign in</h1>
</div>
</div>
<div class="containerright"></div>

</div>
{% endblock %}
129 changes: 99 additions & 30 deletions accounts/templates/accounts/signup.html
Original file line number Diff line number Diff line change
@@ -1,43 +1,112 @@


{% extends 'base.html' %}

{% block content %}
<div class="container-fluid row" style="width:100%; margin:0; padding:0;">
<div class="containerleft">
</div>
<div class="containerbody">
<div class="container" style="margin:0,25px,25px,25px; width:100%;">
<section id="recently">
<div class="col">

<section class="login-block">
<div class="bodycontainer">
<div class="row">
<div style="border-radius: 5px; border:1px dashed rgb(91,155,213); width:100%; ">
{% if error %}
{{ error }}
<br>
<br>
{% endif %}
<div class="col login-sec">
<h2 class="text-center">Sign Up</h2>

<div class="container">
<section id="recently">
<div class="col">
<div class="row">
<div style="border-radius: 5px; border:2px dashed rgb(255, 118, 99); width:100%; ">
{% if error %}
{{ error }}
<br>
<br>
{% endif %}
<form method="POST" action="{% url 'signup'%}">
{% csrf_token %}
<div class="row" style="height:50px;"></div>
<div class="form-group row">
<label class="col-sm-4 col-form-label textfont" >아이디(ID): </label>
<div class="col-5">
<input class="form-control" placeholder="username" name="username" type="username" value="">
</div>
</div>
<br>
<div class="form-group row">
<label class="col-sm-4 col-form-label textfont" >비밀번호(Password): </label>
<div class="col-sm-5">
<input class="form-control" placeholder="패스워드를 입력하세요" name="password1" type="password" value="">
</div>
</div>
<br>
<div class="form-group row">
<label class="col-sm-4 col-form-label textfont" >비밀번호 확인(Confirm PW): </label>
<div class="col-sm-5">
<input class="form-control" placeholder="패스워드를 확인합니다" name="password2" type="password" value="">
</div>
</div>
<br>
<div class="form-group row">
<label class="col-sm-4 col-form-label textfont" >성별(Gender): </label>
<div class="col-sm-5">
<INPUT TYPE=RADIO NAME="gender" VALUE="M"> 남성(Man) <span> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
<INPUT TYPE=RADIO NAME="gender" VALUE="W"> 여성(Woman)<br>
</div>
</div>
<br>
<div class="form-group row">
<label class="col-sm-4 col-form-label textfont" >성(Last Name): </label>
<div class="col-sm-5">
<input class="form-control"placeholder="성을 입력하세요" name="lastName" type="text" value="">
</div>
</div>
<br>
<div class="form-group row">
<label class="col-sm-4 col-form-label textfont" >이름(First Name): </label>
<div class="col-sm-5">
<input class="form-control" placeholder="이름을 입력하세요"name="firstName" type="text" value="">
</div>
</div>
<br>
<div class="form-group row">
<label class="col-sm-4 col-form-label textfont" >생년월일(birthdate): </label>
<div class="col-sm-5">
<input class="form-control" name="birthdate" type="date" value="">
</div>
</div>
<br>
<div class="form-group row">
<label class="col-sm-4 col-form-label textfont" >닉네임(Nickname): </label>
<div class="col-sm-5">
<input class="form-control" placeholder="닉네임을 입력하세요" name="nickName" type="text" value="">
</div>
</div>
<br>
<div class="form-group row">
<label class="col-sm-4 col-form-label textfont" >관리자아이디여부: </label>
<div class="col-sm-5">
<input name="is_superuser" type="checkbox" value="is_superuser">
</div>
</div>
<br>
<div class="text-center" style="margin:30px 0 50px 0;">
<input class="btn btn-primary" style="width:200px; height:40px; background:#DE6262; border:1.5px solid #DE6262; font-family: 'Gugi', cursive; font-size:20px;" type="submit" value="Sign Up!">
</div>
</form>
</div>
</div>
</div>
</section>
</div>
</div>
</div>

<h1>Sign Up!</h1>

</section>

<form method="POST" action="{% url 'signup'%}">
{% csrf_token %}
<br>아이디(ID): <input name="username" type="text" value=""><br>
<br>비밀번호(Password): <input name="password1" type="password" value=""><br>
<br>비밀번호 확인(Confirm Password): <input name="password2" type="password" value=""><br>
<br>성별(Gender): <INPUT TYPE=RADIO NAME="gender" VALUE="M"> 남성(Man)
<INPUT TYPE=RADIO NAME="gender" VALUE="W"> 여성(Woman)<br>
<br>성(Last Name):<input name="lastName" type="text" value=""><br>
<br>이름(First Name): <input name="firstName" type="text" value=""><br>
<br>생년월일(birthdate): <input name="birthdate" type="date" value=""><br>
<br>닉네임(Nickname): <input name="nickName" type="text" value=""><br>
<br>관리자아이디여부: <input name="is_superuser" type="checkbox" value="is_superuser"><br>
<br>
<input class="btn btn-primary" type="submit" value="Sign Up!">
</form>
</div>
</div>
</div>
</section>
</div>

</div>
<div class="containerright"></div>
</div>
Expand Down
5 changes: 3 additions & 2 deletions board/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ class Board(models.Model) :
body = models.TextField()
product_price = models.PositiveIntegerField(blank=True,default=0)
order_price = models.PositiveIntegerField(default=0)
state = models.CharField(max_length=20)
state = models.CharField(max_length=15)
userId = models.IntegerField()
userName = models.CharField(max_length=20)
image = models.ImageField(upload_to='images/', blank=True)
image1 = models.ImageField(upload_to='images/', blank=True)
image2 = models.ImageField(upload_to='images/', blank=True)
Expand All @@ -33,7 +34,7 @@ def __str__(self) :
class Comment(models.Model):
post = models.IntegerField()
userId = models.IntegerField()
author = models.CharField(max_length=20)
author = models.CharField(max_length=15)
text = models.TextField()
price = models.IntegerField()
created_date = models.DateTimeField(auto_now_add=True)
Expand Down
58 changes: 50 additions & 8 deletions board/templates/board_new.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,49 +38,54 @@ <h1>게시물 등록</h1>
본문을 작성해주세요!
<input type="text" class="form-control" name="title" placeholder="게시물 제목을 입력해주세요."><br>
<textarea class="form-control" rows="15" name="body" placeholder="본문 내용을 입력해주세요"></textarea>
<input type="button" value="파일추가" class="btn btn-primary" onclick="addFile()" id="fileAdd">
<div class="flexbox">
<div class="item"><input type="button" class="btn btn-primary" value="파일추가" onclick="addFile()" id="fileAdd" ></div>
<div class="item"><input type="button" class="btn btn-primary" value="파일삭제" onclick="removeFile()" id="fileRemove"></div>
</div>



<div class="area-file">
<div name="filediv">
<input type="file" name="file" />
<input type="file" name="file" id="file"/>
</div>

<table id="preset1" style="display:none;" name="filetable1">
<tr name="tr_attach_file">
<td>
<input type="file" name="file1"/>
<input type="file" name="file1" id="file1" />
</td>
</tr>
</table>

<table id="preset2" style="display:none;" name="filetable2">
<tr name="tr_attach_file">
<td>
<input type="file" name="file2"/>
<input type="file" name="file2" id="file2"/>
</td>
</tr>
</table>

<table id="preset3" style="display:none;" name="filetable3">
<tr name="tr_attach_file">
<td>
<input type="file" name="file3"/>
<input type="file" name="file3" id="file3"/>
</td>
</tr>
</table>

<table id="preset4" style="display:none;" name="filetable4">
<tr name="tr_attach_file">
<td>
<input type="file" name="file4"/>
<input type="file" name="file4" id="file4"/>
</td>
</tr>
</table>

<table id="preset5" style="display:none;" name="filetable5">
<tr name="tr_attach_file">
<td>
<input type="file" name="file5"/>
<input type="file" name="file5" id="file5"/>
</td>
</tr>
</table>
Expand All @@ -98,8 +103,43 @@ <h1>게시물 등록</h1>

<script>
var count = 0;
function removeFile() {


switch (count) {
case 1 :
$("#file1").remove();
count--;
break;
case 2 :
$("#file2").remove();
count--;
break;
case 3 :
$("#file3").remove();
count--;
break;
case 4 :
$("#file4").remove();
count--;
break;
case 5 :
$("#file5").remove();
count--;
break;
case 6 :
$("#file5").remove();
count--;
break;
default :
break
}
}


function addFile(){
count++;
if (count < 6 ) count++;

switch (count) {
case 1 :
$('[name=form1] [name=filediv]:last').after( $('#preset1 tr').clone());
Expand All @@ -116,6 +156,8 @@ <h1>게시물 등록</h1>
case 5 :
$('[name=form1] [name=filetable4]:last').after( $('#preset5 tr').clone());
break;
default :
break
}

// $('#preset tr').clone() : id=preset 에서 tr 요소 셀렉트 하여 복제 !!
Expand Down
Loading

0 comments on commit 263a878

Please sign in to comment.