dPoll bug fixes: Content editing fixes and table representation on Markdown

in #utopian-io5 years ago (edited)

resim.png

dpoll.xyz
Source code: github repository

What was the issues?

1-The expire_at field is incorrectly set when editing.

This information was sent from the discord channel.
493149983c472980f4fd11e89256d9272dcfc7ec.png

  • Poll options include 1 week and 1 month. This is the time allowed to vote in the poll. A poll page is updated. It is automatically set to 1 month regardless of user preference.

2-Markdown type table data is not shown.

This information was sent from the discord channel. But it was advanced through github.

https://github.com/emre/dpoll.xyz/issues/67

  • When you create a table with Markdown, it occurs smoothly by the editor. However, there is no table support in html conversion in backend codes.

What was the solution?

1 - Fixed : https://github.com/emre/dpoll.xyz/pull/58

@property
def expire_at_humanized(self):
    diff_in_days = (self.expire_at - self.created_at).days
    if diff_in_days == 7:
        return "1_week"
    else:
        return "1_month"

The result of this value(diff_in_days) is generally around 6.95. The value of 6 is accepted because it is questioned as the day. I needed a proper check here. I updated the query as 7 days or less.

if diff_in_days <= 7:

  • I also removed an unnecessary variable.

2 - Fixed : https://github.com/emre/dpoll.xyz/pull/69

  • I've added table support at the backend.

md.markdown(value, extensions=['markdown.extensions.fenced_code', 'markdown.extensions.tables'])

  • I added the class to the table element for bootstrap framework.

$('table').addClass('table'); ( I love jquery.)

Related pull requests

https://github.com/emre/dpoll.xyz/pull/58
https://github.com/emre/dpoll.xyz/pull/69

Sort:  

Hello @tolgahanuzun!

Thanks for your contribution.

  • The first bug was weird, good catch.
  • Table representation on markdown was needed for sure.

A small note for Utopian compability:

  • We expect more volume in the contributions. But, I am kinda guilty for that, I know
    you have 2 more pull requests waiting for review.

  • You may work on the format and language for your next submissions.

Keep developing!


Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]

I have to improve myself on language. Big deficiency for me. Thank you.

Thank you for your review, @emrebeyler! Keep up the good work!

Thanks for contributing to the dPoll content.

You have been upvoted from our community curation account (@dpoll.curation) in courtesy of This Guy... @bluerobo.

Come, join our community at dPoll discord server.


If you want to support dPoll curation, you can also delegate some steem power. Quick steem connect links to delegate:
50SP | 100SP | 250SP | 500SP

Upvoted!

Hey @tolgahanuzun, not sure if you're aware of this, but, because you have a Steemit reputation of 60, you qualify for $80 in Byteball (GBYTE) just for verifying your Steem username. They're giving it away to all users with a reputation of 45 and more.

Byteball is listed on CoinMarketCap and is traded on Bittrex, so you can sell all the GBYTE you get RIGHT AWAY.

To get YOUR FREE $80 (it only takes a few minutes), follow the instructions here:
https://steemit.com/byteball/@rpw/how-to-claim-usd10-in-free-byteball-bytes-gbyte-right-away

Tens of thousands of Steemit users have verified their accounts this year, and if you were not one of them, this is your shot!

Happy holidays:)

Hi @tolgahanuzun!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your post is eligible for our upvote, thanks to our collaboration with @utopian-io!
Feel free to join our @steem-ua Discord server

Hey, @tolgahanuzun!

Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Get higher incentives and support Utopian.io!
Simply set @utopian.pay as a 5% (or higher) payout beneficiary on your contribution post (via SteemPlus or Steeditor).

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!

Coin Marketplace

STEEM 0.29
TRX 0.12
JST 0.032
BTC 63207.78
ETH 3068.52
USDT 1.00
SBD 3.87