Beispiel #1
0
 set: function(value) {
   this._value = value;
   var count = value.likes.count*1;
   u.cls.toggle(this.count, CLS('hidden'), !count);
   if (count) {
     this.count.innerHTML = '';
     var text = count > 1 ? tx('cmt:nlikes', {count: count}) : tx('cmt:1like');
     this.count.appendChild(
       v({ tag: 'a', href: '#', text: text,
         className: CLS('m-comment-header-like-number m-bg-like') })
     );
     this.count.appendChild(v({ text: ' ' + tx('cmt:likethis') }));
   }
 }
Beispiel #2
0
function composeLocation() {
  var loc = this.value.current_location;
  return loc &&
    { tag: 'div',
      className: CLS('m-image-block-with-icon m-image-block-with-icon_place'),
      text: tx('profile:location', {
        name: loc.name,
      } ) };
}
Beispiel #3
0
function composeHometown() {
  var loc = this.value.hometown_location;
  return loc &&
    { tag: 'div',
      className: CLS('m-image-block-with-icon m-image-block-with-icon_origin'),
      text: tx('profile:hometown', {
        name: loc.name,
      } ) };
}
Beispiel #4
0
function composeEducation() {
  var edu = this.value.education_history;
  return edu && edu[0] &&
    { tag: 'div',
      className: CLS('m-image-block-with-icon m-image-block-with-icon_school'),
      text: tx(edu[0].year ? 'profile:edupast' : 'profile:edu', {
        school: edu[0].name,
        concentration: edu[0].concentrations && edu[0].concentrations[0]
      } ) };
}
Beispiel #5
0
function composeWork() {
  var work = this.value.work_history;
  return work && work[0] &&
    { tag: 'div',
      className: CLS('m-image-block-with-icon m-image-block-with-icon_work'),
      text: tx(work[0].end_date ? 'profile:workpast' : 'profile:work', {
        company: work[0].company_name,
        position: work[0].position
      } ) };
}
Beispiel #6
0
function composeRel() {
  var other = this.value.significant_other;
  return other &&
    { tag: 'div',
      className: CLS('m-image-block-with-icon m-image-block-with-icon_relationship'),
      children: [
        { text: tx(
          'profile:relationship',
          { status: this.value.relationship_status }) },
        { text: ' '},
        other && { tag: 'a', href: '#', text: other.name,
          'data-click-action': function() {
            require('app/app').goTo({ name: 'profile', options: { id: other.id } }, true)
          } }
      ] };
}