<commit_before>/*
 * UserFollowCard - Component
 * User info card with follow button
 *
 * Example:
 * m.component(c.UserFollowCard, {friend: friend})
 */

import m from 'mithril';
import h from '../h';
import _ from 'underscore';
import UserFollowBtn from  '../c/user-follow-btn';

const UserFollowCard = {
    controller(args) {
        const friend = m.prop(args.friend);
        return {
            friend: friend
        };
    },
    view(ctrl, args) {
        const friend = ctrl.friend(),
          profile_img = _.isEmpty(friend.avatar) ? '/assets/catarse_bootstrap/user.jpg' : friend.avatar;
        return m('.w-col.w-col-4',
          m('.card.card-backer.u-marginbottom-20.u-radius.u-text-center',
            [
              m(`img.thumb.u-marginbottom-10.u-round[src='${profile_img}']`),
              m('.fontsize-base.fontweight-semibold.lineheight-tight', 
                m('a.link-hidden', {href: `/users/${friend.user_id}`}, friend.name)
              ),
              m('.fontcolor-secondary.fontsize-smallest.u-marginbottom-10',
                (_.isNull(friend.city) ? '' :
                         m('.fontsize-smaller.fontcolor-secondary.u-marginbottom-10', `${friend.city}, ${friend.state}`))
              ),
              m('.fontsize-smaller',
                [
                  m('span.fontweight-semibold', friend.total_contributed_projects),
                  ' apoiados ',
                  m.trust('&nbsp;'),
                  '| ',
                  m.trust('&nbsp;'),
                  m('span.fontweight-semibold', friend.total_published_projects),
                  ' criados'
                ]
              ),
              m('.btn-bottom-card.w-row',
                [
                  m('.w-col.w-col-3.w-col-small-4.w-col-tiny-3'),
                  m('.w-col.w-col-6.w-col-small-4.w-col-tiny-6',
                    m.component(UserFollowBtn, {following: friend.following, follow_id: friend.friend_id})
                  ),
                  m('.w-col.w-col-3.w-col-small-4.w-col-tiny-3')
                ]
              )
            ]
          )
        );<commit_msg>Fixes user friend url id<commit_after>/*
 * UserFollowCard - Component
 * User info card with follow button
 *
 * Example:
 * m.component(c.UserFollowCard, {friend: friend})
 */

import m from 'mithril';
import h from '../h';
import _ from 'underscore';
import UserFollowBtn from  '../c/user-follow-btn';

const UserFollowCard = {
    controller(args) {
        const friend = m.prop(args.friend);
        return {
            friend: friend
        };
    },
    view(ctrl, args) {
        const friend = ctrl.friend(),
          profile_img = _.isEmpty(friend.avatar) ? '/assets/catarse_bootstrap/user.jpg' : friend.avatar;
        return m('.w-col.w-col-4',
          m('.card.card-backer.u-marginbottom-20.u-radius.u-text-center',
            [
              m(`img.thumb.u-marginbottom-10.u-round[src='${profile_img}']`),
              m('.fontsize-base.fontweight-semibold.lineheight-tight', 
                m('a.link-hidden', {href: `/users/${friend.friend_id}`}, friend.name)
              ),
              m('.fontcolor-secondary.fontsize-smallest.u-marginbottom-10',
                (_.isNull(friend.city) ? '' :
                         m('.fontsize-smaller.fontcolor-secondary.u-marginbottom-10', `${friend.city}, ${friend.state}`))
              ),
              m('.fontsize-smaller',
                [
                  m('span.fontweight-semibold', friend.total_contributed_projects),
                  ' apoiados ',
                  m.trust('&nbsp;'),
                  '| ',
                  m.trust('&nbsp;'),
                  m('span.fontweight-semibold', friend.total_published_projects),
                  ' criados'
                ]
              ),
              m('.btn-bottom-card.w-row',
                [
                  m('.w-col.w-col-3.w-col-small-4.w-col-tiny-3'),
                  m('.w-col.w-col-6.w-col-small-4.w-col-tiny-6',
                    m.component(UserFollowBtn, {following: friend.following, follow_id: friend.friend_id})
                  ),
                  m('.w-col.w-col-3.w-col-small-4.w-col-tiny-3')
                ]
              )
            ]
          )
        );
{'fraction_non_alphanumeric': 0.15996236179722417, 'fraction_numerical': 0.008468595624558928, 'mean_word_length': 1.4880046811000585, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3711941', 'n_tokens_mistral': 1338, 'n_tokens_neox': 1283, 'n_words': 160}