From 178f9e167c236e7c793388e6682246246ddf40e6 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Fri, 8 Jan 2016 09:41:56 +0800 Subject: [PATCH] =?UTF-8?q?1.=E7=94=B3=E8=AF=B7=E5=AD=90=E5=9F=9F=E5=90=8D?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E5=AF=B9=E5=AD=90=E5=9F=9F=E5=90=8D=E8=BF=9B?= =?UTF-8?q?=E8=A1=8C=E8=A7=84=E8=8C=83=EF=BC=8C=E4=BB=85=E8=83=BD=E8=BE=93?= =?UTF-8?q?=E5=85=A5=E5=AD=97=E6=AF=8D=E3=80=81=E6=95=B0=E5=AD=97=E5=92=8C?= =?UTF-8?q?=E4=B8=8B=E5=88=92=E7=BA=BF=EF=BC=9B=202.=E5=8D=9A=E5=AE=A2?= =?UTF-8?q?=E4=B8=BB=E9=A1=B5=EF=BC=8C=E6=B7=BB=E5=8A=A0=E5=8F=96=E6=B6=88?= =?UTF-8?q?=E4=B8=BB=E9=A1=B5=E6=8C=89=E9=92=AE=EF=BC=9B=203.=E7=A7=81?= =?UTF-8?q?=E4=BF=A1=E5=8F=AA=E8=83=BD=E5=8F=91=E9=80=81=E8=80=85=E5=92=8C?= =?UTF-8?q?=E6=8E=A5=E6=94=B6=E8=80=85=E8=83=BD=E7=9C=8B=E5=88=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/blog_comments/show.html.erb | 17 +++++++++++++ app/views/organizations/setting.html.erb | 28 +++++++++++++-------- app/views/users/_user_activities.html.erb | 4 ++- app/views/users/user_organizations.html.erb | 3 ++- 4 files changed, 39 insertions(+), 13 deletions(-) diff --git a/app/views/blog_comments/show.html.erb b/app/views/blog_comments/show.html.erb index aa984c621..02f1ad1ad 100644 --- a/app/views/blog_comments/show.html.erb +++ b/app/views/blog_comments/show.html.erb @@ -58,6 +58,23 @@ :class => 'postOptionLink' ) if User.current && User.current.id == @article.author.id %> +
  • + <% if @article.id == @article.blog.homepage_id %> + <%= link_to( + l(:button_cancel_homepage), + {:controller => 'blogs',:action => 'cancel_homepage',:user_id=>@article.author_id,:id=>@article.blog_id, :article_id => @article.id}, + :method => :post, + :class => 'postOptionLink' + ) if User.current && User.current.id == @article.blog.author_id %> + <% else %> + <%= link_to( + l(:button_set_homepage), + {:controller => 'blogs',:action => 'set_homepage',:user_id=>@article.author_id,:id=>@article.blog_id, :article_id => @article.id}, + :method => :post, + :class => 'postOptionLink' + ) if User.current && User.current.id == @article.blog.author_id %> + <% end %> +
  • diff --git a/app/views/organizations/setting.html.erb b/app/views/organizations/setting.html.erb index 77cfdc985..57e2de64b 100644 --- a/app/views/organizations/setting.html.erb +++ b/app/views/organizations/setting.html.erb @@ -140,16 +140,22 @@ $("#add_subfield_form").submit(); } function apply_subdomain(id, domain){ - $.ajax({ - url:"<%= apply_subdomain_organization_path %>", - type:'post', - data:{ - id:id, - domain:domain - }, - success:function(){ - $("#apply_hint").text("您的申请已提交,系统会以消息的形式通知您结果"); - } - }); + var reg = new RegExp("[a-zA-Z0-9_]{1,}"); + if (reg.exec(domain)){ + $.ajax({ + url:"<%= apply_subdomain_organization_path %>", + type:'post', + data:{ + id:id, + domain:domain + }, + success:function(){ + $("#apply_hint").text("您的申请已提交,系统会以消息的形式通知您结果"); + } + }); + } + else{ + $("#apply_hint").text("子域名命名不规范,只能包含字母、数字和下划线,请重新输入"); + } } \ No newline at end of file diff --git a/app/views/users/_user_activities.html.erb b/app/views/users/_user_activities.html.erb index 4953dc134..fa41d2998 100644 --- a/app/views/users/_user_activities.html.erb +++ b/app/views/users/_user_activities.html.erb @@ -126,7 +126,9 @@ <% if act %> <% case user_activity.act_type.to_s %> <% when 'JournalsForMessage' %> - <%= render :partial => 'user_journalsformessage', :locals => {:activity => act,:user_activity_id =>user_activity.id} %> + <% unless act.private == 1 && (!User.current || (User.current && act.jour_id != User.current.id && act.user_id != User.current.id)) %> + <%= render :partial => 'user_journalsformessage', :locals => {:activity => act,:user_activity_id =>user_activity.id} %> + <% end %> <% end %> <% end %> <% when 'Blog'%> diff --git a/app/views/users/user_organizations.html.erb b/app/views/users/user_organizations.html.erb index e9709f766..f3005c456 100644 --- a/app/views/users/user_organizations.html.erb +++ b/app/views/users/user_organizations.html.erb @@ -25,7 +25,8 @@ <% if org.domain.nil? %> <%= link_to org.name, organization_path(org), :class => 'f16 linkBlue' %> <% else %> - <%= org.name %> + <%= link_to org.name, organization_path(org), :class => 'f16 linkBlue' %> + <% end %>
    <%= org.description %>