- if @user.admin?
  %li.dropdown
    %button.btn.navbar-btn.btn-default.dropdown-toggle{"data-toggle" => "dropdown"}
      Admin
      %i.fa.fa-caret-down
    %ul.dropdown-menu
      %li.dropdown-header Settings
      %li
        = link_to admin_settings_url do
          %i.fa.fa-cog.fa-fw
          Edit Settings
      %li
        = link_to admin_views_url do
          %i.fa.fa-th-list.fa-fw
          Setup Views
      %li
        = link_to admin_stats_url do
          %i.fa.fa-bar-chart-o.fa-fw
          Statistics
      - if Rails.env == "development"
        %li
          = link_to admin_test_login_url, :title => "Click to change user" do
            %i.fa.fa-user.fa-fw
            Change User
      - if @topic.kind_of? Person
        %li.divider
        %li.dropdown-header 
          Data for
          = @topic.name
        %li
          = link_to MdlGradeTrack.user_url(@topic.username) do
            %i.fa.fa-file-code-o.fa-fw
            Moodle Grade Track XML
        %li 
          = link_to admin_sync_grade_tracks_url(:person_id => @topic.mis_id) do
            %i.fa.fa-bar-chart.fa-fw
            Sync Moodle Grade Tracks

- if @user.admin?
  %li.dropdown
    %button.btn.navbar-btn.btn-default.dropdown-toggle{"data-toggle" => "dropdown"}
      Admin
      %i.fa.fa-caret-down
    %ul.dropdown-menu
      %li.dropdown-header Settings
      %li
        = link_to admin_settings_url do
          %i.fa.fa-cog.fa-fw
          Edit Settings
      %li
        = link_to admin_views_url do
          %i.fa.fa-th-list.fa-fw
          Setup Views
      %li
        = link_to admin_stats_url do
          %i.fa.fa-bar-chart-o.fa-fw
          Statistics
      - if Rails.env == "development"
        %li
          = link_to admin_test_login_url, :title => "Click to change user" do
            %i.fa.fa-user.fa-fw
            Change User
      - if @topic.kind_of? Person
        %li.divider
        %li.dropdown-header 
          Data for
          = @topic.name
        %li
          = link_to params.merge(:refresh => true) do
            %i.fa.fa-refresh.fa-fw
            Refresh from MIS
        %li
          = link_to MdlGradeTrack.user_url(@topic.username) do
            %i.fa.fa-file-code-o.fa-fw
            Moodle Grade Track XML
        %li 
          = link_to admin_sync_grade_tracks_url(:person_id => @topic.mis_id) do
            %i.fa.fa-bar-chart.fa-fw
            Sync Moodle Grade Tracks

Put the refresh link on admin menu
Put the refresh link on admin menu
