예제 #1
0
        public ArticleModel(RacLib.RacMsg msgs, Article nv, bool incText, bool incComment, bool incTarg, bool incAuth, bool incCateg, bool incLink, bool incAct)
        {
            Id    = nv.id;
            Title = nv.title;

            StartingText = (nv.text.Length < 300) ? nv.text : nv.text.Substring(0, 300);

            if (incText)
            {
                Text       = nv.text;
                Paragraphs = nv.text.Split('\n').ToList();
            }
            else
            {
                Text       = "";
                Paragraphs = new List <string>();
            }

            if (incTarg && nv.target != null)
            {
                Target = new TargetModel(msgs, nv.target, false, false, false, false);
            }
            else
            {
                Target = new TargetModel();
            }

            Comments = new List <ArticleCommentModel>();

            if (incComment)
            {
                for (int i = 0; i < nv.comments.Count; i++)
                {
                    Comments.Add(new ArticleCommentModel(msgs, nv.comments[i]));
                }
            }

            Authors = new AuthorInfo();

            if (incAuth)
            {
                Authors.Date       = msgs.ShowDate(nv.released);
                Authors.DateLabel  = msgs.Get(RacLib.RacMsg.Id.In);
                Authors.StatusText = "";

                Authors.SuggestedLabel = msgs.Get(RacLib.RacMsg.Id.Suggested);
                Authors.AuthoredLabel  = msgs.Get(RacLib.RacMsg.Id.Written);
                Authors.RevisedLabel   = msgs.Get(RacLib.RacMsg.Id.Revised);
                Authors.NarratedLabel  = msgs.Get(RacLib.RacMsg.Id.Narrated);
                Authors.ProducedLabel  = msgs.Get(RacLib.RacMsg.Id.Produced);

                Authors.Suggested = new UserIdModel(nv.suggestedId, nv.suggested);
                Authors.Authored  = new UserIdModel(nv.authoredId, nv.authored);
                Authors.Revised   = new UserIdModel(nv.revisedId, nv.revised);
                Authors.Narrated  = new UserIdModel(nv.narratedId, nv.narrated);
                Authors.Produced  = new UserIdModel(nv.producedId, nv.produced);
            }

            Links = new List <ArticleLinkModel>();

            if (incLink)
            {
                for (int i = 0; i < nv.links.Count; i++)
                {
                    Links.Add(new ArticleLinkModel(msgs, nv.links[i]));
                }
            }

            Actions = new List <ArticleActionModel>();
            if (incAct)
            {
                for (int i = 0; i < nv.actions.Count; i++)
                {
                    Actions.Add(new ArticleActionModel(msgs, nv.actions[i]));
                }
            }

            preferredRevisor  = nv.preferredRevisorId;
            preferredNarrator = nv.preferredNarratorId;
            preferredProducer = nv.preferredProducerId;

            beingRevised  = nv.beingRevisedId;
            beingNarrated = nv.beingNarratedId;
            beingProduced = nv.beingProducedId;

            preferredRevisorName  = nv.preferredRevisorName;
            preferredNarratorName = nv.preferredNarratorName;
            preferredProducerName = nv.preferredProducerName;

            beingRevisedName  = nv.beingRevisedName;
            beingNarratedName = nv.beingNarratedName;
            beingProducedName = nv.beingProducedName;

            Categories = new CategInfo();
            if (incCateg)
            {
                Categories.Categories = new List <NewsCategory>();
                for (int i = 0; i < nv.categories.Count; i++)
                {
                    NewsCategory nc = new NewsCategory();
                    nc.Label    = nv.categories[i];
                    nc.Category = msgs.Get(Category.GetNameForLabel(nc.Label));

                    Categories.Categories.Add(nc);
                }

                Categories.MainCategory = new NewsCategory();
                if (Categories.Categories.Count > 0)
                {
                    Categories.MainCategory = Categories.Categories[0];
                }
            }

            VoteApprove = nv.voteApproved;
            VoteNot     = nv.voteDontLike;
            VoteAlready = nv.voteAlreadyWritten;
            VotePoorly  = nv.votePoorlyWritten;

            UserVote = 0;

            Status          = (int)nv.status;
            StatusNarration = (int)nv.statusNarration;
            Type            = (int)nv.type;
            ArticleType     = (int)nv.textSizeType;

            switch (nv.status)
            {
            case Article.ArticleStatus.Created:
                StatusName         = msgs.Get(RacLib.RacMsg.Id.WaitingApproval);
                Authors.StatusText = msgs.Get(RacLib.RacMsg.Id.Written);
                break;

            case Article.ArticleStatus.Approved:
                StatusName         = msgs.Get(RacLib.RacMsg.Id.WaitingRevision);
                Authors.StatusText = msgs.Get(RacLib.RacMsg.Id.Approved);
                break;

            case Article.ArticleStatus.Revised:
                StatusName         = msgs.Get(RacLib.RacMsg.Id.WaitingNarration);
                Authors.StatusText = msgs.Get(RacLib.RacMsg.Id.Revised);
                break;

            case Article.ArticleStatus.Ready:
                StatusName         = msgs.Get(RacLib.RacMsg.Id.WaitingProduction);
                Authors.StatusText = msgs.Get(RacLib.RacMsg.Id.Narrated);
                break;

            case Article.ArticleStatus.Produced:
                StatusName         = msgs.Get(RacLib.RacMsg.Id.WaitingPublishing);
                Authors.StatusText = msgs.Get(RacLib.RacMsg.Id.Produced);
                break;

            case Article.ArticleStatus.Published:
                StatusName         = msgs.Get(RacLib.RacMsg.Id.Published);
                Authors.StatusText = msgs.Get(RacLib.RacMsg.Id.Published);
                break;

            case Article.ArticleStatus.Removed:
                StatusName         = msgs.Get(RacLib.RacMsg.Id.Removed);
                Authors.StatusText = msgs.Get(RacLib.RacMsg.Id.Removed);
                break;
            }

            switch (nv.statusNarration)
            {
            case Article.ArticleNarrationStatus.Undefined:
                StatusNarrationName = "Aguardando";
                break;


            case Article.ArticleNarrationStatus.Created:
                StatusNarrationName = "Submetido";
                break;

            case Article.ArticleNarrationStatus.Approved:
                StatusNarrationName = "Aprovado";
                break;
            }

            switch (nv.type)
            {
            case Article.ArticleType.ShortNote:
                TypeName = "Tapa Libertário";
                break;

            case Article.ArticleType.Note:
                TypeName = "Nota Libertária";
                break;

            case Article.ArticleType.Article:
                TypeName = "Artigo";
                break;

            case Article.ArticleType.Script:
                TypeName = "Script";
                break;

            case Article.ArticleType.Chronicle:
                TypeName = "Crônica";
                break;

            case Article.ArticleType.Interview:
                TypeName = "Entrevista";
                break;
            }

            switch (nv.textSizeType)
            {
            case Article.TextSizeType.TooShort:
            case Article.TextSizeType.ShortNote:
                ArticleTypeName = "Tapa Libertário";
                break;

            case Article.TextSizeType.Note:
                ArticleTypeName = "Nota Libertária";
                break;

            case Article.TextSizeType.Article:
            case Article.TextSizeType.TooLong:
                ArticleTypeName = "Artigo";
                break;

            default:
                ArticleTypeName = "N/D";
                break;
            }
        }
