Online store on Steemit blockchain| Step sixteen | Templates: Profile

in Steem Alliance2 years ago

Hello, friends!

Step 16.jpg

Today we will design a profile page. So that our avatar and our nickname are displayed. We will also make a simple grid for displaying information. We will also display two buttons. Those who subscribe and those we subscribe to. But we will work with subscribers in the next post. Today there will be only a profile.

As always, we create paths and import our views. Next, we will create our views.

Screenshot_35.png

First two paths. This is the separation between your profile and the user. Which I wrote about in previous posts.
The third way and the fourth is who you are following and who is following you.

Now let's go to our views and write our views.

Screenshot_36.png

Views are created in the market folder in the view file.

Screenshot_37.png

These representations are necessary for the correct display of the profile. Now we need to write two more views for Subscriber and Subscriptions.

We need this so that we can mark up the buttons and there are no errors on the profile page.

Screenshot_39.png

Everything is quite simple there. If we can’t subscribe to someone, we get an error and a 404 page. If everything is fine, then we subscribe to the user.

Now I propose to move from backend to frontend.
As always, we start by adding our integrations of the base template and our navbar.

Screenshot_40.png

Next, we need to create an if function and use it to separate what users see and what an authorized user sees.

Screenshot_41.png

Now we display our nickname, as well as create subscription buttons.

Screenshot_42.png

I haven't forgotten much about the avatar and I'm correcting myself on this. It comes out like this.

Screenshot_43.png

Now, in approximately the same way, we display our profile for other users who decide to visit our page.

Screenshot_44.png

Now the most interesting. We are creating a subscribe and unsubscribe button.

Screenshot_45.png

After that, we make a separate section in which we put our Biography and our nickname just for example. You can display any data that was registered in the profile model.

Screenshot_46.png

This is also done through an if function in order to separate what users see from what the user sees.

Screenshot_47.png

Great!
Now we can see what we got.

Screenshot_48.png

Thanks for supporting the project.

@rme , @rex-sumon , @shy-fox , @hungry-griffin, @pennsif

The project is being created in partnership with @steemit-market.

Above may be wrong. Since I wrote the code from memory and then corrected it. But git will have no errors.

Link to the git.

steem blockchain.jpg

You can get acquainted with the project here.

You can find all parts of the projects by the tag: #storeonsteemit

To be continued...

Sincerely, your HardPhotographer

Sort:  

Thank you, friend!
I'm @steem.history, who is steem witness.
Thank you for witnessvoting for me.
image.png
please click it!
image.png
(Go to https://steemit.com/~witnesses and type fbslo at the bottom of the page)

The weight is reduced because of the lack of Voting Power. If you vote for me as a witness, you can get my little vote.

Upvoted! Thank you for supporting witness @jswit.

Coin Marketplace

STEEM 0.17
TRX 0.15
JST 0.028
BTC 61651.16
ETH 2369.36
USDT 1.00
SBD 2.50