Merge branch 'develop' of https://git.trustie.net/jacknudt/trustieforge into develop
Conflicts: app/views/issues/_form.html.erb db/schema.rbdev_daiao_temp
commit
7899bfe985
@ -1,8 +1,9 @@
|
||||
<% if @fail_hint %>
|
||||
alert("<%= @fail_hint %>");
|
||||
<% else %>
|
||||
$("#org_member_list").html('<%= escape_javascript( render :partial=>"organizations/org_member_list",:locals=> {:members=>@org.org_members}) %>');
|
||||
// 组织添加成员后,同步刷新成员列表,左侧成员数
|
||||
$("#org_member_list").html('<%= escape_javascript( render :partial => "organizations/org_member_list", :locals => {:members => @members}) %>');
|
||||
$("#principals_for_new_member").html('');
|
||||
$("#org_members_count_id").html("<%= @org.org_members.count %>");
|
||||
$("#org_members_count_id").html("<%= @organization.org_members.count %>");
|
||||
$("#not_org_member_search").val("");
|
||||
<% end %>
|
@ -1,3 +1,4 @@
|
||||
// 删除成员后,同步刷新成员列表与左侧成员显示数
|
||||
$("#org_members_count_id").html("");
|
||||
$("#org_members_count_id").html("<%= @org.org_members.count %>")
|
||||
$("#org_member_list").html('<%= escape_javascript( render :partial=>"organizations/org_member_list",:locals=> {:members=>@org.org_members}) %>');
|
||||
$("#org_members_count_id").html("<%= @organization.org_members.count %>");
|
||||
$("#org_member_list").html('<%= escape_javascript( render :partial => "organizations/org_member_list", :locals=> {:members => @members}) %>');
|
@ -1,3 +1,4 @@
|
||||
// 组织成员删除后,同步刷新成员数和成员列表
|
||||
$("#org_members_count_id").html("");
|
||||
$("#org_members_count_id").html("<%= @org.org_members.count %>")
|
||||
$("#org_member_list").html('<%= escape_javascript( render :partial=>"organizations/org_member_list",:locals=> {:members=>@org.org_members}) %>');
|
||||
$("#org_members_count_id").html("<%= @organization.org_members.count %>");
|
||||
$("#org_member_list").html('<%= escape_javascript( render :partial => "organizations/org_member_list", :locals => {:members => @members}) %>');
|
@ -1,23 +1,23 @@
|
||||
<% if @org%>
|
||||
<% if @org %>
|
||||
var checked = $("#principals_for_new_member input:checked").size();
|
||||
if(checked > 0)
|
||||
{
|
||||
alert('翻页或搜索后将丢失当前选择的用户数据!');
|
||||
}
|
||||
<% if @flag == "true"%>
|
||||
<%# if @flag == "true"%>
|
||||
// $('#principals_for_new_member').html('<%#= escape_javascript(find_user_not_in_current_org_by_name(@org)) %>');
|
||||
<%# else%>
|
||||
$('#principals_for_new_member').html('<%= escape_javascript(find_user_not_in_current_org_by_name(@org)) %>');
|
||||
<% else%>
|
||||
$('#principals_for_new_member').html('<%= escape_javascript(find_user_not_in_current_org_by_name(@org)) %>');
|
||||
<% end%>
|
||||
<%# end%>
|
||||
|
||||
<%end%>
|
||||
var collection=$("#principals_for_new_member").children("#principals").children("label");
|
||||
collection.css("text-overflow","ellipsis");
|
||||
collection.css("white-space","nowrap");
|
||||
collection.css("width","200px");
|
||||
collection.css("overflow","hidden");
|
||||
for(i=0;i<collection.length;i++){ //增加悬浮显示
|
||||
var label=collection[i];
|
||||
var text=$(label).text();
|
||||
$(label).attr("title",text);
|
||||
<% end %>
|
||||
var collection = $("#principals_for_new_member").children("#principals").children("label");
|
||||
collection.css("text-overflow", "ellipsis");
|
||||
collection.css("white-space", "nowrap");
|
||||
collection.css("width", "200px");
|
||||
collection.css("overflow", "hidden");
|
||||
for(i = 0; i < collection.length; i++){ //增加悬浮显示
|
||||
var label = collection[i];
|
||||
var text = $(label).text();
|
||||
$(label).attr("title", text);
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
<% if @organization %>
|
||||
// 局部更新组织页面子模块 id = org_member_list
|
||||
$('#org_member_list').html("<%= escape_javascript(render :partial => 'organizations/org_member_list', :locals => {:members => @members}) %>");
|
||||
<% end %>
|
@ -1 +1,2 @@
|
||||
$("#org_member_list").html('<%= escape_javascript( render :partial=>"organizations/org_member_list",:locals=> {:members=>@org.org_members}) %>');
|
||||
// 编辑成员列表角色后,刷新成员列表
|
||||
$("#org_member_list").html('<%= escape_javascript( render :partial => "organizations/org_member_list",:locals => {:members => @members}) %>');
|
@ -0,0 +1,44 @@
|
||||
<div class="post-container">
|
||||
<div loading-spinner></div>
|
||||
<div class="blue-title">编辑资料</div>
|
||||
<div class="blank-row mt10">
|
||||
<div class="upload-input-container img-circle fl ml10 mt4">
|
||||
<!--<input class="upload-input" accept="image/*" multiple="" type="file">-->
|
||||
<!--<input class="upload-input" type="file" capture="camera" accept="image/*" load-head>-->
|
||||
<img ng-src="{{replaceUrl(user.img_url)}}" width="30" class="fl img-circle" style="position:absolute;" />
|
||||
</div>
|
||||
<span class="fl ml25">{{user.login}}</span><span ng-click="unbind()" class="fr f13 mr10 c-blue">解除绑定</span><div class="cl"></div></div>
|
||||
|
||||
<form name="regFrm" novalidate>
|
||||
|
||||
<div class="course-list-row f13 c-grey3 mt10"><span class="fl ml15 c-grey3">姓名</span><input class="new-class-input ml25" ng-model="lastname" placeholder="请输入您的姓名全称" maxlength="30" /></div>
|
||||
<div class="course-list-row f13 c-grey3 mt10" style="height:auto;">
|
||||
<div class="mt5" style="line-height:20px">
|
||||
<span class="ml15 c-grey3">性别</span>
|
||||
<span class="ml25">男</span>
|
||||
<span class="login-box fr mr10 mt2" ng-click="sex=0" ng-class="['login-box', 'fr', 'mr10', 'img-circle', {'checked': sex==0}]"></span>
|
||||
</div>
|
||||
<div class="mb5 mt5" style="line-height:20px;">
|
||||
<span class="ml15 c-grey3"></span>
|
||||
<span class="ml55">女</span>
|
||||
<span class="login-box fr mr10 mt2" ng-click="sex=1" ng-class="['login-box', 'fr', 'mr10', 'img-circle', {'checked': sex==1}]"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="course-list-row f13 c-grey3 mt10">
|
||||
<span class="fl ml15 c-grey3">邮箱</span>
|
||||
<input class="new-class-input ml25" type="email" name="email" ng-model="mail" placeholder="请输入您的邮箱地址" maxlength="60" />
|
||||
<div ng-show="regFrm.$submitted || regFrm.email.$touched">
|
||||
<span class="f12 c-red fl ml15" ng-show="regFrm.email.$error.required">电子邮箱地址不能为空</span>
|
||||
<span class="f12 c-red fl ml15" ng-show="regFrm.email.$error.email">电子邮箱地址不合法</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom-tab-wrap mt10">
|
||||
<a ng-click="cancel()" class="weixin-tab c-grey border-top">取消</a>
|
||||
<a ng-click="confirm(regFrm)" ng-class="[{'btn-disabled':!regFrm.$valid} ]" class="weixin-tab link-blue2 border-top">确定</a>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<my-alert message="alertService_1.message" title="alertService_1.title" visible="alertService_1.visible" cb="alertService_1.cb"></my-alert>
|
||||
<my-alert2 message="alertService_2.message" title="alertService_2.title" visible="alertService_2.visible" cb="alertService_2.cb"></my-alert2>
|
||||
</div>
|
@ -0,0 +1,92 @@
|
||||
app.controller('EditUserInfoController', ['$scope', 'config','$http', 'auth','$location','$routeParams','alertService','rms','common','$timeout','wx', function($scope, config, $http, auth, $location, $routeParams,alertService,rms,common,$timeout,wx){
|
||||
// common.checkLogin();
|
||||
|
||||
$scope.replaceUrl = function(url){
|
||||
return url;
|
||||
};
|
||||
|
||||
var vm = $scope;
|
||||
|
||||
//单弹框
|
||||
vm.alertService_1 = alertService.create();
|
||||
|
||||
//双弹框
|
||||
vm.alertService_2 = alertService.create();
|
||||
|
||||
vm.getuserinfo = function(){
|
||||
$http.get(config.apiUrl + 'users/get_userinfo?token='+auth.token()).then(
|
||||
function(response) {
|
||||
console.log(response.data);
|
||||
vm.user = response.data.data;
|
||||
vm.lastname = vm.user.lastname;
|
||||
vm.mail = vm.user.mail;
|
||||
vm.sex = vm.user.gender;
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
vm.getuserinfo();
|
||||
|
||||
vm.unbind = function(){
|
||||
vm.alertService_2.showMessage('提示', '是否确认解除绑定', function() {
|
||||
$http.post(config.apiUrl + "users/user_unbind",
|
||||
{token: auth.token()}
|
||||
).then(function (response) {
|
||||
if (response.data.status == 0) {
|
||||
vm.alertService_1.showMessage('提示', '解除绑定成功', function () {
|
||||
wx.closeWindow();
|
||||
});
|
||||
}
|
||||
else {
|
||||
vm.alertService_1.showMessage('提示', response.data.message);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
vm.cancel = function(){
|
||||
vm.alertService_2.showMessage('提示', '是否确认取消', function() {
|
||||
wx.closeWindow();
|
||||
});
|
||||
};
|
||||
|
||||
vm.confirm = function(frm){
|
||||
frm.$setSubmitted();
|
||||
|
||||
console.log(frm);
|
||||
if (!frm.$valid) {
|
||||
console.log(frm.$error);
|
||||
return;
|
||||
}
|
||||
|
||||
if(vm.lastname == ""){
|
||||
vm.alertService_1.showMessage('提示', '姓名不能为空');
|
||||
return;
|
||||
}
|
||||
|
||||
if(vm.mail == ""){
|
||||
vm.alertService_1.showMessage('提示', '邮箱不能为空');
|
||||
return;
|
||||
}
|
||||
|
||||
// if(!(/\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i.test(vm.mail))){
|
||||
// vm.alertService_1.showMessage('提示', '邮箱不合法');
|
||||
// return;
|
||||
// }
|
||||
|
||||
$http.post(config.apiUrl + "users/edit_userinfo",
|
||||
{token: auth.token(),lastname: vm.lastname, sex: vm.sex, mail: vm.mail}
|
||||
).then(function(response){
|
||||
if(response.data.status == 0)
|
||||
{
|
||||
vm.alertService_1.showMessage('提示', '修改成功',function(){
|
||||
wx.closeWindow();
|
||||
});
|
||||
}
|
||||
else{
|
||||
vm.alertService_1.showMessage('提示', response.data.message);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
}]);
|
@ -1,19 +1,40 @@
|
||||
app.directive('inputAuto',function(){
|
||||
return{
|
||||
restrict: 'A',
|
||||
scope: {},
|
||||
link: function(scope, element){
|
||||
var copyContainer = element.parent().children().children().eq(0);
|
||||
var sendButton = element.next();
|
||||
element.on('input',function(){
|
||||
//console.log(sendButton);
|
||||
copyContainer.html(element[0].value);
|
||||
var textHeight = copyContainer[0].scrollHeight-10;
|
||||
element.css('height', textHeight + 'px');
|
||||
});
|
||||
sendButton.on('click',function(){
|
||||
element.css('height','18px');
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
//app.directive('inputAuto',function(){
|
||||
// return{
|
||||
// restrict: 'A',
|
||||
// scope: {},
|
||||
// link: function(scope, element){
|
||||
// var copyContainer = element.parent().children().children().eq(0);
|
||||
// var sendButton = element.next();
|
||||
// element.on('input',function(){
|
||||
// //console.log(sendButton);
|
||||
// copyContainer.html(element[0].value);
|
||||
// var textHeight = copyContainer[0].scrollHeight-10;
|
||||
// element.css('height', textHeight + 'px');
|
||||
// });
|
||||
// sendButton.on('click',function(){
|
||||
// element.css('height','18px');
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
//});
|
||||
|
||||
app.directive('inputAuto',["$timeout",function(timer){
|
||||
return{
|
||||
restrict: 'A',
|
||||
scope: {},
|
||||
link: function(scope, element){
|
||||
timer(function(){
|
||||
$(".post-reply-input").bind("input",function(){
|
||||
var copyInput = $(this).prev().children();
|
||||
var sendButton = $(this).next();
|
||||
copyInput.html($(this).val());
|
||||
var textHeight = copyInput[0].scrollHeight-10;
|
||||
$(this).css("height",textHeight + "px");
|
||||
sendButton.click(function(){
|
||||
$(this).prev().css("height","18px");
|
||||
})
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
}]);
|
@ -0,0 +1,35 @@
|
||||
app.directive('loadHead',['$http','config','auth','$location','alertService',function($http,config,auth,$location,alertService){
|
||||
return{
|
||||
restrict: 'A',
|
||||
scope: {},
|
||||
link: function (scope, element, attrs) {
|
||||
element.bind('change', function(){
|
||||
var file = event.target.files[0];
|
||||
//判断类型是不是图片
|
||||
if (!/image\/\w+/.test(file.type)) {
|
||||
alert("非图片");
|
||||
return;
|
||||
}
|
||||
|
||||
var reader = new FileReader();
|
||||
reader.readAsDataURL(file);
|
||||
reader.onload = function (e) {
|
||||
// alert(this.result);//base64
|
||||
|
||||
$http.post(config.apiUrl + "users/upload_head",
|
||||
{token: auth.token(),imgdata:this.result}
|
||||
).then(function (response) {
|
||||
if(response.data.status == 0){
|
||||
scope.$parent.alertService_1.showMessage('提示',"上传成功",function(){
|
||||
scope.$parent.getuserinfo();
|
||||
});
|
||||
}
|
||||
else{
|
||||
scope.$parent.alertService_1.showMessage('提示',response.data.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}]);
|
@ -0,0 +1,42 @@
|
||||
/**
|
||||
* Created by ttang on 2016/9/5.
|
||||
*/
|
||||
app.directive('multiReply',["$timeout",function(timer){
|
||||
return{
|
||||
restrict: 'A',
|
||||
scope: {},
|
||||
link: function(scope, element){
|
||||
timer(function(){
|
||||
$(".reply-icons").each(function(){
|
||||
$(this).toggle(function(){
|
||||
$(this).next().next().removeClass("undis");
|
||||
$(this).next().next().focus();
|
||||
},function(){
|
||||
$(this).next().next().addClass("undis");
|
||||
});
|
||||
});
|
||||
// $(".reply-icons").live("click",function(){
|
||||
// if($(this).hasClass("multi-hide")){
|
||||
// $(".multi-input-container").addClass("undis");
|
||||
// $(".reply-icons").addClass("multi-hide");
|
||||
// $(this).next().next().removeClass("undis");
|
||||
// $(this).next().next().focus();
|
||||
// $(this).removeClass("multi-hide");
|
||||
// $(".post-reply-input").val("");
|
||||
// }
|
||||
// else{
|
||||
// $(this).addClass("multi-hide");
|
||||
// $(".post-input-container").addClass("undis");
|
||||
// $(".post-reply-input").val("");
|
||||
// $("#post_input_1, #post_input_1 .post-input-container").show();
|
||||
// }
|
||||
// });
|
||||
// $(".post-reply-submit,#more_reply").click(function(){
|
||||
// $(".reply-icons").addClass("multi-hide");
|
||||
// $(".post-input-container").addClass("undis");
|
||||
// $("#post_input_1, #post_input_1 .post-input-container").show();
|
||||
// });
|
||||
})
|
||||
}
|
||||
}
|
||||
}]);
|
@ -1,17 +0,0 @@
|
||||
/**
|
||||
* Created by ttang on 2016/8/31.
|
||||
*/
|
||||
app.directive('submitStart',["$timeout",function(timer){
|
||||
return{
|
||||
restrict: 'A',
|
||||
scope: {},
|
||||
link: function(scope, element){
|
||||
timer(function(){
|
||||
$("#manageDelete,.login-box").click(function(){
|
||||
element.removeClass("bg-grey c-white");
|
||||
element.addClass("link-blue2");
|
||||
});
|
||||
})
|
||||
}
|
||||
}
|
||||
}]);
|
Loading…
Reference in new issue