예제 #2
0
 public CategInfo()
 {
     MainCategory = new NewsCategory();
     Categories   = new List <NewsCategory>();
 }
예제 #3
0
        public TargetModel(RacLib.RacMsg msgs, Target nt, bool incText, bool incCateg, bool incAuth, bool incAct)
        {
            Id           = nt.id;
            Title        = nt.title;
            Link         = nt.link;
            StartingText = (nt.text.Length < 300) ? nt.text : nt.text.Substring(0, 300);

            if (incText)
            {
                Text       = nt.text;
                Paragraphs = nt.text.Split('\n').ToList();
            }
            else
            {
                Text       = "";
                Paragraphs = new List <string>();
            }

            Authors = new AuthorInfo();

            if (incAuth)
            {
                Authors.SuggestedLabel = msgs.Get(RacLib.RacMsg.Id.SuggestedBy);
                Authors.AuthoredLabel  = msgs.Get(RacLib.RacMsg.Id.SuggestedBy);

                Authors.Date       = msgs.ShowDate(nt.registered);
                Authors.DateLabel  = msgs.Get(RacLib.RacMsg.Id.Registered2);
                Authors.StatusText = "";

                Authors.Authored = new UserIdModel(nt.authorId, nt.author);
            }

            Actions = new List <TargetActionModel>();
            if (incAct)
            {
                for (int i = 0; i < nt.actions.Count; i++)
                {
                    Actions.Add(new TargetActionModel(nt.actions[i]));
                }
            }

            Categories = new CategInfo();
            if (incCateg)
            {
                Categories.Categories = new List <NewsCategory>();
                for (int i = 0; i < nt.categories.Count; i++)
                {
                    NewsCategory nc = new NewsCategory();
                    nc.Label    = nt.categories[i];
                    nc.Category = msgs.Get(Category.GetNameForLabel(nc.Label));

                    Categories.Categories.Add(nc);
                }

                Categories.MainCategory = new NewsCategory();
                if (Categories.Categories.Count > 0)
                {
                    Categories.MainCategory = Categories.Categories[0];
                }
            }

            VoteWrite = nt.voteWillWriteArticle;
            VoteVery  = nt.voteVeryGood;
            VoteGood  = nt.voteGood;
            VoteNot   = nt.voteNotInteresting;
            VoteOld   = nt.voteOldNews;
            VoteFake  = nt.voteFalseFact;

            UserVote = 0;

            Status     = 1;
            StatusName = "Registrado";

            AssociatedArticleId    = "";
            AssociatedArticleTitle = "";

            Article art = Article.ArticleFromTarget(nt.id);

            if (art != null)
            {
                Status     = 2;
                StatusName = "Já usado";

                AssociatedArticleId    = art.id;
                AssociatedArticleTitle = art.title;
            }
        }
