<commit_before>import UIKit
import WMF

@objc protocol ReadMoreAboutRevertedEditViewControllerDelegate: class {
    func readMoreAboutRevertedEditViewControllerDidPressGoToArticleButton(_ articleKey: String)
    func readMoreAboutRevertedEditViewControllerDidPressShowHistoryButton()
}

class ReadMoreAboutRevertedEditViewController: WMFScrollViewController {
    private var theme = Theme.standard
    @IBOutlet weak var contentView: UIView!
    @IBOutlet weak var titleLabel: UILabel!
    @IBOutlet weak var subtitleLabel: UILabel!
    @IBOutlet weak var contentTextView: UITextView!
    @IBOutlet weak var contentTextViewHeightConstraint: NSLayoutConstraint!
    @IBOutlet weak var button: UIButton!

    @objc public var articleKeys: [String]?

    private var isSingleRevert: Bool {
        return articleKeys?.count == 1
    }

    private var buttonTitle: String {
        if isSingleRevert {
            return WMFLocalizedString("reverted-edit-back-to-article-button-title", value: "Back to article", comment: "Title for button that allows the user to go back to the article they edited")
        } else {
            return WMFLocalizedString("reverted-edit-back-to-history-button-title", value: "Back to History", comment: "Title for button that allows the user to go back to reading history")
        }
    }

    private var subtitle: String {
        if isSingleRevert {
            return WMFLocalizedString("reverted-edit-possible-reasons-subtitle", value: "We know that you tried your best, but one of the reviewers had a concern.\n\nPossible reasons your edit was reverted include:", comment: "Subtitle leading to an explanation why an edit was reverted.")
        } else {
            return WMFLocalizedString("reverted-edits-possible-reasons-subtitle", value: "We know that you tried your best, but some reviewers had concerns.\n\nPossible reasons your edits were reverted include:", comment: "Subtitle leading to an explanation why an edit was reverted.")
        }
    }

    private var titleText: String? {
        if isSingleRevert {
            return WMFLocalizedString("reverted-edit-title", value: "Reverted edit", comment: "Title for the view explaining why an edit was reverted.")
        } else {
            return WMFLocalizedString("reverted-edits-title", value: "Reverted edits", comment: "Title for the view explaining why edits were reverted.")
        }
    }

    @objc public weak var delegate: ReadMoreAboutRevertedEditViewControllerDelegate?

    override public func viewDidLoad() {
        super.viewDidLoad()
        contentTextView.delegate = self
        title = titleText
        
        view.wmf_configureSubviewsForDynamicType()

        titleLabel.text = WMFLocalizedString("reverted-edit-thanks-for-editing-title", value: "Thanks for editing Wikipedia!", comment: "Title thanking the user for contributing to Wikipedia")
        subtitleLabel.text = subtitle

        button.setTitle(buttonTitle, for: .normal)
        button.layer.cornerRadius = 8
        button.contentEdgeInsets = UIEdgeInsets(top: 12, left: 24, bottom: 12, right: 24)
        button.addTarget(self, action: #selector(buttonPressed), for: .touchUpInside)

        apply(theme: theme)
    }

    @objc private func close() {
        dismiss(animated: true)
    }

    @objc private func buttonPressed() {
        close()
        if isSingleRevert, let articleKey = articleKeys?.first {
            delegate?.readMoreAboutRevertedEditViewControllerDidPressGoToArticleButton(articleKey)
        } else {
            delegate?.readMoreAboutRevertedEditViewControllerDidPressShowHistoryButton()
        }
    }

    override func viewWillAppear(_ animated: Bool) {<commit_msg>remove any notion of multiple notifications from ReadMoreAboutRevertedEditViewController<commit_after>import UIKit
import WMF

@objc protocol ReadMoreAboutRevertedEditViewControllerDelegate: class {
    func readMoreAboutRevertedEditViewControllerDidPressGoToArticleButton(_ articleKey: String)
    func readMoreAboutRevertedEditViewControllerDidPressShowHistoryButton()
}

class ReadMoreAboutRevertedEditViewController: WMFScrollViewController {
    private var theme = Theme.standard
    @IBOutlet weak var contentView: UIView!
    @IBOutlet weak var titleLabel: UILabel!
    @IBOutlet weak var subtitleLabel: UILabel!
    @IBOutlet weak var contentTextView: UITextView!
    @IBOutlet weak var contentTextViewHeightConstraint: NSLayoutConstraint!
    @IBOutlet weak var button: UIButton!

    @objc public var articleURL: URL?

    @objc public weak var delegate: ReadMoreAboutRevertedEditViewControllerDelegate?

    override public func viewDidLoad() {
        super.viewDidLoad()

        contentTextView.delegate = self

        title = CommonStrings.revertedEditTitle
        titleLabel.text = WMFLocalizedString("reverted-edit-thanks-for-editing-title", value: "Thanks for editing Wikipedia!", comment: "Title thanking the user for contributing to Wikipedia")
        subtitleLabel.text = WMFLocalizedString("reverted-edit-possible-reasons-subtitle", value: "We know that you tried your best, but one of the reviewers had a concern.\n\nPossible reasons your edit was reverted include:", comment: "Subtitle leading to an explanation why an edit was reverted.")
        button.setTitle(WMFLocalizedString("reverted-edit-back-to-article-button-title", value: "Back to article", comment: "Title for button that allows the user to go back to the article they edited"), for: .normal)

        button.layer.cornerRadius = 8
        button.contentEdgeInsets = UIEdgeInsets(top: 12, left: 24, bottom: 12, right: 24)
        button.addTarget(self, action: #selector(buttonPressed), for: .touchUpInside)

        view.wmf_configureSubviewsForDynamicType()

        apply(theme: theme)
    }

    @objc private func close() {
        dismiss(animated: true)
    }

    @objc private func buttonPressed() {
        close()
        if isSingleRevert, let articleKey = articleKeys?.first {
            delegate?.readMoreAboutRevertedEditViewControllerDidPressGoToArticleButton(articleKey)
        } else {
            delegate?.readMoreAboutRevertedEditViewControllerDidPressShowHistoryButton()
        }
    }

    override func viewWillAppear(_ animated: Bool) {
{'fraction_non_alphanumeric': 0.07516392131776747, 'fraction_numerical': 0.0030385415000799615, 'mean_word_length': 3.72713529856387, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2402026', 'n_tokens_mistral': 1727, 'n_tokens_neox': 1644, 'n_words': 498}