Fixed import data controller to work for admin and user only

This commit is contained in:
saurabhbhatia 2013-12-11 11:58:08 +08:00 committed by Manson Wang
parent 58051caac1
commit 0028a21307
2 changed files with 2 additions and 2 deletions

View File

@ -6,6 +6,8 @@ require 'open-uri'
class Admin::ImportDataController < OrbitBackendController class Admin::ImportDataController < OrbitBackendController
# helper Admin::PagePartsHelper # helper Admin::PagePartsHelper
# include Admin::FrontendWidgetInterface # include Admin::FrontendWidgetInterface
open_for_user
open_for_admin
def get_teacher_data def get_teacher_data
uri = URI("https://localhost:8000/teachers.xml") uri = URI("https://localhost:8000/teachers.xml")

View File

@ -77,7 +77,6 @@
</tbody> </tbody>
</table> </table>
<% if is_admin? %>
<div class="bottomnav clearfix"> <div class="bottomnav clearfix">
<div class="action pull-right"> <div class="action pull-right">
<%= link_to content_tag(:i, nil, :class => 'icon-plus') + t('personal_plugins.sync_data'), admin_import_data_sync_journal_paper_data_path(:user_id => @user.id), :class => 'btn btn-primary' %> <%= link_to content_tag(:i, nil, :class => 'icon-plus') + t('personal_plugins.sync_data'), admin_import_data_sync_journal_paper_data_path(:user_id => @user.id), :class => 'btn btn-primary' %>
@ -88,7 +87,6 @@
<%= paginate @writing_journals, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %> <%= paginate @writing_journals, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
</div> </div>
</div> </div>
<% end %>
<div id="dialog" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="Delete item" aria-hidden="true"> <div id="dialog" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="Delete item" aria-hidden="true">
<div class="modal-header"> <div class="modal-header">