Skip to content
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

Fix typos and indentation in _queue.html.erb #11009

Closed
5 tasks
Somya-Singhal opened this issue Apr 9, 2022 · 13 comments
Closed
5 tasks

Fix typos and indentation in _queue.html.erb #11009

Somya-Singhal opened this issue Apr 9, 2022 · 13 comments
Labels
first-timers-only They need to be well-formatted using the First-timers_Issue_Template.

Comments

@Somya-Singhal
Copy link
Contributor

Somya-Singhal commented Apr 9, 2022

💡Format this Issue Into a First Timers Issue

This has been marked as a good candidate for becoming a first-timers-only issue like these, meaning that it's simple, self-contained, and with some extra formatting✍️, could be a great entry point for a new contributor. If you're familiar enough with this code, please consider reformatting it as a first-timers-only issue, and then ping @publiclab/reviewers to get it labelled🏷. Or, if this is not your first time, try to solve it yourself🧑‍💻!


Hi, this is a first-timers-only issue. This means we've worked to make it more legible to folks who either haven't contributed to our codebase before, or even folks who haven't contributed to open source before.

If that's you, we're interested in helping you take the first step and can answer questions and help you out as you do. Note that we're especially interested in contributions from people from groups underrepresented in free and open source software!

We know that the process of creating a pull request is the biggest barrier for new contributors. This issue is for you 💝

If you have contributed before, consider leaving this one for someone new and looking through our general help wanted issues. Thanks!

🤔 What you will need to know.

Nothing. This issue is meant to welcome you to Open Source :) We are happy to walk you through the process.

📋 Step by Step

  • 🙋 Claim this issue: Claim the issue by commenting. If someone else has claimed it, ask if they've opened a pull request already and if they're stuck -- maybe you can help them solve a problem or move it along!
💡 Learn how to claim 🙋

Claiming an issue

Unless the issue is marked as reserved for someone, you can just say "I'd like to try this!" and then you've claimed it - no need to wait for someone to assign it to you. Just be sure you link your pull request (PR) to this issue so we can see where your solution is.

And open one early if possible - even before you've completed it with additional commits - and others can help you figure out any issues you may face.

  • 📝 Update the file $FILENAME in the $REPO repository (press the little pen Icon) and edit the line as shown below.

See this page for some help in taking your first steps!

Where to look for this issue?

https://github.com/publiclab/plots2/blob/main/app/views/spam2/_queue.html.erb

Below is a "diff" showing in red (and a -) which lines to remove, and in green (and a +) which lines to add:

 <script>
-$(document).ready(function () {
-	var table = table_main("#queue_table");
-	$("#all").click(function () { //select all button
-		select_all();
-  });
-	$("#batch-spam").bind('click', function (e) { //batch spam
-		batch_nav("batch_spam");
-  });
-	$("#batch-publish").bind('click', function (e) { //batch publish
-		batch_nav("batch_publish");
-	});
-	$("#batch-ban").bind('click', function (e) { //batch ban
-		batch_nav("batch_ban");
-	});
-	$("#batch-unban").bind('click', function (e) { //batch unban
-		batch_nav("batch_unban");
-	});
-	$("#delete-batch").bind('click', function (e) { // batch delete
-		batch_nav("batch_delete");
-	});
- });
+  $(document).ready(function () {
+    var table = table_main("#queue_table");
+    $("#all").click(function () { //select all button
+      select_all();
+    });
+    $("#batch-spam").bind('click', function (e) { //batch spam
+      batch_nav("batch_spam");
+    });
+    $("#batch-publish").bind('click', function (e) { //batch publish
+      batch_nav("batch_publish");
+    });
+    $("#batch-ban").bind('click', function (e) { //batch ban
+	batch_nav("batch_ban");
+    });
+    $("#batch-unban").bind('click', function (e) { //batch unban
+	batch_nav("batch_unban");
+    });
+    $("#delete-batch").bind('click', function (e) { // batch delete
+	batch_nav("batch_delete");
+    });
+   });
</script>

