From 3a8f8f39fba907e5da29445e1cdc10e98bdc5d29 Mon Sep 17 00:00:00 2001 From: Mork Date: Tue, 29 Nov 2016 10:27:10 -0800 Subject: [PATCH 1/6] remove _show_dev.html.erb to resolve merge conflict --- app/views/games/_show_dev.html.erb | 36 ------------------------------ 1 file changed, 36 deletions(-) delete mode 100644 app/views/games/_show_dev.html.erb diff --git a/app/views/games/_show_dev.html.erb b/app/views/games/_show_dev.html.erb deleted file mode 100644 index c229d49..0000000 --- a/app/views/games/_show_dev.html.erb +++ /dev/null @@ -1,36 +0,0 @@ -
-

Game Title: <%= @game.title %>

-

General Ratings: <%= @game.reviews_count %> feedbacks

-<%= link_to 'edit game', edit_game_path, class: "orange" %> -| - <%= link_to 'download pdf', game_review_path(@game.id), class: "orange"%> | <%= link_to 'download game', @game.attachment_url, class: "orange"%> -

Overview

-

<%= pluralize @game.reviews_count, "Plays" %>

- <% if @game.reviews_count > 0 %> -

Fun

-
-
- <%= @game.average_score_for(:fun) %>% -
-
-

Playability

-
-
- <%= @game.average_score_for(:playability) %>% -
-
-

Difficulty

-
-
- <%= @game.average_score_for(:difficulty) %>% -
-
- <% else %> -

No Review Data

- <% end %> - Download crash logs -
<%= link_to '<
-
From 4b730dc18038037723bf89bd9c64bf314865576a Mon Sep 17 00:00:00 2001 From: Mork Date: Wed, 30 Nov 2016 10:24:44 -0800 Subject: [PATCH 2/6] add columns to game show page --- app/views/games/show.html.erb | 181 ++++++++++++++++++---------------- 1 file changed, 95 insertions(+), 86 deletions(-) diff --git a/app/views/games/show.html.erb b/app/views/games/show.html.erb index e525740..efc7372 100644 --- a/app/views/games/show.html.erb +++ b/app/views/games/show.html.erb @@ -1,97 +1,106 @@
-
- -
-
- -

<%= @game.title %>

+
+
+
+ +

<%= @game.title %>

-

Made by: <%= @game.user_company %>

-

Date: <%= @game.formatted_created_at %>

-

Type: <%= @game.type_display %>

-

Last in Arcade: <%= @game.last_in_arcade %>

-

Played: <%= @game.reviews_count %> times

-

Overall Rating: <%= @game.reviews_count %>

+

Made by: <%= @game.user_company %>

+

Date: <%= @game.formatted_created_at %>

+

Type: <%= @game.type_display %>

+

Last in Arcade: <%= @game.last_in_arcade %>

+

Played: <%= @game.reviews_count %> times

+

Overall Rating: <%= @game.reviews_count %>

- <%# if can?(:manage, @game) %> - <% if user_is_admin? || - ( user_is_dev? && @game.user_id == current_user.id) %> - <%= @game.download_button %> -
- <%= simple_form_for(@game) do |f| %> - <%= f.error_notification %> -
- <% if @game.may_approve? %> - <%= f.button :submit, Game::STATE_APPROVE %> - <% end %> - <% if @game.may_reject? %> - <%= f.button :submit, Game::STATE_REJECT %> - <% end %> + <%# if can?(:manage, @game) %> + <% if user_is_admin? || + ( user_is_dev? && @game.user_id == current_user.id) %> + <%= @game.download_button %> +
+ <%= simple_form_for(@game) do |f| %> + <%= f.error_notification %> +
+ <% if @game.may_approve? %> + <%= f.button :submit, Game::STATE_APPROVE %> + <% end %> + <% if @game.may_reject? %> + <%= f.button :submit, Game::STATE_REJECT %> + <% end %> +
+ <% end %>
- <% end %> -
- <% end %> + <% end %> + + <%# if (can? :manage, @game ) %> + <% if (user_is_dev? && @game.user_id == current_user.id ) || + user_is_admin? %> - <%# if (can? :manage, @game ) %> - <% if (user_is_dev? && @game.user_id == current_user.id ) || - user_is_admin? %> -
-

Type: - <% @game.taggings.map do |tagging| %> - <%= Tag.find(tagging.tag_id).name %>  |  - <% end %> -

