Skip to content

Commit f749a83

Browse files
committed
Add competition details
1 parent d07bf6b commit f749a83

File tree

4 files changed

+93
-0
lines changed

4 files changed

+93
-0
lines changed

app/controllers/pages_controller.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,13 @@ def guidelines
7575
%w[guidelines learn oshiwambo])
7676
end
7777

78+
def competition
79+
custom_meta_tags('Elaka Competition',
80+
"Partake in Learn Oshiwambo's competitions and help advance Oshiwambo
81+
to English translations.",
82+
%w[competition win reward learn oshiwambo])
83+
end
84+
7885
# also same method in profiles_controller.rb and entries_controller.rb
7986
def get_verified(entry)
8087
@vote = (entry.get_likes :vote_scope => 'verify').first

app/views/entries/_index.html.erb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<% mod_count = 0 %>
22
<% sign_count = 0 %>
33
<% other_count = 0 %>
4+
<% comp_count = 0 %>
45
<% @entries.each do | entry | %>
56

67
<% unless user_signed_in? %>
@@ -15,6 +16,13 @@
1516
<% sign_count = sign_count + 1 %>
1617
<% end %>
1718

19+
<% if comp_count == 2 %>
20+
<div class="text-gray small text-center" style="padding-bottom: 1em;">
21+
<%= link_to "Competition Rules", competition_path, class: "text-yellow" %>
22+
</div>
23+
<% end %>
24+
<% comp_count = comp_count + 1 %>
25+
1826
<%= render 'entries/entry', entry: entry %>
1927

2028
<% if (user_signed_in? and not current_user.moderator?) or not user_signed_in? %>

app/views/pages/competition.html.erb

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
<!--suppress ALL -->
2+
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.15.2/css/all.css"
3+
integrity="sha384-vSIIfh2YWi9wW0r9iZe7RJPrKwp6bG+s9QZMoITbCckVJqGCCRhc+ccxNcdpHuYu"
4+
crossorigin="anonymous">
5+
6+
<strong class="text-yellow" style="font-size: 1.7em;">Competition</strong>
7+
<hr class="custom-horizontal">
8+
9+
<p class="text-gray">
10+
Win <span class="text-yellow">N$800</span> by submitting the highest number of correct translation entries.
11+
</p>
12+
13+
<ul class="text-normal">
14+
<li>
15+
First winner: N$500
16+
</li>
17+
<li>
18+
Second Winner: N$300
19+
</li>
20+
</ul>
21+
22+
<strong class="text-yellow" style="font-size: 1.7em;">Requirements</strong>
23+
<hr class="custom-horizontal">
24+
25+
<ul class="text-normal">
26+
<li>
27+
3 words minimum for each translation entry
28+
</li>
29+
<li>
30+
No single words will qualify. Only sentences!
31+
</li>
32+
</ul>
33+
34+
<div style="padding-left: 1em;">
35+
<p class="text-normal">
36+
<i class="bi bi-check-square-fill text-success" style=""></i>
37+
I like my dog -> Ondi hole ombwa yandje
38+
</p>
39+
40+
<p class="text-normal">
41+
<i class="bi bi-check-square-fill text-success" style=""></i>
42+
Otandi li onyama -> I am eating meat
43+
</p>
44+
45+
<p class="text-normal">
46+
<i class="bi bi-x-square-fill text-danger" style=""></i>
47+
Otandi li -> I am eating
48+
</p>
49+
50+
<p class="text-normal">
51+
<i class="bi bi-x-square-fill text-danger" style=""></i>
52+
Onyama -> Meat
53+
</p>
54+
</div>
55+
56+
<strong class="text-yellow" style="font-size: 1.7em;">Take Note</strong>
57+
<hr class="custom-horizontal">
58+
59+
<ul class="text-normal">
60+
<li>
61+
You should be <%= link_to "logged in", new_session_path(resource_name), class: "text-yellow" %>
62+
. Only correct translation entries under your username will be considered
63+
</li>
64+
<li style="padding-top: 0.5em">
65+
Starting: <span class="text-yellow">00h00, 28th April 2021</span>
66+
</li>
67+
<li style="padding-top: 0.5em">
68+
Ending: <span class="text-yellow">18h00, 29th April 2021</span>
69+
</li>
70+
<li style="padding-top: 0.5em">
71+
Windhoek time.
72+
</li>
73+
</ul>
74+
75+
<br>
76+
<br>
77+
<br>

config/routes.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
match 'privacy', to: 'pages#privacy', :via => 'get'
4141
match 'terms', to: 'pages#terms', :via => 'get'
4242
match 'guidelines', to: 'pages#guidelines', :via => 'get'
43+
match 'competition', to: 'pages#competition', :via => 'get'
4344

4445
# Make sure profile routes are always last to allow mis-routing
4546
# See https://stackoverflow.com/questions/16796244/rails-username-in-url

0 commit comments

Comments
 (0)