<div class="py-3 pl-3 w-100">
  <% if @tags_followed.length == 0 %> 
    <span class="text-secondary">You are not following any tag, Click <a class="badge badge-pill badge-info" href="/subscriptions">here</a> to follow. </span>
  <% else %>
    <a class="fa fa-plus-circle text-info" href="/subscriptions"> </a> 
  <% end %>
  <% @tags_followed.limit(20).each do |tag| %>
    <a class="btn btn-xs my-1 btn-<% if params[:tag] ==  tag.tagname %>info<%else%>light border<%end%> border-curve" href="/spam2/queue/filter/<%= tag.tagname %>"><%= tag.tagname %> <span class="badge badge-pill badge-<% if params[:tag] ==  tag.tagname %>light<%else%>info<%end%>" data-toggle="tooltip" data-placement="top" title="Filter Nodes by Tag"><%= Tag.followers(tag.tagname).where('rusers.role = ?', 'moderator').or(Tag.followers(tag.tagname).where('rusers.role = ?', 'admin')).size %></span></a> 
  <% end %>
  </div>
<div class="card" id="table-card">
  <div class="bg-light navbar navbar-expand">
    <ul class="nav navbar-expand navbar-nav-scroll">
      <li class="nav-item">
        <a class="btn nav-link text-secondary" data-toggle="tooltip" data-placement="top" title="Selected per page"> Selected <span id="select-count" class="badge badge-dark">0</span></a>
      </li>
      <li class="nav-item">
        <a href="/spam2/queue/filter/everything" class="btn nav-link  <% if params[:tag] == "everything" %> active<% else %> text-secondary<% end %>"><i class="fa fa-arrow-circle-o-up <% if params[:tag] == "everything" %> text-dark<% else %> text-secondary<% end %>" data-toggle="tooltip" data-placement="top" title="All Nodes which you are following"></i> All Tags</a>
      </li>
    </ul>
  </div>
  <div class="card-body" style="overflow-x:hidden;">
    <% unless @queue.empty? %>
    <div class="my-0 text-secondary small "><%= page_entries_info(@queue) %>s</div>
    <% end %>
    <table  id="queue_table" class="nowrap table table-hover" style="width:100%; text-align:left">
      <thead style="text-align:left;">
        <tr>
          <th><input type="checkbox"  id="selectall"/></th>
	  <th style="width:250px !important;"><%=translation('users.profile.title')%></th>
	  <th>Author</th>
          <th>Updated at</th>
          <th>Action</th>           
        </tr>       
      </thead>
      <tbody> 
        <% @queue.each do |node| %>
          <tr id="n<%= node.id %>">
            <td><input  class="selectedId" value="<%= node.nid %>" type="checkbox" /></td>
            <td style="width:250px !important;">
              <% if node.status == 1 %><i class="fa fa-check text-success"></i> <% elsif node.status == 0 %><i class="fa fa-ban text-danger"></i> <% elsif node.status == 4 %><i class="fa fa-circle text-primary"></i> <% end %> <% if params[:type] == 'flagged'%> <i class="fa fa-flag text-warning"><% end %>
              <a href="javascript:void(0);" class="text-dark font-weight-bold" id="node-hover" data-toggle="modal" data-target="#ninfo<%= node.id %>"><%= node.title.truncate(25) %></a><br />
               <span class="text-secondary small"><%= node.type.capitalize %> | <%= time_ago_in_words(node.created_at) %> ago</span>
            </td>
            <td>
              <a href="/profile/<%= node.author&.name %>" class="text-info"><%= node.author&.name.truncate(15) %></a><br>
               <span class="text-secondary small"><%= Node.where(uid: node.author&.id).count %> Nodes<span> <%= node.author&.new_contributor%>
             </td>
             <td> 
               <span class="text-dark"><%= time_ago_in_words(node.updated_at) %> ago</span>
            </td>
             <td>
               <a class="btn btn-xs border-curve font-weight-bold btn<% if node.status != 1 %>-success<% else %>-secondary disabled<% end %> publish" data-remote="true" href="/moderate/publish/<%= node.id %>" ><i class="fa fa-check-circle fa-white"></i> Publish post</a>
               <a class="btn btn-xs border-curve font-weight-bold btn<% if node.status != 0 %>-danger<% else %>-secondary disabled<% end %> spam" data-remote="true" href="/moderate/spam/<%= node.id %>"><i class="fa fa-ban fa-white"></i> Spam post</a> 
               <a class="btn btn-xs border-curve font-weight-bold btn-secondary ban a<%= node.author.id %>" <% if node.author.status == 0 %>style="display:none;"<% end %> data-remote="true" href="/ban/<%= node.author.id %>">Ban user</a>
               <a class="btn btn-xs border-curve font-weight-bold btn-secondary unban a-unban<%= node.author.id %>" <% if node.author.status == 1 %>style="display:none;"<% end %> data-remote="true" href="/unban/<%= node.author.id %>">Unban user</a>
               <a class="btn btn-xs border-curve font-weight-bold btn-warning unflag <% if node.flag == 0 %>disabled <% end %>" data-remote="true"href="/moderate/remove_flag_node/<%= node.id %>"> Unflag</a>
               <%= link_to "/notes/delete/#{node.id}", data: { confirm: "Are you sure you want to delete #{node.path}?" }, :remote => true, :class => "btn border-curve btn-sm font-weight-bold btn-light delete" do %>
                <i class="fa fa-trash text-dark"></i>
               <% end %>
               <script>
                $('#n<%= node.id %> .delete').bind('ajax:success', function(e){
                  $('#n<%= node.id %>').fadeOut()
-                 noyNotification('relax', 3000, 'danger', 'topRight', 'Node deleted');
+                 notyNotification('relax', 3000, 'danger', 'topRight', 'Node deleted');
                });
                $('#n<%= node.id %> .publish').bind('ajax:success', function(e){
                  $('#n<%= node.id %>').hide()
                  notyNotification('relax', 3000, 'success', 'topRight', 'Node published');            
  • 💾 Commit your changes

  • 🔀 Start a Pull Request. There are two ways how you can start a pull request:

  1. If you are familiar with the terminal or would like to learn it, here is a great tutorial on how to send a pull request using the terminal.

  2. You can also edit files directly in your browser and open a pull request from there.

  • 🏁 Done Ask in comments for a review :)

Please keep us updated

💬⏰ - We encourage contributors to be respectful to the community and provide an update within a week of claiming a first-timers-only issue. We're happy to keep it assigned to you as long as you need if you update us with a request for more time or help, but if we don't see any activity a week after you claim it we may reassign it to give someone else a chance. Thank you in advance!

If this happens to you, don't sweat it! Grab another open issue.

Is someone else already working on this?

🔗- We encourage contributors to link to the original issue in their pull request so all users can easily see if someone's already started on it.

👥- If someone seems stuck, offer them some help! Otherwise, take a look at some other issues you can help with. Thanks!

🤔❓ Questions?

Leave a comment below, and reach out in our chatroom!

@Somya-Singhal Somya-Singhal added the fto-candidate issues which are meant to be solved by first timers but aren't well-formatted yet label Apr 9, 2022
@welcome
Copy link

welcome bot commented Apr 9, 2022

Thanks for opening your first issue! This space is protected by our Code of Conduct - and we're here to help.
Please follow the issue template to help us help you 👍🎉😄
If you have screenshots or a gif to share demonstrating the issue, that's really helpful! 📸
Do join our Gitter channel for some brainstorming discussions.

@Somya-Singhal
Copy link
Contributor Author

Hello @TildaDares, Please review this FTO issue.Thanks!

@TildaDares
Copy link
Member

Thanks for working on this @Somya-Singhal. This is perfect!!

@TildaDares
Copy link
Member

Reserved for @ayish1998 for 24 hours!!

@TildaDares TildaDares added first-timers-only They need to be well-formatted using the First-timers_Issue_Template. and removed fto-candidate issues which are meant to be solved by first timers but aren't well-formatted yet labels Apr 9, 2022
@ayish1998
Copy link
Contributor

Reserved for @ayish1998 for 24 hours!!

Received with thanks

@ayish1998
Copy link
Contributor

@TildaDares what do I have to do next after resolving the issue?

@TildaDares
Copy link
Member

TildaDares commented Apr 10, 2022

@ayish1998 You can create first-timer issues for others or work on issues with the tag help-wanted or bug label.

@TildaDares
Copy link
Member

Hi @ayish1998 I can't find a PR for this issue.

@ayish1998
Copy link
Contributor

Alright

@Somya-Singhal
Copy link
Contributor Author

Alright

@ayish1998 if you need any help in creating a PR we can discuss it in chat room of public lab.

@TildaDares TildaDares linked a pull request Apr 13, 2022 that will close this issue
5 tasks
@TildaDares
Copy link
Member

Resolved in #11091

@TildaDares
Copy link
Member

Resolved in #11091

1 similar comment
@TildaDares
Copy link
Member

Resolved in #11091

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
first-timers-only They need to be well-formatted using the First-timers_Issue_Template.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants