-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #277 from djangoindia/hotfixes
Hotfixes - event card, email worker, event description
- Loading branch information
Showing
8 changed files
with
121 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from django import template | ||
|
||
|
||
register = template.Library() | ||
|
||
|
||
@register.filter(name="add_class") | ||
def add_class(value, arg): | ||
css_classes = value.field.widget.attrs.get("class", "") | ||
if css_classes: | ||
css_classes = f"{css_classes} {arg}" | ||
else: | ||
css_classes = arg | ||
return value.as_widget(attrs={"class": css_classes}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,87 @@ | ||
<!-- templates/admin/send_email.html --> | ||
{% extends "admin/base_site.html" %} | ||
{% load form_tags %} | ||
|
||
{% block content %} | ||
<h2>Send Email to Selected Users</h2> | ||
<form method="post"> | ||
{% csrf_token %} | ||
{{ form.as_p }} | ||
<input type="submit" name="apply" value="Send emails"> | ||
</form> | ||
<a href="{% url 'admin:index' %}">Cancel</a> | ||
{% block extrastyle %} | ||
{{ block.super }} | ||
<style> | ||
#content-main { | ||
max-width: 800px; | ||
margin: 0 auto; | ||
padding: 20px; | ||
} | ||
.form-row { | ||
margin-bottom: 15px; | ||
} | ||
.form-row label { | ||
display: block; | ||
margin-bottom: 5px; | ||
font-weight: bold; | ||
} | ||
.vTextField { | ||
width: 100%; | ||
padding: 6px 12px; | ||
border: 1px solid #ccc; | ||
border-radius: 4px; | ||
} | ||
.submit-row { | ||
margin-top: 20px; | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
} | ||
.errorlist { | ||
color: red; | ||
margin-top: 5px; | ||
list-style-type: none; | ||
padding: 0; | ||
} | ||
.errornote { | ||
background-color: #ba2121; | ||
color: white; | ||
padding: 10px; | ||
margin-bottom: 15px; | ||
border-radius: 4px; | ||
} | ||
</style> | ||
{% endblock %} | ||
|
||
{% block content %} | ||
<div id="content-main"> | ||
<h1>Send Email to Selected Users</h1> | ||
|
||
<form method="post"> | ||
{% csrf_token %} | ||
<div> | ||
{% if form.errors %} | ||
<p class="errornote"> | ||
{% if form.errors|length == 1 %}Please correct the error below.{% else %}Please correct the errors below.{% endif %} | ||
</p> | ||
{% endif %} | ||
|
||
<fieldset class="module aligned"> | ||
{% for field in form %} | ||
<div class="form-row"> | ||
{{ field.label_tag }} | ||
{{ field|add_class:"vTextField" }} | ||
{% if field.help_text %} | ||
<p class="help">{{ field.help_text }}</p> | ||
{% endif %} | ||
{% if field.errors %} | ||
<ul class="errorlist"> | ||
{% for error in field.errors %} | ||
<li>{{ error }}</li> | ||
{% endfor %} | ||
</ul> | ||
{% endif %} | ||
</div> | ||
{% endfor %} | ||
</fieldset> | ||
|
||
<div class="submit-row"> | ||
<input type="submit" value="Send emails" class="default" name="apply"> | ||
<p class="deletelink-box"><a href="{% url 'admin:index' %}" class="deletelink">Cancel</a></p> | ||
</div> | ||
</div> | ||
</form> | ||
</div> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters