locale_ninja 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +20 -0
  3. data/README.md +93 -0
  4. data/Rakefile +10 -0
  5. data/app/assets/builds/locale_ninja.css +1 -0
  6. data/app/assets/config/locale_ninja_manifest.js +1 -0
  7. data/app/assets/stylesheets/application.tailwind.css +17 -0
  8. data/app/assets/stylesheets/locale_ninja/application.css +26 -0
  9. data/app/controllers/locale_ninja/application_controller.rb +35 -0
  10. data/app/controllers/locale_ninja/branches_controller.rb +22 -0
  11. data/app/controllers/locale_ninja/dashboard_controller.rb +19 -0
  12. data/app/controllers/locale_ninja/locales_controller.rb +33 -0
  13. data/app/controllers/locale_ninja/session_controller.rb +34 -0
  14. data/app/helpers/locale_ninja/application_helper.rb +9 -0
  15. data/app/helpers/locale_ninja/dashboard_helper.rb +6 -0
  16. data/app/helpers/locale_ninja/locale_helper.rb +91 -0
  17. data/app/jobs/locale_ninja/application_job.rb +6 -0
  18. data/app/mailers/locale_ninja/application_mailer.rb +8 -0
  19. data/app/models/locale_ninja/application_record.rb +7 -0
  20. data/app/services/locale_ninja/github_api_service.rb +98 -0
  21. data/app/views/components/_branch_select.html.erb +10 -0
  22. data/app/views/components/_flashes.html.erb +33 -0
  23. data/app/views/components/_sidebar.html.erb +31 -0
  24. data/app/views/components/_table.html.erb +204 -0
  25. data/app/views/layouts/locale_ninja/application.html.erb +15 -0
  26. data/app/views/locale_ninja/branches/index.html.erb +1 -0
  27. data/app/views/locale_ninja/branches/show.html.erb +22 -0
  28. data/app/views/locale_ninja/dashboard/index.html.erb +34 -0
  29. data/app/views/locale_ninja/locales/show.html.erb +21 -0
  30. data/config/credentials/development.key +1 -0
  31. data/config/credentials/development.yml.enc +1 -0
  32. data/config/credentials/production.yml.enc +1 -0
  33. data/config/locales/locale_ninja/en.yml +6 -0
  34. data/config/locales/locale_ninja/fr.yml +6 -0
  35. data/config/routes.rb +13 -0
  36. data/config/tailwind.config.js +23 -0
  37. data/lib/locale_ninja/engine.rb +11 -0
  38. data/lib/locale_ninja/version.rb +6 -0
  39. data/lib/locale_ninja.rb +8 -0
  40. data/lib/tasks/locale_ninja_tasks.rake +21 -0
  41. metadata +190 -0
@@ -0,0 +1,31 @@
1
+ <aside class="flex flex-col w-64 h-screen px-4 py-8 overflow-y-auto bg-white border-r rtl:border-r-0 rtl:border-l">
2
+ <div class="flex flex-col justify-between flex-1 mt-6">
3
+ <nav>
4
+
5
+ <%= link_to root_path, class: "flex items-center px-4 py-2 text-gray-600 transition-colors duration-300 transform rounded-md hover:bg-gray-100 hover:text-gray-700#{current_page?(root_path) ? ' bg-blue-50 text-gray-900' : ''}" do %>
6
+ <span class="mx-4 font-medium">Dashboard</span>
7
+ <% end %>
8
+
9
+ <%= link_to branches_path, class: "flex items-center px-4 py-2 text-gray-600 transition-colors duration-300 transform rounded-md hover:bg-gray-100 hover:text-gray-700#{(controller_name.eql? "branches") && (action_name.eql? "show") ? ' bg-blue-50 text-gray-900' : ''}" do %>
10
+ <span class="mx-4 font-medium">Translations</span>
11
+ <% end %>
12
+ <hr class="my-6 border-gray-200" />
13
+
14
+ <a class="flex items-center px-4 py-2 mt-5 text-gray-600 transition-colors duration-300 transform rounded-md hover:bg-gray-100 hover:text-gray-700" href="#">
15
+ <svg class="w-5 h-5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
16
+ <path d="M10.3246 4.31731C10.751 2.5609 13.249 2.5609 13.6754 4.31731C13.9508 5.45193 15.2507 5.99038 16.2478 5.38285C17.7913 4.44239 19.5576 6.2087 18.6172 7.75218C18.0096 8.74925 18.5481 10.0492 19.6827 10.3246C21.4391 10.751 21.4391 13.249 19.6827 13.6754C18.5481 13.9508 18.0096 15.2507 18.6172 16.2478C19.5576 17.7913 17.7913 19.5576 16.2478 18.6172C15.2507 18.0096 13.9508 18.5481 13.6754 19.6827C13.249 21.4391 10.751 21.4391 10.3246 19.6827C10.0492 18.5481 8.74926 18.0096 7.75219 18.6172C6.2087 19.5576 4.44239 17.7913 5.38285 16.2478C5.99038 15.2507 5.45193 13.9508 4.31731 13.6754C2.5609 13.249 2.5609 10.751 4.31731 10.3246C5.45193 10.0492 5.99037 8.74926 5.38285 7.75218C4.44239 6.2087 6.2087 4.44239 7.75219 5.38285C8.74926 5.99037 10.0492 5.45193 10.3246 4.31731Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
17
+ <path d="M15 12C15 13.6569 13.6569 15 12 15C10.3431 15 9 13.6569 9 12C9 10.3431 10.3431 9 12 9C13.6569 9 15 10.3431 15 12Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
18
+ </svg>
19
+
20
+ <span class="mx-4 font-medium">Settings</span>
21
+ </a>
22
+ </nav>
23
+ <div class="flex flex-col">
24
+ <div class="flex items-center px-4 py-2 text-gray-600 rounded-md">
25
+ <img class="object-cover rounded-full h-9 w-9" src="<%= session.dig(:user,:avatar_url) %>" alt="avatar" />
26
+ <span class="font-medium mx-4 text-gray-600">@<%= session.dig(:user,:login) %></span>
27
+ </div>
28
+ <%= link_to 'Disconnect from Github', logout_path, class: "flex items-center px-4 text-gray-600 hover:underline" %>
29
+ <div>
30
+ </div>
31
+ </aside>
@@ -0,0 +1,204 @@
1
+ <section class="container">
2
+
3
+ <div class="flex flex-col mt-6">
4
+ <div class="-mx-4 -my-2 overflow-x-auto sm:-mx-6 lg:-mx-8">
5
+ <div class="inline-block min-w-full py-2 align-middle md:px-6 lg:px-8">
6
+ <div class="overflow-hidden border border-gray-200 md:rounded-lg">
7
+ <table class="min-w-full divide-y divide-gray-200">
8
+ <thead class="bg-gray-50">
9
+ <tr>
10
+ <th scope="col" class="py-3.5 px-4 text-sm font-normal text-left rtl:text-right text-gray-500">
11
+ <button class="flex items-center gap-x-3 focus:outline-none">
12
+ <span>Key</span>
13
+
14
+ <svg class="h-3" viewBox="0 0 10 11" fill="none" xmlns="http://www.w3.org/2000/svg">
15
+ <path d="M2.13347 0.0999756H2.98516L5.01902 4.79058H3.86226L3.45549 3.79907H1.63772L1.24366 4.79058H0.0996094L2.13347 0.0999756ZM2.54025 1.46012L1.96822 2.92196H3.11227L2.54025 1.46012Z" fill="currentColor" stroke="currentColor" stroke-width="0.1" />
16
+ <path d="M0.722656 9.60832L3.09974 6.78633H0.811638V5.87109H4.35819V6.78633L2.01925 9.60832H4.43446V10.5617H0.722656V9.60832Z" fill="currentColor" stroke="currentColor" stroke-width="0.1" />
17
+ <path d="M8.45558 7.25664V7.40664H8.60558H9.66065C9.72481 7.40664 9.74667 7.42274 9.75141 7.42691C9.75148 7.42808 9.75146 7.42993 9.75116 7.43262C9.75001 7.44265 9.74458 7.46304 9.72525 7.49314C9.72522 7.4932 9.72518 7.49326 9.72514 7.49332L7.86959 10.3529L7.86924 10.3534C7.83227 10.4109 7.79863 10.418 7.78568 10.418C7.77272 10.418 7.73908 10.4109 7.70211 10.3534L7.70177 10.3529L5.84621 7.49332C5.84617 7.49325 5.84612 7.49318 5.84608 7.49311C5.82677 7.46302 5.82135 7.44264 5.8202 7.43262C5.81989 7.42993 5.81987 7.42808 5.81994 7.42691C5.82469 7.42274 5.84655 7.40664 5.91071 7.40664H6.96578H7.11578V7.25664V0.633865C7.11578 0.42434 7.29014 0.249976 7.49967 0.249976H8.07169C8.28121 0.249976 8.45558 0.42434 8.45558 0.633865V7.25664Z" fill="currentColor" stroke="currentColor" stroke-width="0.3" />
18
+ </svg>
19
+ </button>
20
+ </th>
21
+
22
+ <th scope="col" class="px-4 py-3.5 text-sm font-normal text-left rtl:text-right text-gray-500">
23
+ Text
24
+ </th>
25
+
26
+ <th scope="col" class="px-4 py-3.5 text-sm font-normal text-left rtl:text-right text-gray-500">Users</th>
27
+
28
+ <th scope="col" class="px-4 py-3.5 text-sm font-normal text-left rtl:text-right text-gray-500">Last edited</th>
29
+
30
+ <th scope="col" class="relative py-3.5 px-4">
31
+ <span class="sr-only">Edit</span>
32
+ </th>
33
+ </tr>
34
+ </thead>
35
+ <tbody class="bg-white divide-y divide-gray-200">
36
+ <tr>
37
+ <td class="px-4 py-4 text-sm font-medium whitespace-nowrap">
38
+ <div>
39
+ <p class="text-sm font-normal text-gray-600">catalogapp.io</p>
40
+ </div>
41
+ </td>
42
+ <td class="px-4 py-4 text-sm whitespace-nowrap">
43
+ <div>
44
+ <p class="text-gray-500">Brings all your news into one place</p>
45
+ </div>
46
+ </td>
47
+ <td class="px-4 py-4 text-sm whitespace-nowrap">
48
+ <div class="flex items-center">
49
+ <img class="object-cover w-6 h-6 -mx-1 border-2 border-white rounded-full shrink-0" src="https://images.unsplash.com/photo-1494790108377-be9c29b29330?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=256&q=80" alt="">
50
+ <img class="object-cover w-6 h-6 -mx-1 border-2 border-white rounded-full shrink-0" src="https://images.unsplash.com/photo-1534528741775-53994a69daeb?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=256&q=80" alt="">
51
+ <img class="object-cover w-6 h-6 -mx-1 border-2 border-white rounded-full shrink-0" src="https://images.unsplash.com/photo-1438761681033-6461ffad8d80?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1256&q=80" alt="">
52
+ <img class="object-cover w-6 h-6 -mx-1 border-2 border-white rounded-full shrink-0" src="https://images.unsplash.com/photo-1560250097-0b93528c311a?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=256&q=80" alt="">
53
+ <p class="flex items-center justify-center w-6 h-6 -mx-1 text-xs text-blue-600 bg-blue-100 border-2 border-white rounded-full">+4</p>
54
+ </div>
55
+ </td>
56
+
57
+ <td class="px-4 py-4 text-sm whitespace-nowrap">
58
+ <p class="text-gray-500">2 days ago</p>
59
+ </td>
60
+
61
+ <td class="px-4 py-4 text-sm whitespace-nowrap">
62
+ <button class="px-1 py-1 text-gray-500 transition-colors duration-200 rounded-lg hover:bg-gray-100">
63
+ <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
64
+ <path stroke-linecap="round" stroke-linejoin="round" d="M12 6.75a.75.75 0 110-1.5.75.75 0 010 1.5zM12 12.75a.75.75 0 110-1.5.75.75 0 010 1.5zM12 18.75a.75.75 0 110-1.5.75.75 0 010 1.5z" />
65
+ </svg>
66
+ </button>
67
+ </td>
68
+ </tr>
69
+
70
+ <tr>
71
+ <td class="px-4 py-4 text-sm font-medium whitespace-nowrap">
72
+ <div>
73
+ <p class="text-sm font-normal text-gray-600">getcirooles.com</p>
74
+ </div>
75
+ </td>
76
+ <td class="px-4 py-4 text-sm whitespace-nowrap">
77
+ <div>
78
+ <p class="text-gray-500">Super lightweight design app</p>
79
+ </div>
80
+ </td>
81
+ <td class="px-4 py-4 text-sm whitespace-nowrap">
82
+ <div class="flex items-center">
83
+ <img class="object-cover w-6 h-6 -mx-1 border-2 border-white rounded-full shrink-0" src="https://images.unsplash.com/photo-1494790108377-be9c29b29330?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=256&q=80" alt="">
84
+ <img class="object-cover w-6 h-6 -mx-1 border-2 border-white rounded-full shrink-0" src="https://images.unsplash.com/photo-1534528741775-53994a69daeb?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=256&q=80" alt="">
85
+ <img class="object-cover w-6 h-6 -mx-1 border-2 border-white rounded-full shrink-0" src="https://images.unsplash.com/photo-1438761681033-6461ffad8d80?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1256&q=80" alt="">
86
+ <img class="object-cover w-6 h-6 -mx-1 border-2 border-white rounded-full shrink-0" src="https://images.unsplash.com/photo-1560250097-0b93528c311a?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=256&q=80" alt="">
87
+ <p class="flex items-center justify-center w-6 h-6 -mx-1 text-xs text-blue-600 bg-blue-100 border-2 border-white rounded-full">+4</p>
88
+ </div>
89
+ </td>
90
+
91
+ <td class="px-4 py-4 text-sm whitespace-nowrap">
92
+ <p class="text-gray-500">15 days ago</p>
93
+ </td>
94
+
95
+ <td class="px-4 py-4 text-sm whitespace-nowrap">
96
+ <button class="px-1 py-1 text-gray-500 transition-colors duration-200 rounded-lg hover:bg-gray-100">
97
+ <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
98
+ <path stroke-linecap="round" stroke-linejoin="round" d="M12 6.75a.75.75 0 110-1.5.75.75 0 010 1.5zM12 12.75a.75.75 0 110-1.5.75.75 0 010 1.5zM12 18.75a.75.75 0 110-1.5.75.75 0 010 1.5z" />
99
+ </svg>
100
+ </button>
101
+ </td>
102
+ </tr>
103
+ <tr>
104
+ <td class="px-4 py-4 text-sm font-medium whitespace-nowrap">
105
+ <div>
106
+ <p class="text-sm font-normal text-gray-600">catalogapp.io</p>
107
+ </div>
108
+ </td>
109
+ <td class="px-4 py-4 text-sm whitespace-nowrap">
110
+ <div>
111
+ <p class="text-gray-500">Brings all your news into one place</p>
112
+ </div>
113
+ </td>
114
+ <td class="px-4 py-4 text-sm whitespace-nowrap">
115
+ <div class="flex items-center">
116
+ <img class="object-cover w-6 h-6 -mx-1 border-2 border-white rounded-full shrink-0" src="https://images.unsplash.com/photo-1494790108377-be9c29b29330?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=256&q=80" alt="">
117
+ <img class="object-cover w-6 h-6 -mx-1 border-2 border-white rounded-full shrink-0" src="https://images.unsplash.com/photo-1534528741775-53994a69daeb?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=256&q=80" alt="">
118
+ <img class="object-cover w-6 h-6 -mx-1 border-2 border-white rounded-full shrink-0" src="https://images.unsplash.com/photo-1438761681033-6461ffad8d80?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1256&q=80" alt="">
119
+ <img class="object-cover w-6 h-6 -mx-1 border-2 border-white rounded-full shrink-0" src="https://images.unsplash.com/photo-1560250097-0b93528c311a?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=256&q=80" alt="">
120
+ <p class="flex items-center justify-center w-6 h-6 -mx-1 text-xs text-blue-600 bg-blue-100 border-2 border-white rounded-full">+4</p>
121
+ </div>
122
+ </td>
123
+
124
+ <td class="px-4 py-4 text-sm whitespace-nowrap">
125
+ <p class="text-gray-500">2 minutes ago</p>
126
+ </td>
127
+
128
+ <td class="px-4 py-4 text-sm whitespace-nowrap">
129
+ <button class="px-1 py-1 text-gray-500 transition-colors duration-200 rounded-lg hover:bg-gray-100">
130
+ <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
131
+ <path stroke-linecap="round" stroke-linejoin="round" d="M12 6.75a.75.75 0 110-1.5.75.75 0 010 1.5zM12 12.75a.75.75 0 110-1.5.75.75 0 010 1.5zM12 18.75a.75.75 0 110-1.5.75.75 0 010 1.5z" />
132
+ </svg>
133
+ </button>
134
+ </td>
135
+ </tr>
136
+
137
+ <tr>
138
+ <td class="px-4 py-4 text-sm font-medium whitespace-nowrap">
139
+ <div>
140
+ <p class="text-sm font-normal text-gray-600">getcirooles.com</p>
141
+ </div>
142
+ </td>
143
+ <td class="px-4 py-4 text-sm whitespace-nowrap">
144
+ <div>
145
+ <p class="text-gray-500">Super lightweight design app</p>
146
+ </div>
147
+ </td>
148
+ <td class="px-4 py-4 text-sm whitespace-nowrap">
149
+ <div class="flex items-center">
150
+ <img class="object-cover w-6 h-6 -mx-1 border-2 border-white rounded-full shrink-0" src="https://images.unsplash.com/photo-1494790108377-be9c29b29330?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=256&q=80" alt="">
151
+ <img class="object-cover w-6 h-6 -mx-1 border-2 border-white rounded-full shrink-0" src="https://images.unsplash.com/photo-1534528741775-53994a69daeb?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=256&q=80" alt="">
152
+ <img class="object-cover w-6 h-6 -mx-1 border-2 border-white rounded-full shrink-0" src="https://images.unsplash.com/photo-1438761681033-6461ffad8d80?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1256&q=80" alt="">
153
+ <img class="object-cover w-6 h-6 -mx-1 border-2 border-white rounded-full shrink-0" src="https://images.unsplash.com/photo-1560250097-0b93528c311a?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=256&q=80" alt="">
154
+ <p class="flex items-center justify-center w-6 h-6 -mx-1 text-xs text-blue-600 bg-blue-100 border-2 border-white rounded-full">+4</p>
155
+ </div>
156
+ </td>
157
+
158
+ <td class="px-4 py-4 text-sm whitespace-nowrap">
159
+ <p class="text-gray-500">2 months ago</p>
160
+ </td>
161
+
162
+ <td class="px-4 py-4 text-sm whitespace-nowrap">
163
+ <button class="px-1 py-1 text-gray-500 transition-colors duration-200 rounded-lg hover:bg-gray-100">
164
+ <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
165
+ <path stroke-linecap="round" stroke-linejoin="round" d="M12 6.75a.75.75 0 110-1.5.75.75 0 010 1.5zM12 12.75a.75.75 0 110-1.5.75.75 0 010 1.5zM12 18.75a.75.75 0 110-1.5.75.75 0 010 1.5z" />
166
+ </svg>
167
+ </button>
168
+ </td>
169
+ </tr>
170
+ </tbody>
171
+ </table>
172
+ </div>
173
+ </div>
174
+ </div>
175
+ </div>
176
+
177
+ <div class="mt-6 sm:flex sm:items-center sm:justify-between ">
178
+ <div class="text-sm text-gray-500">
179
+ Page <span class="font-medium text-gray-700">1 of 10</span>
180
+ </div>
181
+
182
+ <div class="flex items-center mt-4 gap-x-4 sm:mt-0">
183
+ <a href="#" class="flex items-center justify-center w-1/2 px-5 py-2 text-sm text-gray-700 capitalize transition-colors duration-200 bg-white border rounded-md sm:w-auto gap-x-2 hover:bg-gray-100">
184
+ <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-5 h-5 rtl:-scale-x-100">
185
+ <path stroke-linecap="round" stroke-linejoin="round" d="M6.75 15.75L3 12m0 0l3.75-3.75M3 12h18" />
186
+ </svg>
187
+
188
+ <span>
189
+ previous
190
+ </span>
191
+ </a>
192
+
193
+ <a href="#" class="flex items-center justify-center w-1/2 px-5 py-2 text-sm text-gray-700 capitalize transition-colors duration-200 bg-white border rounded-md sm:w-auto gap-x-2 hover:bg-gray-100">
194
+ <span>
195
+ Next
196
+ </span>
197
+
198
+ <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-5 h-5 rtl:-scale-x-100">
199
+ <path stroke-linecap="round" stroke-linejoin="round" d="M17.25 8.25L21 12m0 0l-3.75 3.75M21 12H3" />
200
+ </svg>
201
+ </a>
202
+ </div>
203
+ </div>
204
+ </section>
@@ -0,0 +1,15 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Locale ninja</title>
5
+ <%= csrf_meta_tags %>
6
+ <%= csp_meta_tag %>
7
+ <%= stylesheet_link_tag "locale_ninja/application", media: "all" %>
8
+ <%= stylesheet_link_tag "locale_ninja", "data-turbo-track": "reload" %>
9
+ </head>
10
+ <body class="flex min-h-screen">
11
+ <%= render "/components/sidebar" %>
12
+ <%= yield %>
13
+ <%= render 'components/flashes' %>
14
+ </body>
15
+ </html>
@@ -0,0 +1 @@
1
+ <%= render '/components/branch_select' %>
@@ -0,0 +1,22 @@
1
+ <div class="flex flex-col w-full p-8">
2
+ <%= render '/components/branch_select' %>
3
+
4
+ <h1 class="text-dark-blue mb-8">Actual branch : <%= @branch_name %></h1>
5
+ <div class="flex flex-wrap">
6
+ <% @code_value_by_locales.each do |locale, *values| %>
7
+ <%= link_to branch_locale_path(@branch_name, locale), class: "w-48 max-w-sm px-4 py-3 mr-8 mb-8 bg-white rounded-md shadow-md border-solid border-t-4 border-blue-600" do %>
8
+ <div class="flex flex-col justify-between">
9
+ <div>
10
+ <div>
11
+ <span class="text-lg font-bold text-gray-800"><%= locale %></span>
12
+ <span class="text-sm font-light text-gray-800"><%= country_flag(locale) %></span>
13
+ </div>
14
+ </div>
15
+ <div class="w-full bg-gray-200 rounded-full h-2.5">
16
+ <div class="bg-blue-600 h-2.5 rounded-full" style="width: <%= (values[0].count{|key, value| value.present?}.to_f / values[0].count.to_f) * 100 %>%"></div>
17
+ </div>
18
+ </div>
19
+ <% end %>
20
+ <% end %>
21
+ </div>
22
+ </div>
@@ -0,0 +1,34 @@
1
+ <div class="flex flex-col w-full p-8">
2
+ <h1 class="text-dark-blue">Dashboard</h1>
3
+ <div class="w-full p-8 my-8 bg-white rounded-lg shadow-md border-t-4 border-blue-600">
4
+ <div class="mt-2">
5
+ <span class="text-xl font-bold text-gray-700">Internationalization made easy ✌️</span>
6
+ <p class="mt-2 text-gray-600">Manage your translations in a simple and easy way. No more spreadsheets, no more copy-pasting. Just focus on your app.</p>
7
+ </div>
8
+ </div>
9
+ <div class="flex flex-row gap-4 my-4">
10
+ <div class="w-full p-8 space-y-8 text-center bg-white rounded-lg shadow-md">
11
+ <p class="font-medium text-gray-900 uppercase">Number of branches</p>
12
+
13
+ <h2 class="text-5xl font-bold uppercase">
14
+ <%= @branches_count %>
15
+ </h2>
16
+ </div>
17
+ <div class="w-full p-8 space-y-8 text-center bg-white rounded-lg shadow-md">
18
+ <p class="font-medium text-gray-900 uppercase">Number of commits</p>
19
+
20
+ <h2 class="text-5xl font-bold uppercase">
21
+ <%= @commits_count%>
22
+ </h2>
23
+
24
+ <p class="font-medium text-gray-900">last month</p>
25
+ </div>
26
+ <div class="w-full p-8 space-y-8 text-center bg-white rounded-lg shadow-md">
27
+ <p class="font-medium text-gray-900 uppercase">Number of languages</p>
28
+
29
+ <h2 class="text-5xl font-bold uppercase">
30
+ <%= @locales_count %>
31
+ </h2>
32
+ </div>
33
+ </div>
34
+ </div>
@@ -0,0 +1,21 @@
1
+ <div class="flex flex-col w-full p-8">
2
+ <div class="flex justify-between items-center">
3
+ <h1>Page de la langue <%= country_flag(@locale) %></h1>
4
+ <div class="font-bold text-gray-400">Traductions manquantes : <%= @translations.count{|key, value| value.blank?} %></div>
5
+ </div>
6
+ <div class="py-8 my-8">
7
+ <%= form_with url: branch_locale_path(@branch_name, @locale), method: :patch do |form| %>
8
+ <% @translations.each do |(target_key, target_value), (source_key, source_value)| %>
9
+ <div class="mb-8">
10
+ <div class="flex">
11
+ <%= form.label "code", "Default sentence:", class: "block text-sm mr-1 text-gray-500 self-center" %>
12
+ <%= form.label "source_val", (source_value || ''), class: "block text-sm self-center" %>
13
+ </div>
14
+ <%= form.label "code", target_key.split('$').last, class: "block text-sm text-gray-500" %>
15
+ <%= form.text_field "val[#{target_key}]", value: target_value, class: "block mt-2 w-full placeholder-gray-400/70 rounded-lg border border-gray-200 bg-white px-5 py-2.5 text-gray-700 focus:border-blue-400 focus:outline-none focus:ring focus:ring-blue-300 focus:ring-opacity-40" %>
16
+ </div>
17
+ <% end %>
18
+ <%= form.submit "Enregistrer", class: "px-4 py-2 text-sm font-medium text-white bg-blue-500 rounded-md hover:bg-blue-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-400" %>
19
+ <% end %>
20
+ </div>
21
+ </div>
@@ -0,0 +1 @@
1
+ 8ea34c7919dc3a47b5022227073cc53f
@@ -0,0 +1 @@
1
+ 8Zlm4FLKzgIQnlpgi5LfQ1Pu7hK8Zm+lnkwVpVVatBq8m4K4jFj886DlIh5N7d33tBBKD67EhXBBaKet9TUeG4stYdQ=--Yw5SQyilZhPfsd+S--MwnZgxyrridWzWrTnRpMFw==
@@ -0,0 +1 @@
1
+ BQr3/TNxG9UXgVotNDr3O9Jh+LQQvsyK/szxkr4Ha3XUwH8G3pjKp38VW1jf7tO3qEDmlFpEe1q0cJIlSwJ9CX2xgWY=--R2WNPX4reF0LdIzL--75aNMyz2KyhHjeoOAimYnQ==
@@ -0,0 +1,6 @@
1
+ en:
2
+ locale_ninja:
3
+ locales:
4
+ update:
5
+ error: Translation could not be updated.
6
+ success: Translation has been updated.
@@ -0,0 +1,6 @@
1
+ fr:
2
+ locale_ninja:
3
+ locales:
4
+ update:
5
+ error: La traduction n'a pas pu être mise à jour.
6
+ success: La traduction a été mise à jour.
data/config/routes.rb ADDED
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ LocaleNinja::Engine.routes.draw do
4
+ root to: 'dashboard#index'
5
+
6
+ resources :dashboard, only: [:index]
7
+ post 'branch/select', to: 'branches#select'
8
+ resources :branches, only: %i[index show] do
9
+ resources :locales, only: %i[index show update], param: :locale
10
+ end
11
+ get '/github', to: 'session#login'
12
+ get '/logout', to: 'session#logout'
13
+ end
@@ -0,0 +1,23 @@
1
+ const defaultTheme = require('tailwindcss/defaultTheme')
2
+
3
+ module.exports = {
4
+ content: [
5
+ './public/*.html',
6
+ './app/helpers/**/*.rb',
7
+ './app/javascript/**/*.js',
8
+ './app/views/**/*.{erb,haml,html,slim}'
9
+ ],
10
+ theme: {
11
+ extend: {
12
+ fontFamily: {
13
+ sans: ['Inter var', ...defaultTheme.fontFamily.sans],
14
+ },
15
+ },
16
+ },
17
+ plugins: [
18
+ require('@tailwindcss/forms'),
19
+ require('@tailwindcss/aspect-ratio'),
20
+ require('@tailwindcss/typography'),
21
+ require('@tailwindcss/container-queries'),
22
+ ]
23
+ }
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module LocaleNinja
4
+ class Engine < ::Rails::Engine
5
+ isolate_namespace LocaleNinja
6
+
7
+ initializer 'locale_ninja.assets' do |app|
8
+ app.config.assets.precompile += %w[locale_ninja_manifest locale_ninja/application.css locale_ninja.css]
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module LocaleNinja
4
+ VERSION = '0.1.2'
5
+ public_constant :VERSION
6
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'locale_ninja/version'
4
+ require 'locale_ninja/engine'
5
+
6
+ module LocaleNinja
7
+ # Your code goes here...
8
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ task tailwind_engine_watch: :environment do
4
+ require 'tailwindcss-rails'
5
+
6
+ system "#{Tailwindcss::Engine.root.join('exe/tailwindcss')} \
7
+ -i #{LocaleNinja::Engine.root.join('app/assets/stylesheets/application.tailwind.css')} \
8
+ -o #{LocaleNinja::Engine.root.join('app/assets/builds/locale_ninja.css')} \
9
+ -c #{LocaleNinja::Engine.root.join('config/tailwind.config.js')} \
10
+ --minify -w"
11
+ end
12
+
13
+ task tailwind_engine_build: :environment do
14
+ require 'tailwindcss-rails'
15
+
16
+ system "#{Tailwindcss::Engine.root.join('exe/tailwindcss')} \
17
+ -i #{LocaleNinja::Engine.root.join('app/assets/stylesheets/application.tailwind.css')} \
18
+ -o #{LocaleNinja::Engine.root.join('app/assets/builds/locale_ninja.css')} \
19
+ -c #{LocaleNinja::Engine.root.join('config/tailwind.config.js')} \
20
+ --minify"
21
+ end