-
+
+ <%= button_to "Download Pdf", game_review_path(@game.id), class:"orange" %> + <%= button_to "Download Game", @game.attachment_url, class:"orange" %> + <%= button_to "Download Crash", href="#", class:"orange" %> +
+ <% end %> -
- <%= button_to "Download Pdf", game_review_path(@game.id), class:"orange" %> - <%= button_to "Download Game", @game.attachment_url, class:"orange" %> - <%= button_to "Download Crash", href="#", class:"orange" %> -
- <% end %> + <% if user_is_gamer? %> +
+ <%= button_to "Buy", @game.link, class:"orange" %> +
+ <% end %> - <% if user_is_gamer? %> -
- <%= button_to "Buy", @game.link, class:"orange" %> -
- <% end %> +
+ +
-
- -
+
+
+
+ +
+ +
+ -
+
+

Type: + <% @game.taggings.map do |tagging| %> + <%= Tag.find(tagging.tag_id).name %>  |  + <% end %> +

+
+
+
From 4f55251a5c37334e839e3a1d3645d5b319171a8a Mon Sep 17 00:00:00 2001 From: Mork Date: Wed, 30 Nov 2016 10:54:21 -0800 Subject: [PATCH 3/6] change column layout --- app/views/games/show.html.erb | 184 +++++++++++++++++----------------- 1 file changed, 90 insertions(+), 94 deletions(-) diff --git a/app/views/games/show.html.erb b/app/views/games/show.html.erb index efc7372..fce08ae 100644 --- a/app/views/games/show.html.erb +++ b/app/views/games/show.html.erb @@ -1,106 +1,102 @@
-
-
-
- -

<%= @game.title %>

- -

Made by: <%= @game.user_company %>

-

Date: <%= @game.formatted_created_at %>

-

Type: <%= @game.type_display %>

-

Last in Arcade: <%= @game.last_in_arcade %>

-

Played: <%= @game.reviews_count %> times

-

Overall Rating: <%= @game.reviews_count %>

+
+
+

<%= @game.title %>

+

<%= @game.description %>

+ <%# if can?(:manage, @game) %> + <% if user_is_admin? || + ( user_is_dev? && @game.user_id == current_user.id) %> + <%= @game.download_button %> +
+ <%= simple_form_for(@game) do |f| %> + <%= f.error_notification %> +
+ <% if @game.may_approve? %> + <%= f.button :submit, Game::STATE_APPROVE %> + <% end %> + <% if @game.may_reject? %> + <%= f.button :submit, Game::STATE_REJECT %> + <% end %> +
+ <% end %> +
+ <% end %> - <%# if can?(:manage, @game) %> - <% if user_is_admin? || - ( user_is_dev? && @game.user_id == current_user.id) %> - <%= @game.download_button %> -
- <%= simple_form_for(@game) do |f| %> - <%= f.error_notification %> -
- <% if @game.may_approve? %> - <%= f.button :submit, Game::STATE_APPROVE %> - <% end %> - <% if @game.may_reject? %> - <%= f.button :submit, Game::STATE_REJECT %> - <% end %> -
- <% end %> -
+ <%# if (can? :manage, @game ) %> + <% if (user_is_dev? && @game.user_id == current_user.id ) || + user_is_admin? %> +
+

Type: + <% @game.taggings.map do |tagging| %> + <%= Tag.find(tagging.tag_id).name %>  |  <% end %> +

+
- <%# if (can? :manage, @game ) %> - <% if (user_is_dev? && @game.user_id == current_user.id ) || - user_is_admin? %> +
+ <%= button_to "Download Pdf", game_review_path(@game.id), class:"orange" %> + <%= button_to "Download Game", @game.attachment_url, class:"orange" %> + <%= button_to "Download Crash", href="#", class:"orange" %> +
+ <% end %> -
- <%= button_to "Download Pdf", game_review_path(@game.id), class:"orange" %> - <%= button_to "Download Game", @game.attachment_url, class:"orange" %> - <%= button_to "Download Crash", href="#", class:"orange" %> -
+
+
+
+ +
+ -
-
+

Made by: <%= @game.user_company %>

+

Date: <%= @game.formatted_created_at %>

+

Type: <%= @game.type_display %>

+

Last in Arcade: <%= @game.last_in_arcade %>

+

Played: <%= @game.reviews_count %> times

+

Overall Rating: <%= @game.reviews_count %>

-
- -
- -
- + <% if user_is_gamer? %> +
+ <%= button_to "Buy", @game.link, class:"orange" %> +
+ <% end %> -
-

Type: - <% @game.taggings.map do |tagging| %> - <%= Tag.find(tagging.tag_id).name %>  |  - <% end %> -

