Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

html refined! no inline #74

Closed
wants to merge 3 commits into from
Closed

Conversation

gauravrock
Copy link
Contributor

Thank You for your contribution to the PyJudge

  • My title is a short description of what I am trying to do
  • I have mentioned all the issues I am fixing
  • Proposed changes
  • All the inline elements are removed from the indx.html file and added to styles.css thereby resolving the issue Clean up HTML and CSS #70

Copy link
Member

@theSage21 theSage21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CSS stands for Cascading Style Sheets. In other words, styles which are common to a lot of elements need to be defined only once (maybe in a class/element tag etc).

In this PR p1, p2 both have common elements. Let's move that into a common p tag style? Then p1 and p2 can be just the differences. Similarly inp1 and inp2.

@gauravrock
Copy link
Contributor Author

CSS stands for Cascading Style Sheets. In other words, styles which are common to a lot of elements need to be defined only once (maybe in a class/element tag etc).

In this PR p1, p2 both have common elements. Let's move that into a common p tag style? Then p1 and p2 can be just the differences. Similarly inp1 and inp2.

i'll do it but there is a problem with loading css file it gives 404 error. yesterday, it was working fine & now it give:
screenshot 2019-01-29 at 12 45 52 pm

@theSage21
Copy link
Member

theSage21 commented Jan 29, 2019 via email

@gauravrock
Copy link
Contributor Author

gauravrock commented Jan 29, 2019

Why is a static file starting with question prefix?

On Tue 29 Jan, 2019, 12:46 Gaurav sharma @.*** wrote: CSS stands for Cascading Style Sheets. In other words, styles which are common to a lot of elements need to be defined only once (maybe in a class/element tag etc). In this PR p1, p2 both have common elements. Let's move that into a common p tag style? Then p1 and p2 can be just the differences. Similarly inp1 and inp2. i'll do it but there is a problem with loading css file it gives 404 error. yesterday, it was working fine & now it give: [image: screenshot 2019-01-29 at 12 45 52 pm] https://user-images.githubusercontent.com/23530368/51891020-d6273780-23c3-11e9-991f-339897411ff2.png — You are receiving this because your review was requested. Reply to this email directly, view it on GitHub <#74 (comment)>, or mute the thread https://github.com/notifications/unsubscribe-auth/AHVj0VtwMvtTj_5W9_rH3brYgCx_My0aks5vH_VIgaJpZM4aWLZr .

i think someone has messed with the path..is that the case??? because my present directory is correct
screenshot 2019-01-29 at 1 19 53 pm

and i entered the correct url!! http://localhost:8080/question/1

@theSage21
Copy link
Member

theSage21 commented Jan 29, 2019

  • I meant the URL /question/css/index.css. Why does it have question in the beginning?
  • Nobody can mess with your path. Unless you have a little sister who has access to your laptop/desktop. Path is dependent on the machine that is running the code.
  • There is no way you could have gotten the css files yesterday since Serve the css file for the statement page #17 is still open.
  • You probably accessed the html file directly in which case it would have worked. For example file:///home/arjoonn/PyJudge/index.html in my browser will work fine.
  • Also, could you paste actual text instead of images? You can read about markdown to see how you can include code.

@gauravrock
Copy link
Contributor Author

  • I meant the URL /question/css/index.css. Why does it have question in the beginning?
  • Nobody can mess with your path. Unless you have a little sister who has access to your laptop/desktop. Path is dependent on the machine that is running the code.
  • There is no way you could have gotten the css files yesterday since Serve the css file for the statement page #17 is still open.
  • You probably accessed the html file directly in which case it would have worked. For example file:///home/arjoonn/PyJudge/index.html in my browser will work fine.
  • Also, could you paste actual text instead of images?
  • my question is why running the command python server.py and then http://localhost:8080/question/1 only shows the static page bcz yesterday it was working fine by doing the same.
  • however, I am able to see all the embed CSS in HTML file:///Users/apple/Desktop/project/PyJudge/index.html. but the thing that is not running the project.
  • and one more doubt do you want me to put p1 & p2 tag to share the same elements.

@theSage21
Copy link
Member

would you like to open an issue for this problem that you are having? We can discuss it there

@gauravrock
Copy link
Contributor Author

would you like to open an issue for this problem that you are having? We can discuss it there

  • sure, what about this PR?

@gauravrock gauravrock mentioned this pull request Jan 29, 2019
1 task
@theSage21
Copy link
Member

theSage21 commented Jan 29, 2019 via email

@gauravrock
Copy link
Contributor Author

The changes mentioned. Just work in that if you want

On Tue 29 Jan, 2019, 14:27 Gaurav sharma @.*** wrote: would you like to open an issue for this problem that you are having? We can discuss it there - sure, what about this PR? — You are receiving this because your review was requested. Reply to this email directly, view it on GitHub <#74 (comment)>, or mute the thread https://github.com/notifications/unsubscribe-auth/AHVj0VRV_DsHLea3ghf3csqXTIhW3DMHks5vIAztgaJpZM4aWLZr .

  • I am not able to understand the above-mentioned changes.

@theSage21
Copy link
Member

Think about it like this. If you were told to write a function to return squares of numbers between 1 to 3 and cubes for numbers from 3 to 5, one way of doing it would be:

def square(x):
    if x == 1:
        return 1
    if x == 2:
        return 4
    if x == 3:
        return 9
    if x == 4:
        return 64
    if x == 5:
        return 125

This is similar to assigning all items in the HTML a special class/id and styling that. A cleaner way would be to do this:

def square(x):
    if 1<= x <= 3:
        return x * x
    if 3 < x <= 5:
        return x * x * x

This is what the change requests to do. You must write a CSS file that avoids special cases. For example, margins/padding/font/text size/ text alignment and so on can be made common. They can be specified once and it will be applied everywhere.

index.html Outdated Show resolved Hide resolved
@theSage21
Copy link
Member

This work will have to be done again on top of the current master branch or rebased. Please open this PR once again if you rebase or create a new one if you do it in a new branch.

@theSage21 theSage21 closed this Feb 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants