Changeset - 2a23a0a55ea0
[Not reviewed]
conservancy/usethesource/forms.py
Show inline comments
...
 
@@ -8,3 +8,7 @@ class CommentForm(forms.ModelForm):
 
        model = Comment
 
        fields = ['message']
 
        fields = ['time', 'message']
 

	
 
    def __init__(self, *args, **kwargs):
 
        super().__init__(*args, **kwargs)
 
        self.fields['time'].widget.input_type = 'datetime-local'
 

	
conservancy/usethesource/models.py
Show inline comments
...
 
@@ -5,2 +5,3 @@ from django.db import models
 
from django.urls import reverse
 
from django.utils import timezone
 

	
...
 
@@ -41,3 +42,3 @@ class Comment(models.Model):
 
    user = models.ForeignKey(User, on_delete=models.PROTECT)
 
    time = models.DateTimeField(auto_now_add=True)
 
    time = models.DateTimeField(default=timezone.now)
 
    message = models.TextField()
conservancy/usethesource/templates/usethesource/add_comment_form.html
Show inline comments
 
file renamed from conservancy/usethesource/templates/usethesource/comment_form.html to conservancy/usethesource/templates/usethesource/add_comment_form.html
...
 
@@ -2,6 +2,7 @@
 
  {% csrf_token %}
 
  {{ form.message }}
 
  <div>{{ form.time }}</div>
 
  <div class="mt2">{{ form.message }}</div>
 
  <div class="mt2">
 
    <button type="submit" hx-get="{% url 'usethesource:add_button' slug=candidate.slug %}" class="b pointer white bg-light-silver pv2 ph3" style="border: none">Cancel</button>
 
    {% include 'usethesource/save_button_partial.html' %}
 
    <button type="submit" class="b white bg-green pv2 ph3" style="border: none">Save and email</button>
 
  </div>
conservancy/usethesource/templates/usethesource/candidate.html
Show inline comments
...
 
@@ -17,3 +17,3 @@
 
          <h2 class="f2 lh-title ttu mt0">{{ candidate.name }}</h2>
 
          <a href="{% url 'admin:usethesource_candidate_change' object_id=candidate.id %}" title="Edit candidate" class="f3 white bg-light-silver db ph2 mh2 mb3" style="transform: scaleX(-1); text-decoration: none !important">✎</a>
 
          {% if user.is_staff or user.is_superuser %}<a href="{% url 'admin:usethesource_candidate_change' object_id=candidate.id %}" title="Edit candidate" class="f3 white bg-light-silver db ph2 mh2 mb3" style="transform: scaleX(-1); text-decoration: none !important">✎</a>{% endif %}
 
        </div>
...
 
@@ -39,3 +39,3 @@
 

	
 
    {% if user.is_staff %}
 
    {% if user.is_staff or user.is_superuser %}
 
      {% include "usethesource/add_comment_button_partial.html" %}
conservancy/usethesource/templates/usethesource/edit_comment_form.html
Show inline comments
...
 
@@ -2,6 +2,7 @@
 
  {% csrf_token %}
 
  {{ form.message }}
 
  <div>{{ form.time }}</div>
 
  <div class="mt2">{{ form.message }}</div>
 
  <div class="mt2">
 
    <button type="submit" hx-get="{% url 'usethesource:view_comment' comment_id=comment.id show_add='false' %}" class="b pointer white bg-light-silver pv2 ph3" style="border: none">Cancel</button>
 
    {% include 'usethesource/save_button_partial.html' %}
 
    <button type="submit" class="b white bg-green pv2 ph3" style="border: none">Save</button>
 
  </div>
conservancy/usethesource/templates/usethesource/save_button_partial.html
Show inline comments
 
deleted file
conservancy/usethesource/views.py
Show inline comments
...
 
@@ -48,3 +48,3 @@ def create_comment(request, slug):
 
            return redirect('usethesource:view_comment', comment_id=comment.id, show_add='true')
 
    return render(request, 'usethesource/comment_form.html', {'form': form, 'candidate': candidate})
 
    return render(request, 'usethesource/add_comment_form.html', {'form': form, 'candidate': candidate})
 

	
0 comments (0 inline, 0 general)