Skip to content

Commit

Permalink
[Design] idea_list
Browse files Browse the repository at this point in the history
  • Loading branch information
jimin-kiim committed Aug 2, 2021
1 parent 603da49 commit f43458f
Show file tree
Hide file tree
Showing 9 changed files with 76 additions and 22 deletions.
2 changes: 1 addition & 1 deletion SWIDEA_SITE/config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'DIRS': [os.path.join(BASE_DIR, 'config', 'templates')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
Expand Down
24 changes: 24 additions & 0 deletions SWIDEA_SITE/config/templates/base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SW Idea site</title>
<link rel="stylesheet"href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-B0vP5xmATw1+K9KRQjQERJvTumQW0nPEzvF6L/Z6nronJ3oUOFUFpCjEUQouq2+l" crossorigin="anonymous">

</head>
<body>
<nav class="navbar shadow">
<a class="col text-center text-dark pt-2"><h4>SW idea site</h4></a>
</nav>
{% block content %}
{% endblock %}

{% block extra %}
{% endblock %}
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-Piv4xVNRyMGpqkS2by6br4gNJ7DXjqk09RmUpJ8jgGtD7zP9yug3goQfGII0yAns" crossorigin="anonymous"></script>

</body>
</html>
6 changes: 5 additions & 1 deletion SWIDEA_SITE/devtools/templates/devtool/detail.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{% extends "base.html" %}

{% block content %}
<h1>{{ tool.name }}</h1>
<br/>
{{ tool.kind }}
Expand All @@ -11,4 +13,6 @@ <h1>{{ tool.name }}</h1>

<button class="btn" onclick="location.href='{% url 'devtools:tool_delete' tool.pk %}'">μ‚­μ œ</button>
<button class="btn" onclick="location.href='{% url 'devtools:tool_edit' tool.pk %}'">μˆ˜μ •</button>
<button class="btn" onclick="location.href='{% url "devtools:tool_list" %}'">λͺ©λ‘</button>
<button class="btn" onclick="location.href='{% url "devtools:tool_list" %}'">λͺ©λ‘</button>

{% endblock %}
6 changes: 5 additions & 1 deletion SWIDEA_SITE/devtools/templates/devtool/form.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
{% extends "base.html" %}
{% block content %}
<form action ="" method="POST">
{% csrf_token %}
<table>
{{form.as_table}}
</table>

<input type="submit" value="μ €μž₯ν•˜κΈ°"/>
</form>
</form>

{% endblock %}
6 changes: 5 additions & 1 deletion SWIDEA_SITE/devtools/templates/devtool/list.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

{% extends "base.html" %}
{% block content %}
<a href="{% url 'devtools:tool_create' %}">μƒˆ 개발 툴 등둝</a>
<br/>
{%for tool in tool %}
Expand All @@ -9,3 +10,6 @@ <h1>{{tool.name}}</h1>
<p>{{ tool.kind }}</p>
<p>{{ tool.description }}</p>
{% endfor %}


{% endblock %}
6 changes: 5 additions & 1 deletion SWIDEA_SITE/ideas/templates/idea/detail.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{% extends "base.html" %}

{% block content %}
<h1>{{ idea.title }}</h1>
{% if idea.image %}
<img src="{{ idea.image.url }}" style="max-width: 100%;"/>
Expand All @@ -12,4 +14,6 @@ <h1>{{ idea.title }}</h1>

<button class="btn" onclick="location.href='{% url "ideas:idea_delete" idea.pk %}'"> μ‚­μ œ </button>
<button class="btn" onclick="location.href='{% url "ideas:idea_edit" idea.pk %}'"> μˆ˜μ • </button>
<button class="btn" onclick="location.href='{% url "ideas:idea_list" %}'"> λͺ©λ‘ </button>
<button class="btn" onclick="location.href='{% url "ideas:idea_list" %}'"> λͺ©λ‘ </button>

{% endblock %}
8 changes: 7 additions & 1 deletion SWIDEA_SITE/ideas/templates/idea/form.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
{% extends "base.html" %}


{% block content %}
<form action ="" method="POST" enctype="multipart/form-data">
{% csrf_token %}
<table>
{{form.as_table}}
</table>

<input type="submit" value="μ €μž₯ν•˜κΈ°"/>
</form>
</form>

{% endblock %}
38 changes: 23 additions & 15 deletions SWIDEA_SITE/ideas/templates/idea/list.html
Original file line number Diff line number Diff line change
@@ -1,23 +1,31 @@

<a href="{% url 'ideas:idea_create' %}">μƒˆ 아이디어 등둝</a>
{% extends "base.html" %}
{% load static %}
{% block content %}
<button class="btn btn-sm border-primary mt-3 ml-3" onclick="location.href='{% url 'ideas:idea_create' %}'">μƒˆ 아이디어 등둝</a></button>
<br/>
{%for idea in idea %}
{% if idea.image %}
<img src="{{ idea.image.url }}" style="max-width: 100%;"/>
{%endif%}
<p>
<h1><a href="{% url 'ideas:idea_detail' idea.pk%}">{{ idea.title }}</a></h1>
<p>μ˜ˆμƒ 개발 툴:{{ idea.devtool }}</p>
아이디어 관심도: {{ idea.interest }}
<button class="btn" id="up">+</button>
<button class="btn" id="down">-</button>
</p>

{% endfor %}
<div class="d-flex justify-content-evenly">
{%for idea in idea %}
<div class="p-3 d-flex flex-column align-items-center">
<img src="{{ idea.image.url }}" style="max-width: 100%;"/>
<div>
<h3><a href="{% url 'ideas:idea_detail' idea.pk%}">{{ idea.title }}</a></h3>
<span class="font-weight-bold">μ˜ˆμƒ 개발 툴:</span> {{ idea.devtool }}
<br>
<span class="font-weight-bold">아이디어 관심도:</span> {{ idea.interest }}
<button class="btn btn-sm border-primary" id="up">+</button>
<button class="btn btn-sm border-primary" id="down">-</button>

</div>
</div>
{% endfor %}
</div>
{% endblock %}

{% block extra %}
<script>
const button = document.querySelectorAll('.btn');
button.forEach(button => button.addEventListener('click',()=> {
console.log('Click!!!');
}));
</script>
{% endblock %}
2 changes: 1 addition & 1 deletion piro15_Ajax_Pirostagram/config/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
path('', include('main.urls'), name="main"),
]

urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

0 comments on commit f43458f

Please sign in to comment.