From 3ae26a6530a22fff9e7db3db6b1b53509332c756 Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Fri, 17 Jun 2016 11:23:49 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=84=E7=BB=87=E9=85=8D=E7=BD=AE=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=20=E5=90=8D=E5=B8=88=E5=88=97=E8=A1=A8=20=E7=83=AD?= =?UTF-8?q?=E9=97=A8=E9=A1=B9=E7=9B=AE=20=E5=AD=A6=E9=9C=B8=20=E7=B2=BE?= =?UTF-8?q?=E5=93=81=E8=AF=BE=E7=A8=8B=E7=9A=84=E5=8F=B3=E4=B8=8A=E8=A7=92?= =?UTF-8?q?=E5=AD=97=E6=A0=B7=E5=8F=AA=E5=AF=B9=E8=B6=85=E7=BA=A7=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=91=98=E6=98=BE=E7=A4=BA,=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E6=97=B6=E5=A6=82=E6=9E=9C=E5=B7=B2=E7=BB=8F?= =?UTF-8?q?=E5=B8=A6=E4=BA=86=E9=93=BE=E6=8E=A5=E5=88=99=E4=B8=8D=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E7=82=B9=E5=87=BB=E5=BC=B9=E6=A1=86=E6=95=88=E6=9E=9C?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/organizations/courses.html.erb | 8 +++++--- app/views/organizations/projects.html.erb | 8 +++++--- app/views/organizations/students.html.erb | 8 +++++--- app/views/organizations/teachers.html.erb | 8 +++++--- public/javascripts/application.js | 6 ++++++ 5 files changed, 26 insertions(+), 12 deletions(-) diff --git a/app/views/organizations/courses.html.erb b/app/views/organizations/courses.html.erb index 875fc3340..6abc6e127 100644 --- a/app/views/organizations/courses.html.erb +++ b/app/views/organizations/courses.html.erb @@ -14,9 +14,11 @@ <%= submit_tag '', :class => 'homepageSearchIcon', :onfocus => 'this.blur();', :class => "teacher-search-icon fl" %> <% end %> -
- <%= link_to "精品课程", courses_organization_path(@organization, :type => "famous", :org_subfield_id => @field.id), :class => "fontGrey2" %> -
+ <% if User.current.admin? %> +
+ <%= link_to "精品课程", courses_organization_path(@organization, :type => "famous", :org_subfield_id => @field.id), :class => "fontGrey2" %> +
+ <% end %>
diff --git a/app/views/organizations/projects.html.erb b/app/views/organizations/projects.html.erb index 1c6cfa1d1..427443950 100644 --- a/app/views/organizations/projects.html.erb +++ b/app/views/organizations/projects.html.erb @@ -14,9 +14,11 @@ <%= submit_tag '', :class => 'homepageSearchIcon', :onfocus => 'this.blur();', :class => "teacher-search-icon fl" %> <% end %> -
- <%= link_to "热门项目", projects_organization_path(@organization, :type => "famous", :org_subfield_id => @field.id), :class => "fontGrey2" %> -
+ <% if User.current.admin? %> +
+ <%= link_to "热门项目", projects_organization_path(@organization, :type => "famous", :org_subfield_id => @field.id), :class => "fontGrey2" %> +
+ <% end %>
diff --git a/app/views/organizations/students.html.erb b/app/views/organizations/students.html.erb index 770967210..bfc51fd50 100644 --- a/app/views/organizations/students.html.erb +++ b/app/views/organizations/students.html.erb @@ -14,9 +14,11 @@ <%= submit_tag '', :class => 'homepageSearchIcon', :onfocus => 'this.blur();', :class => "teacher-search-icon fl" %> <% end %> -
- <%= link_to "学霸列表", students_organization_path(@organization, :type => "famous", :org_subfield_id => @field.id), :class => "fontGrey2" %> -
+ <% if User.current.admin? %> +
+ <%= link_to "学霸列表", students_organization_path(@organization, :type => "famous", :org_subfield_id => @field.id), :class => "fontGrey2" %> +
+ <% end %>
diff --git a/app/views/organizations/teachers.html.erb b/app/views/organizations/teachers.html.erb index dac36f7a5..03334f14f 100644 --- a/app/views/organizations/teachers.html.erb +++ b/app/views/organizations/teachers.html.erb @@ -22,9 +22,11 @@ -
- <%= link_to "名师列表", teachers_organization_path(@organization, :type => "famous", :org_subfield_id => @field.id), :class => "fontGrey2" %> -
+ <% if User.current.admin? %> +
+ <%= link_to "名师列表", teachers_organization_path(@organization, :type => "famous", :org_subfield_id => @field.id), :class => "fontGrey2" %> +
+ <% end %>
diff --git a/public/javascripts/application.js b/public/javascripts/application.js index 0437125e8..22483c1d5 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -1045,6 +1045,12 @@ function showNormalImage(id) { $(image).attr('src',_src); return; } + + //已被加链接则不处理 + if ($(image).parent() && $(image).parent().attr('href')){ + return; + } + //无格式的图片不让点击显示大图,显示的话会有问题 var tmpsrc = image.attr('src'); if (tmpsrc.indexOf('.gif') >= 0 || tmpsrc.indexOf('.jpg') >= 0 || tmpsrc.indexOf('.jpeg') >= 0 || tmpsrc.indexOf('.png') >= 0 || tmpsrc.indexOf('.bmp') >= 0 || tmpsrc.indexOf('.png') >= 0 || tmpsrc.indexOf('.BMP') >= 0 || tmpsrc.indexOf('.JPEG') >= 0 || tmpsrc.indexOf('.JPG') >= 0 || tmpsrc.indexOf('.PNG') >= 0 || tmpsrc.indexOf('.GIF') >= 0) {