-
-
-
+
+ +
+
+ +
From 87017785998efda6ca21ae6537fdfc86cbaeb184 Mon Sep 17 00:00:00 2001 From: Mork Date: Wed, 30 Nov 2016 12:53:48 -0800 Subject: [PATCH 4/6] modify management div --- app/views/games/show.html.erb | 55 ++++++++++++++++++++--------------- 1 file changed, 31 insertions(+), 24 deletions(-) diff --git a/app/views/games/show.html.erb b/app/views/games/show.html.erb index fce08ae..c08f624 100644 --- a/app/views/games/show.html.erb +++ b/app/views/games/show.html.erb @@ -1,47 +1,52 @@
+
-
+

<%= @game.title %>

<%= @game.description %>

+ + <% if (user_is_dev? && @game.user_id == current_user.id ) || + user_is_admin? %> +

Type: + <% @game.taggings.map do |tagging| %> + <%= Tag.find(tagging.tag_id).name %>  |  + <% end %> +

+
<%# if can?(:manage, @game) %> <% if user_is_admin? || ( user_is_dev? && @game.user_id == current_user.id) %> - <%= @game.download_button %>
<%= simple_form_for(@game) do |f| %> <%= f.error_notification %> -
+

+ <%= link_to "Download Game", @game.download_button, class: "btn btn-default" %> <% if @game.may_approve? %> - <%= f.button :submit, Game::STATE_APPROVE %> + <%= f.button :submit, Game::STATE_APPROVE, value: "Approve Game" %> <% end %> <% if @game.may_reject? %> - <%= f.button :submit, Game::STATE_REJECT %> + <%= f.button :submit, Game::STATE_REJECT, value: "Reject Game" %> <% end %> -

+

<% end %>
<% end %> <%# if (can? :manage, @game ) %> - <% if (user_is_dev? && @game.user_id == current_user.id ) || - user_is_admin? %> -
-

Type: - <% @game.taggings.map do |tagging| %> - <%= Tag.find(tagging.tag_id).name %>  |  - <% end %> -

-
-
- <%= button_to "Download Pdf", game_review_path(@game.id), class:"orange" %> - <%= button_to "Download Game", @game.attachment_url, class:"orange" %> - <%= button_to "Download Crash", href="#", class:"orange" %> +
+

+ <%= link_to "Download Pdf", game_review_path(@game.id), class:"btn btn-default" %> + <%= link_to "Download Game", @game.attachment_url, class:"btn btn-default" %> + <%= link_to "Download Crash", href="#", class:"btn btn-default" %> +

<% end %> - +
+
-
+
+
-
- + +
+

Made by: <%= @game.user_company %>

Date: <%= @game.formatted_created_at %>

@@ -86,7 +92,7 @@

Last in Arcade: <%= @game.last_in_arcade %>

Played: <%= @game.reviews_count %> times

Overall Rating: <%= @game.reviews_count %>

- + <% if user_is_gamer? %>
<%= button_to "Buy", @game.link, class:"orange" %> @@ -100,3 +106,4 @@
+
From 5e7648accb65c5a9c4b16086091472d70946b08c Mon Sep 17 00:00:00 2001 From: Mork Date: Wed, 30 Nov 2016 15:10:25 -0800 Subject: [PATCH 5/6] update after fetch origin --- app/views/games/show.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/games/show.html.erb b/app/views/games/show.html.erb index c08f624..69d0600 100644 --- a/app/views/games/show.html.erb +++ b/app/views/games/show.html.erb @@ -12,7 +12,7 @@ <%= Tag.find(tagging.tag_id).name %>  |  <% end %>

-
+
<%# if can?(:manage, @game) %> <% if user_is_admin? || ( user_is_dev? && @game.user_id == current_user.id) %> From dc042a28a200b8a561f22698b5bc197056dad5eb Mon Sep 17 00:00:00 2001 From: Mork Date: Tue, 6 Dec 2016 10:07:51 -0800 Subject: [PATCH 6/6] update image carousel on show page --- app/views/games/show.html.erb | 64 ++++++++++++++++------------------- 1 file changed, 30 insertions(+), 34 deletions(-) diff --git a/app/views/games/show.html.erb b/app/views/games/show.html.erb index 69d0600..1684221 100644 --- a/app/views/games/show.html.erb +++ b/app/views/games/show.html.erb @@ -12,7 +12,7 @@ <%= Tag.find(tagging.tag_id).name %>  |  <% end %>

-
+
<%# if can?(:manage, @game) %> <% if user_is_admin? || ( user_is_dev? && @game.user_id == current_user.id) %> @@ -31,7 +31,6 @@ <% end %>
<% end %> - <%# if (can? :manage, @game ) %>
@@ -41,47 +40,44 @@ <%= link_to "Download Crash", href="#", class:"btn btn-default" %>

+
<% end %>
-
-
-