Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Aug 17 09:32
    User @bjorno43 unbanned @linkin-park
  • Jun 20 21:19
    @bjorno43 banned @shenerd140
  • Apr 25 17:13
    @mstellaluna banned @cmal
  • Jan 08 22:05
    @mstellaluna banned @dertiuss323
  • Nov 07 2018 04:42
    User @texas2010 unbanned @ows-ali
  • Nov 02 2018 16:25
    @texas2010 banned @ows-ali
  • Oct 12 2018 05:50
    @bjorno43 banned @NACH74
  • Oct 05 2018 23:02
    @mstellaluna banned @JomoPipi
  • Sep 16 2018 12:21
    @bjorno43 banned @yash-kedia
  • Sep 16 2018 12:16
    @bjorno43 banned @vnikifirov
  • Sep 05 2018 08:12
    User @bjorno43 unbanned @androuino
  • Sep 05 2018 07:38
    @bjorno43 banned @androuino
  • Aug 23 2018 16:57
    User @bjorno43 unbanned @rahuldkjain
  • Aug 23 2018 16:23
    @bjorno43 banned @rahuldkjain
  • Jul 29 2018 14:13
    User @bjorno43 unbanned @jkyereh
  • Jul 29 2018 01:00
    @bjorno43 banned @jkyereh
  • Jul 10 2018 22:09
    @bjorno43 banned @manafn
  • Jul 06 2018 15:20
    @texas2010 banned @imlegend19
  • Jul 03 2018 12:28
    @bjorno43 banned @vbvmatta
  • Jun 29 2018 13:54
    @bjorno43 banned @OGTechnoBoy
Mark
@cityproject
instead.
I'm looking for ways to print logout button instead of login button once a user logs in.
Darth Skywalker
@adityaparab
@cityproject : SHow your HTML markup
Mark
@cityproject
<div class="login_div" > <!--ng-controller="login_controller"-->
<form id="login_form" method="post" action="{% url 'login' %}">
{% csrf_token %}

          <div class="field-wrap">
          <!--<label>
            Email Address
          </label>-->
          <input required="" type="text" name="username" placeholder="Username">
        </div>

        <div class="field-wrap">
          <!--<label>
            Password
          </label>-->
          <input required="" type="password" name="password" placeholder="Password">
        </div>

        <button class="progress-button forgot" data-style="rotate-angle-bottom" data-perspective data-horizontal>
          <span class="progress-wrap">
            <span class="content">Forgot Password?</span>
              <span class="progress">
              <span class="progress-inner"></span>
            </span>
          </span>
        </button>
<br>
        <button class="ladda-button button-primary login_button" ng-click="vm.submit()"/><span class="ladda-label">Log In</span></button>

        </form>
</div>
so, when the user logs in, the login form and login button should be replaced with logout button and username.
without refreshing the page
Norvin Burrus
@ndburrus
Phanindra M
@PhaniMaddi
which is better Bootstrap 3 or Bootstrap 4?
Darth Skywalker
@adityaparab
@cityproject :smile:
Sorry, I've been away from this room for a while
Mark
@cityproject
ah it's okay.
Darth Skywalker
@adityaparab
1) You don't have logout button on your page.
Mark
@cityproject
i get that all the time :)
Darth Skywalker
@adityaparab
2) I see some Angular JS things in your page!
and still you're using jquery
Mark
@cityproject
yes.
i am not good at angular :(
so certain things must be done using jQuery.
Darth Skywalker
@adityaparab
@cityproject lol. With Angular, this will be a piece of cake!
anyway, let's solve your log out button problem first
Mark
@cityproject
i thought that, replacing login button with logout button can be done using html tag
so yeah
Darth Skywalker
@adityaparab
Put this at the end of your template
<div><button id="logout" style="display:none;">Log Out</button></div>
and your ajax

    $.ajax({
      type:"POST",
      url: '/api/users/login/',
      data:$('#login_form').serialize(),
      error: function(response){
        alert('Not authorized.');  // Or something in a message DIV
      },
      success: function(response){
        console.log(response);
        $(this).css('display','none');
        $('button#logout').css('display','block');
   }
  });
Mark
@cityproject
oh yrah
yeah*
why didn't i think of this solution?
Darth Skywalker
@adityaparab
You wnat to solve it using Angular way?
Mark
@cityproject
if that's more seamless yes
Darth Skywalker
@adityaparab
It's seamless for everyone :D
do you have any angular code already?
Mark
@cityproject
ah yes. i have one for displaying the contents.
Darth Skywalker
@adityaparab
Share that code
let's modify it
Mark
@cityproject
sec
Darth Skywalker
@adityaparab
What directive is for login?
Mark
@cityproject
login's just ajax
Darth Skywalker
@adityaparab
does that code belong to posts.html?
the html code i mean
Mark
@cityproject
you can try with test, test1234 for id and password each
sec.
login's inside the index.html
the angular js code has two templates
post.html and posts.html
i have to leave my room for 15 minutes though :(
brb
Muhammad Sirajuddeen
@sirajtechy
Let's continue mark. Post ur questions
Come back let's try
Dariusz Biskupski
@Visiona
Hi all, I wonder if anyone can help me understand why a bunch of divs position: relative is overlapping my top navbar positioned as fixed
Muhammad Sirajuddeen
@sirajtechy
Try this