package fr.utc.assos.uvweb.ui.activity;

import android.os.Bundle;
import android.view.MenuItem;
import android.widget.TextView;

import fr.utc.assos.uvweb.R;
import fr.utc.assos.uvweb.model.Comment;
import fr.utc.assos.uvweb.ui.fragment.CommentFragment;

public class CommentActivity extends ToolbarActivity {

    public static final String ARG_COMMENT = "arg_comment";
    public static final String ARG_UVNAME = "arg_uvname";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);

        Comment comment = getIntent().getParcelableExtra(ARG_COMMENT);
        String uvName = getIntent().getStringExtra(ARG_UVNAME);

        setTitle(uvName);

        TextView rateView = (TextView) findViewById(R.id.globalrate);
        TextView authorView = (TextView) findViewById(R.id.author);

        rateView.setText(getString(R.string.global_rate, comment.getGlobalRate()));
        authorView.setText(comment.getAuthor());

        getSupportFragmentManager()
                .beginTransaction()
                .replace(R.id.fragment_comment_container, CommentFragment.newInstance(comment))
                .commit();
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_comment;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        if (item.getItemId() == android.R.id.home) {
            finish();
            return true;
        }
        return super.onOptionsItemSelected(item);
    }
}

@@ -422,16 +422,72 @@
 uvname%22;
+%0A    private static final String TAG_PASSED = %22obtenue%22;
 %0A%0A    @O
@@ -1057,48 +1057,302 @@
     
-authorView.setText(comment.getAuthor());
+if (comment.getPassed().equals(TAG_PASSED)) %7B%0A            authorView.setText(getString(R.string.author_passed, comment.getAuthor(), comment.getSemester()));%0A        %7D else %7B%0A            authorView.setText(getString(R.string.author_failed, comment.getAuthor(), comment.getSemester()));%0A        %7D
 %0A%0A  

Add passed vs failed information in comment detail