Giter Club home page Giter Club logo

shlifim's People

Contributors

avivz450 avatar danitlevi avatar idokah avatar ifireball avatar liornoy avatar rebeccatubman avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

shlifim's Issues

Fix and re-organize Base template

The base template is being extended by every template, therefore it serves for different uses and should give freedom of design and remove limitations.

Changes made:

  • Added structure - <head> & <body> tags
  • Added the needed JS links and Bootstrap links (also ajax for future use)
  • Removed "Shlifim" prefix from costume title
  • Fixed Navbar to be collapsable
  • Added CSS class to static/home/style.css for the navbar color
  • More changes below:

Please Notice - I removed the background color definition in the base,
to add background color in your feature create a <body> tag and add a CSS class with
the wanted color.

Also, I removed the following tags:
<div class="row">
<div class="col-md-8">

They used to warp the block content and thus limited the design possibilities of each
page that extended the base. (Mostly it Interrupted the landing page from being full-screen)
if your feature was changed by this add the tags I mentioned in your template.

"Base.html" is prune to changes in the future in case of:
Adding routes to links in the navbar (replacing href=#")
Adding more <script> & <link> tags
Prettifying the navbar itself

Let me know if you have any suggestions for improvement or requests for changes.

Add 'Tags' Page

The page will display all the tags and will allow to search for a specific tag.
The design for the Tags page will be similar to Users page from the pages_design.md in documentation.

image

Add documentation folder

Add documentation folder which contains files that are not related to the code, but related to the project .

Create Question Model and Migrations

Create a DB table for questions following the table in the ERD which includes:

  • question id(PK)
  • user id(FK)
  • title
  • content
  • publish date
  • subject id(FK)
  • grade
  • sub subject id (FK)
  • book id (FK)
  • book page
  • is edited

Add more answers and tags test data

Currently, we have 2 answers test data in the migrations,
and a small number of tags_questions also.

More test data is needed for logical testing purposes and for testing the look of the features

Create base.html file

The base.html file will be inherited by all the other HTML files and will include
a Navbar with links to other pages, a search box for questions, and authentication buttons (Login/Logout and profile page).
Moreover, the base.html will have all the needed CSS links and messages logic for showing one-time messages to the user
(for example confirmation for creating a user or posting a question).

Add "Explore page"

Add "Explore page" - a page that displays all the questions in the app.

Web page contributions User Story

User Story:
As a Shlifim user,
I want to post a query about my home work
so that other people will respond me and I will find a solution

Use case:

  1. The user connects Shlifim website.
  2. The user scrolling to the bottom of the page.
  3. The user filling the "Author" and "Text" fields with relevant details about his question.
  4. The user clicks "Post".
  5. The new post is displayed on the website. There is a bold text: Posted by "Author" at "Current date" and below the Text field is displayed.
  6. If another user responds to the question, the user will see the responses to his post below it as follows:
    Comments:
    Posted by "author of the response" at "Current date"
    --Response body--
    (End of messages)

Create Answer tests

Creating Answer model tests (before Edward class).
After all the features will merge and we'll have a view.py , I will add more tests.

Add a basic 'Add a question' page using model form

Add a basic 'Add a question' page.
In this issue, the page will not include style, tags, and special content editor - only the basic action of posting a question using model form.
files that need to be modified :

  • home/urls.py
  • home/views.py

new files :

  • home/forms.py
  • home/templates/home/questions/new_question.html

Add JS file to 'new_question' page

Need to do it to display certain fields within a Django form based on the data of another selected field within that same form.
For an example :
If the User chose 'Math' in the subject field, he will only see all the sub-subjects that related to math (such as 'Geomtry' and more...)

Update display-question feature tests

Currently, the test which tests the context response from the display question page is not good.
It uses .startswith() instead of an equal, and the test data it checks is sparse.
Now that we have more test data this test needs to be refactored.

Also, need to create a new test for testing the query param which sorts the answers.

Edit User's test data

  • Add 'Admin' superuser (instead of Lior).
  • Add "BlockedUser" user who is blocked.

These additions are meant to clarify the user's purpose.

Update readme

  1. Change to the new logo.
  2. Remove the broken 'flake8' badge and 'version' badge.
  3. Add open issues badge.

Assign to @liornoy

Create Answers Model and Migrations

Create a DB table for Answers following the table in the ERD which includes:

  • answer_id (PK) (int)
  • user_id (FK) (int)
  • question_id (FK) (int)
  • content (text)
  • publish_date (date)
  • likes_count (int)
  • dislikes_count (int)
  • picture (?)
  • is_edited (boolean)

about the picture column I am not sure which type it should be (URL/File/...), relevant to Questions table to. ( @danitLevi )
I would glad to hear your opinion on this @ifireball.

Add timezone support to all test-data

As for now, we use "naive" datetime for our test data.
for example: datetime(2019, 5, 3, 9, 40, 35)

This causes Django to send warnings when using makemigrations and when using pytest.

Fix for it is adding "tzinfo=pytz.UTC".

Found typo in sub_subjects_test_data

0004_test_data_book_subsubject_subject.py file creates test data for Subject, Sub-subject, and books.

While working on creating more question test data, I encountered an error caused by
a typo (extra white space after the text) in sub_subjects_test_data:

('Geometry ', 'Math'),
...
('Thermodynamics ', 'Physics'),
...
 ('Roman period ', 'History'),

Create 'home' App and replace with 'landingpage'

'landingpage' is a temporary app for holding the demo page used for the first presentation.
Now we'll replace it with a 'home' app that will contain most of the functions and logic of the 'Shlifim'.

The current "landingpage.html" page will be moved to the 'about' view and will be upgraded in the future.

Adding answers to question feature

The feature will allow us to comment on questions.

Tasks:

  1. Add text editor to display-question page (#44 )
  2. Create POST request when submitting, and save the comment in Answers table in the db.
  3. Change the text editor in admin page.

Issues regarding the presentation of models on the admin page

Looking at the models through the admin page, I noticed that:

1. Uniting the User and the Profile models to one page on the admin page

There is a different page for viewing users and viewing profiles which in my opinion should be on the same page because the profile model is an extension for the user model, and has one on one relation.

2. How models are being displayed on the admin page:

In models such 'Book' 'Question', 'Sub-subject', 'Answer' the admin page is showing by default only one column of information, for example for Books it shows only the book's name, but it would be better if it showed the related subject in the same row.

The solutions:

  1. Found this tutorial that shows how to display the Profile information inside the built-in user model page in admin.
  2. Found this StackOverflow thread discussing ModelAdmin classes that enable you to add 'list_display' field which customize the way the admin page displays the data of our models. This way the admin page can be more informative.

Example of the Book model page on the admin page before and after the change

Before:
image

After:
image

Update links in Explore-page

  • Add "add question" button that leads to "add question page" (should be synchronized with @avivz450 )

  • Click on question in explore page leads to the selected question page (should be synchronized with @liornoy )

Add images for the subjects

For each subject add a picture that will be used when presenting a question
with the subject.

The images should be in the 'static' folder inside the 'home' app.

Displaying certain question page feature

This feature is for the page that opens after you click certain questions on the "Explore" page.
The page will display the question, and underneath all the existing answers.
Also, if this page is opened by the user who wrote the question he will have the options to delete and edit.

Tasks:

  1. Add the needed function/class to views.py
  2. Add the route to the urls,py
  3. Create the needed HTML file
  4. Add the needed tests for the feature

The "prototype" design:

image

Update Display-Question tests

Add test for navigating to not-existing question for example: explore/question_999
Add test for entering wrong query param for example: explore/question_2/?sortanswersby=cat

Adding a landing page

User Story:
As a “Shlifim” website user, I want to search or upload questions I may have from homework or assignments I have from school so that I can receive answers, summaries, or sources for my questions.
I'll know I'm done when I managed to find my answer and finish my homework or assignments.

Use Case:
A new user will sign up to the website while a registered user will log in.
Once the user is on the 'Home Page' he will be able to look through the latest questions.
He will be able to search and filter existing questions, add a new question, or add a new answer to an existing question.

For Demo 1 we will create a landing page that includes:

  • Our application logo
  • A brief explanation of the app
  • Coming soon features
  • Team members

Add filter option in "Explore page"

Add filter option to "explore page"
Enable filter questions by :

  • Subject
  • Grade
  • Sub subject
  • Free text
  • Tags
  • Book (including book page and question number)

Install PyTest

make a PR for the installation of PyTest only ,so the team can use it for their tests.

Update links to the Explore-Page

  • Clicking on the "Shlifim" logo in the menu bar leads to Explore-Page
  • Clicking on the "get started" button in Home-page leads to Explore-Page

Fix NOT NULL Constraint in Question model

In the home app, models.py file. the Question model, the 'book' field is set to:

book = models.ForeignKey(Book, on_delete=models.CASCADE, blank=True)

When creating a question without a book Django throws: "NOT NULL constraint failed"
should add null=true to solve this

The same goes for sub_subject field

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.