Conflicts: app/views/exercise/_student_table.html.erb db/schema.rbcxt_course
commit
b796ac3b53
@ -1,193 +1,192 @@
|
||||
<style type="text/css">
|
||||
div.talk_new .ke-container{margin-left:2px;}
|
||||
.break_word {width:100%;}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
//头部导航
|
||||
var menuids=["TopUserNav"] //Enter id(s) of SuckerTree UL menus, separated by commas
|
||||
function buildsubmenus(){
|
||||
for (var i=0; i<menuids.length; i++){
|
||||
var div = document.getElementById(menuids[i]);
|
||||
if(div == undefined)continue;
|
||||
var ultags=div.getElementsByTagName("ul");
|
||||
for (var t=0; t<ultags.length; t++){
|
||||
ultags[t].parentNode.getElementsByTagName("a")[0].className="subfolderstyle";
|
||||
ultags[t].parentNode.onmouseover=function(){
|
||||
this.getElementsByTagName("ul")[0].style.display="block";
|
||||
}
|
||||
ultags[t].parentNode.onmouseout=function(){
|
||||
this.getElementsByTagName("ul")[0].style.display="none";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (window.addEventListener)
|
||||
window.addEventListener("load", buildsubmenus, false)
|
||||
else if (window.attachEvent)
|
||||
window.attachEvent("onload", buildsubmenus)
|
||||
</script>
|
||||
<%= import_ke(enable_at: false, prettify: false) %>
|
||||
|
||||
|
||||
<%= render :partial => 'blogs/article_list', :locals => {:blog=>@user.blog,:topics => @topics, :page => 0, :user => @user} %>
|
||||
|
||||
|
||||
<script type="text/javascript">//侧导航
|
||||
|
||||
function nh_check_field(params){
|
||||
var result=true;
|
||||
if(params.subject!=undefined){
|
||||
if($.trim(params.subject.val()) == ""){
|
||||
params.subjectmsg.html('主题不能为空');
|
||||
params.subjectmsg.css({color:'#ff0000'});
|
||||
result=false;
|
||||
}else{
|
||||
params.subjectmsg.html('填写正确');
|
||||
params.subjectmsg.css({color:'#008000'});
|
||||
}
|
||||
params.subjectmsg.show();
|
||||
}
|
||||
|
||||
if(params.content!=undefined){
|
||||
if(params.content.isEmpty()){
|
||||
result=false;
|
||||
}
|
||||
if(params.content.html()!=params.textarea.html() || params.issubmit==true){
|
||||
params.textarea.html(params.content.html());
|
||||
params.content.sync(); //用上面那句ie11提交到服务器居然木有值
|
||||
if(params.content.isEmpty()){
|
||||
params.contentmsg.html('内容不能为空');
|
||||
params.contentmsg.css({color:'#ff0000'});
|
||||
}else{
|
||||
params.contentmsg.html('填写正确');
|
||||
params.contentmsg.css({color:'#008000'});
|
||||
}
|
||||
params.contentmsg.show();
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
function nh_init_board(params){
|
||||
//发帖/编辑/回复按钮的click
|
||||
params.showbtn.click(function(){
|
||||
params.textarea.removeAttr('placeholder');
|
||||
if(params.textarea.data('init') == undefined){
|
||||
//初始化编辑器
|
||||
var editor = params.kindutil.create(params.textarea, {
|
||||
// allowPreviewEmoticons : false,
|
||||
// allowImageUpload : false,
|
||||
autoHeightMode : true,
|
||||
resizeType : 1,minWidth:"1px",width:"560px",height:"150px",
|
||||
allowFileManager:true,uploadJson:"/kindeditor/upload",
|
||||
fileManagerJson:"/kindeditor/filemanager",
|
||||
afterChange:function(){//按键事件
|
||||
nh_check_field({content:this,contentmsg:params.contentmsg,textarea:params.textarea});
|
||||
// var edit = this.edit;
|
||||
// var body = edit.doc.body;
|
||||
// edit.iframe.height(minHeight);
|
||||
// this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight) + 30, minHeight));
|
||||
},
|
||||
afterCreate:function(){
|
||||
this.loadPlugin("autoheight");
|
||||
var userAgent = navigator.userAgent.toLowerCase();
|
||||
if(/trident/.test(userAgent)){
|
||||
$("div.talk_new .ke-container").css({'margin-left':'0px'});
|
||||
}
|
||||
// var toolbar = $("div[class='ke-toolbar']",params.about_talk);
|
||||
// $(".ke-outline>.ke-toolbar-icon",toolbar).append('表情');
|
||||
// params.toolbar_container.append(toolbar);
|
||||
}
|
||||
}).loadPlugin('paste');
|
||||
|
||||
//主题输入框按键事件
|
||||
params.inputsubject.keyup(function(){
|
||||
nh_check_field({subject:params.inputsubject,subjectmsg:params.subjectmsg});
|
||||
})
|
||||
//表单提交
|
||||
params.form.submit(function(){
|
||||
var is_checked = nh_check_field({
|
||||
issubmit:true,
|
||||
subject:params.inputsubject,
|
||||
subjectmsg:params.subjectmsg,
|
||||
content:editor,
|
||||
contentmsg:params.contentmsg,
|
||||
textarea:params.textarea
|
||||
});
|
||||
if(is_checked){
|
||||
//return true 居然不提交 fuck your sister
|
||||
$(this)[0].submit();
|
||||
// return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
//提交按钮click
|
||||
params.submitbtn.click(function(){
|
||||
params.form.submit();
|
||||
});
|
||||
//取消按钮click
|
||||
params.cancelbtn.click(function(){
|
||||
params.about_talk.toggle();//显示/隐藏编辑区
|
||||
if(params.about_talk.is(':hidden')){//隐藏时reset表单数据
|
||||
params.form[0].reset();
|
||||
if(params.type=='reply'){
|
||||
params.textarea.empty();
|
||||
}else{
|
||||
params.textarea.html(params.init_content_val.val());
|
||||
}
|
||||
var str = params.textarea.html();
|
||||
str=str.replace(new RegExp(/</g),'<');
|
||||
str=str.replace(new RegExp(/>/g),'>');
|
||||
editor.html(str);
|
||||
params.subjectmsg.hide();
|
||||
params.contentmsg.hide();
|
||||
if(params.quote_show!=undefined)params.quote_show.empty();
|
||||
if(params.quote_input!=undefined)params.quote_input.empty();
|
||||
}else{
|
||||
if(params.type=='reply'){
|
||||
params.textarea.show();
|
||||
params.textarea.focus();
|
||||
params.textarea.hide();
|
||||
//params.jumphref.attr('href','#'+params.form.attr('id'));
|
||||
//params.jumphref[0].click();
|
||||
}else{
|
||||
params.textarea.show();
|
||||
params.textarea.focus();
|
||||
params.textarea.hide();
|
||||
// params.inputsubject.focus();
|
||||
}
|
||||
}
|
||||
});
|
||||
params.textarea.data('init','1');//标记为已经初始化
|
||||
}
|
||||
params.cancelbtn.click();//显示/隐藏编辑区
|
||||
});
|
||||
if(params.type == 'reply'){
|
||||
params.showbtn_child.click(function(){
|
||||
if(params.textarea.data('init') == undefined){
|
||||
params.showbtn.click();
|
||||
}else{
|
||||
params.cancelbtn.click();
|
||||
if(params.about_talk.is(':hidden')){
|
||||
params.cancelbtn.click();
|
||||
}
|
||||
}
|
||||
var parent_topic_id = $(this).data('topic-id');
|
||||
if(parent_topic_id!=undefined)$("input[name='parent_topic']",params.form).val(parent_topic_id);
|
||||
var ref_str = params.get_ref_str_call($(this));
|
||||
params.quote_show.html(ref_str);
|
||||
params.quote_input.html(ref_str);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
setTimeout(function(){
|
||||
elocalStorage(message_content_editor,'blog_<%=User.current.id %>');
|
||||
}, 10000);
|
||||
});
|
||||
</script>
|
||||
<style type="text/css">
|
||||
div.talk_new .ke-container{margin-left:2px;}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
//头部导航
|
||||
var menuids=["TopUserNav"] //Enter id(s) of SuckerTree UL menus, separated by commas
|
||||
function buildsubmenus(){
|
||||
for (var i=0; i<menuids.length; i++){
|
||||
var div = document.getElementById(menuids[i]);
|
||||
if(div == undefined)continue;
|
||||
var ultags=div.getElementsByTagName("ul");
|
||||
for (var t=0; t<ultags.length; t++){
|
||||
ultags[t].parentNode.getElementsByTagName("a")[0].className="subfolderstyle";
|
||||
ultags[t].parentNode.onmouseover=function(){
|
||||
this.getElementsByTagName("ul")[0].style.display="block";
|
||||
}
|
||||
ultags[t].parentNode.onmouseout=function(){
|
||||
this.getElementsByTagName("ul")[0].style.display="none";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (window.addEventListener)
|
||||
window.addEventListener("load", buildsubmenus, false)
|
||||
else if (window.attachEvent)
|
||||
window.attachEvent("onload", buildsubmenus)
|
||||
</script>
|
||||
<%= import_ke(enable_at: false, prettify: false) %>
|
||||
|
||||
|
||||
<%= render :partial => 'blogs/article_list', :locals => {:blog=>@user.blog,:topics => @topics, :page => 0, :user => @user} %>
|
||||
|
||||
|
||||
<script type="text/javascript">//侧导航
|
||||
|
||||
function nh_check_field(params){
|
||||
var result=true;
|
||||
if(params.subject!=undefined){
|
||||
if($.trim(params.subject.val()) == ""){
|
||||
params.subjectmsg.html('主题不能为空');
|
||||
params.subjectmsg.css({color:'#ff0000'});
|
||||
result=false;
|
||||
}else{
|
||||
params.subjectmsg.html('填写正确');
|
||||
params.subjectmsg.css({color:'#008000'});
|
||||
}
|
||||
params.subjectmsg.show();
|
||||
}
|
||||
|
||||
if(params.content!=undefined){
|
||||
if(params.content.isEmpty()){
|
||||
result=false;
|
||||
}
|
||||
if(params.content.html()!=params.textarea.html() || params.issubmit==true){
|
||||
params.textarea.html(params.content.html());
|
||||
params.content.sync(); //用上面那句ie11提交到服务器居然木有值
|
||||
if(params.content.isEmpty()){
|
||||
params.contentmsg.html('内容不能为空');
|
||||
params.contentmsg.css({color:'#ff0000'});
|
||||
}else{
|
||||
params.contentmsg.html('填写正确');
|
||||
params.contentmsg.css({color:'#008000'});
|
||||
}
|
||||
params.contentmsg.show();
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
function nh_init_board(params){
|
||||
//发帖/编辑/回复按钮的click
|
||||
params.showbtn.click(function(){
|
||||
params.textarea.removeAttr('placeholder');
|
||||
if(params.textarea.data('init') == undefined){
|
||||
//初始化编辑器
|
||||
var editor = params.kindutil.create(params.textarea, {
|
||||
// allowPreviewEmoticons : false,
|
||||
// allowImageUpload : false,
|
||||
autoHeightMode : true,
|
||||
resizeType : 1,minWidth:"1px",width:"560px",height:"150px",
|
||||
allowFileManager:true,uploadJson:"/kindeditor/upload",
|
||||
fileManagerJson:"/kindeditor/filemanager",
|
||||
afterChange:function(){//按键事件
|
||||
nh_check_field({content:this,contentmsg:params.contentmsg,textarea:params.textarea});
|
||||
// var edit = this.edit;
|
||||
// var body = edit.doc.body;
|
||||
// edit.iframe.height(minHeight);
|
||||
// this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight) + 30, minHeight));
|
||||
},
|
||||
afterCreate:function(){
|
||||
this.loadPlugin("autoheight");
|
||||
var userAgent = navigator.userAgent.toLowerCase();
|
||||
if(/trident/.test(userAgent)){
|
||||
$("div.talk_new .ke-container").css({'margin-left':'0px'});
|
||||
}
|
||||
// var toolbar = $("div[class='ke-toolbar']",params.about_talk);
|
||||
// $(".ke-outline>.ke-toolbar-icon",toolbar).append('表情');
|
||||
// params.toolbar_container.append(toolbar);
|
||||
}
|
||||
}).loadPlugin('paste');
|
||||
|
||||
//主题输入框按键事件
|
||||
params.inputsubject.keyup(function(){
|
||||
nh_check_field({subject:params.inputsubject,subjectmsg:params.subjectmsg});
|
||||
})
|
||||
//表单提交
|
||||
params.form.submit(function(){
|
||||
var is_checked = nh_check_field({
|
||||
issubmit:true,
|
||||
subject:params.inputsubject,
|
||||
subjectmsg:params.subjectmsg,
|
||||
content:editor,
|
||||
contentmsg:params.contentmsg,
|
||||
textarea:params.textarea
|
||||
});
|
||||
if(is_checked){
|
||||
//return true 居然不提交 fuck your sister
|
||||
$(this)[0].submit();
|
||||
// return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
//提交按钮click
|
||||
params.submitbtn.click(function(){
|
||||
params.form.submit();
|
||||
});
|
||||
//取消按钮click
|
||||
params.cancelbtn.click(function(){
|
||||
params.about_talk.toggle();//显示/隐藏编辑区
|
||||
if(params.about_talk.is(':hidden')){//隐藏时reset表单数据
|
||||
params.form[0].reset();
|
||||
if(params.type=='reply'){
|
||||
params.textarea.empty();
|
||||
}else{
|
||||
params.textarea.html(params.init_content_val.val());
|
||||
}
|
||||
var str = params.textarea.html();
|
||||
str=str.replace(new RegExp(/</g),'<');
|
||||
str=str.replace(new RegExp(/>/g),'>');
|
||||
editor.html(str);
|
||||
params.subjectmsg.hide();
|
||||
params.contentmsg.hide();
|
||||
if(params.quote_show!=undefined)params.quote_show.empty();
|
||||
if(params.quote_input!=undefined)params.quote_input.empty();
|
||||
}else{
|
||||
if(params.type=='reply'){
|
||||
params.textarea.show();
|
||||
params.textarea.focus();
|
||||
params.textarea.hide();
|
||||
//params.jumphref.attr('href','#'+params.form.attr('id'));
|
||||
//params.jumphref[0].click();
|
||||
}else{
|
||||
params.textarea.show();
|
||||
params.textarea.focus();
|
||||
params.textarea.hide();
|
||||
// params.inputsubject.focus();
|
||||
}
|
||||
}
|
||||
});
|
||||
params.textarea.data('init','1');//标记为已经初始化
|
||||
}
|
||||
params.cancelbtn.click();//显示/隐藏编辑区
|
||||
});
|
||||
if(params.type == 'reply'){
|
||||
params.showbtn_child.click(function(){
|
||||
if(params.textarea.data('init') == undefined){
|
||||
params.showbtn.click();
|
||||
}else{
|
||||
params.cancelbtn.click();
|
||||
if(params.about_talk.is(':hidden')){
|
||||
params.cancelbtn.click();
|
||||
}
|
||||
}
|
||||
var parent_topic_id = $(this).data('topic-id');
|
||||
if(parent_topic_id!=undefined)$("input[name='parent_topic']",params.form).val(parent_topic_id);
|
||||
var ref_str = params.get_ref_str_call($(this));
|
||||
params.quote_show.html(ref_str);
|
||||
params.quote_input.html(ref_str);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
setTimeout(function(){
|
||||
elocalStorage(message_content_editor,'blog_<%=User.current.id %>');
|
||||
}, 10000);
|
||||
});
|
||||
</script>
|
||||
|
@ -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,24 @@
|
||||
class GroupHomeworkCopyWork < ActiveRecord::Migration
|
||||
def up
|
||||
homeworks = HomeworkCommon.where("homework_type = 3")
|
||||
count = homeworks.count / 30 + 2
|
||||
transaction do
|
||||
for i in 1 ... count do i
|
||||
homeworks.page(i).per(30).each do |homework|
|
||||
homework.student_works.each do |stu|
|
||||
stu.student_work_projects.each do |stu_pro|
|
||||
if stu_pro.is_leader == 0
|
||||
new_stu = StudentWork.new(:name => stu.name, :description => stu.description, :homework_common_id =>homework.id, :user_id => stu_pro.user_id, :final_score => stu.final_score, :teacher_score => stu.teacher_score, :student_score => stu.student_score, :teaching_asistant_score => stu.teaching_asistant_score,
|
||||
:project_id => stu.project_id, :late_penalty => stu.late_penalty,:absence_penalty => stu.absence_penalty,:work_score => stu.work_score,:work_status => 3,:commit_time => stu.commit_time)
|
||||
new_stu.save
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
File diff suppressed because it is too large
Load Diff
@ -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