dPoll bug fixes: Content editing fixes and table representation on Markdown
utopian-io·@tolgahanuzun·
0.000 HBDdPoll bug fixes: Content editing fixes and table representation on Markdown
 [dpoll.xyz](dpoll.xyz) Source code: [github repository](https://github.com/emre/dpoll.xyz) *What was the issues?* ## 1-The expire_at field is incorrectly set when editing. This information was sent from the discord channel.  - 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
👍 ezravandi, curbot, bitok.xyz, phatima, steem.create, ctime, bluerobo, hanke, feronio, tahirozgen, bulent1976, amosbastian, jaff8, asaj, bluesniper, tobias-g, leir, statsexpert, dpoll.curation, hakancelik, kevinwong, samedb, ali.yuce, travelfund, grand.strategy, dpoll.sponsors, dpoll.funds, tombstone, arconite, nurhayati, mcfarhat, curation.trail, filmfanatic, peyloride, miniature-tiger, tolgahanuzun, scipio, loshcat, greenorange, fatihgul, mvanyi, steem-ua, newsrx, priyankachauhan, tensor, bejust, shaka, vannour, obvious, misan, astrophoto.kevin, steemworld, tineschreibt, bearded-benjamin, hmtsyhn, tdre, ryuna.siege, xinvista, jjay, scienceangel, utopian-io, jga,