remotes/origin/1203
Назар Котюк 11 years ago
commit 4937a1c083
  1. 2
      templates/client/includes/accounts/current_user.html
  2. 2
      templates/client/includes/announces.html
  3. 2
      templates/client/static_client/css_min/main.min.css
  4. 25
      templates/client/static_client/js/_modules/page.company.js
  5. 28
      templates/client/static_client/js/_modules/page.profile.js
  6. 2
      templates/client/static_client/js_min/_modules/page.company.min.js
  7. 2
      templates/client/static_client/js_min/_modules/page.profile.min.js

@ -56,7 +56,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="i-rating" title="{% trans 'Рейтинг' %}: {{ user.rating }}">{{ user.rating }}</div> <div class="i-rating" title="{% trans 'Рейтинг' %}: {{ user.rating }}" id="profile-rating">{{ user.rating }}</div>
<div class="reason_block"> <div class="reason_block">
<p>Заполните свой<br>профиль, чтобы<br>повысить рейтинг</p> <p>Заполните свой<br>профиль, чтобы<br>повысить рейтинг</p>
<p>Чем выше<br>рейтинг —<br>тем больше<br>преимуществ!</p> <p>Чем выше<br>рейтинг —<br>тем больше<br>преимуществ!</p>

@ -6,6 +6,8 @@
<li><a class="icon-big-email" href="#">{% trans 'по e-mail' %}</a></li> <li><a class="icon-big-email" href="#">{% trans 'по e-mail' %}</a></li>
<li><a class="icon-big-rss" href="#">{% trans 'через RSS' %}</a></li> <li><a class="icon-big-rss" href="#">{% trans 'через RSS' %}</a></li>
<li><a class="icon-big-twitter" href="#">{% trans 'на twitter' %}</a></li> <li><a class="icon-big-twitter" href="#">{% trans 'на twitter' %}</a></li>
{% comment %}
<li><a class="icon-big-ical" href="#">{% trans 'в iCal' %}</a></li> <li><a class="icon-big-ical" href="#">{% trans 'в iCal' %}</a></li>
{% endcomment %}
</ul> </ul>
</div> </div>

File diff suppressed because one or more lines are too long

@ -16,6 +16,26 @@ if (EXPO.company){
//dependences //dependences
var $waiter; var $waiter;
//private //private
/**
* Rating functional. Object stores data, HTML Instance of rating field, and can refresh its value
* @param {Object} opt - options for rating instance, like HTML Id and other
* @constructor
*/
function Rating(opt){
this.opt = opt;
this.$inst = $('#'+opt.id);
this.value = this.$inst.text;
}
Rating.prototype = {
/**
* refreshes value of HTML instance with new.
* @param {number} newRating - new profile rating value
*/
refresh: function (newRating) {
this.value = newRating;
this.$inst.text(this.value);
}
};
// factory for on page form objects // factory for on page form objects
function Forms(){} function Forms(){}
// methods to perform ajax responses to send and receive data from the server // methods to perform ajax responses to send and receive data from the server
@ -34,6 +54,9 @@ if (EXPO.company){
contentType: false, contentType: false,
success: function(data) { success: function(data) {
self.pullHandler(data); self.pullHandler(data);
if(data.success){
EXPO.company.rating.refresh(data.rating);
}
$('#wait-ajax').fadeOut(); $('#wait-ajax').fadeOut();
} }
}); });
@ -400,6 +423,8 @@ if (EXPO.company){
$(selector).inputmasks(maskOpts); $(selector).inputmasks(maskOpts);
}; };
this.rating = new Rating(this.opt.rating);
this.forms = {}; this.forms = {};
$(function () { $(function () {
var $editables = $('.'+self.opt.editableClass); var $editables = $('.'+self.opt.editableClass);

@ -19,9 +19,30 @@ if (EXPO.profile){
$waiter; $waiter;
//private //private
// factory for on page form objects
/**
* Rating functional. Object stores data, HTML Instance of rating field, and can refresh its value
* @param {Object} opt - options for rating instance, like HTML Id and other
* @constructor
*/
function Rating(opt){
this.opt = opt;
this.$inst = $('#'+opt.id);
this.value = this.$inst.text;
}
Rating.prototype = {
/**
* refreshes value of HTML instance with new.
* @param {number} newRating - new profile rating value
*/
refresh: function (newRating) {
this.value = newRating;
this.$inst.text(this.value);
}
};
function Forms(){}; function Forms(){};
// methods to perform ajax responses to send and receive data from the server // methods to perform ajax responses to send and receive data from the server
// factory for on page form objects
Forms.prototype = { Forms.prototype = {
// ajax request realization // ajax request realization
getajax: function (dataToSend) { getajax: function (dataToSend) {
@ -37,6 +58,9 @@ if (EXPO.profile){
contentType: false, contentType: false,
success: function(data) { success: function(data) {
self.pullHandler(data); self.pullHandler(data);
if(data.success){
EXPO.profile.rating.refresh(data.rating);
}
$('#wait-ajax').fadeOut(); $('#wait-ajax').fadeOut();
} }
}); });
@ -107,6 +131,7 @@ if (EXPO.profile){
this.$editable.removeClass('hidden'); this.$editable.removeClass('hidden');
this.$description.addClass('hidden'); this.$description.addClass('hidden');
} }
} }
}; };
Forms.factory = function (type, ajaxpath) { Forms.factory = function (type, ajaxpath) {
@ -425,6 +450,7 @@ if (EXPO.profile){
$(selector).inputmasks(maskOpts); $(selector).inputmasks(maskOpts);
}; };
this.rating = new Rating(this.opt.rating);
this.forms = {}; this.forms = {};
$(function () { $(function () {
var $editables = $('.'+self.opt.editableClass); var $editables = $('.'+self.opt.editableClass);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save