-
-
Notifications
You must be signed in to change notification settings - Fork 773
pitch pages #753
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
pitch pages #753
Conversation
| @@ -0,0 +1,51 @@ | |||
| <script id="idea_template" type="text/x-jsrender"> | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this file needs to be formated properly ...
app/retail/views.py
Outdated
| github_username=request.POST.get('githubUsername'), | ||
| summary=request.POST.get('summary'), | ||
| more_info=request.POST.get('moreInfo'), | ||
| looking_for_capital=True, #request.POST.get('lookingForCapital') returns 'fasle' or 'true' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no idea how to serialize properly javascript's true/false to python's True/False, any ideas?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per this
looking_for_capital = True if request.POST.get('lookingForCapital') == 'true' else False
or
looking_for_capital = request.POST.get('lookingForCaptail') == 'true'
could be good solutions? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah i saw this solution, i wonder if there is another...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean framework should provide proper deserializer, no manual checks spread across the code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Imma try this tomorrow: https://stackoverflow.com/questions/15476983/deserialize-a-json-string-to-an-object-in-python
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neat that looks a lot cleaner 👍🏻
Codecov Report
@@ Coverage Diff @@
## master #753 +/- ##
==========================================
+ Coverage 30.25% 30.43% +0.17%
==========================================
Files 125 126 +1
Lines 9013 9102 +89
Branches 1157 1161 +4
==========================================
+ Hits 2727 2770 +43
- Misses 6178 6224 +46
Partials 108 108
Continue to review full report at Codecov.
|
|
Actual implementation fetches disqus thread's data on client side (most recent values, api limits may be exceeded) and there are no likes and posts counts in model so there is no way to perform sort. To provide sorting functionality these values should be placed in model but syncing them with disqus may be problematic. I can think of two syncing modes:
@mbeacom , @owocki does actual implementation or any of syncing modes satisfy You ? |
|
Looks great!!! :D I defer to @owocki and @mbeacom but think option number 2 of values are updated during ideas list/idea fetch would be interesting to run with to start. Nice to have those recent values as part of feedback to the user and I don't think we'll be bumping up against API limits to start 🤔 |
|
I'll take a look at webhook later but seems like it's triggered only by new comments. Unfortunately, webhooks are only available for WordPress plugin... |
|
So if we want that kind of sorting we need to somehow sync our model with disqus threads data. As @mkosowsk suggested, fetchin disquss threads data right before ideas list fetch might not have a big impact at start (disqus api max page size of 100), but as soon as we hit 200, 300, 400+ ideas on list requests times will get longer. I think we can defer this optimization. So if we stick with this solution then when request hits ideas/fetch following actions will be taken:
|
hopefully there is an API and we can just refresh the model to the disquis data on the serverside and not have to do it everytime a user hits the page |
7bff4c2 to
df128cd
Compare
|
syncing will occur every 10 minutes |
|
very excited for this.. let me know when ready to test |
|
@owocki 🏁 ready to test |
|
@owocki hold on, I'll add i18n. |
|
@owocki finally 🏁 |
| """Define the structure of idea""" | ||
| full_name = models.CharField(max_length=255) | ||
| email = models.EmailField(max_length=255) | ||
| github_username = models.CharField(max_length=255) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it might be better to reference profile here in order to remove redundancy but I see avatar_url spread across models. What do You think? Maybe refactor in another PR ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kziemianek Ideally, if we could reference profile and add a related name for reverse as: ideas, that would be 👍
|
No further work planned but labeled as WIP :) |
|
@owocki @mbeacom @thelostone-mc few fixes in last commits:
fixed
the command should update this value, it gets updated after a while, you want it updated right after hitting hearth ?
changed label to github login
fixed
unfortunetly I cannot reproduce this problem
cool! fixed :)
there is a link in navbar, should i add next?
changed to ideas/
changed to ideas/ideas/... what is slug? |
can we change to slug == the |
|
sweet looking fwd to testing now |
|
@owocki sorry the url is |
|
@thelostone-mc, i made some changes according to Your comments, thanks a lot :)
i've described it in last comment
i've described it in last comment
You mean these dropdowns with search built-in ?
Changed it to Muli
does this meet your expectations ?
definetly yes!
added - for empty has and needs |
Yup! We'll throw in the dropdown without search later and update this then @kziemianek looks better ^_^ |
|
@thelostone-mc I also updated select to use jquery select2 with hidden search box. |
|
@mbeacom are we waiting for something? have you seen my last comments :) ? |
mbeacom
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally, lgtm. Deploying to staging.
app/retail/views.py
Outdated
| designers_exists = bool(request.POST.get('designers_exists')) | ||
| customer_exists = bool(request.POST.get('customer_exists')) | ||
| profile = request.user.profile if request.user.is_authenticated else None | ||
| idea = Idea(full_name=full_name, email=email, github_username=github_username, summary=summary, more_info=more_info, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
v2 we should probably move this to a form.
|
Also, I |
|
@mbeacom i bet duplicated idea was dropped to next page after another idea becoming more trending, so it was returned by paginator again. As a workaround, I can add check to ensure only one idea with given |
app/assets/v2/js/pages/ideas_list.js
Outdated
|
|
||
| function loadMoreIdeas() { | ||
| fetchIdeas(++pageIdx, pageSize, sorting(), (result) => { | ||
| console.log('test'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unexpected console statement. (no-console)
app/retail/views.py
Outdated
| designers_exists = bool(request.POST.get('designers_exists')) | ||
| customer_exists = bool(request.POST.get('customer_exists')) | ||
| profile = request.user.profile if request.user.is_authenticated else None | ||
| idea = Idea(full_name=full_name, email=email, github_username=github_username, summary=summary, more_info=more_info, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E501 line too long (124 > 120 characters)
| from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator | ||
| from django.core.validators import validate_email | ||
| from django.http import HttpResponse, JsonResponse | ||
| from django.http import HttpResponse, HttpResponseRedirect, JsonResponse |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
F401 'django.http.HttpResponse' imported but unused


Refs: #506
Description
Add pitch pages as described #506
Checklist
Affected core subsystem(s)
Testing
Performed manual local tests.
Refers/Fixes
Refs #506