Skip to content

Commit 18e91ae

Browse files
authored
Merge pull request #101 from talko611/add-create-event-style
Add create event style
2 parents 559037b + c8dcffc commit 18e91ae

File tree

3 files changed

+100
-15
lines changed

3 files changed

+100
-15
lines changed
Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,23 @@
11
{% extends 'base.html' %}
22
{% block content %}
3-
<h1>Create Event</h1>
4-
<form id="event-form" method="post">
5-
{% csrf_token %} {{ form.as_p }}
6-
<button type="submit">Create</button>
7-
{% if error %}
8-
<label id="error-label" style="color: red;">{{error}}</label>
9-
{% endif %}
10-
</form>
3+
<div class="create-event-form-header">
4+
<h2>Create Event</h2>
5+
</div>
6+
<div class="create-event-form-container">
7+
<form method="post" class="create-event-form">
8+
{% csrf_token %}
9+
{% for field in form %}
10+
<div class="form-field" id="field_{{ field.name }}">
11+
{{ field.label_tag }}
12+
{{ field }}
13+
</div>
14+
{% endfor %}
15+
<div class="btn-container">
16+
<button type="submit">Create</button>
17+
</div>
18+
{% if error %}
19+
<label class="error-label">{{error}}</label>
20+
{% endif %}
21+
</form>
22+
</div>
1123
{% endblock %}
Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
{% extends 'base.html' %}
22
{% block content %}
3-
<h1>{{event.name}} Event</h1>
4-
<li>Category: {{event.category.name}}</li>
5-
<li>Location: {{event.location.city}}</li>
6-
<li>Starts At: {{event.start_time}}</li>
7-
<li>Ends At: {{event.end_time}}</li>
8-
<li>Participants : {{event.participants_num}}/{{event.max_participants}}</li>
3+
<div class="event-info-header">
4+
<h2>{{event.name}} Event</h2>
5+
</div>
6+
<div class="event-info-container">
7+
<ul>
8+
<li>Category: {{event.category.name}}</li>
9+
<li>Location: {{event.location.city}}</li>
10+
<li>Starts At: {{event.start_time}}</li>
11+
<li>Ends At: {{event.end_time}}</li>
12+
<li>Participants : {{event.participants_num}}/{{event.max_participants}}</li>
13+
</ul>
14+
</div>
915
{% endblock %}
1016
{% block poll_info %}{% endblock %}
1117
{% block teams_info %}{% endblock %}

static_home_page/static/web_page_css.css

Lines changed: 68 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,14 +108,17 @@ form {
108108
flex-direction: column;
109109
max-width: 400px;
110110
margin: auto;
111+
111112
}
112113

113114
form label {
114115
font-weight: bold;
115116
margin-bottom: 0.5rem;
116117
}
117118

118-
p { font-size: 26px; }
119+
p {
120+
font-size: 26px;
121+
}
119122

120123
.logo {
121124
border-radius: 50%;
@@ -127,3 +130,67 @@ p { font-size: 26px; }
127130
box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
128131
transition: all 0.2s ease-in-out;
129132
}
133+
134+
.create-event-form-header {
135+
margin: 15px;
136+
}
137+
138+
.create-event-form-container {
139+
margin: 20px;
140+
}
141+
142+
.create-event-form>div {
143+
display: flex;
144+
justify-content: space-between;
145+
margin-bottom: 5px;
146+
align-items: center;
147+
}
148+
149+
.create-event-form>div>label {
150+
font-weight: normal;
151+
font-size: 14px;
152+
margin: 0;
153+
}
154+
155+
.create-event-form>div>input {
156+
width: 200px;
157+
}
158+
159+
.create-event-form>div>select {
160+
width: 200px;
161+
}
162+
163+
.create-event-form>.btn-container {
164+
justify-content: center;
165+
}
166+
167+
.create-event-form>.btn-container>button {
168+
width: 200px;
169+
}
170+
171+
.create-event-form>.error-label {
172+
color: red;
173+
}
174+
175+
.create-event-form #field_is_private {
176+
justify-content: flex-start;
177+
}
178+
179+
.create-event-form #field_is_private>input[type='checkbox'] {
180+
width: 20px;
181+
}
182+
183+
.event-info-header {
184+
margin: 15px;
185+
}
186+
187+
.event-info-container {
188+
margin: 20px;
189+
display: flex;
190+
justify-content: center;
191+
}
192+
193+
.event-info-container>ul>li {
194+
margin: 3px 0;
195+
padding: 3px 0;
196+
}

0 commit comments

Comments
 (0)