Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

65 generowanie listy komentarzy #405

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
2 changes: 1 addition & 1 deletion app/controllers/article_revisions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def update
end
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Te zmiany nie mają uzasadnienia.


def edit
@article_revision = ArticleRevision.find(params[:id])
@article_revision = ArticleRevision.find(params[:id])
end

def show
Expand Down
1 change: 1 addition & 0 deletions app/controllers/issues_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def update

def show
@issue = Issue.find_by_volume(params[:id])
@article_revisions = ArticleRevision.joins(:submission).where(submissions: { issue: id })
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: params[:id]

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choć mam spore wątpliwości odnośnie tego czy to jest potrzebne.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To powinno być w osobnej akcji show_comments zdefiniowanej w tym kontrolerze. Na wzór akcji takich jak show_reviews etc.

end


Expand Down
9 changes: 9 additions & 0 deletions app/models/submission.rb
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,15 @@ def last_deadline
end
end

def show_comments
if self.last_revision
self.last_revision.comments
else
"[ZAAKCEPTOWANO BEZ ZMIAN]"
end
end


def deadline_missed?
self.reviews.any?{|r| r.deadline_missed? }
end
Expand Down
17 changes: 17 additions & 0 deletions app/views/article_revisions/index.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.scroll-panel-header
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Proszę to przenieść do pliku app/views/issues/show_comments.html.haml

%h3.scroll-panel-title Komentarze do numeru
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Niepoprawne wcięcie - 2 spacje powinny być.

.scroll-panel-body
%table.table.table-hover.table-admin
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lepiej byłoby wyświetlić to w postaci listy (np. dl), ponieważ komentarz może być dość rozbudowany.

%thead
%tr
%th Numer
%th Artykuł
%th Wersja
%th Komentarz
%tbody
- @article_revisions.each do |revision|
%tr
%td= @issue_id
%td= revision.submission.title
%td= revision.version
%td= revision.comment
4 changes: 3 additions & 1 deletion app/views/issues/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@
= link_to "Edytuj", edit_issue_path(@issue), class: %w{btn btn-primary btn-sm}
= link_to "Pokaż recenzje", show_reviews_issue_path(@issue), class: %w{btn btn-default btn-sm}
= link_to "Pokaż recenzentów", show_reviewers_issue_path(@issue), class: %w{btn btn-default btn-sm}
= link_to "Komentarze do numeru", article_revisions_path(issue_id: @issue.id), class: %w{btn btn-default btn-sm pull-right}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jw. tzn. show_comments_issue_path(@issue)


.scroll-panel-body

%h3 Zgłoszone artykuły
%table.table.table-hover.table-admin
%table.table.table-hover.table-admin
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Należy usunąć tę spację.

%thead
%tr
%th Tytuł
Expand Down
8 changes: 8 additions & 0 deletions spec/features/submissions_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,14 @@
expect(page).to have_content("nie może być puste")
end


scenario "sortowanie zgłoszeń względem daty nadesłania" do
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, ten test nie ma sensu w tym kontekście

visit "/submissions"
click_on("Data nadesłania")
expect(page).to have_content(/11-01-2016.*19-01-2016/)
click_on("Data nadesłania")
expect(page).to have_content(/19-01-2016.*11-01-2016/)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

brakuje end


scenario "wysłanie maila z umową" do
visit '/submissions'
clear_emails
Expand Down