personal-activity/app/views/plugin/personal_activity/_profile.html.erb

88 lines
3.5 KiB
Plaintext
Raw Normal View History

2020-02-06 05:45:12 +00:00
<% content_for :page_specific_css do %>
<%= stylesheet_link_tag "lib/list-check" %>
<% end %>
<% content_for :page_specific_javascript do %>
<%= javascript_include_tag "lib/list-check" %>
<% end %>
<%
#@activities = Activity.where(member_profile_id: current_user.member_profile.id).desc(:year).page(params[:page]).per(10)
if has_access?
@activities = Activity.where(member_profile_id: @member.id).desc(:year).page(params[:page]).per(10)
else
@activities = Activity.where(is_hidden: false, member_profile_id: @member.id).desc(:year).page(params[:page]).per(10)
end
%>
<table class="table table-condensed table-striped main-list">
<thead>
<tr>
<% if has_access? %>
<th><input type="checkbox" /></th>
<% end %>
<th class="span1"><%= t('personal_activity.year') %></th>
<th><%= t('personal_activity.activity_name') %></th>
<% if not @user%>
<th><%= t('personal_activity.activity_area') %></th>
<% end %>
</tr>
</thead>
<tbody>
<% @activities.each do |activity| %>
<tr id="<%= dom_id activity %>" class="<%= activity.is_hidden ? "checkHide" : "" %>">
<% if has_access? %>
<td>
<%= check_box_tag 'to_change[]', activity.id.to_s, false, :class => "list-check" %>
</td>
<% end %>
<td><%= activity.year %></td>
<td>
2020-02-13 07:54:36 +00:00
<%= link_to activity.activity_name, OrbitHelper.url_to_plugin_show(activity.to_param,'personal_activity'), target: "blank"%>
2020-02-06 05:45:12 +00:00
<% activity.activity_name %>
<% if has_access? %>
<div class="quick-edit">
<ul class="nav nav-pills hide">
<%# if current_user.is_admin? %>
<li><%= link_to t('edit'), edit_admin_activity_path(activity) %></li>
<li><%= link_to t(:delete_), admin_activity_path(id: activity.id), method: :delete, remote: true, data: { confirm: 'Are you sure?' } %></li>
<%# end %>
</ul>
</div>
<% end %>
</td>
<td><%= activity.activity_area %></td>
</tr>
<% end %>
</tbody>
</table>
<div class="bottomnav clearfix">
<% if has_access? %>
<div class="action pull-right">
<%#= link_to content_tag(:i, nil, :class => 'icon-edit') +' '+ t('setting'),'/admin/members/'+@member.to_param+'/books/frontend_setting', :class => 'btn btn-primary' %>
2020-02-13 07:54:36 +00:00
<%= link_to content_tag(:i, nil, :class => 'icon-plus') +' '+ t('new_'),
'/admin/members/'+@member.to_param+'/activities/new', :class => 'btn btn-primary' %>
2020-02-06 05:45:12 +00:00
</div>
<% end %>
<div class="pagination pagination-centered">
<%= paginate @activities, :params => {:direction => params[:direction], :sort => params[:sort] } %>
</div>
</div>
<div id="dialog" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="Delete item" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3><%= t(:sure?) %></h3>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true"><%= t(:close) %></button>
<button class="delete-item btn btn-danger"><%= t(:submit) %></button>
</div>
</div>