orionblastar / K666

K666 is forum discussion software, this is an attempt to write the Free version FreeK666 without violating copyright
http://k666.kr5ddit.com
MIT License
5 stars 0 forks source link

Create Template Fragments #13

Closed procrasti closed 8 years ago

procrasti commented 8 years ago

Depends: https://github.com/orionblastar/K666/issues/5 Branch: fragments* (without the *, means see below)

Let's bring all that stuff from the static into the dynamic page, but we'll break it into separate fragments you can include from the index.html page.

  1. create a file called: ./freek666/templates/fragments/welcome_user_fragment.html
  2. copy all the stuff I told you to do in #5, from the templated index.html file into it.
  3. Replace all that in the template/index.html with one line {% include "fragments/welcome_user_fragment.html %}
  4. Add all the html stuff from the static index to the template/index.html file.

----- BEGIN EXAMPLE OF template/index.html -----

<html>
    <head>
        <title>Welcome to K666</title>
    </head>
     <body>
        <h1>Welcome to K666</h1>
        <p>Free Speech as in Open Source.</p>
        {% include "fragments/welcome_user_fragment.html" %}
        <pre>
Welcome to the K666 Open Source Generic Discussion Forum, Feel Free to Fork Anytime:
Git Hub Repository: https://github.com/orionblaster/K666
        </pre>
        <p><a href="/admin">Admin</a></p>
        <p><a href="/index">Index</a></p>
        <p><a href="/login">Accounts Login</a>: but this probably doesn't work?</p>
        <img src="/static/images/up.jpg" />
        <img src="/static/images/down.jpg" />
         <img src="/static/images/FreeK666.png" />
         <img src="/static/images/FreeK666coin.jpg" />
         <div><img src="http://i.imgur.com/B8sO2Hd.jpg" /></div>
         <p>Donations: <a href="https://www.blocktrail.com/BTC/address/1Dy5rLHwt8wk79C6jfH6uRf2bpcVnJtNyQ">bitcoin:1Dy5rLHwt8wk79C6jfH6uRf2bpcVnJtNyQ</a></p>
     </body>
</html>

----- END EXAMPLE OF template/index.html -----

Now probably fragment all of the other stuff out too... examples:

And then maybe even:

----- FINAL EXAMPLE OF templates/index.html -----

<html>
    <head>
        <title>{% include "fragments/title_fragment.html" %}</title>
    </head>
    <body>
        {% include "fragments/page_header_fragment.html" %}
        {% include "fragments/welcome_user_fragment.html" %}
        {% include "fragments/intro_fragment.html" %}
        {% include "fragments/common_links_fragment.html" %}
        {% include "fragments/images_fragment.html" %}
        {% include "fragments/donations_fragment.html" %}
     </body>
</html>

----- END FINAL EXAMPLE OF templates/index.html ----- (please indent it nicely though... posting into github messes that up... how to post blocks of code with correct formatting? would be good to know for kr5ddit too... we probably use the same markup engine!)

Which would be a lot nicer, right?

*: You can push branches into your github repository as follows, full example from fragments

# Clone the repository into a working directory, and change into it
$ git clone https://github.com/orionblastar/K666 k6fragments
$ cd k6fragments

# Branch from mergetest... it's the latest thing... we haven't merged it into master yet... anyway.
$ git branch mergetest

# Create the branch you are going to work on, and switch to it
$ git branch fragments
$ git checkout fragments

# Push the new branch back to the original repository... you can do this at any time, before or after you've made commits for example.
$ git push -u origin fragments

# Now view that branch on github!
procrasti commented 8 years ago

Alright... make sure you create a branch that derives from mergetest, or a branch that mergetest has been merged into (FreeK666)... or just branch directly from mergetest, that will also work fine.

so:

git clone http..... && cd git checkout mergetest git branch fragments git checkout fragments

I'll assign this one to you to work on... let me know if you have any questions.

procrasti commented 8 years ago

Don't branch from mergetest now... branch direct from master!

$ git clone http... && cd...
$ git branch fragments
$ git checkout fragments

# make the branch in github
$ git push -u origin fragments

Make the above changes.

$ git commit
$ git push
orionblastar commented 8 years ago

Did we push mergetest into master yet? I don't remember doing that. Did you? Just wanting to know if master has all of the latest changes or if it is still in mergetest?

procrasti commented 8 years ago

Yes... I merged mergetest into master... and into FreeK666 (the branch!)... I still have problems merging master into FreeK666 (and vice versa) without getting the README.md file changes!! I'm sure it can be done... just can't work it out right now... but yeah, continue branch fragments from master would be best.

orionblastar commented 8 years ago

OK I am working on master and changed the branch to fragments. Haven't checked it in yet as I am going to test it out first and then see if it works.

orionblastar commented 8 years ago

OK I think I made all of the changes, but it still goes to static/index.html instead of the template one.

orionblastar commented 8 years ago

OK I checked into the fragments branch, can't see my changes or if I did anything right.

procrasti commented 8 years ago

OK I think I made all of the changes, but it still goes to static/index.html instead of the template one.

Yeah, don't worry... we can fix this in freek666/urls.py

OK I checked into the fragments branch, can't see my changes or if I did anything right.

Dude, I see it... it's the fragments branch... you can see it in the code section, but you have to select the right branch. It looks good, but I'm trying it now!

procrasti commented 8 years ago

Okay... So, I did a little tidying up, and I've merged it into master now... Great Job!

So, PLEASE CLOSE THIS ISSUE!

Then go work on adding user signup: https://github.com/orionblastar/K666/issues/8

orionblastar commented 8 years ago

Issue is closed, what next?

procrasti commented 8 years ago

what next?

User SignUp: https://github.com/orionblastar/K666/issues/8