Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
bryli authored Apr 10, 2024
2 parents 0d05e30 + b2bcc6f commit 699e842
Show file tree
Hide file tree
Showing 10 changed files with 88 additions and 15 deletions.
76 changes: 73 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,73 @@
hknweb
======
All of our documentation is in our [wiki](https://github.com/compserv/hknweb/wiki/)!
# hknweb

Welcome! This is the *in-progress website redesign* for the [IEEE-Eta Kappa Nu (HKN)](https://hkn.ieee.org/) [University of California, Berkeley Mu Chapter](https://dev-hkn.eecs.berkeley.edu/), built with [Django](https://www.djangoproject.com/), [Django REST framework](https://www.django-rest-framework.org/), and [Vue.js](https://vuejs.org/).

## Setup and Development

1. **Fork and Clone the Repository:** Go to [https://github.com/compserv/hknweb](https://github.com/compserv/hknweb) and click on the "Fork" button in the top left corner to fork the repository to your GitHub account. Clone the repository to your local machine.

2. **Install Python 3.9 and Poetry:** Ensure you have Python 3.9 installed on your system. You can download it from [python.org](https://www.python.org/downloads/). Then, install [Pipx](https://pipx.pypa.io/stable/installation/) if not already installed. Finally, install Poetry:

```sh
pipx install poetry
```

3. **Install Dependencies:** Navigate to the cloned repository directory (`hknweb`) in your terminal and run the following command to install project dependencies using Poetry:

```sh
poetry install
```

4. **Activate Virtual Environment:** Run the following command to activate the virtual environment created by Poetry:

```sh
poetry shell
```

5. **Apply Migrations:** Apply all database changes using the following command:

```sh
python manage.py migrate
```

6. **Run the Server:** Finally, run the development server using the following command:

```sh
python manage.py runserver
```

You should now be able to access the website locally at `http://localhost:8000`.

In order to access the admin interface, run

```sh
python manage.py createsuperuser
```

Complete the following prompts to create a local admin user, which can then be used to access the admin interface by logging in at `http://localhost:8000/admin`.

## Deployment

The deployment pipeline pulls from `compserv/master` to OCF servers using `fabfile.py`.

```sh
# Activate our dev environment
poetry shell
# Depending on your ssh setup, this may or may not work for you:
HKNWEB_MODE="prod" fab deploy
# If your SSH key to the apphost requires a password to unlock:
HKNWEB_MODE="prod" fab --prompt-for-passphrase deploy
# If you have no SSH key to the apphost, and require password authentication:
HKNWEB_MODE="prod" fab --prompt-for-login-password deploy
```

## Contributing

If you'd like to contribute to this project, feel free to fork the repository, make your changes, and submit a pull request.
## License
This project is licensed under the [MIT License](LICENSE). Feel free to use, modify, and distribute the code as per the terms of the license.
2 changes: 1 addition & 1 deletion hknweb/academics/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class Migration(migrations.Migration):
name='Rating',
fields=[
('academicentity_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='academics.AcademicEntity')),
('question_text', models.TextField(max_length=500)),
('question_text', models.TextField(max_length=2000)),
('inverted', models.BooleanField(default=False)),
('range_max', models.IntegerField(default=7)),
('rating_value', models.FloatField()),
Expand Down
2 changes: 1 addition & 1 deletion hknweb/academics/migrations/0002_auto_20211223_1902.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='icsr',
name='course_name',
field=models.TextField(default='', max_length=500),
field=models.TextField(default='', max_length=2000),
),
]
2 changes: 1 addition & 1 deletion hknweb/academics/models/course_surveys/rating.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Rating(AcademicEntity):
)

# value attributes
question_text = models.TextField(max_length=500)
question_text = models.TextField(max_length=2000)
inverted = models.BooleanField(default=False)
range_max = models.IntegerField(default=7)
rating_value = models.FloatField()
2 changes: 1 addition & 1 deletion hknweb/events/models/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Event(models.Model):
end_time = models.DateTimeField()
location = models.CharField(max_length=255)
event_type = models.ForeignKey(EventType, models.CASCADE)
description = MarkdownxField(max_length=500)
description = MarkdownxField(max_length=2000)
rsvp_limit = models.PositiveIntegerField(null=True, blank=True)
access_level = models.IntegerField(
choices=ACCESS_LEVELS,
Expand Down
1 change: 1 addition & 0 deletions hknweb/static/css/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ body {

.content {
padding-bottom: 1em;
overflow:auto;
}

/*
Expand Down
Binary file modified hknweb/static/img/indrel_sponsors_citadel_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 7 additions & 2 deletions hknweb/templates/events/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,15 @@
overflow: auto;
}


@media screen and (min-width: 1000px) {
.content-wrapper {
left: 12.5%;
position: relative;
{% if show_sidebar %}
left: 5%;
{% else %}
left: 12.5%;
{% endif %}
position: relative;
}
}

Expand Down
6 changes: 1 addition & 5 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ fabric = "^3.2.2"
django-autocomplete-light = "^3.9.7"
djangorestframework = "^3.14.0"
google-api-python-client = "^2.99.0"
pillow = "^9.5.0"
icalendar = "^5.0.10"

[tool.poetry.group.prod]
Expand Down Expand Up @@ -51,4 +52,4 @@ omit = [
[tool.coverage.report]
skip_covered = true
sort = "miss"
fail_under = 85
fail_under = 85

0 comments on commit 699e842

Please sign in to comment.