Merge branch 'szzh' of http://repository.trustie.net/xianbo/trustie2 into szzh
This commit is contained in:
commit
dfae970d1c
|
@ -12,6 +12,8 @@ module TagsHelper
|
||||||
@obj = Issue.find_by_id(obj_id)
|
@obj = Issue.find_by_id(obj_id)
|
||||||
when '4'
|
when '4'
|
||||||
@obj = Bid.find_by_id(obj_id)
|
@obj = Bid.find_by_id(obj_id)
|
||||||
|
when '5'
|
||||||
|
@obj = Forum.find_by_id(obj_id)
|
||||||
when '6'
|
when '6'
|
||||||
@obj = Attachment.find_by_id(obj_id)
|
@obj = Attachment.find_by_id(obj_id)
|
||||||
when '7'
|
when '7'
|
||||||
|
@ -44,6 +46,8 @@ module TagsHelper
|
||||||
if user.id == obj_id
|
if user.id == obj_id
|
||||||
@result = true
|
@result = true
|
||||||
end
|
end
|
||||||
|
when '5'
|
||||||
|
@result = is_forum_manager?(user.id,obj_id)
|
||||||
when '7'
|
when '7'
|
||||||
if user.id == obj_id
|
if user.id == obj_id
|
||||||
@result = true
|
@result = true
|
||||||
|
@ -56,6 +60,17 @@ module TagsHelper
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# 判断用户是否是贴吧的管理员
|
||||||
|
# add by chenmin
|
||||||
|
def is_forum_manager?(user_id,forum_id)
|
||||||
|
@result = false
|
||||||
|
@user_id = Forum.find(forum_id).creator_id;
|
||||||
|
if @user_id == user.id
|
||||||
|
@result = true
|
||||||
|
end
|
||||||
|
return @result
|
||||||
|
end
|
||||||
|
|
||||||
def tagname_val
|
def tagname_val
|
||||||
("#tag_name_name").value
|
("#tag_name_name").value
|
||||||
end
|
end
|
|
@ -53,7 +53,7 @@
|
||||||
</span>
|
</span>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<div style="padding-top: 10px">
|
<div style="width: 100%;word-break: break-all;">
|
||||||
<% if @topics.any? %>
|
<% if @topics.any? %>
|
||||||
<!-- <table class="list messages">
|
<!-- <table class="list messages">
|
||||||
<thead><tr>
|
<thead><tr>
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<p>
|
<p>
|
||||||
<strong><%= l(:label_bids_reward_method) %><span class="bonus"><%= @contest.budget%></span></strong>
|
<strong><%= l(:label_bids_reward_method) %><span class="bonus"><%= @contest.budget%></span></strong>
|
||||||
</p>
|
</p>
|
||||||
<div class="bid_description">
|
<div class="bid_description" style="width: 100%;word-break:break-all;">
|
||||||
<%= @contest.description %>
|
<%= @contest.description %>
|
||||||
<!-- <%# if @contest.attachments.any?%>
|
<!-- <%# if @contest.attachments.any?%>
|
||||||
<%# options = {:author => true} %>
|
<%# options = {:author => true} %>
|
||||||
|
|
|
@ -14,6 +14,16 @@
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
function check(){
|
||||||
|
var regex=/^\d*$/;
|
||||||
|
if (!regex.test($("#class_period").val())){
|
||||||
|
alert("学时只能为整数");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<% object = [] %>
|
<% object = [] %>
|
||||||
|
@ -67,11 +77,11 @@
|
||||||
-->
|
-->
|
||||||
<% unless @course.nil?%>
|
<% unless @course.nil?%>
|
||||||
<p><table><tr><td><span class="info" align="right" style="width: 90px; font-weight: bold ;margin-left:22px"><%= l(:label_class_period) %><span class="required"> * </span></span>
|
<p><table><tr><td><span class="info" align="right" style="width: 90px; font-weight: bold ;margin-left:22px"><%= l(:label_class_period) %><span class="required"> * </span></span>
|
||||||
<span class="info" style="width: 10px"><%= text_field_tag :class_period, @course.class_period, :placeholder => "在此输入课时" %></span> <span> <strong><%= l(:label_class_hour)%></strong></span>
|
<span class="info" style="width: 10px;"><%= text_field_tag :class_period, @course.class_period, :placeholder => "在此输入课时",:maxlength=>5 %></span> <span> <strong><%= l(:label_class_hour)%></strong></span>
|
||||||
</td></tr></table></p>
|
</td></tr></table></p>
|
||||||
<% else %>
|
<% else %>
|
||||||
<p><table><tr><td><span class="info" align="right" style="width: 90px; font-weight: bold ;margin-left:22px"><%= l(:label_class_period) %><span class="required"> * </span></span>
|
<p><table><tr><td><span class="info" align="right" style="width: 90px; font-weight: bold ;margin-left:22px"><%= l(:label_class_period) %><span class="required"> * </span></span>
|
||||||
<span class="info" style="width: 10px"><%= text_field_tag :class_period, nil, :placeholder => "在此输入课时" %></span><strong><%= l(:label_class_hour)%></strong>
|
<span class="info" style="width: 10px;"><%= text_field_tag :class_period, nil, :placeholder => "在此输入课时",:maxlength=>5 %></span><strong><%= l(:label_class_hour)%></strong>
|
||||||
</td></tr></table></p>
|
</td></tr></table></p>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|
|
@ -93,7 +93,7 @@
|
||||||
<%= link_to @topic.author, user_path(@topic.author) %>
|
<%= link_to @topic.author, user_path(@topic.author) %>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="memo-section">
|
<div class="memo-section" style="width: 100%;word-break: break-all;">
|
||||||
<div class="memo-title <%= @topic.sticky? ? 'sticky' : '' %> <%= @topic.locked? ? 'locked' : '' %>">
|
<div class="memo-title <%= @topic.sticky? ? 'sticky' : '' %> <%= @topic.locked? ? 'locked' : '' %>">
|
||||||
<% if @project %>
|
<% if @project %>
|
||||||
<%= label_tag l(:field_subject) %>: <%= link_to @topic.subject, project_boards_path(@topic.project) %>
|
<%= label_tag l(:field_subject) %>: <%= link_to @topic.subject, project_boards_path(@topic.project) %>
|
||||||
|
|
|
@ -70,7 +70,14 @@
|
||||||
:taggable_id => obj.id, :taggable_type => object_flag %> </span>
|
:taggable_id => obj.id, :taggable_type => object_flag %> </span>
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<% when '5' %>
|
||||||
|
<% if Forum.find(params[:id]) %>
|
||||||
|
<% if Forum.find(params[:id]).creator_id == User.current.id %>
|
||||||
|
<span class='del'> <%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag,
|
||||||
|
:taggable_id => obj.id, :taggable_type => object_flag %> </span>
|
||||||
|
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
<% when '6' %>
|
<% when '6' %>
|
||||||
<%# if (User.current.logged? &&
|
<%# if (User.current.logged? &&
|
||||||
User.current.admin?
|
User.current.admin?
|
||||||
|
|
Loading…
Reference in New Issue