예제 #4
0
        public VideoModel(RacLib.RacMsg msgs, Video nv, bool incText, bool incCateg, bool incAuth, bool incAct)
        {
            Id    = nv.id;
            Title = nv.title;

            YoutubeLink  = nv.linkYoutube;
            BitchuteLink = nv.linkBitchute;

            StartingDescription = (nv.description.Length < 300) ? nv.description : nv.description.Substring(0, 300);

            if (incText)
            {
                Description     = nv.description;
                Script          = nv.script;
                DescriptionPars = nv.description.Split('\n').ToList();
                ScriptPars      = nv.script.Split('\n').ToList();
            }
            else
            {
                Description     = "";
                Script          = "";
                DescriptionPars = new List <string>();
                ScriptPars      = new List <string>();
            }

            Authors = new AuthorInfo();

            if (incAuth)
            {
                Authors.AuthoredLabel = "Produzido por";

                Authors.Date      = nv.released.ToString("dd/MM/yyyy");
                Authors.DateLabel = "em";

                Authors.Authored = new UserIdModel(nv.authorId, nv.author);
            }

            Actions = new List <VideoActionModel>();
            if (incAct)
            {
                for (int i = 0; i < nv.actions.Count; i++)
                {
                    Actions.Add(new VideoActionModel(nv.actions[i]));
                }
            }

            Categories = new CategInfo();
            if (incCateg)
            {
                Categories.Categories = new List <NewsCategory>();
                for (int i = 0; i < nv.categories.Count; i++)
                {
                    NewsCategory nc = new NewsCategory();
                    nc.Label    = nv.categories[i];
                    nc.Category = msgs.Get(Category.GetNameForLabel(nc.Label));

                    Categories.Categories.Add(nc);
                }

                Categories.MainCategory = new NewsCategory();
                if (Categories.Categories.Count > 0)
                {
                    Categories.MainCategory = Categories.Categories[0];
                }
            }

            Status     = (int)1;
            StatusName = "Publicado";
        }