initial commit
This commit is contained in:
9
app/views/guesses/index.html.erb
Normal file
9
app/views/guesses/index.html.erb
Normal file
@@ -0,0 +1,9 @@
|
||||
<div class="puzhome">
|
||||
|
||||
<h1> Najnoviji uspjesi</h1>
|
||||
|
||||
<% @guesses.each do |guess| %>
|
||||
<div><%= guess.created_at_formatted %><h3> <%= link_to( guess.username, users_url + "?username=" + guess.username.to_s) %>: <%= guess.definition %></h3> </div>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
4
app/views/guesses/index.json.jbuilder
Normal file
4
app/views/guesses/index.json.jbuilder
Normal file
@@ -0,0 +1,4 @@
|
||||
json.array!(@guesses) do |guess|
|
||||
json.extract! guess, :username, :definition
|
||||
json.url guess_url(guess, format: :json)
|
||||
end
|
||||
1
app/views/guesses/show.html.erb
Normal file
1
app/views/guesses/show.html.erb
Normal file
@@ -0,0 +1 @@
|
||||
Nothing to see here - move along!
|
||||
3
app/views/guesses/show.json.jbuilder
Normal file
3
app/views/guesses/show.json.jbuilder
Normal file
@@ -0,0 +1,3 @@
|
||||
json.extract! guess, :username, :definition
|
||||
|
||||
|
||||
28
app/views/layouts/application.html.erb
Normal file
28
app/views/layouts/application.html.erb
Normal file
@@ -0,0 +1,28 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" itemscope itemtype="http://schema.org/Organization">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Rijeci</title>
|
||||
<%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
|
||||
<%= javascript_include_tag "application", "data-turbolinks-track" => true %>
|
||||
<%= csrf_meta_tags %>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="main">
|
||||
<div class="topnav">
|
||||
<h1 class="title"></h1>
|
||||
<h1 class="titlenum"></h1>
|
||||
</div>
|
||||
<div class="content">
|
||||
<%= yield %>
|
||||
</div>
|
||||
<div class="footer">
|
||||
<a href="http://www.islambosna.ba"><img src="http://www.islambosna.ba/wp-content/uploads/2013/06/logotip_noba_520t.png" /></a>
|
||||
Developed by Ahmed Islamovic.
|
||||
</div>
|
||||
</div>
|
||||
<a class="forkme" href="https://github.com/senaduka/flip"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub"></a>
|
||||
</body>
|
||||
</html>
|
||||
25
app/views/results/_form.html.erb
Normal file
25
app/views/results/_form.html.erb
Normal file
@@ -0,0 +1,25 @@
|
||||
<%= form_for(@result) do |f| %>
|
||||
<% if @result.errors.any? %>
|
||||
<div id="error_explanation">
|
||||
<h2><%= pluralize(@result.errors.count, "error") %> prohibited this result from being saved:</h2>
|
||||
|
||||
<ul>
|
||||
<% @result.errors.full_messages.each do |msg| %>
|
||||
<li><%= msg %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="field">
|
||||
<%= f.label :user_id %><br>
|
||||
<%= f.number_field :user_id %>
|
||||
</div>
|
||||
<div class="field">
|
||||
<%= f.label :time %><br>
|
||||
<%= f.text_field :time %>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<%= f.submit %>
|
||||
</div>
|
||||
<% end %>
|
||||
6
app/views/results/edit.html.erb
Normal file
6
app/views/results/edit.html.erb
Normal file
@@ -0,0 +1,6 @@
|
||||
<h1>Editing result</h1>
|
||||
|
||||
<%= render 'form' %>
|
||||
|
||||
<%= link_to 'Show', @result %> |
|
||||
<%= link_to 'Back', results_path %>
|
||||
29
app/views/results/index.html.erb
Normal file
29
app/views/results/index.html.erb
Normal file
@@ -0,0 +1,29 @@
|
||||
<h1>Listing results</h1>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>User</th>
|
||||
<th>Time</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% @results.each do |result| %>
|
||||
<tr>
|
||||
<td><%= result.user_id %></td>
|
||||
<td><%= result.time %></td>
|
||||
<td><%= link_to 'Show', result %></td>
|
||||
<td><%= link_to 'Edit', edit_result_path(result) %></td>
|
||||
<td><%= link_to 'Destroy', result, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
|
||||
<%= link_to 'New Result', new_result_path %>
|
||||
4
app/views/results/index.json.jbuilder
Normal file
4
app/views/results/index.json.jbuilder
Normal file
@@ -0,0 +1,4 @@
|
||||
json.array!(@results) do |result|
|
||||
json.extract! result, :user_id, :time
|
||||
json.url result_url(result, format: :json)
|
||||
end
|
||||
5
app/views/results/new.html.erb
Normal file
5
app/views/results/new.html.erb
Normal file
@@ -0,0 +1,5 @@
|
||||
<h1>New result</h1>
|
||||
|
||||
<%= render 'form' %>
|
||||
|
||||
<%= link_to 'Back', results_path %>
|
||||
14
app/views/results/show.html.erb
Normal file
14
app/views/results/show.html.erb
Normal file
@@ -0,0 +1,14 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
|
||||
<p>
|
||||
<strong>User:</strong>
|
||||
<%= @result.user_id %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Time:</strong>
|
||||
<%= @result.time %>
|
||||
</p>
|
||||
|
||||
<%= link_to 'Edit', edit_result_path(@result) %> |
|
||||
<%= link_to 'Back', results_path %>
|
||||
1
app/views/results/show.json.jbuilder
Normal file
1
app/views/results/show.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.extract! @result, :user_id, :time, :created_at, :updated_at
|
||||
11
app/views/solutions/index.html.erb
Normal file
11
app/views/solutions/index.html.erb
Normal file
@@ -0,0 +1,11 @@
|
||||
<div class="puzhome">
|
||||
|
||||
<h1> Najnovije pobjede</h1>
|
||||
<% i = 1 %>
|
||||
<% @solutions.each do |solution| %>
|
||||
<div><%=i%>. <%= solution.created_at_formatted %> <%= link_to( solution.username, users_url + "?username=" + solution.username) %>: <%= solution.number %> u vremenu <%=solution.time%></div>
|
||||
<% i += 1%>
|
||||
<% end %>
|
||||
|
||||
|
||||
</div>
|
||||
4
app/views/solutions/index.json.jbuilder
Normal file
4
app/views/solutions/index.json.jbuilder
Normal file
@@ -0,0 +1,4 @@
|
||||
json.array!(@solutions) do |solution|
|
||||
json.extract! solution, :number, :time, :username
|
||||
json.url solution_url(solution, format: :json)
|
||||
end
|
||||
1
app/views/solutions/show.json.jbuilder
Normal file
1
app/views/solutions/show.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.extract! @solution, :number, :time, :username, :created_at, :updated_at
|
||||
19
app/views/users/index.html.erb
Normal file
19
app/views/users/index.html.erb
Normal file
@@ -0,0 +1,19 @@
|
||||
<div class="puzhome">
|
||||
|
||||
<h1> Najnovije pobjede</h1>
|
||||
<% i = 1 %>
|
||||
<% @solutions.each do |solution| %>
|
||||
<div><%=i%>. <%= solution.created_at_formatted %> <%= solution.username %>: <%= solution.number %> u vremenu <%=solution.time%></div>
|
||||
<% i += 1%>
|
||||
<% end %>
|
||||
|
||||
<h1> Najnoviji uspjesi</h1>
|
||||
|
||||
<% @guesses.each do |guess| %>
|
||||
<div><%= guess.created_at_formatted %><h3><%= guess.username %>: <%= guess.definition %></h3> </div>
|
||||
<% end %>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user