#251 Plus-plus front end
Closed 7 years ago by sayanchowdhury. Opened 7 years ago by skrzepto.
skrzepto/fedora-hubs plus-plus  into  develop

@@ -27,6 +27,7 @@ 

          if assoc.user:

              sub_list = [u.name for u in assoc.user.subscriptions]

      subscribers = [u.username for u in widget.hub.subscribers]

+     karma_url = flask.url_for('plus_plus_status', user=username)

      return dict(

          username=username,

          fedmsgs=fedmsgs,
@@ -39,6 +40,7 @@ 

              'hub_subscribe', hub=widget.hub.name),

          hub_unsubscribe_url=flask.url_for(

              'hub_unsubscribe', hub=widget.hub.name),

+         karma_url=karma_url

      )

  

  

@@ -1,8 +1,8 @@ 

  <div class="stats-container row">

    <div class="col-sm-7 col-md-12 col-lg-7">

    <table class="stats-table">

-     <tr><th>subscribers</th><th>subscribed to</th></tr>

-     <tr class="text-info"><td>{{subscribers_text}}</td><td class="text-center">{{subscribed_text}}</td></tr>

+     <tr><th>subscribers</th><th>subscribed to</th><th>karma</th></tr>

+     <tr class="text-info"><td>{{subscribers_text}}</td><td class="text-center">{{subscribed_text}}</td><td class="text-center" id="karma_current"></td></tr>

    </table>

    </div>

    <div class="col-sm-5 col-md-12 col-lg-5">
@@ -21,3 +21,26 @@ 

    {% endif %}

    </div>

  </div>

+ 

+ <script type="text/javascript">

+ 

+ function get_karma_stats() {

+     var karma_url = '{{ karma_url }}'

+       $.ajax({

+         method: "GET",

+         url: karma_url,

+         dataType: 'html',

+         success: function(html) {

+           console.log('Success: ' + html);

+           karma_arr = JSON.parse(html);

+           $('#karma_current').html(karma_arr['current']);

+         },

+         error: function() {

+           console.log('Error: getting karma');

+         },

+       });

+     }

+ 

+ get_karma_stats()

+ 

+ </script> 

\ No newline at end of file

Initial hookup to the front end, disclaimer the ui isnt fixed and text overflows.

Looking for recommendations and some comments.

Move frontend karma display to contact widget. Copy of irc talk about moving this.

<sayan> mizmo: thoughts on this? https://pagure.io/fedora-hubs/pull-request/251
<mizmo> you know what you guys make a good point about karma being diff than subscribers
<sayan> check the drive link
<mizmo> id put it in the grey info box
* mizmo looks at link
<mizmo> skrzepto, can you put it in the box below
<mizmo> as a line item
<sayan> mizmo: yes the thing is in a widget, things should be related but in this mockup     https://pagure.io/fedora-hubs/issue/raw/files/839a1996a67fc26fbdd66c9c992e887b59942044208b8df225d856ac64940bc0-pluspage3.png
<sayan> since you move that to the top, we can put subscriber, subscribed and karma together
<mizmo> i think theres three separate things here:
<mizmo> 1) widget to give the person karma
<mizmo> 2) metadata to display how much karma a user has
<mizmo> 3) notification that karma has been given
<mizmo> for #2, I think it shouldn't go in the subscribers box, it should go in the box below with general metadata about the user
<skrzepto> mizmo, so in the contact widget?
<mizmo> skrzepto, yeh i think so. because "member since" - that's other general data bout the user
<skrzepto> so under member since should i add "Karma #" ?
<skrzepto> if we are adding this to the contact widget im at a standstill devyani7_ pr is still open for that widget
<sayan> skrzepto: yes, because that ticket needs modification once fas3 is released
<skrzepto> true
<mizmo> skrzepto, yeh just Karma: $NUMBER or whatever

This has been merged via #255

Pull-Request has been closed by sayanchowdhury

7 years ago