Skip to content
This repository was archived by the owner on Sep 3, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions index/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ class Petition(models.Model):
ID = models.IntegerField(primary_key=True)
archived = models.BooleanField(default=False)
hidden = models.BooleanField(default=False)
''' these commented sections are meant to be where recognized and resolved statuses of a Petition object would be defined. Section is not done, so if it is uncommented, site will crash'''
#recognized = models.BooleanField(default=False)
#resolved = models.BooleanField(default=False)

created_date = models.DateTimeField(
db_index=True, default=timezone.now
Expand Down Expand Up @@ -169,6 +172,16 @@ def set_archived(self, bool_val):
# Adds a description to the basic petitions model, with a max length
# of 4000 words

'''function for setting a petition object as recognized/resolved'''

'''def set_recognized(self, bool_val):
self.recognized = bool_val
# Senate can verify if a petition has been recognized by them'''

'''def set_resolved(self, bool_val):
self.resolved = bool_val
# Senate can verify if a petition has been resolved by them (passed, failed, etc.)'''

def add_description(self, descript):
self.description = descript
return True
Expand Down
41 changes: 41 additions & 0 deletions index/static/petition/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,44 @@ body {
.card {
min-height: 175px;
}

.headingbar{
margin-top: 1em;
margin-bottom: 1em;
}

.pagination > li > a
{
background-color: white;
color: red;
}

.pagination > li > a:focus,
.pagination > li > a:hover,
.pagination > li > span:focus,
.pagination > li > span:hover
{
color: red;
background-color: #eee;
border-color: #ddd;
}
/* beautification for each tag in the petition */
.Tag{
font-weight: bold;
padding: 1mm;
color: #ffffff;
background-color: #ed1c24;
border: solid 1px #ed1c24;
box-shadow: 3px 3px 3px #505050;
border-radius: 3px;
}

.Tag:hover{
text-decoration: none;
font-weight: bold;
padding: 1mm;
color: #ed1c24;
background-color: #ffffff;
border: solid 1px #ffffff;
box-shadow: 3px 3px 3px #505050;
}
71 changes: 71 additions & 0 deletions index/templates/about.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{% extends "base.html" %}
{% block title %}About RPI Petitions{% endblock %}

{% block content %}

<div class="container">
<h3 class="text-dark text-center pontiac headingbar">About RPI Petitions</h3>
<br>
<!-- Navigation tabs -->
<ul class="nav nav-tabs justify-content-center" role="tablist">
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#history">History</a>
</li>
<li class="nav-item">
<a class="nav-link active" data-toggle="tab" href="#petprocess">Petition Process</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#moderation">Moderation</a>
</li>
</ul>
<!-- Tab descriptions -->
<div class="tab-content">
<!--This explains the history of the site. Paraphrased what was in the older website, so this is really just a placeholder-->
<div id="history" class="container tab-pane fade"><br>
<p>This version of RPI Petitions is the collaborative effort of members of the Rensselaer Center for Open Source (RCOS), RPI's Web Technologies Group, and Student Senate.</p>
<p>RPI Petitions exists for the purpose of giving all RPI students the abilty to spark change in their community.</p>
</div>

<!--These are the steps we recommend first-time users read before they make a petition. Can be edited based on what features are included in the site's final version-->
<div id="petprocess" class="container tab-pane active"><br>
<p>Curious about creating a new petition? Here are some steps to help get you started!</p>
<blockquote class="blockquote bg-light text-center pontiac">Have an Idea!</blockquote>
<p>Search for petitions that match your concerns. If a petition for your issue already exists, sign it! This will help raise support for your cause and reach the amount of signatures needed to gain Senate support (250, as of 03/13/2015).</p>
<hr>
<blockquote class="blockquote bg-light text-center pontiac">Write your Petition!</blockquote>
<p>
<a href="{% url 'create' %}">Create a petition</a> if your issue hasn’t been raised. Use proper grammar and spelling, and make your description clear so that others can easily find your petition. Be sure to review our Moderation Policy (located on the right-most tab of this page) before posting.
</p>
<p class="text-danger">Be careful! You can't edit or delete a petition once it has been submitted. </p>
<hr>
<blockquote class="blockquote bg-light text-center pontiac">Share your Petition!</blockquote>
<p>Use social media to spread awareness of your issue!</p>
<p> A petition has one year to reach its threshold. If the threshold is not reached, then the petition is archived. You can still search for said petition, but you will be unable to sign it. Student Senate may elect to address a petition prior to reaching its threshold.</p>
</div>

<!--Details which bodies moderate the site and what's allowed/not allowed for a petition-->
<div id="moderation" class="container tab-pane fade"><br>
<p>The Rensselaer Union Student Senate empowers the Elections Committee and Web Technologies Group with moderating privileges on the RPI Petitions website. Petitions deemed inappropriate may be removed from the site at the discretion of these committees, for reasons including but not limited to: </p>
<ol>
<b>
<li>Violation of the Senate Bylaws, Union Constitution, or external laws and regulations including those set by local, regional, or federal government. </li>
<li>Mandating the hiring or firing of Institute personnel.</li>
<li>Requesting removal of an elected official without specifying good cause.</li>
<li>Direct personal attacks or slander.</li>
<li>Sharing of personal or confidential information.</li>
<li>Inappropriate or profane language.</li>
<li>Discriminatory or prejudicial content.</li>
<li>Redundancy with existing petitions.</li>
<li>Lack of clarity in the petition's goals.</li>
<li>Spamming of petitions.</li>
</b>
</ol>
<p>Petitions out-of-scope for the Student Senate may additionally be referred to other organizations where applicable. In all cases where a petition is removed or referred, its sponsor will be notified of the reason for removal or referral.</p>

<p>To appeal decisions involving a petition's removal or referral, please contact Rules and Elections at [email protected].</p>

<p>Full moderation rules may be found in Rules and Elections' official <a href="http://docs.studentsenate.rpi.edu/documents/2743/download" target="_blank">Petition and Referendum Handbook</a>.</p>
</div>
</div>
</div>
{% endblock %}
102 changes: 102 additions & 0 deletions index/templates/all-petitions.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
{% extends "base.html" %}
{% block title %}View All Petitions{% endblock %}

{% block content %}

<div class="container">
<h3 class="text-dark headingbar text-center pontiac">All Petitions</h3>
<div class="row">
<!--Resolved Petitions Checkbox-->
<div class="col-sm-5">
<div class="checkbox">
<label>
<input type="checkbox" aria-label="All resolved petitions checkbox"> Show All Resolved
</label>
</div>
</div>
<!--Recognized Petitions Checkbox-->
<div class="col-sm-4">
<div class="checkbox">
<label>
<input type="checkbox"> Show All Recognized
</label>
</div>
</div>
<!--Sort Petitions Dropdown Menu-->
<div class="col-sm-3">
<div class="dropleft float-right">
<button class="btn btn-secondary dropdown-toggle" type="button" id="tagdropdown" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
Sort By:
</button>
<div class="dropdown-menu" aria-labelledby="tagdropdown">
<a class="dropdown-item" href="#">Most Recent</a>
<a class="dropdown-item" href="#">Most Signatures</a>
</div>
</div>
</div>
</div>
</div>
<br>

<!--Displays cards-->
<div class="container">
<ul class="card-columns">
{% for petition in petitions %}
<li class="card bg-light">
<div class="card-body text-center">
<h5 class="card-title text-center"><a href="#">{{ petition.title }}</a></h5>
<h6 class="card-subtitle mb-2">{{ petition.signatures.count }} signatures</h6>
{% for tag in petition.tags.all %}
<a href="#" class=" Tag link">{{ tag }}</a><br>
{% endfor %}
</div>
</li>
<!--If there are no petitions, display this message-->
{% empty %}
<p>No petitions yet. Stay tuned!</p>
{% endfor %}
</ul>
</div>

<!--Paginator Test-->
{% if petitions.has_other_pages %}
<ul class="pagination justify-content-center">
<!--if there are any accessable petitions before the page that we're on, be able to get access to that 'page' of information-->
{% if petitions.has_previous %}
<li class="page-item">
<a class="page-link" href="?page=1">First</a>
</li>
<li class="page-item">
<a class="page-link" href="?page={{ petitions.previous_page_number }}">&laquo;</a>
</li>
<!--Else disable left arrow-->
{% else %}
<li class="page-item disabled"><span class="page-link">First</li>
<li class="page-item disabled"><span class="page-link">&laquo;</span></li>
{% endif %}
<!--Page number logic-->
{% for i in petitions.paginator.page_range %}
{% if petitions.number == i %}
<li class="page-item active">
<span class="page-link">{{ i }}<span class="sr-only">(current)</span></span></li>
{% else %}
<li><a class="page-link" href="?page={{ i }}">{{ i }}</a></li>
{% endif %}
{% endfor %}
{% if petitions.has_next %}
<!--Link to the next page of objects-->
<li class="page-item">
<a class="page-link" href="?page={{ petitions.next_page_number }}">&raquo;</a>
</li>
<!--Link to the last page-->
<li class="page-item">
<a class="page-link" href="?page={{ petitions.paginator.num_pages }}">Last</a>
</li>
{% else %}
<li class="page-item disabled"><span class="page-link">&raquo;</span></li>
<li class="page-item disabled"><span class="page-link">Last</li>
{% endif %}
</ul>
{% endif %}
{% endblock %}
6 changes: 0 additions & 6 deletions index/templates/all.html

This file was deleted.

15 changes: 9 additions & 6 deletions index/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@
<head>
{% block head %}
<title>{% block title %}{% endblock %}</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script>
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
<meta charset="utf-8">
{% load static %}
<link rel="shortcut icon" href="{% static 'petition/favicon.png' %}">
<link rel="shortcut icon" href="{% static 'petition/favicon.png' %}">
<link rel="stylesheet" href="{% static 'petition/style.css' %}">
{% endblock %}
</head>
Expand All @@ -31,7 +35,7 @@
</ul>
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="">About</a>
<a class="nav-link" href="{% url 'about' %}">About</a>
</li>
<li class="nav-item">
<button class="btn" href="">Login</button>
Expand All @@ -48,14 +52,13 @@
<footer class="footer">
<div class="container">
<span class="text-muted">
<p>This is an <a href="https://github.com/wtg">open source</a> project made and maintained by the Web Technologies Group of the Rensselaer Union Student Senate</p></span>
<p>This is an <a href="https://github.com/wtg">open source</a> project made and maintained by the Web Technologies Group of the Rensselaer Union Student Senate.</p></span>
<a href="https://webtech.union.rpi.edu/">
<img class="wtg-logo" src="{% static 'petition/wtg.svg' %}">
</a>
</div>
</footer>

<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
</body>
</html>
66 changes: 66 additions & 0 deletions index/templates/create-petition.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{% extends "base.html" %}
{% block title %}Create A Petition{% endblock %}

{% block content %}
<!--Page Heading-->
<div class="container">
<h3 class="text-dark headingbar text-center pontiac">Create a Petition</h3>
</div>
<!--Warning block-->
<div class="container preface">
<p>If this is your first time creating a petition on RPI Petitions, please read our fantastic <a href="about.html"
class="guidelink"> one-minute guide</a>.
<br><br>
Note: You <span style="color:red">cannot</span> manually edit or delete the petition once it is submitted (so
read through it twice!).</p>
</div>

<!--Contains all the inputs needed for creating a petition (title, tag(s), description)-->
<div class="container creating">
<!--Enter your petition's name. There will be a character limit to keep the sections neat and enforce simple titles-->
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon1">Name:</span>
</div>
<input type="text" class="form-control" placeholder="Enter petition name here" aria-label="Username"
aria-describedby="basic-addon1">
</div>
<!--All tags from the original website. Users are only allowed to pick 3 tags (need to create an algorithm) to stop the user after they've chosen 3-->
<div class="dropdown mb-3">
<button class="btn dropdown-toggle" type="button" id="tagdropdown" data-toggle="dropdown" aria-haspopup="true"
aria-expanded="false">Petition Tags <span style="font-size: 10px">(max of 3)</span></button>
<div class="dropdown-menu" aria-labelledby="all-tags">
<a class="dropdown-item" href="#">Academics</a>
<a class="dropdown-item" href="#">Athletics</a>
<a class="dropdown-item" href="#">Communications</a>
<a class="dropdown-item" href="#">Community</a>
<a class="dropdown-item" href="#">Dining Services</a>
<a class="dropdown-item" href="#">Extracurriculars</a>
<a class="dropdown-item" href="#">Facilities</a>
<a class="dropdown-item" href="#">Greek Life</a>
<a class="dropdown-item" href="#">Health Services</a>
<a class="dropdown-item" href="#">Rensselaer Union</a>
<a class="dropdown-item" href="#">Research</a>
<a class="dropdown-item" href="#">Residence Life</a>
<a class="dropdown-item" href="#">Safety</a>
<a class="dropdown-item" href="#">Student Government</a>
<a class="dropdown-item" href="#">Student Life</a>
<a class="dropdown-item" href="#">Student Rights</a>
<a class="dropdown-item" href="#">Technology Services</a>
<a class="dropdown-item" href="#">Tradition</a>
<a class="dropdown-item" href="#">Transportation</a>
</div>
</div>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">Description</span>
</div>
<textarea class="form-control" placeholder="Talk about why you're excited about this petition!"
aria-label="petition-description"></textarea>
</div>
</div>
<!--The 'send petition' button-->
<div class="container" role="group" aria-label="sendPetition">
<button class="btn ">Create Petition</button>
</div>
{% endblock %}
19 changes: 0 additions & 19 deletions index/templates/create.html

This file was deleted.

Loading