Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ def index
:per_page => params[:DataTables_Table_0_length]
)
else
@users = User.find(current_user.id)
@users = User.where("id = #{current_user.id}").paginate(
:page => params[:page],
:per_page => params[:DataTables_Table_0_length]
)
end

respond_to do |format|
Expand Down
3 changes: 1 addition & 2 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,8 @@
<li><%= link_to "Species", species_index_path %></li>
<li><%= link_to "Traits", traits_path %></li>
<li><%= link_to "Treatments", treatments_path %></li>
<% if current_user != nil && current_user.page_access_level <= 2 %>
<%# if current_user != nil && current_user.page_access_level <= 2 %>
<li><%= link_to "Users", users_path %></li>
<% end %>
<li><%= link_to "Variables", variables_path %></li>
<li><%= link_to "Yields", yields_path %></li>
</ul>
Expand Down
25 changes: 20 additions & 5 deletions app/views/sites/_index_table.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
<th class="sorting" role="columnheader" aria-controls="DataTables_Table_0" style="width: 40px"><%= sortable "sites.lat", "Lat" %></th>
<th class="sorting" role="columnheader" aria-controls="DataTables_Table_0" style="width: 40px"><%= sortable "sites.lon", "Lon" %></th>
<th class="sorting" role="columnheader" aria-controls="DataTables_Table_0" style="width: 40px"><%= sortable "sites.espg", "Espg" %></th>
<th class="sorting" role="columnheader" aria-controls="
DataTables_Table_0" style="width: 160px"><%= sortable "sites.map", "Map" %></th>
<th role="columnheader" aria-controls="DataTables_Table_0" style="width: 162px">Actions</th>
</tr>
</thead>
Expand All @@ -23,15 +25,29 @@
<td class="center"><%= site.lat %></td>
<td class="center"><%= site.lon %></td>
<td class="center"><%= site.espg %></td>
<td><%= link_to_prototype_window("map", "#{site.id}", { :className => "alphacube", :width => "625", :height => "525", :zIndex => "100", :resizable => "true", :title => "#{site.sitename}", :draggable => "true", :wiredDrag => "true", :url => "/sites/map?id=#{site.id}" }) %> <br />
<td><%= link_to_prototype_window("map", "#{site.id}", { :className => "alphacube", :width => "625", :height => "525", :zIndex => "100", :resizable => "true", :title => "#{site.sitename}", :draggable => "true", :wiredDrag => "true", :url => "/sites/map?id=#{site.id}" }) %> <br />

</td>
<% if !session["citation"].nil? %>
<td><%= link_to 'Link', {:action => "linked", :id => site.id }, :remote => true %></td>
<% end %>
<td><%= link_to 'Show', site %></td>
<td><%= link_to 'Edit', edit_site_path(site) %></td>
<td><%= link_to 'Destroy', site, :confirm => 'Are you sure?', :method => :delete %></td>
<td class="center ">
<!-- SHOW -->
<%= link_to site, :class => "button button-small", :alt => "show" do %>
<i class="icon-zoom-in"></i>
<% end %>
<!-- EDIT -->
<%= link_to edit_site_path(site), :class => "button button-small", :alt => "edit" do %>
<i class="icon-edit"></i>
<% end %>
<!-- DELETE -->
<% if current_user.page_access_level == 1 %>
<%= link_to site, :method => :delete, :type => 'site', :confirm => 'Are you sure?', :class=> 'button button-small button-danger', :alt => "delete" do %>
<i class="icon-trash"></i>
<% end %>
<% end %>
</td>

</tr>
<% end %>
</tbody>
Expand All @@ -51,4 +67,3 @@
</div>
</div>
</div>

17 changes: 8 additions & 9 deletions app/views/sites/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
</script>

<div class="content">
<div class="container">
<div class="sixteen columns">
<div class="container">
<div class="sixteen columns">
<div id="linked">
<%= render 'linked' %>
</div>

<header>
<h1>Listing Sites</h1>
</header>
<header>
<h1>Listing Sites</h1>
</header>
<div id="process_container">
<div id="back"><%= link_to '<< Citations', citations_path %></div>
<div id="new"><%= link_to 'New Site', new_site_path, :class => "button button-primary" %></div>
Expand All @@ -30,7 +30,6 @@

<div id="simple_search_table" class="simple_search_table_1"><%= render 'index_table' %></div>

</div> <!-- class="sixteen columns" -->
</div> <!-- container -->
</div>

</div> <!-- class="sixteen columns" -->
</div> <!-- container -->
</div>
Loading