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
Added new page for tagged content by a single author with '/tag/:tagname/author/:authorname' #1872
Conversation
Generated by 🚫 Danger |
This old code tried to do this! plots2/app/controllers/notes_controller.rb Lines 264 to 272 in 8069e30
Let's update this or replace it with your new code. Great! |
@jywarren I have made a commit can you please view it. At my localhost:3000 it is working properly. |
@jwarren I am little confused about this commit. What are we trying to build? |
app/controllers/tag_controller.rb
Outdated
@wildcard = true | ||
end | ||
@tagname = params[:id] | ||
@user = DrupalUser.find_by(name: params[:author]) |
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.
Can we just search User.find_by
here, not DrupalUser
which we're trying to reduce usage of (and eliminate)? Thanks!
app/models/tag.rb
Outdated
@@ -239,7 +239,6 @@ def self.trending(limit = 5 , start_date = DateTime.now - 1.month , end_date = D | |||
#select nodes by tagname and user_id | |||
def self.tagged_nodes_by_author(tagname, user_id) | |||
if tagname[-1..-1] == '*' | |||
@wildcard = 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.
Ah, we use this to disable some things that don't currently work with wildcard searches... so maybe preserve this unless we're sure that the whole page works identically for normal tags and wildcard queries?
@@ -0,0 +1,43 @@ | |||
<% if params[:controller] == "tag" || params[:controller] == "search" %> |
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.
Was there not an efficient way to use the same show.html.erb
template, and adapt it using one of these if/else
statements for displaying posts by a single author?
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.
Perhaps anything that doesn't currently work with just one author, like the other tabs, could be disabled by checking the params[:action]
to see if this is an instance of an author-specific tag show page and not just a normal one?
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 will try to change it
@@ -185,6 +185,19 @@ def setup | |||
assert_select '#wiki-content', 1 | |||
end | |||
|
|||
test 'show note with author and tagname without wildcard' do |
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.
These look great. Awesome job on the tests.
Sorry, just getting to this after the backlog over the new year. I made some requests above. The bigger goal here is to make it possible to list completed activities on peoples' profiles. When you complete an activity and post a response, it's tagged
Then, we can:
Does this make sense?
Do you mean wiki likes? Sorry, what section of code? Regarding pagination of 30, i agree! We can change it to 24 if you want to open a new PR. |
This |
The idea of the tag page wiki button is that if there's a wiki page whose URL matches the tagname, like /wiki/gsoc for tag
Are you sure? i just tried this for /wiki/abcdef and it worked for me -- presented me a blank wiki page form. It looks like your |
Ok, got it. I checked it again after logging out and then logging in again. Then, it worked. It is not displaying the login page. Thanks... |
|
I would leave blank the translations you don't know for sure. Also, were
you able to consolidate the template with the existing tag show template
then? Cool!
…On Jan 10, 2018 5:10 PM, "Sidharth Bansal" ***@***.***> wrote:
[image: image]
<https://user-images.githubusercontent.com/20972099/34798020-63e896f8-f680-11e7-8c91-9e136681c24e.png>
[image: image]
<https://user-images.githubusercontent.com/20972099/34798032-711fac62-f680-11e7-8bd5-07a2db3535e0.png>
[image: image]
<https://user-images.githubusercontent.com/20972099/34798073-9a0b84a2-f680-11e7-8970-8815b41034a8.png>
[image: image]
<https://user-images.githubusercontent.com/20972099/34798083-a660ea58-f680-11e7-9ab3-e733c92c8f52.png>
I think it is working fine. As per your suggestion I have disabled the
buttons which are not needed in this with a tooltip.
I have used the google translator for the locale files. I don't know
Dutch. Hope it works.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1872 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABfJwHFFN9XBLISKm_CZ-08yogQZh_yks5tJTUbgaJpZM4Q-Aw2>
.
|
Indeed you did! This looks great; is it ready? Want to throw in a functional test to confirm this at least loads successfully in tests? This will protect your code from future issues too. Awesome! |
config/locales/views/tag/show/de.yml
Outdated
@@ -18,3 +18,4 @@ de: | |||
no_results_found: "Keine Ergebnisse gefunden; versuchen, für '<b>%{tag}</b>' Suche" | |||
try_advanced_search: "Oder versuchen Sie eine <a href='%{url1}'>erweiterte Suche</a>" | |||
contributors: "Mitwirkende" | |||
tagged_by: "Notities getagd met \"%{tags}\" door <a href='%{url1}'>%{user_name}</a>" |
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.
Let's remove this, and let it default to English, ok? Thanks!
Just one more tweak to leave the German translation blank, and we'll be good to merge! |
Thanks, this is exciting! |
Amazing. This is a great implementation. 🎉 🎈 |
I hope we'll deploy it today and then we can check http://publiclab.org/tag/replication:*/author/warren -- and then make a link to it from the profile page. Thank you!!! |
@jywarren Just thinking, it will be better not to display "has no lead wiki " for power tags. Because even though Gsoc wiki page exists, searching /tag/Gsoc* gives us that it leads to no wiki page. I think, if a person is searching for power tag, then he/ she should get a message that "Enter a tag instead of power tag to get related wiki pages" or we can remove the lead wiki section when there is a power tag type search. |
I think i agree -- we could could truncate the * and just lead to Same with the link from profile page. I think we could show a count and link with a fourth column where it displays questions, answers, and comments. What do you think? |
I think truncating is not a better option. Reason -- if a lazy person who knows a little code writes |
This is really great. There have been many times when I have wanted to use something like this. I added some links to my profile with this type of search. Thanks much. |
The link to the author's profile at the author's tag result page is broken, e.g., "Notes on ndvi by cfastie" on this page: https://publiclab.org/tag/ndvi/author/cfastie |
@Fastie thanks, I will change it |
…ame/author/:authorname' (publiclab#1872) * Added new page for tagged content by a single author(Resolves publiclab#1854) * Added show_for_author view and action * Added Tests * Modified controller and model * Modified controller and view * Changed the view * Views corrected * Fixed I18n * Controller test modified * Testing improved * Tests improved * Localisation removed
fixes #1854
This'll allow:
http://publiclab.org/tag/replication:*/author/warren would show all replications by author
warren
!Progress: