Commit ff32594e authored by Sara Kuqi's avatar Sara Kuqi
Browse files

Measured and Submmited button fix location, chemists view after sign-up

parent c532c3e2
......@@ -235,14 +235,11 @@ text-decoration: underline;
font-style: normal;
}
div.absolute {
position: absolute;
right: 0;
width: 150px;
margin-top:10px;
margin-left: 515px;
}
div.absolutem {
position: absolute;
right: 0;
width: 115px;
margin-top:10px;
margin-left: 530px;
}
......@@ -25,6 +25,7 @@ class SamplePdf < Prawn::Document
def table_rows
output = [expected]
# if (operator? && (@sample.status=='submitted'|| @sample.status=='measured')) || (!operator? && @sample.status=='measured')
@sample.results.each_with_index do |result,i|
#update = [[res],difference]]
r = ["Result #{i+1}:"]
......@@ -32,6 +33,7 @@ class SamplePdf < Prawn::Document
output << r
output += [difference(result)]
end
# end
output
end
......@@ -104,4 +106,24 @@ class SamplePdf < Prawn::Document
end
end
# def operator?
# current_user.type == "Operator"
# end
# def current_user
# if (user_id = session[:user_id])
# @current_user ||= User.find_by(id: user_id)
# elsif (user_id = cookies.signed[:user_id])
# user = User.find_by(id: user_id)
# if user && user.authenticated?(cookies[:remember_token])
# log_in user
# @current_user = user
# end
# end
# end
#
# def log_in(user)
# session[:user_id] = user.id
# end
end
<footer class="container-fluid text-center">
<p>Copyright © 2016 Design Shack</p>
<p style="text-align:left">© 2016 - mol_app</p>
</footer>
......@@ -34,7 +34,6 @@
</div>
</div>
<%= render 'layouts/footer' %>
<%#= debug(params) if Rails.env.development? %>
</div>
</body>
</html>
......@@ -63,14 +63,13 @@ $(document).ready(function() {
<%end%>
</tbody>
</table>
<p> <% if @sample.status == "in preparation" %>
<div class='absolute'><%=link_to (@sample.status ? "submitted for measurement" : "No"),
Measured_sample_path(@sample), :action => 'solve', :class => 'btn btn-default' %></div>
<% elsif operator? && @sample.status == "submitted" %>
<div class='absolutem'><%=link_to (@sample.status ? "Release Measurement" : "No"),
ReleaseMeasurment_sample_path(@sample), :action => 'solve', :class => 'btn btn-default' %></div>
<%end%>
</p>
<%if @sample.status == "in preparation" %>
<div class='absolute'><%=link_to (@sample.status ? "submitted for measurement" : "No"),
Measured_sample_path(@sample), :action => 'solve', :class => 'btn btn-default' %></div>
<% elsif operator? && @sample.status == "submitted" %>
<div class='absolutem'><%=link_to (@sample.status ? "Release Measurement" : "No"),
ReleaseMeasurment_sample_path(@sample), :action => 'solve', :class => 'btn btn-default' %></div>
<%end%>
<script type="text/javascript">
......
<% provide(:title, 'All users') %>
<h1>All users</h1>
<%= will_paginate %>
<ul class="users">
<% @users.each do |user| %>
<li>
......
<% provide(:title, @user.name) %>
<h3><%= @user.name %></h3>
<p>Samples (<%= @user.samples.count %>)</p>
<%=render 'shared/sample_form'%></br>
<div class="row">
<% if @user.samples.any? %>
<h3><%= @user.name %></h3>
<p>Samples (<%= @user.samples.count %>)</p>
<% if !operator?%>
<%=render 'shared/sample_form'%></br>
<% end %>
<div class="panel panel-default">
<%= render 'samples/samples' %>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment