diff --git a/Gemfile b/Gemfile index e29b6468..464575d7 100644 --- a/Gemfile +++ b/Gemfile @@ -61,10 +61,12 @@ group :test do gem 'capybara', '>= 3.26' gem 'selenium-webdriver' # Easy installation and use of web drivers to run system tests with browsers - gem 'simplecov' + gem 'simplecov', '0.17.1', require: false # CC last supported v0.17 gem 'webdrivers' gem 'rails-controller-testing' end # Windows does not include zoneinfo files, so bundle the tzinfo-data gem gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby] + +gem "tailwindcss-rails", "~> 0.4.3" diff --git a/Gemfile.lock b/Gemfile.lock index 0734834f..70b23d1a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -281,7 +281,7 @@ GEM childprocess (>= 0.5, < 4.0) rubyzip (>= 1.2.2) semantic_range (3.0.0) - simplecov (0.17.0) + simplecov (0.17.1) docile (~> 1.1) json (>= 1.8, < 3) simplecov-html (~> 0.10.0) @@ -294,6 +294,8 @@ GEM actionpack (>= 4.0) activesupport (>= 4.0) sprockets (>= 3.0.0) + tailwindcss-rails (0.4.3) + rails (>= 6.0.0) temple (0.8.2) thor (1.1.0) tilt (2.0.10) @@ -353,8 +355,9 @@ DEPENDENCIES rspec-rails (~> 5.0.2) sass-rails (~> 6.0.0) selenium-webdriver - simplecov + simplecov (= 0.17.1) spring + tailwindcss-rails (~> 0.4.3) turbolinks (~> 5) tzinfo-data web-console (>= 4.1.0) diff --git a/app/assets/images/logo-m.png b/app/assets/images/logo-m.png new file mode 100644 index 00000000..54755484 Binary files /dev/null and b/app/assets/images/logo-m.png differ diff --git a/app/javascript/application.css b/app/javascript/application.css new file mode 100644 index 00000000..6562f5d5 --- /dev/null +++ b/app/javascript/application.css @@ -0,0 +1,3 @@ +@import "tailwindcss/base"; +@import "tailwindcss/utilities"; +@import "tailwindcss/components"; diff --git a/app/presenters/result_status_presenter.rb b/app/presenters/result_status_presenter.rb index c8e166d8..edf97f39 100644 --- a/app/presenters/result_status_presenter.rb +++ b/app/presenters/result_status_presenter.rb @@ -12,21 +12,21 @@ def status if @quiz.theory return generate_tag(@quiz.result.result) if @quiz.result - content_tag(:span, "Waiting for chellenge") + content_tag(:span, "Waiting for chellenge", class: "text-sm px-3 py-1 bg-indigo-200 text-indigo-800 rounded-full") else @in_proccess = Practice.find_by(user: user, action_name: 'domain') @practice = PracticeResult.find_by(user: user) return generate_tag(@practice.result) unless @practice.nil? - return content_tag(:span, "In Proccess", class: "answered") unless @in_proccess.nil? - content_tag(:span, "Waiting for chellenge") + return content_tag(:span, "In Proccess", class: "text-sm px-3 py-1 bg-red-200 text-red-800 rounded-full") unless @in_proccess.nil? + content_tag(:span, "Waiting for chellenge", class: "text-sm px-3 py-1 bg-indigo-200 text-indigo-800 rounded-full") end end def generate_tag(flag) - return content_tag(:span, "True", class: "green") if flag - content_tag(:span, "Fails", class: "answered") + return content_tag(:span, "Passed", class: "text-sm px-3 py-1 bg-green-200 text-green-800 rounded-full") if flag + content_tag(:span, "Failed", class: "text-sm px-3 py-1 bg-gray-200 text-gray-800 rounded-full") end end diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index 8ee66285..73f7cc03 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -1,49 +1,44 @@ <% if user_signed_in? %> -
- <%= @result %> +
-

Your quizzes:

<% if @quizzes.any? %> - - - - - - - - - - - <% current_user.quizzes.each do |quiz| %> - - - - - - <% if quiz.theory %> - - <% else %> - - <% end %> - - <% end %> - -
IDTitleStatusTypeActions
<%= quiz.id %><%= quiz.title %> - <% quiz_presenter = ResultStatusPresenter.new(quiz: quiz, user: current_user) %> - <%= quiz_presenter.status %> - + <% current_user.quizzes.each do |quiz| %> +
+
+ +
+
<%= quiz.title %>
+ + Lorem ipsum dolor, sit amet consectetur adipisicing elit. Voluptate tempore eligendi magnam + distinctio molestias. Incidunt at consequuntur consequatur + officiis repudiandae! Culpa cum vel tenetur itaque eius provident voluptatum similique impedit? + +
+ +
+ + <% quiz_presenter = ResultStatusPresenter.new(quiz: quiz, user: current_user) %> + Status <%= quiz_presenter.status %> + +
+ <% if quiz.theory %> - Theory + <%= button_to "Let's Start", quiz_prepare_path(quiz), method: :get, class: "w-full h-16 text-lg font-extrabold text-gray-100 transition duration-300 bg-purple-600 rounded-b-lg hover:bg-purple-700 cursor-pointer" %> <% else %> - Practice + + <%= button_to "Let's Start", practice_index_path, method: :get, class: "w-full h-16 text-lg font-extrabold text-gray-100 transition duration-300 bg-purple-600 rounded-b-lg hover:bg-purple-700 cursor-pointer" %> <% end %> -
<%= link_to "Start", quiz_prepare_path(quiz), class: 'actions' %><%= link_to "Start", practice_index_path, class: 'actions' %>
- <% else %> -

No any quizzes

+ +
+ <% end %> - + <% else %> + No Any Quizzes + <% end %> + + <% else %> diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 947e5bd9..ee81653f 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -7,6 +7,8 @@ <%= csrf_meta_tags %> <%= csp_meta_tag %> + <%= stylesheet_link_tag "inter-font", "data-turbo-track": "reload" %> + <%= stylesheet_link_tag "tailwind", "data-turbo-track": "reload" %> <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> <%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %> @@ -15,15 +17,13 @@ - + <%= render 'shared/navbar' %> -